code
stringlengths
63
466k
code_sememe
stringlengths
141
3.79M
token_type
stringlengths
274
1.23M
@Override public void registerBlueprint(Object blueprint) throws RegisterBlueprintException { SpringBlueprint springBlueprint = blueprint.getClass().getAnnotation(SpringBlueprint.class); if ( springBlueprint != null && springBlueprint.autowire() ) { logger.debug( "Autowiring blueprint {}", blueprint ); beanFactory.autowireBean( blueprint ); } super.registerBlueprint(blueprint); }
class class_name[name] begin[{] method[registerBlueprint, return_type[void], modifier[public], parameter[blueprint]] begin[{] local_variable[type[SpringBlueprint], springBlueprint] if[binary_operation[binary_operation[member[.springBlueprint], !=, literal[null]], &&, call[springBlueprint.autowire, parameter[]]]] begin[{] call[logger.debug, parameter[literal["Autowiring blueprint {}"], member[.blueprint]]] call[beanFactory.autowireBean, parameter[member[.blueprint]]] else begin[{] None end[}] SuperMethodInvocation(arguments=[MemberReference(member=blueprint, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=registerBlueprint, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None) end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[registerBlueprint] operator[SEP] identifier[Object] identifier[blueprint] operator[SEP] Keyword[throws] identifier[RegisterBlueprintException] { identifier[SpringBlueprint] identifier[springBlueprint] operator[=] identifier[blueprint] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] identifier[getAnnotation] operator[SEP] identifier[SpringBlueprint] operator[SEP] Keyword[class] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[springBlueprint] operator[!=] Other[null] operator[&&] identifier[springBlueprint] operator[SEP] identifier[autowire] operator[SEP] operator[SEP] operator[SEP] { identifier[logger] operator[SEP] identifier[debug] operator[SEP] literal[String] , identifier[blueprint] operator[SEP] operator[SEP] identifier[beanFactory] operator[SEP] identifier[autowireBean] operator[SEP] identifier[blueprint] operator[SEP] operator[SEP] } Keyword[super] operator[SEP] identifier[registerBlueprint] operator[SEP] identifier[blueprint] operator[SEP] operator[SEP] }
public void setPersistenceClass(String persistenceClass) throws Exception { this.persistenceClass = persistenceClass; if (persistenceClass != null) { store = PersistenceUtils.getPersistenceStore(this, persistenceClass); } }
class class_name[name] begin[{] method[setPersistenceClass, return_type[void], modifier[public], parameter[persistenceClass]] begin[{] assign[THIS[member[None.persistenceClass]], member[.persistenceClass]] if[binary_operation[member[.persistenceClass], !=, literal[null]]] begin[{] assign[member[.store], call[PersistenceUtils.getPersistenceStore, parameter[THIS[], member[.persistenceClass]]]] else begin[{] None end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[setPersistenceClass] operator[SEP] identifier[String] identifier[persistenceClass] operator[SEP] Keyword[throws] identifier[Exception] { Keyword[this] operator[SEP] identifier[persistenceClass] operator[=] identifier[persistenceClass] operator[SEP] Keyword[if] operator[SEP] identifier[persistenceClass] operator[!=] Other[null] operator[SEP] { identifier[store] operator[=] identifier[PersistenceUtils] operator[SEP] identifier[getPersistenceStore] operator[SEP] Keyword[this] , identifier[persistenceClass] operator[SEP] operator[SEP] } }
public static boolean isSetterMethod(final Method method) { final String methodName = method.getName(); if(!methodName.startsWith("set")) { return false; } else if(methodName.length() <= 3) { return false; } if(method.getParameterCount() != 1) { return false; } return true; }
class class_name[name] begin[{] method[isSetterMethod, return_type[type[boolean]], modifier[public static], parameter[method]] begin[{] local_variable[type[String], methodName] if[call[methodName.startsWith, parameter[literal["set"]]]] begin[{] return[literal[false]] else begin[{] if[binary_operation[call[methodName.length, parameter[]], <=, literal[3]]] begin[{] return[literal[false]] else begin[{] None end[}] end[}] if[binary_operation[call[method.getParameterCount, parameter[]], !=, literal[1]]] begin[{] return[literal[false]] else begin[{] None end[}] return[literal[true]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[boolean] identifier[isSetterMethod] operator[SEP] Keyword[final] identifier[Method] identifier[method] operator[SEP] { Keyword[final] identifier[String] identifier[methodName] operator[=] identifier[method] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[methodName] operator[SEP] identifier[startsWith] operator[SEP] literal[String] operator[SEP] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[methodName] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[<=] Other[3] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } Keyword[if] operator[SEP] identifier[method] operator[SEP] identifier[getParameterCount] operator[SEP] operator[SEP] operator[!=] Other[1] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } Keyword[return] literal[boolean] operator[SEP] }
@Pure public Direction1D getRoadSegmentDirectionAt(int index) { if (index >= 0) { int b = 0; for (final RoadPath p : this.paths) { final int e = b + p.size(); if (index < e) { return p.getSegmentDirectionAt(index - b); } b = e; } } throw new IndexOutOfBoundsException(); }
class class_name[name] begin[{] method[getRoadSegmentDirectionAt, return_type[type[Direction1D]], modifier[public], parameter[index]] begin[{] if[binary_operation[member[.index], >=, literal[0]]] begin[{] local_variable[type[int], b] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=MemberReference(member=b, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=p, selectors=[], type_arguments=None), operator=+), name=e)], modifiers={'final'}, type=BasicType(dimensions=[], name=int)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=b, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=-)], member=getSegmentDirectionAt, postfix_operators=[], prefix_operators=[], qualifier=p, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=b, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)]), control=EnhancedForControl(iterable=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=paths, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=p)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=RoadPath, sub_type=None))), label=None) else begin[{] None end[}] 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) end[}] END[}]
annotation[@] identifier[Pure] Keyword[public] identifier[Direction1D] identifier[getRoadSegmentDirectionAt] operator[SEP] Keyword[int] identifier[index] operator[SEP] { Keyword[if] operator[SEP] identifier[index] operator[>=] Other[0] operator[SEP] { Keyword[int] identifier[b] operator[=] Other[0] operator[SEP] Keyword[for] operator[SEP] Keyword[final] identifier[RoadPath] identifier[p] operator[:] Keyword[this] operator[SEP] identifier[paths] operator[SEP] { Keyword[final] Keyword[int] identifier[e] operator[=] identifier[b] operator[+] identifier[p] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[index] operator[<] identifier[e] operator[SEP] { Keyword[return] identifier[p] operator[SEP] identifier[getSegmentDirectionAt] operator[SEP] identifier[index] operator[-] identifier[b] operator[SEP] operator[SEP] } identifier[b] operator[=] identifier[e] operator[SEP] } } Keyword[throw] Keyword[new] identifier[IndexOutOfBoundsException] operator[SEP] operator[SEP] operator[SEP] }
private boolean isJoda(Class<?> clazz) { for (Constructor<?> each : clazz.getConstructors()) { Class<?>[] parameterTypes = each.getParameterTypes(); if (parameterTypes.length > 0) { if (parameterTypes[0].getName().startsWith("org.joda.time.")) { return true; } } } return false; }
class class_name[name] begin[{] method[isJoda, return_type[type[boolean]], modifier[private], parameter[clazz]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getParameterTypes, postfix_operators=[], prefix_operators=[], qualifier=each, selectors=[], type_arguments=None), name=parameterTypes)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=?, type=None)], dimensions=[None], name=Class, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=parameterTypes, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=MemberReference(member=parameterTypes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)), MethodInvocation(arguments=[], member=getName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="org.joda.time.")], member=startsWith, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true), label=None)]))]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getConstructors, postfix_operators=[], prefix_operators=[], qualifier=clazz, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=each)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=?, type=None)], dimensions=[], name=Constructor, sub_type=None))), label=None) return[literal[false]] end[}] END[}]
Keyword[private] Keyword[boolean] identifier[isJoda] operator[SEP] identifier[Class] operator[<] operator[?] operator[>] identifier[clazz] operator[SEP] { Keyword[for] operator[SEP] identifier[Constructor] operator[<] operator[?] operator[>] identifier[each] operator[:] identifier[clazz] operator[SEP] identifier[getConstructors] operator[SEP] operator[SEP] operator[SEP] { identifier[Class] operator[<] operator[?] operator[>] operator[SEP] operator[SEP] identifier[parameterTypes] operator[=] identifier[each] operator[SEP] identifier[getParameterTypes] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[parameterTypes] operator[SEP] identifier[length] operator[>] Other[0] operator[SEP] { Keyword[if] operator[SEP] identifier[parameterTypes] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] identifier[startsWith] operator[SEP] literal[String] operator[SEP] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } } } Keyword[return] literal[boolean] operator[SEP] }
public static void main(String[] args) { if (args.length == 0) { System.out.println( "Usage: BGZFBlockIndex [BGZF block indices...]\n\n"+ "Writes a few statistics about each BGZF block index."); return; } for (String arg : args) { final File f = new File(arg); if (f.isFile() && f.canRead()) { try { System.err.printf("%s:\n", f); final BGZFBlockIndex bi = new BGZFBlockIndex(f); final long second = bi.secondBlock(); final long last = bi.lastBlock(); System.err.printf( "\t%d blocks\n" + "\tfirst after 0 is at %#014x\n" + "\tlast is at %#014x\n" + "\tassociated BGZF file size %d\n", bi.size()-1, bi.secondBlock(), bi.lastBlock(), bi.fileSize()); } catch (IOException e) { System.err.printf("Failed to read %s!\n", f); e.printStackTrace(); } } else System.err.printf("%s does not look like a readable file!\n", f); } }
class class_name[name] begin[{] method[main, return_type[void], modifier[public static], parameter[args]] begin[{] if[binary_operation[member[args.length], ==, literal[0]]] begin[{] call[System.out.println, parameter[binary_operation[literal["Usage: BGZFBlockIndex [BGZF block indices...]\n\n"], +, literal["Writes a few statistics about each BGZF block index."]]]] return[None] else begin[{] None end[}] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MemberReference(member=arg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=File, sub_type=None)), name=f)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=File, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=isFile, postfix_operators=[], prefix_operators=[], qualifier=f, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[], member=canRead, postfix_operators=[], prefix_operators=[], qualifier=f, selectors=[], type_arguments=None), operator=&&), else_statement=StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="%s does not look like a readable file!\n"), MemberReference(member=f, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=printf, postfix_operators=[], prefix_operators=[], qualifier=System.err, selectors=[], type_arguments=None), label=None), label=None, then_statement=BlockStatement(label=None, statements=[TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="%s:\n"), MemberReference(member=f, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=printf, postfix_operators=[], prefix_operators=[], qualifier=System.err, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MemberReference(member=f, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=BGZFBlockIndex, sub_type=None)), name=bi)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=BGZFBlockIndex, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=secondBlock, postfix_operators=[], prefix_operators=[], qualifier=bi, selectors=[], type_arguments=None), name=second)], modifiers={'final'}, type=BasicType(dimensions=[], name=long)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=lastBlock, postfix_operators=[], prefix_operators=[], qualifier=bi, selectors=[], type_arguments=None), name=last)], modifiers={'final'}, type=BasicType(dimensions=[], name=long)), StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\t%d blocks\n"), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\tfirst after 0 is at %#014x\n"), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\tlast is at %#014x\n"), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\tassociated BGZF file size %d\n"), operator=+), BinaryOperation(operandl=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=bi, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-), MethodInvocation(arguments=[], member=secondBlock, postfix_operators=[], prefix_operators=[], qualifier=bi, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=lastBlock, postfix_operators=[], prefix_operators=[], qualifier=bi, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=fileSize, postfix_operators=[], prefix_operators=[], qualifier=bi, selectors=[], type_arguments=None)], member=printf, postfix_operators=[], prefix_operators=[], qualifier=System.err, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Failed to read %s!\n"), MemberReference(member=f, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=printf, postfix_operators=[], prefix_operators=[], qualifier=System.err, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=printStackTrace, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IOException']))], finally_block=None, label=None, resources=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=args, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=arg)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None) end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[main] operator[SEP] identifier[String] operator[SEP] operator[SEP] identifier[args] operator[SEP] { Keyword[if] operator[SEP] identifier[args] operator[SEP] identifier[length] operator[==] Other[0] operator[SEP] { identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[println] operator[SEP] literal[String] operator[+] literal[String] operator[SEP] operator[SEP] Keyword[return] operator[SEP] } Keyword[for] operator[SEP] identifier[String] identifier[arg] operator[:] identifier[args] operator[SEP] { Keyword[final] identifier[File] identifier[f] operator[=] Keyword[new] identifier[File] operator[SEP] identifier[arg] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[f] operator[SEP] identifier[isFile] operator[SEP] operator[SEP] operator[&&] identifier[f] operator[SEP] identifier[canRead] operator[SEP] operator[SEP] operator[SEP] { Keyword[try] { identifier[System] operator[SEP] identifier[err] operator[SEP] identifier[printf] operator[SEP] literal[String] , identifier[f] operator[SEP] operator[SEP] Keyword[final] identifier[BGZFBlockIndex] identifier[bi] operator[=] Keyword[new] identifier[BGZFBlockIndex] operator[SEP] identifier[f] operator[SEP] operator[SEP] Keyword[final] Keyword[long] identifier[second] operator[=] identifier[bi] operator[SEP] identifier[secondBlock] operator[SEP] operator[SEP] operator[SEP] Keyword[final] Keyword[long] identifier[last] operator[=] identifier[bi] operator[SEP] identifier[lastBlock] operator[SEP] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[err] operator[SEP] identifier[printf] operator[SEP] literal[String] operator[+] literal[String] operator[+] literal[String] operator[+] literal[String] , identifier[bi] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[-] Other[1] , identifier[bi] operator[SEP] identifier[secondBlock] operator[SEP] operator[SEP] , identifier[bi] operator[SEP] identifier[lastBlock] operator[SEP] operator[SEP] , identifier[bi] operator[SEP] identifier[fileSize] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[IOException] identifier[e] operator[SEP] { identifier[System] operator[SEP] identifier[err] operator[SEP] identifier[printf] operator[SEP] literal[String] , identifier[f] operator[SEP] operator[SEP] identifier[e] operator[SEP] identifier[printStackTrace] operator[SEP] operator[SEP] operator[SEP] } } Keyword[else] identifier[System] operator[SEP] identifier[err] operator[SEP] identifier[printf] operator[SEP] literal[String] , identifier[f] operator[SEP] operator[SEP] } }
@Override public SQLProperty findPropertyByName(String name) { name = name.toLowerCase(); for (SQLProperty item : properties) { if (item.getName().toLowerCase().equals(name)) { return item; } } return null; }
class class_name[name] begin[{] method[findPropertyByName, return_type[type[SQLProperty]], modifier[public], parameter[name]] begin[{] assign[member[.name], call[name.toLowerCase, parameter[]]] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=item, selectors=[MethodInvocation(arguments=[], member=toLowerCase, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=MemberReference(member=item, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=properties, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=item)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=SQLProperty, sub_type=None))), label=None) return[literal[null]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[SQLProperty] identifier[findPropertyByName] operator[SEP] identifier[String] identifier[name] operator[SEP] { identifier[name] operator[=] identifier[name] operator[SEP] identifier[toLowerCase] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[SQLProperty] identifier[item] operator[:] identifier[properties] operator[SEP] { Keyword[if] operator[SEP] identifier[item] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] identifier[toLowerCase] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[name] operator[SEP] operator[SEP] { Keyword[return] identifier[item] operator[SEP] } } Keyword[return] Other[null] operator[SEP] }
private long[] computeContentSummary(long[] summary, Set<Long> visitedCtx) { if (children != null) { for (INode child : children) { if (child.isDirectory()) { // Process the directory with the visited hard link context ((INodeDirectory)child).computeContentSummary(summary, visitedCtx); } else { // Process the file if (child instanceof INodeHardLinkFile) { // Get the current hard link ID long hardLinkID = ((INodeHardLinkFile) child).getHardLinkID(); if (visitedCtx.contains(hardLinkID)) { // The current hard link file has been visited, so only increase the file count. summary[1] ++; continue; } else { // Add the current hard link file to the visited set visitedCtx.add(hardLinkID); // Compute the current hardlink file child.computeContentSummary(summary); } } else { // compute the current child for non hard linked files child.computeContentSummary(summary); } } } } summary[2]++; return summary; }
class class_name[name] begin[{] method[computeContentSummary, return_type[type[long]], modifier[private], parameter[summary, visitedCtx]] begin[{] if[binary_operation[member[.children], !=, literal[null]]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[], member=isDirectory, postfix_operators=[], prefix_operators=[], qualifier=child, selectors=[], type_arguments=None), else_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=child, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=INodeHardLinkFile, sub_type=None), operator=instanceof), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=summary, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=computeContentSummary, postfix_operators=[], prefix_operators=[], qualifier=child, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MemberReference(member=child, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=INodeHardLinkFile, sub_type=None)), name=hardLinkID)], modifiers=set(), type=BasicType(dimensions=[], name=long)), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=hardLinkID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=contains, postfix_operators=[], prefix_operators=[], qualifier=visitedCtx, selectors=[], type_arguments=None), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=hardLinkID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=visitedCtx, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=summary, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=computeContentSummary, postfix_operators=[], prefix_operators=[], qualifier=child, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MemberReference(member=summary, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1))]), label=None), ContinueStatement(goto=None, label=None)]))]))]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Cast(expression=MemberReference(member=child, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=INodeDirectory, sub_type=None)), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=children, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=child)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=INode, sub_type=None))), label=None) else begin[{] None end[}] member[.summary] return[member[.summary]] end[}] END[}]
Keyword[private] Keyword[long] operator[SEP] operator[SEP] identifier[computeContentSummary] operator[SEP] Keyword[long] operator[SEP] operator[SEP] identifier[summary] , identifier[Set] operator[<] identifier[Long] operator[>] identifier[visitedCtx] operator[SEP] { Keyword[if] operator[SEP] identifier[children] operator[!=] Other[null] operator[SEP] { Keyword[for] operator[SEP] identifier[INode] identifier[child] operator[:] identifier[children] operator[SEP] { Keyword[if] operator[SEP] identifier[child] operator[SEP] identifier[isDirectory] operator[SEP] operator[SEP] operator[SEP] { operator[SEP] operator[SEP] identifier[INodeDirectory] operator[SEP] identifier[child] operator[SEP] operator[SEP] identifier[computeContentSummary] operator[SEP] identifier[summary] , identifier[visitedCtx] operator[SEP] operator[SEP] } Keyword[else] { Keyword[if] operator[SEP] identifier[child] Keyword[instanceof] identifier[INodeHardLinkFile] operator[SEP] { Keyword[long] identifier[hardLinkID] operator[=] operator[SEP] operator[SEP] identifier[INodeHardLinkFile] operator[SEP] identifier[child] operator[SEP] operator[SEP] identifier[getHardLinkID] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[visitedCtx] operator[SEP] identifier[contains] operator[SEP] identifier[hardLinkID] operator[SEP] operator[SEP] { identifier[summary] operator[SEP] Other[1] operator[SEP] operator[++] operator[SEP] Keyword[continue] operator[SEP] } Keyword[else] { identifier[visitedCtx] operator[SEP] identifier[add] operator[SEP] identifier[hardLinkID] operator[SEP] operator[SEP] identifier[child] operator[SEP] identifier[computeContentSummary] operator[SEP] identifier[summary] operator[SEP] operator[SEP] } } Keyword[else] { identifier[child] operator[SEP] identifier[computeContentSummary] operator[SEP] identifier[summary] operator[SEP] operator[SEP] } } } } identifier[summary] operator[SEP] Other[2] operator[SEP] operator[++] operator[SEP] Keyword[return] identifier[summary] operator[SEP] }
public final void mUNIFY() throws RecognitionException { try { int _type = UNIFY; int _channel = DEFAULT_TOKEN_CHANNEL; // src/main/resources/org/drools/compiler/lang/DRL5Lexer.g:188:5: ( ':=' ) // src/main/resources/org/drools/compiler/lang/DRL5Lexer.g:188:7: ':=' { match(":="); if (state.failed) return; } state.type = _type; state.channel = _channel; } finally { // do for sure before leaving } }
class class_name[name] begin[{] method[mUNIFY, return_type[void], modifier[final public], parameter[]] begin[{] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=UNIFY, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), name=_type)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=DEFAULT_TOKEN_CHANNEL, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), name=_channel)], modifiers=set(), type=BasicType(dimensions=[], name=int)), BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=":=")], member=match, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), IfStatement(condition=MemberReference(member=failed, postfix_operators=[], prefix_operators=[], qualifier=state, selectors=[]), else_statement=None, label=None, then_statement=ReturnStatement(expression=None, label=None))]), StatementExpression(expression=Assignment(expressionl=MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=state, selectors=[]), type==, value=MemberReference(member=_type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=channel, postfix_operators=[], prefix_operators=[], qualifier=state, selectors=[]), type==, value=MemberReference(member=_channel, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)], catches=None, finally_block=[], label=None, resources=None) end[}] END[}]
Keyword[public] Keyword[final] Keyword[void] identifier[mUNIFY] operator[SEP] operator[SEP] Keyword[throws] identifier[RecognitionException] { Keyword[try] { Keyword[int] identifier[_type] operator[=] identifier[UNIFY] operator[SEP] Keyword[int] identifier[_channel] operator[=] identifier[DEFAULT_TOKEN_CHANNEL] operator[SEP] { identifier[match] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[state] operator[SEP] identifier[failed] operator[SEP] Keyword[return] operator[SEP] } identifier[state] operator[SEP] identifier[type] operator[=] identifier[_type] operator[SEP] identifier[state] operator[SEP] identifier[channel] operator[=] identifier[_channel] operator[SEP] } Keyword[finally] { } }
public void marshall(CloudWatchDimensionConfiguration cloudWatchDimensionConfiguration, ProtocolMarshaller protocolMarshaller) { if (cloudWatchDimensionConfiguration == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(cloudWatchDimensionConfiguration.getDimensionName(), DIMENSIONNAME_BINDING); protocolMarshaller.marshall(cloudWatchDimensionConfiguration.getDimensionValueSource(), DIMENSIONVALUESOURCE_BINDING); protocolMarshaller.marshall(cloudWatchDimensionConfiguration.getDefaultDimensionValue(), DEFAULTDIMENSIONVALUE_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[cloudWatchDimensionConfiguration, protocolMarshaller]] begin[{] if[binary_operation[member[.cloudWatchDimensionConfiguration], ==, 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=getDimensionName, postfix_operators=[], prefix_operators=[], qualifier=cloudWatchDimensionConfiguration, selectors=[], type_arguments=None), MemberReference(member=DIMENSIONNAME_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=getDimensionValueSource, postfix_operators=[], prefix_operators=[], qualifier=cloudWatchDimensionConfiguration, selectors=[], type_arguments=None), MemberReference(member=DIMENSIONVALUESOURCE_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=getDefaultDimensionValue, postfix_operators=[], prefix_operators=[], qualifier=cloudWatchDimensionConfiguration, selectors=[], type_arguments=None), MemberReference(member=DEFAULTDIMENSIONVALUE_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[CloudWatchDimensionConfiguration] identifier[cloudWatchDimensionConfiguration] , identifier[ProtocolMarshaller] identifier[protocolMarshaller] operator[SEP] { Keyword[if] operator[SEP] identifier[cloudWatchDimensionConfiguration] 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[cloudWatchDimensionConfiguration] operator[SEP] identifier[getDimensionName] operator[SEP] operator[SEP] , identifier[DIMENSIONNAME_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[cloudWatchDimensionConfiguration] operator[SEP] identifier[getDimensionValueSource] operator[SEP] operator[SEP] , identifier[DIMENSIONVALUESOURCE_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[cloudWatchDimensionConfiguration] operator[SEP] identifier[getDefaultDimensionValue] operator[SEP] operator[SEP] , identifier[DEFAULTDIMENSIONVALUE_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 getDeclaredCharset(String contentType) { if (contentType == null) { return null; } Matcher matcher = CHARSET_PATT.matcher(contentType); if (matcher.find()) { String encstr = matcher.group(1); return encstr; } else { return null; } }
class class_name[name] begin[{] method[getDeclaredCharset, return_type[type[String]], modifier[public static], parameter[contentType]] begin[{] if[binary_operation[member[.contentType], ==, literal[null]]] begin[{] return[literal[null]] else begin[{] None end[}] local_variable[type[Matcher], matcher] if[call[matcher.find, parameter[]]] begin[{] local_variable[type[String], encstr] return[member[.encstr]] else begin[{] return[literal[null]] end[}] end[}] END[}]
Keyword[public] Keyword[static] identifier[String] identifier[getDeclaredCharset] operator[SEP] identifier[String] identifier[contentType] operator[SEP] { Keyword[if] operator[SEP] identifier[contentType] operator[==] Other[null] operator[SEP] { Keyword[return] Other[null] operator[SEP] } identifier[Matcher] identifier[matcher] operator[=] identifier[CHARSET_PATT] operator[SEP] identifier[matcher] operator[SEP] identifier[contentType] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[matcher] operator[SEP] identifier[find] operator[SEP] operator[SEP] operator[SEP] { identifier[String] identifier[encstr] operator[=] identifier[matcher] operator[SEP] identifier[group] operator[SEP] Other[1] operator[SEP] operator[SEP] Keyword[return] identifier[encstr] operator[SEP] } Keyword[else] { Keyword[return] Other[null] operator[SEP] } }
public FieldErrorBuilder address(final Optional<CellPosition> address) { address.ifPresent(a -> address(a)); return this; }
class class_name[name] begin[{] method[address, return_type[type[FieldErrorBuilder]], modifier[public], parameter[address]] begin[{] call[address.ifPresent, parameter[LambdaExpression(body=MethodInvocation(arguments=[MemberReference(member=a, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=address, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), parameters=[MemberReference(member=a, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])])]] return[THIS[]] end[}] END[}]
Keyword[public] identifier[FieldErrorBuilder] identifier[address] operator[SEP] Keyword[final] identifier[Optional] operator[<] identifier[CellPosition] operator[>] identifier[address] operator[SEP] { identifier[address] operator[SEP] identifier[ifPresent] operator[SEP] identifier[a] operator[->] identifier[address] operator[SEP] identifier[a] operator[SEP] operator[SEP] operator[SEP] Keyword[return] Keyword[this] operator[SEP] }
private void createNewUser() throws CmsException { //Password was checked by validator before String ou = m_ou.getValue(); if (!ou.endsWith("/")) { ou += "/"; } CmsUser user = m_cms.createUser(ou + m_loginname.getValue(), m_pw.getPassword1(), "", null); updateUser(user); m_cms.writeUser(user); if (!CmsStringUtil.isEmptyOrWhitespaceOnly(m_group.getValue())) { m_cms.addUserToGroup(user.getName(), m_group.getValue()); } OpenCms.getRoleManager().addUserToRole(m_cms, (CmsRole)m_role.getValue(), user.getName()); m_user = user; }
class class_name[name] begin[{] method[createNewUser, return_type[void], modifier[private], parameter[]] begin[{] local_variable[type[String], ou] if[call[ou.endsWith, parameter[literal["/"]]]] begin[{] assign[member[.ou], literal["/"]] else begin[{] None end[}] local_variable[type[CmsUser], user] call[.updateUser, parameter[member[.user]]] call[m_cms.writeUser, parameter[member[.user]]] if[call[CmsStringUtil.isEmptyOrWhitespaceOnly, parameter[call[m_group.getValue, parameter[]]]]] begin[{] call[m_cms.addUserToGroup, parameter[call[user.getName, parameter[]], call[m_group.getValue, parameter[]]]] else begin[{] None end[}] call[OpenCms.getRoleManager, parameter[]] assign[member[.m_user], member[.user]] end[}] END[}]
Keyword[private] Keyword[void] identifier[createNewUser] operator[SEP] operator[SEP] Keyword[throws] identifier[CmsException] { identifier[String] identifier[ou] operator[=] identifier[m_ou] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[ou] operator[SEP] identifier[endsWith] operator[SEP] literal[String] operator[SEP] operator[SEP] { identifier[ou] operator[+=] literal[String] operator[SEP] } identifier[CmsUser] identifier[user] operator[=] identifier[m_cms] operator[SEP] identifier[createUser] operator[SEP] identifier[ou] operator[+] identifier[m_loginname] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] , identifier[m_pw] operator[SEP] identifier[getPassword1] operator[SEP] operator[SEP] , literal[String] , Other[null] operator[SEP] operator[SEP] identifier[updateUser] operator[SEP] identifier[user] operator[SEP] operator[SEP] identifier[m_cms] operator[SEP] identifier[writeUser] operator[SEP] identifier[user] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[CmsStringUtil] operator[SEP] identifier[isEmptyOrWhitespaceOnly] operator[SEP] identifier[m_group] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { identifier[m_cms] operator[SEP] identifier[addUserToGroup] operator[SEP] identifier[user] operator[SEP] identifier[getName] operator[SEP] operator[SEP] , identifier[m_group] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[OpenCms] operator[SEP] identifier[getRoleManager] operator[SEP] operator[SEP] operator[SEP] identifier[addUserToRole] operator[SEP] identifier[m_cms] , operator[SEP] identifier[CmsRole] operator[SEP] identifier[m_role] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] , identifier[user] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[m_user] operator[=] identifier[user] operator[SEP] }
@Override public MoveSelector buildBaseMoveSelector(HeuristicConfigPolicy configPolicy, SelectionCacheType minimumCacheType, boolean randomSelection) { EntitySelectorConfig entitySelectorConfig_ = entitySelectorConfig == null ? new EntitySelectorConfig() : entitySelectorConfig; EntitySelector entitySelector = entitySelectorConfig_.buildEntitySelector(configPolicy, minimumCacheType, SelectionOrder.fromRandomSelectionBoolean(randomSelection)); ValueSelectorConfig valueSelectorConfig_ = valueSelectorConfig == null ? new ValueSelectorConfig() : valueSelectorConfig; ValueSelector[] valueSelectors = new ValueSelector[K - 1]; for (int i = 0; i < valueSelectors.length; i++) { valueSelectors[i] = valueSelectorConfig_.buildValueSelector(configPolicy, entitySelector.getEntityDescriptor(), minimumCacheType, SelectionOrder.fromRandomSelectionBoolean(randomSelection)); } return new KOptMoveSelector(entitySelector, valueSelectors, randomSelection); }
class class_name[name] begin[{] method[buildBaseMoveSelector, return_type[type[MoveSelector]], modifier[public], parameter[configPolicy, minimumCacheType, randomSelection]] begin[{] local_variable[type[EntitySelectorConfig], entitySelectorConfig_] local_variable[type[EntitySelector], entitySelector] local_variable[type[ValueSelectorConfig], valueSelectorConfig_] local_variable[type[ValueSelector], valueSelectors] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=valueSelectors, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MethodInvocation(arguments=[MemberReference(member=configPolicy, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getEntityDescriptor, postfix_operators=[], prefix_operators=[], qualifier=entitySelector, selectors=[], type_arguments=None), MemberReference(member=minimumCacheType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[MemberReference(member=randomSelection, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=fromRandomSelectionBoolean, postfix_operators=[], prefix_operators=[], qualifier=SelectionOrder, selectors=[], type_arguments=None)], member=buildValueSelector, postfix_operators=[], prefix_operators=[], qualifier=valueSelectorConfig_, selectors=[], type_arguments=None)), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=valueSelectors, 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[ClassCreator(arguments=[MemberReference(member=entitySelector, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=valueSelectors, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=randomSelection, 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=KOptMoveSelector, sub_type=None))] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[MoveSelector] identifier[buildBaseMoveSelector] operator[SEP] identifier[HeuristicConfigPolicy] identifier[configPolicy] , identifier[SelectionCacheType] identifier[minimumCacheType] , Keyword[boolean] identifier[randomSelection] operator[SEP] { identifier[EntitySelectorConfig] identifier[entitySelectorConfig_] operator[=] identifier[entitySelectorConfig] operator[==] Other[null] operator[?] Keyword[new] identifier[EntitySelectorConfig] operator[SEP] operator[SEP] operator[:] identifier[entitySelectorConfig] operator[SEP] identifier[EntitySelector] identifier[entitySelector] operator[=] identifier[entitySelectorConfig_] operator[SEP] identifier[buildEntitySelector] operator[SEP] identifier[configPolicy] , identifier[minimumCacheType] , identifier[SelectionOrder] operator[SEP] identifier[fromRandomSelectionBoolean] operator[SEP] identifier[randomSelection] operator[SEP] operator[SEP] operator[SEP] identifier[ValueSelectorConfig] identifier[valueSelectorConfig_] operator[=] identifier[valueSelectorConfig] operator[==] Other[null] operator[?] Keyword[new] identifier[ValueSelectorConfig] operator[SEP] operator[SEP] operator[:] identifier[valueSelectorConfig] operator[SEP] identifier[ValueSelector] operator[SEP] operator[SEP] identifier[valueSelectors] operator[=] Keyword[new] identifier[ValueSelector] operator[SEP] identifier[K] operator[-] Other[1] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[valueSelectors] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[valueSelectors] operator[SEP] identifier[i] operator[SEP] operator[=] identifier[valueSelectorConfig_] operator[SEP] identifier[buildValueSelector] operator[SEP] identifier[configPolicy] , identifier[entitySelector] operator[SEP] identifier[getEntityDescriptor] operator[SEP] operator[SEP] , identifier[minimumCacheType] , identifier[SelectionOrder] operator[SEP] identifier[fromRandomSelectionBoolean] operator[SEP] identifier[randomSelection] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] Keyword[new] identifier[KOptMoveSelector] operator[SEP] identifier[entitySelector] , identifier[valueSelectors] , identifier[randomSelection] operator[SEP] operator[SEP] }
public static boolean handle(File zip, String name, ZipEntryCallback action) { ZipFile zf = null; try { zf = new ZipFile(zip); ZipEntry ze = zf.getEntry(name); if (ze == null) { return false; // entry not found } InputStream in = new BufferedInputStream(zf.getInputStream(ze)); try { action.process(in, ze); } finally { IOUtils.closeQuietly(in); } return true; } catch (IOException e) { throw ZipExceptionUtil.rethrow(e); } finally { closeQuietly(zf); } }
class class_name[name] begin[{] method[handle, return_type[type[boolean]], modifier[public static], parameter[zip, name, action]] begin[{] local_variable[type[ZipFile], zf] TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=zf, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[MemberReference(member=zip, 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=ZipFile, sub_type=None))), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getEntry, postfix_operators=[], prefix_operators=[], qualifier=zf, selectors=[], type_arguments=None), name=ze)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ZipEntry, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=ze, 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=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MethodInvocation(arguments=[MemberReference(member=ze, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getInputStream, postfix_operators=[], prefix_operators=[], qualifier=zf, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=BufferedInputStream, sub_type=None)), name=in)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=InputStream, sub_type=None)), TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=in, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=ze, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=process, postfix_operators=[], prefix_operators=[], qualifier=action, selectors=[], type_arguments=None), label=None)], catches=None, finally_block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=in, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=closeQuietly, postfix_operators=[], prefix_operators=[], qualifier=IOUtils, selectors=[], type_arguments=None), label=None)], label=None, resources=None), ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=MethodInvocation(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=rethrow, postfix_operators=[], prefix_operators=[], qualifier=ZipExceptionUtil, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IOException']))], finally_block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=zf, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=closeQuietly, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], label=None, resources=None) end[}] END[}]
Keyword[public] Keyword[static] Keyword[boolean] identifier[handle] operator[SEP] identifier[File] identifier[zip] , identifier[String] identifier[name] , identifier[ZipEntryCallback] identifier[action] operator[SEP] { identifier[ZipFile] identifier[zf] operator[=] Other[null] operator[SEP] Keyword[try] { identifier[zf] operator[=] Keyword[new] identifier[ZipFile] operator[SEP] identifier[zip] operator[SEP] operator[SEP] identifier[ZipEntry] identifier[ze] operator[=] identifier[zf] operator[SEP] identifier[getEntry] operator[SEP] identifier[name] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[ze] operator[==] Other[null] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } identifier[InputStream] identifier[in] operator[=] Keyword[new] identifier[BufferedInputStream] operator[SEP] identifier[zf] operator[SEP] identifier[getInputStream] operator[SEP] identifier[ze] operator[SEP] operator[SEP] operator[SEP] Keyword[try] { identifier[action] operator[SEP] identifier[process] operator[SEP] identifier[in] , identifier[ze] operator[SEP] operator[SEP] } Keyword[finally] { identifier[IOUtils] operator[SEP] identifier[closeQuietly] operator[SEP] identifier[in] operator[SEP] operator[SEP] } Keyword[return] literal[boolean] operator[SEP] } Keyword[catch] operator[SEP] identifier[IOException] identifier[e] operator[SEP] { Keyword[throw] identifier[ZipExceptionUtil] operator[SEP] identifier[rethrow] operator[SEP] identifier[e] operator[SEP] operator[SEP] } Keyword[finally] { identifier[closeQuietly] operator[SEP] identifier[zf] operator[SEP] operator[SEP] } }
private String buildMapClickMessage(LatLng latLng, double zoom, BoundingBox boundingBox, double tolerance, Projection projection) { String message = null; // Verify the features are indexed and we are getting information if (isIndexed() && (maxFeaturesInfo || featuresInfo)) { if (isOnAtCurrentZoom(zoom, latLng)) { // Get the number of features in the tile location long tileFeatureCount = tileFeatureCount(latLng, zoom); // If more than a configured max features to draw if (isMoreThanMaxFeatures(tileFeatureCount)) { // Build the max features message if (maxFeaturesInfo) { message = buildMaxFeaturesInfoMessage(tileFeatureCount); } } // Else, query for the features near the click else if (featuresInfo) { // Query for results and build the message FeatureIndexResults results = queryFeatures(boundingBox, projection); message = featureInfoBuilder.buildResultsInfoMessageAndClose(results, tolerance, latLng, projection); } } } return message; }
class class_name[name] begin[{] method[buildMapClickMessage, return_type[type[String]], modifier[private], parameter[latLng, zoom, boundingBox, tolerance, projection]] begin[{] local_variable[type[String], message] if[binary_operation[call[.isIndexed, parameter[]], &&, binary_operation[member[.maxFeaturesInfo], ||, member[.featuresInfo]]]] begin[{] if[call[.isOnAtCurrentZoom, parameter[member[.zoom], member[.latLng]]]] begin[{] local_variable[type[long], tileFeatureCount] if[call[.isMoreThanMaxFeatures, parameter[member[.tileFeatureCount]]]] begin[{] if[member[.maxFeaturesInfo]] begin[{] assign[member[.message], call[.buildMaxFeaturesInfoMessage, parameter[member[.tileFeatureCount]]]] else begin[{] None end[}] else begin[{] if[member[.featuresInfo]] begin[{] local_variable[type[FeatureIndexResults], results] assign[member[.message], call[featureInfoBuilder.buildResultsInfoMessageAndClose, parameter[member[.results], member[.tolerance], member[.latLng], member[.projection]]]] else begin[{] None end[}] end[}] else begin[{] None end[}] else begin[{] None end[}] return[member[.message]] end[}] END[}]
Keyword[private] identifier[String] identifier[buildMapClickMessage] operator[SEP] identifier[LatLng] identifier[latLng] , Keyword[double] identifier[zoom] , identifier[BoundingBox] identifier[boundingBox] , Keyword[double] identifier[tolerance] , identifier[Projection] identifier[projection] operator[SEP] { identifier[String] identifier[message] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[isIndexed] operator[SEP] operator[SEP] operator[&&] operator[SEP] identifier[maxFeaturesInfo] operator[||] identifier[featuresInfo] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[isOnAtCurrentZoom] operator[SEP] identifier[zoom] , identifier[latLng] operator[SEP] operator[SEP] { Keyword[long] identifier[tileFeatureCount] operator[=] identifier[tileFeatureCount] operator[SEP] identifier[latLng] , identifier[zoom] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[isMoreThanMaxFeatures] operator[SEP] identifier[tileFeatureCount] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[maxFeaturesInfo] operator[SEP] { identifier[message] operator[=] identifier[buildMaxFeaturesInfoMessage] operator[SEP] identifier[tileFeatureCount] operator[SEP] operator[SEP] } } Keyword[else] Keyword[if] operator[SEP] identifier[featuresInfo] operator[SEP] { identifier[FeatureIndexResults] identifier[results] operator[=] identifier[queryFeatures] operator[SEP] identifier[boundingBox] , identifier[projection] operator[SEP] operator[SEP] identifier[message] operator[=] identifier[featureInfoBuilder] operator[SEP] identifier[buildResultsInfoMessageAndClose] operator[SEP] identifier[results] , identifier[tolerance] , identifier[latLng] , identifier[projection] operator[SEP] operator[SEP] } } } Keyword[return] identifier[message] operator[SEP] }
protected Reliability getReplyReliability() { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "getReplyReliability"); Reliability result = null; if (replyReliabilityByte != -1) { result = Reliability.getReliability(replyReliabilityByte); } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "getReplyReliability", result); return result; }
class class_name[name] begin[{] method[getReplyReliability, return_type[type[Reliability]], modifier[protected], parameter[]] begin[{] if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{] call[SibTr.entry, parameter[THIS[], member[.tc], literal["getReplyReliability"]]] else begin[{] None end[}] local_variable[type[Reliability], result] if[binary_operation[member[.replyReliabilityByte], !=, literal[1]]] begin[{] assign[member[.result], call[Reliability.getReliability, parameter[member[.replyReliabilityByte]]]] else begin[{] None end[}] if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{] call[SibTr.exit, parameter[THIS[], member[.tc], literal["getReplyReliability"], member[.result]]] else begin[{] None end[}] return[member[.result]] end[}] END[}]
Keyword[protected] identifier[Reliability] identifier[getReplyReliability] 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] Keyword[this] , identifier[tc] , literal[String] operator[SEP] operator[SEP] identifier[Reliability] identifier[result] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[replyReliabilityByte] operator[!=] operator[-] Other[1] operator[SEP] { identifier[result] operator[=] identifier[Reliability] operator[SEP] identifier[getReliability] operator[SEP] identifier[replyReliabilityByte] 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] , identifier[result] operator[SEP] operator[SEP] Keyword[return] identifier[result] operator[SEP] }
public Field createFieldMultiChoicePlain( Field routeFieldParam, List<String> multiChoiceValuesParam ) { if(routeFieldParam != null && this.serviceTicket != null) { routeFieldParam.setServiceTicket(this.serviceTicket); } if(multiChoiceValuesParam == null) { multiChoiceValuesParam = new ArrayList(); } if(routeFieldParam != null) { routeFieldParam.setTypeAsEnum(Field.Type.MultipleChoice); routeFieldParam.setTypeMetaData(FieldMetaData.MultiChoice.PLAIN); routeFieldParam.setFieldValue(new MultiChoice(multiChoiceValuesParam)); } return new Field(this.putJson( routeFieldParam, Version1.routeFieldCreate())); }
class class_name[name] begin[{] method[createFieldMultiChoicePlain, return_type[type[Field]], modifier[public], parameter[routeFieldParam, multiChoiceValuesParam]] begin[{] if[binary_operation[binary_operation[member[.routeFieldParam], !=, literal[null]], &&, binary_operation[THIS[member[None.serviceTicket]], !=, literal[null]]]] begin[{] call[routeFieldParam.setServiceTicket, parameter[THIS[member[None.serviceTicket]]]] else begin[{] None end[}] if[binary_operation[member[.multiChoiceValuesParam], ==, literal[null]]] begin[{] assign[member[.multiChoiceValuesParam], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ArrayList, sub_type=None))] else begin[{] None end[}] if[binary_operation[member[.routeFieldParam], !=, literal[null]]] begin[{] call[routeFieldParam.setTypeAsEnum, parameter[member[Field.Type.MultipleChoice]]] call[routeFieldParam.setTypeMetaData, parameter[member[FieldMetaData.MultiChoice.PLAIN]]] call[routeFieldParam.setFieldValue, parameter[ClassCreator(arguments=[MemberReference(member=multiChoiceValuesParam, 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=MultiChoice, sub_type=None))]] else begin[{] None end[}] return[ClassCreator(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=routeFieldParam, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=routeFieldCreate, postfix_operators=[], prefix_operators=[], qualifier=Version1, selectors=[], type_arguments=None)], member=putJson, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Field, sub_type=None))] end[}] END[}]
Keyword[public] identifier[Field] identifier[createFieldMultiChoicePlain] operator[SEP] identifier[Field] identifier[routeFieldParam] , identifier[List] operator[<] identifier[String] operator[>] identifier[multiChoiceValuesParam] operator[SEP] { Keyword[if] operator[SEP] identifier[routeFieldParam] operator[!=] Other[null] operator[&&] Keyword[this] operator[SEP] identifier[serviceTicket] operator[!=] Other[null] operator[SEP] { identifier[routeFieldParam] operator[SEP] identifier[setServiceTicket] operator[SEP] Keyword[this] operator[SEP] identifier[serviceTicket] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[multiChoiceValuesParam] operator[==] Other[null] operator[SEP] { identifier[multiChoiceValuesParam] operator[=] Keyword[new] identifier[ArrayList] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[routeFieldParam] operator[!=] Other[null] operator[SEP] { identifier[routeFieldParam] operator[SEP] identifier[setTypeAsEnum] operator[SEP] identifier[Field] operator[SEP] identifier[Type] operator[SEP] identifier[MultipleChoice] operator[SEP] operator[SEP] identifier[routeFieldParam] operator[SEP] identifier[setTypeMetaData] operator[SEP] identifier[FieldMetaData] operator[SEP] identifier[MultiChoice] operator[SEP] identifier[PLAIN] operator[SEP] operator[SEP] identifier[routeFieldParam] operator[SEP] identifier[setFieldValue] operator[SEP] Keyword[new] identifier[MultiChoice] operator[SEP] identifier[multiChoiceValuesParam] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] Keyword[new] identifier[Field] operator[SEP] Keyword[this] operator[SEP] identifier[putJson] operator[SEP] identifier[routeFieldParam] , identifier[Version1] operator[SEP] identifier[routeFieldCreate] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
public Coordinate getCoordinate(int index) { int grpIndex = coordIndex.get(index); return group.coords.get(grpIndex); }
class class_name[name] begin[{] method[getCoordinate, return_type[type[Coordinate]], modifier[public], parameter[index]] begin[{] local_variable[type[int], grpIndex] return[call[group.coords.get, parameter[member[.grpIndex]]]] end[}] END[}]
Keyword[public] identifier[Coordinate] identifier[getCoordinate] operator[SEP] Keyword[int] identifier[index] operator[SEP] { Keyword[int] identifier[grpIndex] operator[=] identifier[coordIndex] operator[SEP] identifier[get] operator[SEP] identifier[index] operator[SEP] operator[SEP] Keyword[return] identifier[group] operator[SEP] identifier[coords] operator[SEP] identifier[get] operator[SEP] identifier[grpIndex] operator[SEP] operator[SEP] }
static public String substitute(String original, String match, String subst) { String s = original; int pos; while (0 <= (pos = s.indexOf(match))) { StringBuilder sb = new StringBuilder(s); s = sb.replace(pos, pos + match.length(), subst).toString(); } return s; }
class class_name[name] begin[{] method[substitute, return_type[type[String]], modifier[public static], parameter[original, match, subst]] begin[{] local_variable[type[String], s] local_variable[type[int], pos] while[binary_operation[literal[0], <=, assign[member[.pos], call[s.indexOf, parameter[member[.match]]]]]] begin[{] local_variable[type[StringBuilder], sb] assign[member[.s], call[sb.replace, parameter[member[.pos], binary_operation[member[.pos], +, call[match.length, parameter[]]], member[.subst]]]] end[}] return[member[.s]] end[}] END[}]
Keyword[static] Keyword[public] identifier[String] identifier[substitute] operator[SEP] identifier[String] identifier[original] , identifier[String] identifier[match] , identifier[String] identifier[subst] operator[SEP] { identifier[String] identifier[s] operator[=] identifier[original] operator[SEP] Keyword[int] identifier[pos] operator[SEP] Keyword[while] operator[SEP] Other[0] operator[<=] operator[SEP] identifier[pos] operator[=] identifier[s] operator[SEP] identifier[indexOf] operator[SEP] identifier[match] operator[SEP] operator[SEP] operator[SEP] { identifier[StringBuilder] identifier[sb] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] identifier[s] operator[SEP] operator[SEP] identifier[s] operator[=] identifier[sb] operator[SEP] identifier[replace] operator[SEP] identifier[pos] , identifier[pos] operator[+] identifier[match] operator[SEP] identifier[length] operator[SEP] operator[SEP] , identifier[subst] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[s] operator[SEP] }
private void checkOperand(Type type, Expr operand, Environment environment) { checkIsSubtype(type, checkExpression(operand, environment), environment, operand); }
class class_name[name] begin[{] method[checkOperand, return_type[void], modifier[private], parameter[type, operand, environment]] begin[{] call[.checkIsSubtype, parameter[member[.type], call[.checkExpression, parameter[member[.operand], member[.environment]]], member[.environment], member[.operand]]] end[}] END[}]
Keyword[private] Keyword[void] identifier[checkOperand] operator[SEP] identifier[Type] identifier[type] , identifier[Expr] identifier[operand] , identifier[Environment] identifier[environment] operator[SEP] { identifier[checkIsSubtype] operator[SEP] identifier[type] , identifier[checkExpression] operator[SEP] identifier[operand] , identifier[environment] operator[SEP] , identifier[environment] , identifier[operand] operator[SEP] operator[SEP] }
public void unmarkCompacting(Iterable<SSTableReader> unmark) { boolean isValid = cfstore.isValid(); if (!isValid) { // The CF has been dropped. We don't know if the original compaction suceeded or failed, // which makes it difficult to know if the sstable reference has already been released. // A "good enough" approach is to mark the sstables involved obsolete, which if compaction succeeded // is harmlessly redundant, and if it failed ensures that at least the sstable will get deleted on restart. for (SSTableReader sstable : unmark) sstable.markObsolete(); } View currentView, newView; do { currentView = view.get(); newView = currentView.unmarkCompacting(unmark); } while (!view.compareAndSet(currentView, newView)); if (!isValid) { // when the CFS is invalidated, it will call unreferenceSSTables(). However, unreferenceSSTables only deals // with sstables that aren't currently being compacted. If there are ongoing compactions that finish or are // interrupted after the CFS is invalidated, those sstables need to be unreferenced as well, so we do that here. unreferenceSSTables(); } }
class class_name[name] begin[{] method[unmarkCompacting, return_type[void], modifier[public], parameter[unmark]] begin[{] local_variable[type[boolean], isValid] if[member[.isValid]] begin[{] ForStatement(body=StatementExpression(expression=MethodInvocation(arguments=[], member=markObsolete, postfix_operators=[], prefix_operators=[], qualifier=sstable, selectors=[], type_arguments=None), label=None), control=EnhancedForControl(iterable=MemberReference(member=unmark, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=sstable)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=SSTableReader, sub_type=None))), label=None) else begin[{] None end[}] local_variable[type[View], currentView] do[call[view.compareAndSet, parameter[member[.currentView], member[.newView]]]] begin[{] assign[member[.currentView], call[view.get, parameter[]]] assign[member[.newView], call[currentView.unmarkCompacting, parameter[member[.unmark]]]] end[}] if[member[.isValid]] begin[{] call[.unreferenceSSTables, parameter[]] else begin[{] None end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[unmarkCompacting] operator[SEP] identifier[Iterable] operator[<] identifier[SSTableReader] operator[>] identifier[unmark] operator[SEP] { Keyword[boolean] identifier[isValid] operator[=] identifier[cfstore] operator[SEP] identifier[isValid] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[isValid] operator[SEP] { Keyword[for] operator[SEP] identifier[SSTableReader] identifier[sstable] operator[:] identifier[unmark] operator[SEP] identifier[sstable] operator[SEP] identifier[markObsolete] operator[SEP] operator[SEP] operator[SEP] } identifier[View] identifier[currentView] , identifier[newView] operator[SEP] Keyword[do] { identifier[currentView] operator[=] identifier[view] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[newView] operator[=] identifier[currentView] operator[SEP] identifier[unmarkCompacting] operator[SEP] identifier[unmark] operator[SEP] operator[SEP] } Keyword[while] operator[SEP] operator[!] identifier[view] operator[SEP] identifier[compareAndSet] operator[SEP] identifier[currentView] , identifier[newView] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[isValid] operator[SEP] { identifier[unreferenceSSTables] operator[SEP] operator[SEP] operator[SEP] } }
public boolean matches(CharSequence rawPassword, String encodedPassword) { return matches(rawPassword == null ? null : rawPassword.toString(), encodedPassword); }
class class_name[name] begin[{] method[matches, return_type[type[boolean]], modifier[public], parameter[rawPassword, encodedPassword]] begin[{] return[call[.matches, parameter[TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=rawPassword, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), if_false=MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=rawPassword, selectors=[], type_arguments=None), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)), member[.encodedPassword]]]] end[}] END[}]
Keyword[public] Keyword[boolean] identifier[matches] operator[SEP] identifier[CharSequence] identifier[rawPassword] , identifier[String] identifier[encodedPassword] operator[SEP] { Keyword[return] identifier[matches] operator[SEP] identifier[rawPassword] operator[==] Other[null] operator[?] Other[null] operator[:] identifier[rawPassword] operator[SEP] identifier[toString] operator[SEP] operator[SEP] , identifier[encodedPassword] operator[SEP] operator[SEP] }
@Override public CPOptionValue findByUuid_First(String uuid, OrderByComparator<CPOptionValue> orderByComparator) throws NoSuchCPOptionValueException { CPOptionValue cpOptionValue = fetchByUuid_First(uuid, orderByComparator); if (cpOptionValue != null) { return cpOptionValue; } StringBundler msg = new StringBundler(4); msg.append(_NO_SUCH_ENTITY_WITH_KEY); msg.append("uuid="); msg.append(uuid); msg.append("}"); throw new NoSuchCPOptionValueException(msg.toString()); }
class class_name[name] begin[{] method[findByUuid_First, return_type[type[CPOptionValue]], modifier[public], parameter[uuid, orderByComparator]] begin[{] local_variable[type[CPOptionValue], cpOptionValue] if[binary_operation[member[.cpOptionValue], !=, literal[null]]] begin[{] return[member[.cpOptionValue]] else begin[{] None end[}] local_variable[type[StringBundler], msg] call[msg.append, parameter[member[._NO_SUCH_ENTITY_WITH_KEY]]] call[msg.append, parameter[literal["uuid="]]] call[msg.append, parameter[member[.uuid]]] call[msg.append, parameter[literal["}"]]] ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=msg, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=NoSuchCPOptionValueException, sub_type=None)), label=None) end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[CPOptionValue] identifier[findByUuid_First] operator[SEP] identifier[String] identifier[uuid] , identifier[OrderByComparator] operator[<] identifier[CPOptionValue] operator[>] identifier[orderByComparator] operator[SEP] Keyword[throws] identifier[NoSuchCPOptionValueException] { identifier[CPOptionValue] identifier[cpOptionValue] operator[=] identifier[fetchByUuid_First] operator[SEP] identifier[uuid] , identifier[orderByComparator] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[cpOptionValue] operator[!=] Other[null] operator[SEP] { Keyword[return] identifier[cpOptionValue] operator[SEP] } identifier[StringBundler] identifier[msg] operator[=] Keyword[new] identifier[StringBundler] operator[SEP] Other[4] operator[SEP] operator[SEP] identifier[msg] operator[SEP] identifier[append] operator[SEP] identifier[_NO_SUCH_ENTITY_WITH_KEY] operator[SEP] operator[SEP] identifier[msg] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[msg] operator[SEP] identifier[append] operator[SEP] identifier[uuid] operator[SEP] operator[SEP] identifier[msg] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[NoSuchCPOptionValueException] operator[SEP] identifier[msg] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
private void obtainDialogButtonTextColor(@NonNull final TypedArray typedArray) { ColorStateList colorStateList = typedArray.getColorStateList(R.styleable.DialogPreference_dialogButtonTextColor); if (colorStateList != null) { setDialogButtonTextColor(colorStateList); } }
class class_name[name] begin[{] method[obtainDialogButtonTextColor, return_type[void], modifier[private], parameter[typedArray]] begin[{] local_variable[type[ColorStateList], colorStateList] if[binary_operation[member[.colorStateList], !=, literal[null]]] begin[{] call[.setDialogButtonTextColor, parameter[member[.colorStateList]]] else begin[{] None end[}] end[}] END[}]
Keyword[private] Keyword[void] identifier[obtainDialogButtonTextColor] operator[SEP] annotation[@] identifier[NonNull] Keyword[final] identifier[TypedArray] identifier[typedArray] operator[SEP] { identifier[ColorStateList] identifier[colorStateList] operator[=] identifier[typedArray] operator[SEP] identifier[getColorStateList] operator[SEP] identifier[R] operator[SEP] identifier[styleable] operator[SEP] identifier[DialogPreference_dialogButtonTextColor] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[colorStateList] operator[!=] Other[null] operator[SEP] { identifier[setDialogButtonTextColor] operator[SEP] identifier[colorStateList] operator[SEP] operator[SEP] } }
public <E> Collection<E> unmodifiable(Collection<E> input) { if (input == null) { return null; } return Collections.unmodifiableCollection(input); }
class class_name[name] begin[{] method[unmodifiable, return_type[type[Collection]], modifier[public], parameter[input]] begin[{] if[binary_operation[member[.input], ==, literal[null]]] begin[{] return[literal[null]] else begin[{] None end[}] return[call[Collections.unmodifiableCollection, parameter[member[.input]]]] end[}] END[}]
Keyword[public] operator[<] identifier[E] operator[>] identifier[Collection] operator[<] identifier[E] operator[>] identifier[unmodifiable] operator[SEP] identifier[Collection] operator[<] identifier[E] operator[>] identifier[input] operator[SEP] { Keyword[if] operator[SEP] identifier[input] operator[==] Other[null] operator[SEP] { Keyword[return] Other[null] operator[SEP] } Keyword[return] identifier[Collections] operator[SEP] identifier[unmodifiableCollection] operator[SEP] identifier[input] operator[SEP] operator[SEP] }
public static String getTimeShort() { SimpleDateFormat formatter = new SimpleDateFormat("HH:mm:ss"); Date currentTime = new Date(); String dateString = formatter.format(currentTime); return dateString; }
class class_name[name] begin[{] method[getTimeShort, return_type[type[String]], modifier[public static], parameter[]] begin[{] local_variable[type[SimpleDateFormat], formatter] local_variable[type[Date], currentTime] local_variable[type[String], dateString] return[member[.dateString]] end[}] END[}]
Keyword[public] Keyword[static] identifier[String] identifier[getTimeShort] operator[SEP] operator[SEP] { identifier[SimpleDateFormat] identifier[formatter] operator[=] Keyword[new] identifier[SimpleDateFormat] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[Date] identifier[currentTime] operator[=] Keyword[new] identifier[Date] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[dateString] operator[=] identifier[formatter] operator[SEP] identifier[format] operator[SEP] identifier[currentTime] operator[SEP] operator[SEP] Keyword[return] identifier[dateString] operator[SEP] }
public static void generateFixedUrls(final ContentSpec contentSpec, boolean missingOnly, final Integer fixedUrlPropertyTagId) { final Set<String> existingFixedUrls = new HashSet<String>(); final Set<SpecNode> nodesWithoutFixedUrls = new HashSet<SpecNode>(); final List<SpecNode> specNodes = getAllSpecNodes(contentSpec); // Collect any current fixed urls or nodes that need configuring if (missingOnly) { collectFixedUrlInformation(specNodes, nodesWithoutFixedUrls, existingFixedUrls); } generateFixedUrlForNodes(nodesWithoutFixedUrls, existingFixedUrls, fixedUrlPropertyTagId); }
class class_name[name] begin[{] method[generateFixedUrls, return_type[void], modifier[public static], parameter[contentSpec, missingOnly, fixedUrlPropertyTagId]] begin[{] local_variable[type[Set], existingFixedUrls] local_variable[type[Set], nodesWithoutFixedUrls] local_variable[type[List], specNodes] if[member[.missingOnly]] begin[{] call[.collectFixedUrlInformation, parameter[member[.specNodes], member[.nodesWithoutFixedUrls], member[.existingFixedUrls]]] else begin[{] None end[}] call[.generateFixedUrlForNodes, parameter[member[.nodesWithoutFixedUrls], member[.existingFixedUrls], member[.fixedUrlPropertyTagId]]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[generateFixedUrls] operator[SEP] Keyword[final] identifier[ContentSpec] identifier[contentSpec] , Keyword[boolean] identifier[missingOnly] , Keyword[final] identifier[Integer] identifier[fixedUrlPropertyTagId] operator[SEP] { Keyword[final] identifier[Set] operator[<] identifier[String] operator[>] identifier[existingFixedUrls] operator[=] Keyword[new] identifier[HashSet] operator[<] identifier[String] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[Set] operator[<] identifier[SpecNode] operator[>] identifier[nodesWithoutFixedUrls] operator[=] Keyword[new] identifier[HashSet] operator[<] identifier[SpecNode] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[List] operator[<] identifier[SpecNode] operator[>] identifier[specNodes] operator[=] identifier[getAllSpecNodes] operator[SEP] identifier[contentSpec] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[missingOnly] operator[SEP] { identifier[collectFixedUrlInformation] operator[SEP] identifier[specNodes] , identifier[nodesWithoutFixedUrls] , identifier[existingFixedUrls] operator[SEP] operator[SEP] } identifier[generateFixedUrlForNodes] operator[SEP] identifier[nodesWithoutFixedUrls] , identifier[existingFixedUrls] , identifier[fixedUrlPropertyTagId] operator[SEP] operator[SEP] }
public long getSaving(Configuration conf) { try { DFSClient dfs = ((DistributedFileSystem)FileSystem.get(conf)).getClient(); Counters raidedCounters = stateToSourceCounters.get(RaidState.RAIDED); long physical = raidedCounters.getNumBytes() + parityCounters.getNumBytes(); long logical = raidedCounters.getNumLogical(); return logical * dfs.getDefaultReplication() - physical; } catch (Exception e) { return -1; } }
class class_name[name] begin[{] method[getSaving, return_type[type[long]], modifier[public], parameter[conf]] begin[{] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MethodInvocation(arguments=[MemberReference(member=conf, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=FileSystem, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=DistributedFileSystem, sub_type=None)), name=dfs)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=DFSClient, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=RAIDED, postfix_operators=[], prefix_operators=[], qualifier=RaidState, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=stateToSourceCounters, selectors=[], type_arguments=None), name=raidedCounters)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Counters, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getNumBytes, postfix_operators=[], prefix_operators=[], qualifier=raidedCounters, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[], member=getNumBytes, postfix_operators=[], prefix_operators=[], qualifier=parityCounters, selectors=[], type_arguments=None), operator=+), name=physical)], modifiers=set(), type=BasicType(dimensions=[], name=long)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getNumLogical, postfix_operators=[], prefix_operators=[], qualifier=raidedCounters, selectors=[], type_arguments=None), name=logical)], modifiers=set(), type=BasicType(dimensions=[], name=long)), ReturnStatement(expression=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=logical, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=getDefaultReplication, postfix_operators=[], prefix_operators=[], qualifier=dfs, selectors=[], type_arguments=None), operator=*), operandr=MemberReference(member=physical, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=-), label=None)], catches=[CatchClause(block=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=1), 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[long] identifier[getSaving] operator[SEP] identifier[Configuration] identifier[conf] operator[SEP] { Keyword[try] { identifier[DFSClient] identifier[dfs] operator[=] operator[SEP] operator[SEP] identifier[DistributedFileSystem] operator[SEP] identifier[FileSystem] operator[SEP] identifier[get] operator[SEP] identifier[conf] operator[SEP] operator[SEP] operator[SEP] identifier[getClient] operator[SEP] operator[SEP] operator[SEP] identifier[Counters] identifier[raidedCounters] operator[=] identifier[stateToSourceCounters] operator[SEP] identifier[get] operator[SEP] identifier[RaidState] operator[SEP] identifier[RAIDED] operator[SEP] operator[SEP] Keyword[long] identifier[physical] operator[=] identifier[raidedCounters] operator[SEP] identifier[getNumBytes] operator[SEP] operator[SEP] operator[+] identifier[parityCounters] operator[SEP] identifier[getNumBytes] operator[SEP] operator[SEP] operator[SEP] Keyword[long] identifier[logical] operator[=] identifier[raidedCounters] operator[SEP] identifier[getNumLogical] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[logical] operator[*] identifier[dfs] operator[SEP] identifier[getDefaultReplication] operator[SEP] operator[SEP] operator[-] identifier[physical] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { Keyword[return] operator[-] Other[1] operator[SEP] } }
public static void clearCache (@Nonnull final ClassLoader aClassLoader) { ResourceBundle.clearCache (aClassLoader); if (LOGGER.isDebugEnabled ()) LOGGER.debug ("Cache was cleared: " + ResourceBundle.class.getName () + "; classloader=" + aClassLoader); }
class class_name[name] begin[{] method[clearCache, return_type[void], modifier[public static], parameter[aClassLoader]] begin[{] call[ResourceBundle.clearCache, parameter[member[.aClassLoader]]] if[call[LOGGER.isDebugEnabled, parameter[]]] begin[{] call[LOGGER.debug, parameter[binary_operation[binary_operation[binary_operation[literal["Cache was cleared: "], +, 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=ResourceBundle, sub_type=None))], +, literal["; classloader="]], +, member[.aClassLoader]]]] else begin[{] None end[}] end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[clearCache] operator[SEP] annotation[@] identifier[Nonnull] Keyword[final] identifier[ClassLoader] identifier[aClassLoader] operator[SEP] { identifier[ResourceBundle] operator[SEP] identifier[clearCache] operator[SEP] identifier[aClassLoader] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[LOGGER] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[LOGGER] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[+] identifier[ResourceBundle] operator[SEP] Keyword[class] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[aClassLoader] operator[SEP] operator[SEP] }
@When("^I create a Cassandra index named '(.+?)' with schema '(.+?)' of type '(json|string)' in table '(.+?)' using magic_column '(.+?)' using keyspace '(.+?)' with:$") public void createCustomMapping(String index_name, String schema, String type, String table, String magic_column, String keyspace, DataTable modifications) throws Exception { String retrievedData = commonspec.retrieveData(schema, type); String modifiedData = commonspec.modifyData(retrievedData, type, modifications).toString(); String query = "CREATE CUSTOM INDEX " + index_name + " ON " + keyspace + "." + table + "(" + magic_column + ") " + "USING 'com.stratio.cassandra.lucene.Index' WITH OPTIONS = " + modifiedData; commonspec.getLogger().debug("Will execute a cassandra query: {}", query); commonspec.getCassandraClient().executeQuery(query); }
class class_name[name] begin[{] method[createCustomMapping, return_type[void], modifier[public], parameter[index_name, schema, type, table, magic_column, keyspace, modifications]] begin[{] local_variable[type[String], retrievedData] local_variable[type[String], modifiedData] local_variable[type[String], query] call[commonspec.getLogger, parameter[]] call[commonspec.getCassandraClient, parameter[]] end[}] END[}]
annotation[@] identifier[When] operator[SEP] literal[String] operator[SEP] Keyword[public] Keyword[void] identifier[createCustomMapping] operator[SEP] identifier[String] identifier[index_name] , identifier[String] identifier[schema] , identifier[String] identifier[type] , identifier[String] identifier[table] , identifier[String] identifier[magic_column] , identifier[String] identifier[keyspace] , identifier[DataTable] identifier[modifications] operator[SEP] Keyword[throws] identifier[Exception] { identifier[String] identifier[retrievedData] operator[=] identifier[commonspec] operator[SEP] identifier[retrieveData] operator[SEP] identifier[schema] , identifier[type] operator[SEP] operator[SEP] identifier[String] identifier[modifiedData] operator[=] identifier[commonspec] operator[SEP] identifier[modifyData] operator[SEP] identifier[retrievedData] , identifier[type] , identifier[modifications] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[query] operator[=] literal[String] operator[+] identifier[index_name] operator[+] literal[String] operator[+] identifier[keyspace] operator[+] literal[String] operator[+] identifier[table] operator[+] literal[String] operator[+] identifier[magic_column] operator[+] literal[String] operator[+] literal[String] operator[+] identifier[modifiedData] operator[SEP] identifier[commonspec] operator[SEP] identifier[getLogger] operator[SEP] operator[SEP] operator[SEP] identifier[debug] operator[SEP] literal[String] , identifier[query] operator[SEP] operator[SEP] identifier[commonspec] operator[SEP] identifier[getCassandraClient] operator[SEP] operator[SEP] operator[SEP] identifier[executeQuery] operator[SEP] identifier[query] operator[SEP] operator[SEP] }
public void setNetworkInterfaces(java.util.Collection<ScheduledInstancesNetworkInterface> networkInterfaces) { if (networkInterfaces == null) { this.networkInterfaces = null; return; } this.networkInterfaces = new com.amazonaws.internal.SdkInternalList<ScheduledInstancesNetworkInterface>(networkInterfaces); }
class class_name[name] begin[{] method[setNetworkInterfaces, return_type[void], modifier[public], parameter[networkInterfaces]] begin[{] if[binary_operation[member[.networkInterfaces], ==, literal[null]]] begin[{] assign[THIS[member[None.networkInterfaces]], literal[null]] return[None] else begin[{] None end[}] assign[THIS[member[None.networkInterfaces]], ClassCreator(arguments=[MemberReference(member=networkInterfaces, 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=ScheduledInstancesNetworkInterface, sub_type=None))], dimensions=None, name=SdkInternalList, sub_type=None)))))] end[}] END[}]
Keyword[public] Keyword[void] identifier[setNetworkInterfaces] operator[SEP] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[Collection] operator[<] identifier[ScheduledInstancesNetworkInterface] operator[>] identifier[networkInterfaces] operator[SEP] { Keyword[if] operator[SEP] identifier[networkInterfaces] operator[==] Other[null] operator[SEP] { Keyword[this] operator[SEP] identifier[networkInterfaces] operator[=] Other[null] operator[SEP] Keyword[return] operator[SEP] } Keyword[this] operator[SEP] identifier[networkInterfaces] operator[=] Keyword[new] identifier[com] operator[SEP] identifier[amazonaws] operator[SEP] identifier[internal] operator[SEP] identifier[SdkInternalList] operator[<] identifier[ScheduledInstancesNetworkInterface] operator[>] operator[SEP] identifier[networkInterfaces] operator[SEP] operator[SEP] }
@VisibleForTesting Map<String, Plugin> instantiatePluginClasses(Map<PluginClassLoaderDef, ClassLoader> classloaders) { // instantiate plugins Map<String, Plugin> instancesByPluginKey = new HashMap<>(); for (Map.Entry<PluginClassLoaderDef, ClassLoader> entry : classloaders.entrySet()) { PluginClassLoaderDef def = entry.getKey(); ClassLoader classLoader = entry.getValue(); // the same classloader can be used by multiple plugins for (Map.Entry<String, String> mainClassEntry : def.getMainClassesByPluginKey().entrySet()) { String pluginKey = mainClassEntry.getKey(); String mainClass = mainClassEntry.getValue(); try { instancesByPluginKey.put(pluginKey, (Plugin) classLoader.loadClass(mainClass).newInstance()); } catch (UnsupportedClassVersionError e) { throw new IllegalStateException(String.format("The plugin [%s] does not support Java %s", pluginKey, SystemUtils.JAVA_VERSION_TRIMMED), e); } catch (Throwable e) { throw new IllegalStateException(String.format( "Fail to instantiate class [%s] of plugin [%s]", mainClass, pluginKey), e); } } } return instancesByPluginKey; }
class class_name[name] begin[{] method[instantiatePluginClasses, return_type[type[Map]], modifier[default], parameter[classloaders]] begin[{] local_variable[type[Map], instancesByPluginKey] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getKey, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None), name=def)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=PluginClassLoaderDef, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None), name=classLoader)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ClassLoader, sub_type=None)), ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getKey, postfix_operators=[], prefix_operators=[], qualifier=mainClassEntry, selectors=[], type_arguments=None), name=pluginKey)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=mainClassEntry, selectors=[], type_arguments=None), name=mainClass)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=pluginKey, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Cast(expression=MethodInvocation(arguments=[MemberReference(member=mainClass, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=loadClass, postfix_operators=[], prefix_operators=[], qualifier=classLoader, selectors=[MethodInvocation(arguments=[], member=newInstance, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=Plugin, sub_type=None))], member=put, postfix_operators=[], prefix_operators=[], qualifier=instancesByPluginKey, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="The plugin [%s] does not support Java %s"), MemberReference(member=pluginKey, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=JAVA_VERSION_TRIMMED, postfix_operators=[], prefix_operators=[], qualifier=SystemUtils, selectors=[])], member=format, postfix_operators=[], prefix_operators=[], qualifier=String, selectors=[], type_arguments=None), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalStateException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['UnsupportedClassVersionError'])), CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Fail to instantiate class [%s] of plugin [%s]"), MemberReference(member=mainClass, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=pluginKey, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=format, postfix_operators=[], prefix_operators=[], qualifier=String, selectors=[], type_arguments=None), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalStateException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Throwable']))], finally_block=None, label=None, resources=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getMainClassesByPluginKey, postfix_operators=[], prefix_operators=[], qualifier=def, selectors=[MethodInvocation(arguments=[], member=entrySet, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=mainClassEntry)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Map, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=None, name=Entry, sub_type=None)))), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=entrySet, postfix_operators=[], prefix_operators=[], qualifier=classloaders, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=entry)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Map, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=PluginClassLoaderDef, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=ClassLoader, sub_type=None))], dimensions=None, name=Entry, sub_type=None)))), label=None) return[member[.instancesByPluginKey]] end[}] END[}]
annotation[@] identifier[VisibleForTesting] identifier[Map] operator[<] identifier[String] , identifier[Plugin] operator[>] identifier[instantiatePluginClasses] operator[SEP] identifier[Map] operator[<] identifier[PluginClassLoaderDef] , identifier[ClassLoader] operator[>] identifier[classloaders] operator[SEP] { identifier[Map] operator[<] identifier[String] , identifier[Plugin] operator[>] identifier[instancesByPluginKey] operator[=] Keyword[new] identifier[HashMap] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Map] operator[SEP] identifier[Entry] operator[<] identifier[PluginClassLoaderDef] , identifier[ClassLoader] operator[>] identifier[entry] operator[:] identifier[classloaders] operator[SEP] identifier[entrySet] operator[SEP] operator[SEP] operator[SEP] { identifier[PluginClassLoaderDef] identifier[def] operator[=] identifier[entry] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] operator[SEP] identifier[ClassLoader] identifier[classLoader] operator[=] identifier[entry] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Map] operator[SEP] identifier[Entry] operator[<] identifier[String] , identifier[String] operator[>] identifier[mainClassEntry] operator[:] identifier[def] operator[SEP] identifier[getMainClassesByPluginKey] operator[SEP] operator[SEP] operator[SEP] identifier[entrySet] operator[SEP] operator[SEP] operator[SEP] { identifier[String] identifier[pluginKey] operator[=] identifier[mainClassEntry] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[mainClass] operator[=] identifier[mainClassEntry] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] Keyword[try] { identifier[instancesByPluginKey] operator[SEP] identifier[put] operator[SEP] identifier[pluginKey] , operator[SEP] identifier[Plugin] operator[SEP] identifier[classLoader] operator[SEP] identifier[loadClass] operator[SEP] identifier[mainClass] operator[SEP] operator[SEP] identifier[newInstance] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[UnsupportedClassVersionError] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[pluginKey] , identifier[SystemUtils] operator[SEP] identifier[JAVA_VERSION_TRIMMED] operator[SEP] , identifier[e] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Throwable] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[mainClass] , identifier[pluginKey] operator[SEP] , identifier[e] operator[SEP] operator[SEP] } } } Keyword[return] identifier[instancesByPluginKey] operator[SEP] }
public static LineString removeDuplicateCoordinates(LineString linestring, double tolerance) throws SQLException { Coordinate[] coords = CoordinateUtils.removeRepeatedCoordinates(linestring.getCoordinates(), tolerance, false); if(coords.length<2){ throw new SQLException("Not enough coordinates to build a new LineString.\n Please adjust the tolerance"); } return FACTORY.createLineString(coords); }
class class_name[name] begin[{] method[removeDuplicateCoordinates, return_type[type[LineString]], modifier[public static], parameter[linestring, tolerance]] begin[{] local_variable[type[Coordinate], coords] if[binary_operation[member[coords.length], <, literal[2]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Not enough coordinates to build a new LineString.\n Please adjust the tolerance")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SQLException, sub_type=None)), label=None) else begin[{] None end[}] return[call[FACTORY.createLineString, parameter[member[.coords]]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[LineString] identifier[removeDuplicateCoordinates] operator[SEP] identifier[LineString] identifier[linestring] , Keyword[double] identifier[tolerance] operator[SEP] Keyword[throws] identifier[SQLException] { identifier[Coordinate] operator[SEP] operator[SEP] identifier[coords] operator[=] identifier[CoordinateUtils] operator[SEP] identifier[removeRepeatedCoordinates] operator[SEP] identifier[linestring] operator[SEP] identifier[getCoordinates] operator[SEP] operator[SEP] , identifier[tolerance] , literal[boolean] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[coords] operator[SEP] identifier[length] operator[<] Other[2] operator[SEP] { Keyword[throw] Keyword[new] identifier[SQLException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[return] identifier[FACTORY] operator[SEP] identifier[createLineString] operator[SEP] identifier[coords] operator[SEP] operator[SEP] }
public List<CmsClientSitemapEntry> getLoadedDescendants(String path) { LinkedList<CmsClientSitemapEntry> remainingEntries = new LinkedList<CmsClientSitemapEntry>(); List<CmsClientSitemapEntry> result = new ArrayList<CmsClientSitemapEntry>(); CmsClientSitemapEntry entry = getEntry(path); remainingEntries.add(entry); while (remainingEntries.size() > 0) { CmsClientSitemapEntry currentEntry = remainingEntries.removeFirst(); result.add(currentEntry); for (CmsClientSitemapEntry subEntry : currentEntry.getSubEntries()) { remainingEntries.add(subEntry); } } return result; }
class class_name[name] begin[{] method[getLoadedDescendants, return_type[type[List]], modifier[public], parameter[path]] begin[{] local_variable[type[LinkedList], remainingEntries] local_variable[type[List], result] local_variable[type[CmsClientSitemapEntry], entry] call[remainingEntries.add, parameter[member[.entry]]] while[binary_operation[call[remainingEntries.size, parameter[]], >, literal[0]]] begin[{] local_variable[type[CmsClientSitemapEntry], currentEntry] call[result.add, parameter[member[.currentEntry]]] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=subEntry, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=remainingEntries, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getSubEntries, postfix_operators=[], prefix_operators=[], qualifier=currentEntry, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=subEntry)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=CmsClientSitemapEntry, sub_type=None))), label=None) end[}] return[member[.result]] end[}] END[}]
Keyword[public] identifier[List] operator[<] identifier[CmsClientSitemapEntry] operator[>] identifier[getLoadedDescendants] operator[SEP] identifier[String] identifier[path] operator[SEP] { identifier[LinkedList] operator[<] identifier[CmsClientSitemapEntry] operator[>] identifier[remainingEntries] operator[=] Keyword[new] identifier[LinkedList] operator[<] identifier[CmsClientSitemapEntry] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[CmsClientSitemapEntry] operator[>] identifier[result] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[CmsClientSitemapEntry] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[CmsClientSitemapEntry] identifier[entry] operator[=] identifier[getEntry] operator[SEP] identifier[path] operator[SEP] operator[SEP] identifier[remainingEntries] operator[SEP] identifier[add] operator[SEP] identifier[entry] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[remainingEntries] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] { identifier[CmsClientSitemapEntry] identifier[currentEntry] operator[=] identifier[remainingEntries] operator[SEP] identifier[removeFirst] operator[SEP] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[add] operator[SEP] identifier[currentEntry] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[CmsClientSitemapEntry] identifier[subEntry] operator[:] identifier[currentEntry] operator[SEP] identifier[getSubEntries] operator[SEP] operator[SEP] operator[SEP] { identifier[remainingEntries] operator[SEP] identifier[add] operator[SEP] identifier[subEntry] operator[SEP] operator[SEP] } } Keyword[return] identifier[result] operator[SEP] }
public CompareType createCompareTypeFromString(EDataType eDataType, String initialValue) { CompareType result = CompareType.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[createCompareTypeFromString, return_type[type[CompareType]], modifier[public], parameter[eDataType, initialValue]] begin[{] local_variable[type[CompareType], 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[CompareType] identifier[createCompareTypeFromString] operator[SEP] identifier[EDataType] identifier[eDataType] , identifier[String] identifier[initialValue] operator[SEP] { identifier[CompareType] identifier[result] operator[=] identifier[CompareType] 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] }
public BaseTemplate yieldUnescaped(Object obj) throws IOException { writeIndent(); out.write(obj.toString()); return this; }
class class_name[name] begin[{] method[yieldUnescaped, return_type[type[BaseTemplate]], modifier[public], parameter[obj]] begin[{] call[.writeIndent, parameter[]] call[out.write, parameter[call[obj.toString, parameter[]]]] return[THIS[]] end[}] END[}]
Keyword[public] identifier[BaseTemplate] identifier[yieldUnescaped] operator[SEP] identifier[Object] identifier[obj] operator[SEP] Keyword[throws] identifier[IOException] { identifier[writeIndent] operator[SEP] operator[SEP] operator[SEP] identifier[out] operator[SEP] identifier[write] operator[SEP] identifier[obj] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] Keyword[this] operator[SEP] }
public String getString (String key, Supplier<String> notFound) { Object object = getObject (key); return (object instanceof String) ? (String) object : notFound.get (); }
class class_name[name] begin[{] method[getString, return_type[type[String]], modifier[public], parameter[key, notFound]] begin[{] local_variable[type[Object], object] return[TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=object, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None), operator=instanceof), if_false=MethodInvocation(arguments=[], member=get, postfix_operators=[], prefix_operators=[], qualifier=notFound, selectors=[], type_arguments=None), if_true=Cast(expression=MemberReference(member=object, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)))] end[}] END[}]
Keyword[public] identifier[String] identifier[getString] operator[SEP] identifier[String] identifier[key] , identifier[Supplier] operator[<] identifier[String] operator[>] identifier[notFound] operator[SEP] { identifier[Object] identifier[object] operator[=] identifier[getObject] operator[SEP] identifier[key] operator[SEP] operator[SEP] Keyword[return] operator[SEP] identifier[object] Keyword[instanceof] identifier[String] operator[SEP] operator[?] operator[SEP] identifier[String] operator[SEP] identifier[object] operator[:] identifier[notFound] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] }
public void addIntentFilterForReceiver(ComponentName componentName, IntentFilter filter) throws NameNotFoundException { addIntentFilterForComponent(componentName, filter, receiverFilters); }
class class_name[name] begin[{] method[addIntentFilterForReceiver, return_type[void], modifier[public], parameter[componentName, filter]] begin[{] call[.addIntentFilterForComponent, parameter[member[.componentName], member[.filter], member[.receiverFilters]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[addIntentFilterForReceiver] operator[SEP] identifier[ComponentName] identifier[componentName] , identifier[IntentFilter] identifier[filter] operator[SEP] Keyword[throws] identifier[NameNotFoundException] { identifier[addIntentFilterForComponent] operator[SEP] identifier[componentName] , identifier[filter] , identifier[receiverFilters] operator[SEP] operator[SEP] }
public static SocketIOServer newInstance(int port, SSLContext sslContext) { SslContext nettySslContext = new JdkSslContext(sslContext, false, ClientAuth.NONE); return newInstance(port, nettySslContext); }
class class_name[name] begin[{] method[newInstance, return_type[type[SocketIOServer]], modifier[public static], parameter[port, sslContext]] begin[{] local_variable[type[SslContext], nettySslContext] return[call[.newInstance, parameter[member[.port], member[.nettySslContext]]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[SocketIOServer] identifier[newInstance] operator[SEP] Keyword[int] identifier[port] , identifier[SSLContext] identifier[sslContext] operator[SEP] { identifier[SslContext] identifier[nettySslContext] operator[=] Keyword[new] identifier[JdkSslContext] operator[SEP] identifier[sslContext] , literal[boolean] , identifier[ClientAuth] operator[SEP] identifier[NONE] operator[SEP] operator[SEP] Keyword[return] identifier[newInstance] operator[SEP] identifier[port] , identifier[nettySslContext] operator[SEP] operator[SEP] }
public static void writeAndClose(Writer writer, CharSequence cs) { try { write(writer, cs); } catch (IOException e) { throw Lang.wrapThrow(e); } finally { safeClose(writer); } }
class class_name[name] begin[{] method[writeAndClose, return_type[void], modifier[public static], parameter[writer, cs]] begin[{] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=writer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=cs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=write, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=MethodInvocation(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=wrapThrow, postfix_operators=[], prefix_operators=[], qualifier=Lang, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IOException']))], finally_block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=writer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=safeClose, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], label=None, resources=None) end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[writeAndClose] operator[SEP] identifier[Writer] identifier[writer] , identifier[CharSequence] identifier[cs] operator[SEP] { Keyword[try] { identifier[write] operator[SEP] identifier[writer] , identifier[cs] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[IOException] identifier[e] operator[SEP] { Keyword[throw] identifier[Lang] operator[SEP] identifier[wrapThrow] operator[SEP] identifier[e] operator[SEP] operator[SEP] } Keyword[finally] { identifier[safeClose] operator[SEP] identifier[writer] operator[SEP] operator[SEP] } }
public final void bitcoinSerialize(OutputStream stream) throws IOException { // 1st check for cached bytes. if (payload != null && length != UNKNOWN_LENGTH) { stream.write(payload, offset, length); return; } bitcoinSerializeToStream(stream); }
class class_name[name] begin[{] method[bitcoinSerialize, return_type[void], modifier[final public], parameter[stream]] begin[{] if[binary_operation[binary_operation[member[.payload], !=, literal[null]], &&, binary_operation[member[.length], !=, member[.UNKNOWN_LENGTH]]]] begin[{] call[stream.write, parameter[member[.payload], member[.offset], member[.length]]] return[None] else begin[{] None end[}] call[.bitcoinSerializeToStream, parameter[member[.stream]]] end[}] END[}]
Keyword[public] Keyword[final] Keyword[void] identifier[bitcoinSerialize] operator[SEP] identifier[OutputStream] identifier[stream] operator[SEP] Keyword[throws] identifier[IOException] { Keyword[if] operator[SEP] identifier[payload] operator[!=] Other[null] operator[&&] identifier[length] operator[!=] identifier[UNKNOWN_LENGTH] operator[SEP] { identifier[stream] operator[SEP] identifier[write] operator[SEP] identifier[payload] , identifier[offset] , identifier[length] operator[SEP] operator[SEP] Keyword[return] operator[SEP] } identifier[bitcoinSerializeToStream] operator[SEP] identifier[stream] operator[SEP] operator[SEP] }
private boolean consumeAnyButEOF() { int c = input.LA(1); if (c == CharStream.EOF) return false; if (log.isTraceEnabled()) log.trace("Lexer consumes '{}' while consumeButEOF", Character.toString((char) c)); // consume character input.consume(); return true; }
class class_name[name] begin[{] method[consumeAnyButEOF, return_type[type[boolean]], modifier[private], parameter[]] begin[{] local_variable[type[int], c] if[binary_operation[member[.c], ==, member[CharStream.EOF]]] begin[{] return[literal[false]] else begin[{] None end[}] if[call[log.isTraceEnabled, parameter[]]] begin[{] call[log.trace, parameter[literal["Lexer consumes '{}' while consumeButEOF"], call[Character.toString, parameter[Cast(expression=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=BasicType(dimensions=[], name=char))]]]] else begin[{] None end[}] call[input.consume, parameter[]] return[literal[true]] end[}] END[}]
Keyword[private] Keyword[boolean] identifier[consumeAnyButEOF] operator[SEP] operator[SEP] { Keyword[int] identifier[c] operator[=] identifier[input] operator[SEP] identifier[LA] operator[SEP] Other[1] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[c] operator[==] identifier[CharStream] operator[SEP] identifier[EOF] operator[SEP] Keyword[return] literal[boolean] operator[SEP] Keyword[if] operator[SEP] identifier[log] operator[SEP] identifier[isTraceEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[log] operator[SEP] identifier[trace] operator[SEP] literal[String] , identifier[Character] operator[SEP] identifier[toString] operator[SEP] operator[SEP] Keyword[char] operator[SEP] identifier[c] operator[SEP] operator[SEP] operator[SEP] identifier[input] operator[SEP] identifier[consume] operator[SEP] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP] }
public void registerComponents() throws Exception { Debug.logVerbose("[JdonFramework] note: registe all basic components in container.xml size=" + basicComponents.size(), module); try { Iterator iter = basicComponents.iterator(); while (iter.hasNext()) { String name = (String) iter.next(); ComponentMetaDef componentMetaDef = basicComponents.getComponentMetaDef(name); xmlcontainerRegistry.registerComponentMetaDef(componentMetaDef); } } catch (Exception ex) { Debug.logError("[JdonFramework] register basiceComponents error:" + ex, module); throw new Exception(ex); } }
class class_name[name] begin[{] method[registerComponents, return_type[void], modifier[public], parameter[]] begin[{] call[Debug.logVerbose, parameter[binary_operation[literal["[JdonFramework] note: registe all basic components in container.xml size="], +, call[basicComponents.size, parameter[]]], member[.module]]] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=iterator, postfix_operators=[], prefix_operators=[], qualifier=basicComponents, selectors=[], type_arguments=None), name=iter)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Iterator, sub_type=None)), WhileStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MethodInvocation(arguments=[], member=next, postfix_operators=[], prefix_operators=[], qualifier=iter, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), name=name)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getComponentMetaDef, postfix_operators=[], prefix_operators=[], qualifier=basicComponents, selectors=[], type_arguments=None), name=componentMetaDef)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ComponentMetaDef, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=componentMetaDef, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=registerComponentMetaDef, postfix_operators=[], prefix_operators=[], qualifier=xmlcontainerRegistry, selectors=[], type_arguments=None), label=None)]), condition=MethodInvocation(arguments=[], member=hasNext, postfix_operators=[], prefix_operators=[], qualifier=iter, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="[JdonFramework] register basiceComponents error:"), operandr=MemberReference(member=ex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), MemberReference(member=module, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=logError, postfix_operators=[], prefix_operators=[], qualifier=Debug, selectors=[], type_arguments=None), label=None), ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=ex, 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=Exception, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ex, types=['Exception']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[public] Keyword[void] identifier[registerComponents] operator[SEP] operator[SEP] Keyword[throws] identifier[Exception] { identifier[Debug] operator[SEP] identifier[logVerbose] operator[SEP] literal[String] operator[+] identifier[basicComponents] operator[SEP] identifier[size] operator[SEP] operator[SEP] , identifier[module] operator[SEP] operator[SEP] Keyword[try] { identifier[Iterator] identifier[iter] operator[=] identifier[basicComponents] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[iter] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] { identifier[String] identifier[name] operator[=] operator[SEP] identifier[String] operator[SEP] identifier[iter] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] identifier[ComponentMetaDef] identifier[componentMetaDef] operator[=] identifier[basicComponents] operator[SEP] identifier[getComponentMetaDef] operator[SEP] identifier[name] operator[SEP] operator[SEP] identifier[xmlcontainerRegistry] operator[SEP] identifier[registerComponentMetaDef] operator[SEP] identifier[componentMetaDef] operator[SEP] operator[SEP] } } Keyword[catch] operator[SEP] identifier[Exception] identifier[ex] operator[SEP] { identifier[Debug] operator[SEP] identifier[logError] operator[SEP] literal[String] operator[+] identifier[ex] , identifier[module] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[Exception] operator[SEP] identifier[ex] operator[SEP] operator[SEP] } }
@GwtIncompatible // CopyOnWriteArraySet public static <E> CopyOnWriteArraySet<E> newCopyOnWriteArraySet(Iterable<? extends E> elements) { // We copy elements to an ArrayList first, rather than incurring the // quadratic cost of adding them to the COWAS directly. Collection<? extends E> elementsCollection = (elements instanceof Collection) ? Collections2.cast(elements) : Lists.newArrayList(elements); return new CopyOnWriteArraySet<E>(elementsCollection); }
class class_name[name] begin[{] method[newCopyOnWriteArraySet, return_type[type[CopyOnWriteArraySet]], modifier[public static], parameter[elements]] begin[{] local_variable[type[Collection], elementsCollection] return[ClassCreator(arguments=[MemberReference(member=elementsCollection, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=E, sub_type=None))], dimensions=None, name=CopyOnWriteArraySet, sub_type=None))] end[}] END[}]
annotation[@] identifier[GwtIncompatible] Keyword[public] Keyword[static] operator[<] identifier[E] operator[>] identifier[CopyOnWriteArraySet] operator[<] identifier[E] operator[>] identifier[newCopyOnWriteArraySet] operator[SEP] identifier[Iterable] operator[<] operator[?] Keyword[extends] identifier[E] operator[>] identifier[elements] operator[SEP] { identifier[Collection] operator[<] operator[?] Keyword[extends] identifier[E] operator[>] identifier[elementsCollection] operator[=] operator[SEP] identifier[elements] Keyword[instanceof] identifier[Collection] operator[SEP] operator[?] identifier[Collections2] operator[SEP] identifier[cast] operator[SEP] identifier[elements] operator[SEP] operator[:] identifier[Lists] operator[SEP] identifier[newArrayList] operator[SEP] identifier[elements] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[CopyOnWriteArraySet] operator[<] identifier[E] operator[>] operator[SEP] identifier[elementsCollection] operator[SEP] operator[SEP] }
public static Class getProxyFactory(Class persistentClass, Class[] interfaces) throws PersistenceException { Enhancer e = new Enhancer(); e.setSuperclass(interfaces.length == 1 ? persistentClass : null); e.setInterfaces(interfaces); e.setCallbackTypes(new Class[] { InvocationHandler.class, NoOp.class, }); e.setCallbackFilter(FINALIZE_FILTER); e.setUseFactory(false); e.setInterceptDuringConstruction(false); return e.createClass(); }
class class_name[name] begin[{] method[getProxyFactory, return_type[type[Class]], modifier[public static], parameter[persistentClass, interfaces]] begin[{] local_variable[type[Enhancer], e] call[e.setSuperclass, parameter[TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=interfaces, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator===), if_false=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), if_true=MemberReference(member=persistentClass, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]] call[e.setInterfaces, parameter[member[.interfaces]]] call[e.setCallbackTypes, parameter[ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=InvocationHandler, sub_type=None)), ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=NoOp, sub_type=None))]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Class, sub_type=None))]] call[e.setCallbackFilter, parameter[member[.FINALIZE_FILTER]]] call[e.setUseFactory, parameter[literal[false]]] call[e.setInterceptDuringConstruction, parameter[literal[false]]] return[call[e.createClass, parameter[]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[Class] identifier[getProxyFactory] operator[SEP] identifier[Class] identifier[persistentClass] , identifier[Class] operator[SEP] operator[SEP] identifier[interfaces] operator[SEP] Keyword[throws] identifier[PersistenceException] { identifier[Enhancer] identifier[e] operator[=] Keyword[new] identifier[Enhancer] operator[SEP] operator[SEP] operator[SEP] identifier[e] operator[SEP] identifier[setSuperclass] operator[SEP] identifier[interfaces] operator[SEP] identifier[length] operator[==] Other[1] operator[?] identifier[persistentClass] operator[:] Other[null] operator[SEP] operator[SEP] identifier[e] operator[SEP] identifier[setInterfaces] operator[SEP] identifier[interfaces] operator[SEP] operator[SEP] identifier[e] operator[SEP] identifier[setCallbackTypes] operator[SEP] Keyword[new] identifier[Class] operator[SEP] operator[SEP] { identifier[InvocationHandler] operator[SEP] Keyword[class] , identifier[NoOp] operator[SEP] Keyword[class] , } operator[SEP] operator[SEP] identifier[e] operator[SEP] identifier[setCallbackFilter] operator[SEP] identifier[FINALIZE_FILTER] operator[SEP] operator[SEP] identifier[e] operator[SEP] identifier[setUseFactory] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[e] operator[SEP] identifier[setInterceptDuringConstruction] operator[SEP] literal[boolean] operator[SEP] operator[SEP] Keyword[return] identifier[e] operator[SEP] identifier[createClass] operator[SEP] operator[SEP] operator[SEP] }
@Override public void destroy(Exception e) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "destroy", e); if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled() && (e != null)) SibTr.exception(this, tc, e); //Romil liberty changes // super.destroy(e); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "destroy"); }
class class_name[name] begin[{] method[destroy, return_type[void], modifier[public], parameter[e]] begin[{] if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{] call[SibTr.entry, parameter[THIS[], member[.tc], literal["destroy"], member[.e]]] else begin[{] None end[}] if[binary_operation[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEventEnabled, parameter[]]], &&, binary_operation[member[.e], !=, literal[null]]]] begin[{] call[SibTr.exception, parameter[THIS[], member[.tc], member[.e]]] else begin[{] None end[}] if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{] call[SibTr.exit, parameter[THIS[], member[.tc], literal["destroy"]]] else begin[{] None end[}] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[destroy] operator[SEP] identifier[Exception] identifier[e] 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] , identifier[e] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isEventEnabled] operator[SEP] operator[SEP] operator[&&] operator[SEP] identifier[e] operator[!=] Other[null] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[exception] operator[SEP] Keyword[this] , identifier[tc] , identifier[e] 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] }
static Deferred<ArrayList<byte[]>> resolveOrCreateAllAsync(final TSDB tsdb, final Map<String, String> tags) { return resolveAllInternalAsync(tsdb, null, tags, true); }
class class_name[name] begin[{] method[resolveOrCreateAllAsync, return_type[type[Deferred]], modifier[static], parameter[tsdb, tags]] begin[{] return[call[.resolveAllInternalAsync, parameter[member[.tsdb], literal[null], member[.tags], literal[true]]]] end[}] END[}]
Keyword[static] identifier[Deferred] operator[<] identifier[ArrayList] operator[<] Keyword[byte] operator[SEP] operator[SEP] operator[>] operator[>] identifier[resolveOrCreateAllAsync] operator[SEP] Keyword[final] identifier[TSDB] identifier[tsdb] , Keyword[final] identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[tags] operator[SEP] { Keyword[return] identifier[resolveAllInternalAsync] operator[SEP] identifier[tsdb] , Other[null] , identifier[tags] , literal[boolean] operator[SEP] operator[SEP] }
public AwsEc2InstanceDetails withIpV4Addresses(String... ipV4Addresses) { if (this.ipV4Addresses == null) { setIpV4Addresses(new java.util.ArrayList<String>(ipV4Addresses.length)); } for (String ele : ipV4Addresses) { this.ipV4Addresses.add(ele); } return this; }
class class_name[name] begin[{] method[withIpV4Addresses, return_type[type[AwsEc2InstanceDetails]], modifier[public], parameter[ipV4Addresses]] begin[{] if[binary_operation[THIS[member[None.ipV4Addresses]], ==, literal[null]]] begin[{] call[.setIpV4Addresses, parameter[ClassCreator(arguments=[MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=ipV4Addresses, 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))))]] else begin[{] None end[}] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=ipV4Addresses, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[MemberReference(member=ele, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=ipV4Addresses, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=ele)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None) return[THIS[]] end[}] END[}]
Keyword[public] identifier[AwsEc2InstanceDetails] identifier[withIpV4Addresses] operator[SEP] identifier[String] operator[...] identifier[ipV4Addresses] operator[SEP] { Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[ipV4Addresses] operator[==] Other[null] operator[SEP] { identifier[setIpV4Addresses] operator[SEP] Keyword[new] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[ArrayList] operator[<] identifier[String] operator[>] operator[SEP] identifier[ipV4Addresses] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] } Keyword[for] operator[SEP] identifier[String] identifier[ele] operator[:] identifier[ipV4Addresses] operator[SEP] { Keyword[this] operator[SEP] identifier[ipV4Addresses] operator[SEP] identifier[add] operator[SEP] identifier[ele] operator[SEP] operator[SEP] } Keyword[return] Keyword[this] operator[SEP] }
public static Trades adaptTrades(EXXTransaction[] transactions, CurrencyPair currencyPair) { List<Trade> trades = new ArrayList<>(); long lastTradeId = 0; for (EXXTransaction transaction : transactions) { final long tradeId = transaction.getTid(); if (tradeId > lastTradeId) { lastTradeId = tradeId; } OrderType orderType = OrderType.BID; if (transaction.getType().equals("sell")) orderType = OrderType.ASK; trades.add( new Trade.Builder() .id(String.valueOf(transaction.getTid())) .originalAmount((transaction.getAmount())) .price(transaction.getPrice()) .timestamp(new Date(transaction.getDate())) .currencyPair(currencyPair) .type(orderType) .build()); } return new Trades(trades, lastTradeId, TradeSortType.SortByID); }
class class_name[name] begin[{] method[adaptTrades, return_type[type[Trades]], modifier[public static], parameter[transactions, currencyPair]] begin[{] local_variable[type[List], trades] local_variable[type[long], lastTradeId] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getTid, postfix_operators=[], prefix_operators=[], qualifier=transaction, selectors=[], type_arguments=None), name=tradeId)], modifiers={'final'}, type=BasicType(dimensions=[], name=long)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=tradeId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=lastTradeId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=>), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=lastTradeId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=tradeId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=BID, postfix_operators=[], prefix_operators=[], qualifier=OrderType, selectors=[]), name=orderType)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=OrderType, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[], member=getType, postfix_operators=[], prefix_operators=[], qualifier=transaction, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="sell")], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), else_statement=None, label=None, then_statement=StatementExpression(expression=Assignment(expressionl=MemberReference(member=orderType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=ASK, postfix_operators=[], prefix_operators=[], qualifier=OrderType, selectors=[])), label=None)), StatementExpression(expression=MethodInvocation(arguments=[ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getTid, postfix_operators=[], prefix_operators=[], qualifier=transaction, selectors=[], type_arguments=None)], member=valueOf, postfix_operators=[], prefix_operators=[], qualifier=String, selectors=[], type_arguments=None)], member=id, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getAmount, postfix_operators=[], prefix_operators=[], qualifier=transaction, selectors=[], type_arguments=None)], member=originalAmount, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getPrice, postfix_operators=[], prefix_operators=[], qualifier=transaction, selectors=[], type_arguments=None)], member=price, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[ClassCreator(arguments=[MethodInvocation(arguments=[], member=getDate, postfix_operators=[], prefix_operators=[], qualifier=transaction, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Date, sub_type=None))], member=timestamp, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=currencyPair, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=currencyPair, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=orderType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=type, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=build, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=Trade, sub_type=ReferenceType(arguments=None, dimensions=None, name=Builder, sub_type=None)))], member=add, postfix_operators=[], prefix_operators=[], qualifier=trades, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=transactions, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=transaction)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=EXXTransaction, sub_type=None))), label=None) return[ClassCreator(arguments=[MemberReference(member=trades, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=lastTradeId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=SortByID, postfix_operators=[], prefix_operators=[], qualifier=TradeSortType, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Trades, sub_type=None))] end[}] END[}]
Keyword[public] Keyword[static] identifier[Trades] identifier[adaptTrades] operator[SEP] identifier[EXXTransaction] operator[SEP] operator[SEP] identifier[transactions] , identifier[CurrencyPair] identifier[currencyPair] operator[SEP] { identifier[List] operator[<] identifier[Trade] operator[>] identifier[trades] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[long] identifier[lastTradeId] operator[=] Other[0] operator[SEP] Keyword[for] operator[SEP] identifier[EXXTransaction] identifier[transaction] operator[:] identifier[transactions] operator[SEP] { Keyword[final] Keyword[long] identifier[tradeId] operator[=] identifier[transaction] operator[SEP] identifier[getTid] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[tradeId] operator[>] identifier[lastTradeId] operator[SEP] { identifier[lastTradeId] operator[=] identifier[tradeId] operator[SEP] } identifier[OrderType] identifier[orderType] operator[=] identifier[OrderType] operator[SEP] identifier[BID] operator[SEP] Keyword[if] operator[SEP] identifier[transaction] operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[orderType] operator[=] identifier[OrderType] operator[SEP] identifier[ASK] operator[SEP] identifier[trades] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[Trade] operator[SEP] identifier[Builder] operator[SEP] operator[SEP] operator[SEP] identifier[id] operator[SEP] identifier[String] operator[SEP] identifier[valueOf] operator[SEP] identifier[transaction] operator[SEP] identifier[getTid] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[originalAmount] operator[SEP] operator[SEP] identifier[transaction] operator[SEP] identifier[getAmount] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[price] operator[SEP] identifier[transaction] operator[SEP] identifier[getPrice] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[timestamp] operator[SEP] Keyword[new] identifier[Date] operator[SEP] identifier[transaction] operator[SEP] identifier[getDate] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[currencyPair] operator[SEP] identifier[currencyPair] operator[SEP] operator[SEP] identifier[type] operator[SEP] identifier[orderType] operator[SEP] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] Keyword[new] identifier[Trades] operator[SEP] identifier[trades] , identifier[lastTradeId] , identifier[TradeSortType] operator[SEP] identifier[SortByID] operator[SEP] operator[SEP] }
@Override public AbstractSerializingCache createCache(String name, ICacheLoader cacheLoader) { return (AbstractSerializingCache) super.createCache(name, cacheLoader); }
class class_name[name] begin[{] method[createCache, return_type[type[AbstractSerializingCache]], modifier[public], parameter[name, cacheLoader]] begin[{] return[Cast(expression=SuperMethodInvocation(arguments=[MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=cacheLoader, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=createCache, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=AbstractSerializingCache, sub_type=None))] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[AbstractSerializingCache] identifier[createCache] operator[SEP] identifier[String] identifier[name] , identifier[ICacheLoader] identifier[cacheLoader] operator[SEP] { Keyword[return] operator[SEP] identifier[AbstractSerializingCache] operator[SEP] Keyword[super] operator[SEP] identifier[createCache] operator[SEP] identifier[name] , identifier[cacheLoader] operator[SEP] operator[SEP] }
Map<UUID, CacheBucketOffset> getTailHashes(long segmentId) { return forSegmentCache(segmentId, SegmentKeyCache::getTailBucketOffsets, Collections.emptyMap()); }
class class_name[name] begin[{] method[getTailHashes, return_type[type[Map]], modifier[default], parameter[segmentId]] begin[{] return[call[.forSegmentCache, parameter[member[.segmentId], MethodReference(expression=MemberReference(member=SegmentKeyCache, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), method=MemberReference(member=getTailBucketOffsets, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type_arguments=[]), call[Collections.emptyMap, parameter[]]]]] end[}] END[}]
identifier[Map] operator[<] identifier[UUID] , identifier[CacheBucketOffset] operator[>] identifier[getTailHashes] operator[SEP] Keyword[long] identifier[segmentId] operator[SEP] { Keyword[return] identifier[forSegmentCache] operator[SEP] identifier[segmentId] , identifier[SegmentKeyCache] operator[::] identifier[getTailBucketOffsets] , identifier[Collections] operator[SEP] identifier[emptyMap] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
@Override public String getFilePath(String resourcePath) { return helper.getFilePath(resolver.getResourcePath(resourcePath)); }
class class_name[name] begin[{] method[getFilePath, return_type[type[String]], modifier[public], parameter[resourcePath]] begin[{] return[call[helper.getFilePath, parameter[call[resolver.getResourcePath, parameter[member[.resourcePath]]]]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[String] identifier[getFilePath] operator[SEP] identifier[String] identifier[resourcePath] operator[SEP] { Keyword[return] identifier[helper] operator[SEP] identifier[getFilePath] operator[SEP] identifier[resolver] operator[SEP] identifier[getResourcePath] operator[SEP] identifier[resourcePath] operator[SEP] operator[SEP] operator[SEP] }
@RequestMapping(value = "branches/{branchId}/template", method = RequestMethod.PUT) public Branch createTemplateInstance(@PathVariable ID branchId, @RequestBody @Valid BranchTemplateInstanceSingleRequest request) { return branchTemplateService.createTemplateInstance(branchId, request); }
class class_name[name] begin[{] method[createTemplateInstance, return_type[type[Branch]], modifier[public], parameter[branchId, request]] begin[{] return[call[branchTemplateService.createTemplateInstance, parameter[member[.branchId], member[.request]]]] end[}] END[}]
annotation[@] identifier[RequestMapping] operator[SEP] identifier[value] operator[=] literal[String] , identifier[method] operator[=] identifier[RequestMethod] operator[SEP] identifier[PUT] operator[SEP] Keyword[public] identifier[Branch] identifier[createTemplateInstance] operator[SEP] annotation[@] identifier[PathVariable] identifier[ID] identifier[branchId] , annotation[@] identifier[RequestBody] annotation[@] identifier[Valid] identifier[BranchTemplateInstanceSingleRequest] identifier[request] operator[SEP] { Keyword[return] identifier[branchTemplateService] operator[SEP] identifier[createTemplateInstance] operator[SEP] identifier[branchId] , identifier[request] operator[SEP] operator[SEP] }
public static String doRequestWithUrl(String url, String method, Map<String, String> header, Map<String, String> params, String charset) throws IOException { HttpURLConnection conn = null; String rsp = null; try { String ctype = "application/json"; String query = buildQuery(params, charset); try { conn = getConnection(buildGetUrl(url, query), method, header, ctype); } catch (IOException e) { throw e; } try { rsp = getResponseAsString(conn); } catch (IOException e) { throw e; } } finally { if (conn != null) { conn.disconnect(); } } return rsp; }
class class_name[name] begin[{] method[doRequestWithUrl, return_type[type[String]], modifier[public static], parameter[url, method, header, params, charset]] begin[{] local_variable[type[HttpURLConnection], conn] local_variable[type[String], rsp] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="application/json"), name=ctype)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=params, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=charset, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=buildQuery, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=query)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=conn, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=url, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=query, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=buildGetUrl, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), MemberReference(member=method, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=header, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=ctype, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getConnection, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IOException']))], finally_block=None, label=None, resources=None), TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=rsp, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=conn, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getResponseAsString, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IOException']))], finally_block=None, label=None, resources=None)], catches=None, finally_block=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=conn, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=disconnect, postfix_operators=[], prefix_operators=[], qualifier=conn, selectors=[], type_arguments=None), label=None)]))], label=None, resources=None) return[member[.rsp]] end[}] END[}]
Keyword[public] Keyword[static] identifier[String] identifier[doRequestWithUrl] operator[SEP] identifier[String] identifier[url] , identifier[String] identifier[method] , identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[header] , identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[params] , identifier[String] identifier[charset] operator[SEP] Keyword[throws] identifier[IOException] { identifier[HttpURLConnection] identifier[conn] operator[=] Other[null] operator[SEP] identifier[String] identifier[rsp] operator[=] Other[null] operator[SEP] Keyword[try] { identifier[String] identifier[ctype] operator[=] literal[String] operator[SEP] identifier[String] identifier[query] operator[=] identifier[buildQuery] operator[SEP] identifier[params] , identifier[charset] operator[SEP] operator[SEP] Keyword[try] { identifier[conn] operator[=] identifier[getConnection] operator[SEP] identifier[buildGetUrl] operator[SEP] identifier[url] , identifier[query] operator[SEP] , identifier[method] , identifier[header] , identifier[ctype] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[IOException] identifier[e] operator[SEP] { Keyword[throw] identifier[e] operator[SEP] } Keyword[try] { identifier[rsp] operator[=] identifier[getResponseAsString] operator[SEP] identifier[conn] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[IOException] identifier[e] operator[SEP] { Keyword[throw] identifier[e] operator[SEP] } } Keyword[finally] { Keyword[if] operator[SEP] identifier[conn] operator[!=] Other[null] operator[SEP] { identifier[conn] operator[SEP] identifier[disconnect] operator[SEP] operator[SEP] operator[SEP] } } Keyword[return] identifier[rsp] operator[SEP] }
@Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { case AfplibPackage.EPG__PAGE_NAME: return getPageName(); case AfplibPackage.EPG__TRIPLETS: return getTriplets(); } return super.eGet(featureID, resolve, coreType); }
class class_name[name] begin[{] method[eGet, return_type[type[Object]], modifier[public], parameter[featureID, resolve, coreType]] begin[{] SwitchStatement(cases=[SwitchStatementCase(case=[MemberReference(member=EPG__PAGE_NAME, postfix_operators=[], prefix_operators=[], qualifier=AfplibPackage, selectors=[])], statements=[ReturnStatement(expression=MethodInvocation(arguments=[], member=getPageName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), SwitchStatementCase(case=[MemberReference(member=EPG__TRIPLETS, postfix_operators=[], prefix_operators=[], qualifier=AfplibPackage, selectors=[])], statements=[ReturnStatement(expression=MethodInvocation(arguments=[], member=getTriplets, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)])], expression=MemberReference(member=featureID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None) return[SuperMethodInvocation(arguments=[MemberReference(member=featureID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=resolve, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=coreType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=eGet, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None)] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[Object] identifier[eGet] operator[SEP] Keyword[int] identifier[featureID] , Keyword[boolean] identifier[resolve] , Keyword[boolean] identifier[coreType] operator[SEP] { Keyword[switch] operator[SEP] identifier[featureID] operator[SEP] { Keyword[case] identifier[AfplibPackage] operator[SEP] identifier[EPG__PAGE_NAME] operator[:] Keyword[return] identifier[getPageName] operator[SEP] operator[SEP] operator[SEP] Keyword[case] identifier[AfplibPackage] operator[SEP] identifier[EPG__TRIPLETS] operator[:] Keyword[return] identifier[getTriplets] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] Keyword[super] operator[SEP] identifier[eGet] operator[SEP] identifier[featureID] , identifier[resolve] , identifier[coreType] operator[SEP] operator[SEP] }
public final void error(Object pObject) { getLogger().log(FQCN, Level.ERROR, pObject, null); }
class class_name[name] begin[{] method[error, return_type[void], modifier[final public], parameter[pObject]] begin[{] call[.getLogger, parameter[]] end[}] END[}]
Keyword[public] Keyword[final] Keyword[void] identifier[error] operator[SEP] identifier[Object] identifier[pObject] operator[SEP] { identifier[getLogger] operator[SEP] operator[SEP] operator[SEP] identifier[log] operator[SEP] identifier[FQCN] , identifier[Level] operator[SEP] identifier[ERROR] , identifier[pObject] , Other[null] operator[SEP] operator[SEP] }
private synchronized void checkFileName(String fileName) throws ParameterException{ Validate.notNull(fileName); File cFile = new File(fileName); if(cFile.getName().length()==0) throw new ParameterException(ErrorCode.INCOMPATIBILITY, fileName + " is not a valid file-name!"); }
class class_name[name] begin[{] method[checkFileName, return_type[void], modifier[synchronized private], parameter[fileName]] begin[{] call[Validate.notNull, parameter[member[.fileName]]] local_variable[type[File], cFile] if[binary_operation[call[cFile.getName, parameter[]], ==, literal[0]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=INCOMPATIBILITY, postfix_operators=[], prefix_operators=[], qualifier=ErrorCode, selectors=[]), BinaryOperation(operandl=MemberReference(member=fileName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" is not a valid file-name!"), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ParameterException, sub_type=None)), label=None) else begin[{] None end[}] end[}] END[}]
Keyword[private] Keyword[synchronized] Keyword[void] identifier[checkFileName] operator[SEP] identifier[String] identifier[fileName] operator[SEP] Keyword[throws] identifier[ParameterException] { identifier[Validate] operator[SEP] identifier[notNull] operator[SEP] identifier[fileName] operator[SEP] operator[SEP] identifier[File] identifier[cFile] operator[=] Keyword[new] identifier[File] operator[SEP] identifier[fileName] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[cFile] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[==] Other[0] operator[SEP] Keyword[throw] Keyword[new] identifier[ParameterException] operator[SEP] identifier[ErrorCode] operator[SEP] identifier[INCOMPATIBILITY] , identifier[fileName] operator[+] literal[String] operator[SEP] operator[SEP] }
@RequestMapping(value="", method={RequestMethod.GET, RequestMethod.HEAD}) public Resources<EventDefinitionResource> getEventDefinitions() throws EventDefinitionNotFoundException, ProviderNotFoundException, AttributeDefinitionNotFoundException { if (LOG.isTraceEnabled()) { LOG.entry(); } final Resources<EventDefinitionResource> resources = getEventDefinitions(eventDefinitionService.getEventDefinitions()); if (LOG.isTraceEnabled()) { LOG.exit(resources); } return resources; }
class class_name[name] begin[{] method[getEventDefinitions, return_type[type[Resources]], modifier[public], parameter[]] begin[{] if[call[LOG.isTraceEnabled, parameter[]]] begin[{] call[LOG.entry, parameter[]] else begin[{] None end[}] local_variable[type[Resources], resources] if[call[LOG.isTraceEnabled, parameter[]]] begin[{] call[LOG.exit, parameter[member[.resources]]] else begin[{] None end[}] return[member[.resources]] end[}] END[}]
annotation[@] identifier[RequestMapping] operator[SEP] identifier[value] operator[=] literal[String] , identifier[method] operator[=] { identifier[RequestMethod] operator[SEP] identifier[GET] , identifier[RequestMethod] operator[SEP] identifier[HEAD] } operator[SEP] Keyword[public] identifier[Resources] operator[<] identifier[EventDefinitionResource] operator[>] identifier[getEventDefinitions] operator[SEP] operator[SEP] Keyword[throws] identifier[EventDefinitionNotFoundException] , identifier[ProviderNotFoundException] , identifier[AttributeDefinitionNotFoundException] { Keyword[if] operator[SEP] identifier[LOG] operator[SEP] identifier[isTraceEnabled] operator[SEP] operator[SEP] operator[SEP] { identifier[LOG] operator[SEP] identifier[entry] operator[SEP] operator[SEP] operator[SEP] } Keyword[final] identifier[Resources] operator[<] identifier[EventDefinitionResource] operator[>] identifier[resources] operator[=] identifier[getEventDefinitions] operator[SEP] identifier[eventDefinitionService] operator[SEP] identifier[getEventDefinitions] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[LOG] operator[SEP] identifier[isTraceEnabled] operator[SEP] operator[SEP] operator[SEP] { identifier[LOG] operator[SEP] identifier[exit] operator[SEP] identifier[resources] operator[SEP] operator[SEP] } Keyword[return] identifier[resources] operator[SEP] }
@Override public boolean eIsSet(int featureID) { switch (featureID) { case XtypePackage.XIMPORT_SECTION__IMPORT_DECLARATIONS: return importDeclarations != null && !importDeclarations.isEmpty(); } return super.eIsSet(featureID); }
class class_name[name] begin[{] method[eIsSet, return_type[type[boolean]], modifier[public], parameter[featureID]] begin[{] SwitchStatement(cases=[SwitchStatementCase(case=[MemberReference(member=XIMPORT_SECTION__IMPORT_DECLARATIONS, postfix_operators=[], prefix_operators=[], qualifier=XtypePackage, selectors=[])], statements=[ReturnStatement(expression=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=importDeclarations, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operandr=MethodInvocation(arguments=[], member=isEmpty, postfix_operators=[], prefix_operators=['!'], qualifier=importDeclarations, selectors=[], type_arguments=None), operator=&&), label=None)])], expression=MemberReference(member=featureID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None) return[SuperMethodInvocation(arguments=[MemberReference(member=featureID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=eIsSet, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None)] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[boolean] identifier[eIsSet] operator[SEP] Keyword[int] identifier[featureID] operator[SEP] { Keyword[switch] operator[SEP] identifier[featureID] operator[SEP] { Keyword[case] identifier[XtypePackage] operator[SEP] identifier[XIMPORT_SECTION__IMPORT_DECLARATIONS] operator[:] Keyword[return] identifier[importDeclarations] operator[!=] Other[null] operator[&&] operator[!] identifier[importDeclarations] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] Keyword[super] operator[SEP] identifier[eIsSet] operator[SEP] identifier[featureID] operator[SEP] operator[SEP] }
public <T extends Post> T newPost(Class<T> klass) throws IllegalAccessException, InstantiationException { return client.newPost(name, klass); }
class class_name[name] begin[{] method[newPost, return_type[type[T]], modifier[public], parameter[klass]] begin[{] return[call[client.newPost, parameter[member[.name], member[.klass]]]] end[}] END[}]
Keyword[public] operator[<] identifier[T] Keyword[extends] identifier[Post] operator[>] identifier[T] identifier[newPost] operator[SEP] identifier[Class] operator[<] identifier[T] operator[>] identifier[klass] operator[SEP] Keyword[throws] identifier[IllegalAccessException] , identifier[InstantiationException] { Keyword[return] identifier[client] operator[SEP] identifier[newPost] operator[SEP] identifier[name] , identifier[klass] operator[SEP] operator[SEP] }
public static void main(String[] args) throws Exception { AdPerformanceConfig config = new AdPerformanceConfig(); config.parse(AdTrackingBenchmark.class.getName(), args); AdTrackingBenchmark benchmark = new AdTrackingBenchmark(config); benchmark.runBenchmark(); }
class class_name[name] begin[{] method[main, return_type[void], modifier[public static], parameter[args]] begin[{] local_variable[type[AdPerformanceConfig], config] call[config.parse, parameter[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=AdTrackingBenchmark, sub_type=None)), member[.args]]] local_variable[type[AdTrackingBenchmark], benchmark] call[benchmark.runBenchmark, parameter[]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[main] operator[SEP] identifier[String] operator[SEP] operator[SEP] identifier[args] operator[SEP] Keyword[throws] identifier[Exception] { identifier[AdPerformanceConfig] identifier[config] operator[=] Keyword[new] identifier[AdPerformanceConfig] operator[SEP] operator[SEP] operator[SEP] identifier[config] operator[SEP] identifier[parse] operator[SEP] identifier[AdTrackingBenchmark] operator[SEP] Keyword[class] operator[SEP] identifier[getName] operator[SEP] operator[SEP] , identifier[args] operator[SEP] operator[SEP] identifier[AdTrackingBenchmark] identifier[benchmark] operator[=] Keyword[new] identifier[AdTrackingBenchmark] operator[SEP] identifier[config] operator[SEP] operator[SEP] identifier[benchmark] operator[SEP] identifier[runBenchmark] operator[SEP] operator[SEP] operator[SEP] }
protected String handleError(final String message) { notifier().error(formatMessage(message)); return formatMessage(message); }
class class_name[name] begin[{] method[handleError, return_type[type[String]], modifier[protected], parameter[message]] begin[{] call[.notifier, parameter[]] return[call[.formatMessage, parameter[member[.message]]]] end[}] END[}]
Keyword[protected] identifier[String] identifier[handleError] operator[SEP] Keyword[final] identifier[String] identifier[message] operator[SEP] { identifier[notifier] operator[SEP] operator[SEP] operator[SEP] identifier[error] operator[SEP] identifier[formatMessage] operator[SEP] identifier[message] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[formatMessage] operator[SEP] identifier[message] operator[SEP] operator[SEP] }
public static void cublasStbmv(char uplo, char trans, char diag, int n, int k, Pointer A, int lda, Pointer x, int incx) { cublasStbmvNative(uplo, trans, diag, n, k, A, lda, x, incx); checkResultBLAS(); }
class class_name[name] begin[{] method[cublasStbmv, return_type[void], modifier[public static], parameter[uplo, trans, diag, n, k, A, lda, x, incx]] begin[{] call[.cublasStbmvNative, parameter[member[.uplo], member[.trans], member[.diag], member[.n], member[.k], member[.A], member[.lda], member[.x], member[.incx]]] call[.checkResultBLAS, parameter[]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[cublasStbmv] operator[SEP] Keyword[char] identifier[uplo] , Keyword[char] identifier[trans] , Keyword[char] identifier[diag] , Keyword[int] identifier[n] , Keyword[int] identifier[k] , identifier[Pointer] identifier[A] , Keyword[int] identifier[lda] , identifier[Pointer] identifier[x] , Keyword[int] identifier[incx] operator[SEP] { identifier[cublasStbmvNative] operator[SEP] identifier[uplo] , identifier[trans] , identifier[diag] , identifier[n] , identifier[k] , identifier[A] , identifier[lda] , identifier[x] , identifier[incx] operator[SEP] operator[SEP] identifier[checkResultBLAS] operator[SEP] operator[SEP] operator[SEP] }
private int getAromaticCarbonsCount(IAtomContainer ac, IAtom atom) { List<IAtom> neighbours = ac.getConnectedAtomsList(atom); int carocounter = 0; for (IAtom neighbour : neighbours) { if (neighbour.getSymbol().equals("C") && neighbour.getFlag(CDKConstants.ISAROMATIC)) { carocounter += 1; } } return carocounter; }
class class_name[name] begin[{] method[getAromaticCarbonsCount, return_type[type[int]], modifier[private], parameter[ac, atom]] begin[{] local_variable[type[List], neighbours] local_variable[type[int], carocounter] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getSymbol, postfix_operators=[], prefix_operators=[], qualifier=neighbour, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="C")], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operandr=MethodInvocation(arguments=[MemberReference(member=ISAROMATIC, postfix_operators=[], prefix_operators=[], qualifier=CDKConstants, selectors=[])], member=getFlag, postfix_operators=[], prefix_operators=[], qualifier=neighbour, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=carocounter, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=neighbours, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=neighbour)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=IAtom, sub_type=None))), label=None) return[member[.carocounter]] end[}] END[}]
Keyword[private] Keyword[int] identifier[getAromaticCarbonsCount] operator[SEP] identifier[IAtomContainer] identifier[ac] , identifier[IAtom] identifier[atom] operator[SEP] { identifier[List] operator[<] identifier[IAtom] operator[>] identifier[neighbours] operator[=] identifier[ac] operator[SEP] identifier[getConnectedAtomsList] operator[SEP] identifier[atom] operator[SEP] operator[SEP] Keyword[int] identifier[carocounter] operator[=] Other[0] operator[SEP] Keyword[for] operator[SEP] identifier[IAtom] identifier[neighbour] operator[:] identifier[neighbours] operator[SEP] { Keyword[if] operator[SEP] identifier[neighbour] operator[SEP] identifier[getSymbol] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[&&] identifier[neighbour] operator[SEP] identifier[getFlag] operator[SEP] identifier[CDKConstants] operator[SEP] identifier[ISAROMATIC] operator[SEP] operator[SEP] { identifier[carocounter] operator[+=] Other[1] operator[SEP] } } Keyword[return] identifier[carocounter] operator[SEP] }
public ReturnValueType<ConstructorType<T>> getOrCreateReturnValue() { Node node = childNode.getOrCreate("return-value"); ReturnValueType<ConstructorType<T>> returnValue = new ReturnValueTypeImpl<ConstructorType<T>>(this, "return-value", childNode, node); return returnValue; }
class class_name[name] begin[{] method[getOrCreateReturnValue, return_type[type[ReturnValueType]], modifier[public], parameter[]] begin[{] local_variable[type[Node], node] local_variable[type[ReturnValueType], returnValue] return[member[.returnValue]] end[}] END[}]
Keyword[public] identifier[ReturnValueType] operator[<] identifier[ConstructorType] operator[<] identifier[T] operator[>] operator[>] identifier[getOrCreateReturnValue] operator[SEP] operator[SEP] { identifier[Node] identifier[node] operator[=] identifier[childNode] operator[SEP] identifier[getOrCreate] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[ReturnValueType] operator[<] identifier[ConstructorType] operator[<] identifier[T] operator[>] operator[>] identifier[returnValue] operator[=] Keyword[new] identifier[ReturnValueTypeImpl] operator[<] identifier[ConstructorType] operator[<] identifier[T] operator[>] operator[>] operator[SEP] Keyword[this] , literal[String] , identifier[childNode] , identifier[node] operator[SEP] operator[SEP] Keyword[return] identifier[returnValue] operator[SEP] }
private Properties readFileHashCacheFile() { Properties props = new Properties(); Log log = getLog(); if (!this.targetDirectory.exists()) { this.targetDirectory.mkdirs(); } else if (!this.targetDirectory.isDirectory()) { log.warn("Something strange here as the '" + this.targetDirectory.getPath() + "' supposedly target directory is not a directory."); return props; } File cacheFile = new File(this.targetDirectory, CACHE_PROPERTIES_FILENAME); if (!cacheFile.exists()) { return props; } try (BufferedInputStream stream = new BufferedInputStream(new FileInputStream(cacheFile))) { props.load(stream); } catch (IOException e) { log.warn("Cannot load file hash cache properties file", e); } return props; }
class class_name[name] begin[{] method[readFileHashCacheFile, return_type[type[Properties]], modifier[private], parameter[]] begin[{] local_variable[type[Properties], props] local_variable[type[Log], log] if[THIS[member[None.targetDirectory]call[None.exists, parameter[]]]] begin[{] THIS[member[None.targetDirectory]call[None.mkdirs, parameter[]]] else begin[{] if[THIS[member[None.targetDirectory]call[None.isDirectory, parameter[]]]] begin[{] call[log.warn, parameter[binary_operation[binary_operation[literal["Something strange here as the '"], +, THIS[member[None.targetDirectory]call[None.getPath, parameter[]]]], +, literal["' supposedly target directory is not a directory."]]]] return[member[.props]] else begin[{] None end[}] end[}] local_variable[type[File], cacheFile] if[call[cacheFile.exists, parameter[]]] begin[{] return[member[.props]] else begin[{] None end[}] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=stream, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=load, postfix_operators=[], prefix_operators=[], qualifier=props, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Cannot load file hash cache properties file"), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=warn, postfix_operators=[], prefix_operators=[], qualifier=log, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IOException']))], finally_block=None, label=None, resources=[TryResource(annotations=[], modifiers=set(), name=stream, type=ReferenceType(arguments=None, dimensions=[], name=BufferedInputStream, sub_type=None), value=ClassCreator(arguments=[ClassCreator(arguments=[MemberReference(member=cacheFile, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=FileInputStream, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=BufferedInputStream, sub_type=None)))]) return[member[.props]] end[}] END[}]
Keyword[private] identifier[Properties] identifier[readFileHashCacheFile] operator[SEP] operator[SEP] { identifier[Properties] identifier[props] operator[=] Keyword[new] identifier[Properties] operator[SEP] operator[SEP] operator[SEP] identifier[Log] identifier[log] operator[=] identifier[getLog] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] Keyword[this] operator[SEP] identifier[targetDirectory] operator[SEP] identifier[exists] operator[SEP] operator[SEP] operator[SEP] { Keyword[this] operator[SEP] identifier[targetDirectory] operator[SEP] identifier[mkdirs] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] operator[!] Keyword[this] operator[SEP] identifier[targetDirectory] operator[SEP] identifier[isDirectory] operator[SEP] operator[SEP] operator[SEP] { identifier[log] operator[SEP] identifier[warn] operator[SEP] literal[String] operator[+] Keyword[this] operator[SEP] identifier[targetDirectory] operator[SEP] identifier[getPath] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[props] operator[SEP] } identifier[File] identifier[cacheFile] operator[=] Keyword[new] identifier[File] operator[SEP] Keyword[this] operator[SEP] identifier[targetDirectory] , identifier[CACHE_PROPERTIES_FILENAME] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[cacheFile] operator[SEP] identifier[exists] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] identifier[props] operator[SEP] } Keyword[try] operator[SEP] identifier[BufferedInputStream] identifier[stream] operator[=] Keyword[new] identifier[BufferedInputStream] operator[SEP] Keyword[new] identifier[FileInputStream] operator[SEP] identifier[cacheFile] operator[SEP] operator[SEP] operator[SEP] { identifier[props] operator[SEP] identifier[load] operator[SEP] identifier[stream] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[IOException] identifier[e] operator[SEP] { identifier[log] operator[SEP] identifier[warn] operator[SEP] literal[String] , identifier[e] operator[SEP] operator[SEP] } Keyword[return] identifier[props] operator[SEP] }
@VisibleForTesting static <T> TypeSerializerSchemaCompatibility<T> resolveSchemaCompatibility( Schema writerSchema, Schema readerSchema) { if (Objects.equals(writerSchema, readerSchema)) { return TypeSerializerSchemaCompatibility.compatibleAsIs(); } final SchemaPairCompatibility compatibility = SchemaCompatibility.checkReaderWriterCompatibility(readerSchema, writerSchema); return avroCompatibilityToFlinkCompatibility(compatibility); }
class class_name[name] begin[{] method[resolveSchemaCompatibility, return_type[type[TypeSerializerSchemaCompatibility]], modifier[static], parameter[writerSchema, readerSchema]] begin[{] if[call[Objects.equals, parameter[member[.writerSchema], member[.readerSchema]]]] begin[{] return[call[TypeSerializerSchemaCompatibility.compatibleAsIs, parameter[]]] else begin[{] None end[}] local_variable[type[SchemaPairCompatibility], compatibility] return[call[.avroCompatibilityToFlinkCompatibility, parameter[member[.compatibility]]]] end[}] END[}]
annotation[@] identifier[VisibleForTesting] Keyword[static] operator[<] identifier[T] operator[>] identifier[TypeSerializerSchemaCompatibility] operator[<] identifier[T] operator[>] identifier[resolveSchemaCompatibility] operator[SEP] identifier[Schema] identifier[writerSchema] , identifier[Schema] identifier[readerSchema] operator[SEP] { Keyword[if] operator[SEP] identifier[Objects] operator[SEP] identifier[equals] operator[SEP] identifier[writerSchema] , identifier[readerSchema] operator[SEP] operator[SEP] { Keyword[return] identifier[TypeSerializerSchemaCompatibility] operator[SEP] identifier[compatibleAsIs] operator[SEP] operator[SEP] operator[SEP] } Keyword[final] identifier[SchemaPairCompatibility] identifier[compatibility] operator[=] identifier[SchemaCompatibility] operator[SEP] identifier[checkReaderWriterCompatibility] operator[SEP] identifier[readerSchema] , identifier[writerSchema] operator[SEP] operator[SEP] Keyword[return] identifier[avroCompatibilityToFlinkCompatibility] operator[SEP] identifier[compatibility] operator[SEP] operator[SEP] }
public boolean present() { boolean isPresent = false; try { element.getWebElement().getText(); isPresent = true; } catch (NoSuchElementException | StaleElementReferenceException e) { log.info(e); } return isPresent; }
class class_name[name] begin[{] method[present, return_type[type[boolean]], modifier[public], parameter[]] begin[{] local_variable[type[boolean], isPresent] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=getWebElement, postfix_operators=[], prefix_operators=[], qualifier=element, selectors=[MethodInvocation(arguments=[], member=getText, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=isPresent, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=info, postfix_operators=[], prefix_operators=[], qualifier=log, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['NoSuchElementException', 'StaleElementReferenceException']))], finally_block=None, label=None, resources=None) return[member[.isPresent]] end[}] END[}]
Keyword[public] Keyword[boolean] identifier[present] operator[SEP] operator[SEP] { Keyword[boolean] identifier[isPresent] operator[=] literal[boolean] operator[SEP] Keyword[try] { identifier[element] operator[SEP] identifier[getWebElement] operator[SEP] operator[SEP] operator[SEP] identifier[getText] operator[SEP] operator[SEP] operator[SEP] identifier[isPresent] operator[=] literal[boolean] operator[SEP] } Keyword[catch] operator[SEP] identifier[NoSuchElementException] operator[|] identifier[StaleElementReferenceException] identifier[e] operator[SEP] { identifier[log] operator[SEP] identifier[info] operator[SEP] identifier[e] operator[SEP] operator[SEP] } Keyword[return] identifier[isPresent] operator[SEP] }
public static String getMessageText(String key, Object... args) { return getWpMessagesForCurrentLocale().key(key, args); }
class class_name[name] begin[{] method[getMessageText, return_type[type[String]], modifier[public static], parameter[key, args]] begin[{] return[call[.getWpMessagesForCurrentLocale, parameter[]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[String] identifier[getMessageText] operator[SEP] identifier[String] identifier[key] , identifier[Object] operator[...] identifier[args] operator[SEP] { Keyword[return] identifier[getWpMessagesForCurrentLocale] operator[SEP] operator[SEP] operator[SEP] identifier[key] operator[SEP] identifier[key] , identifier[args] operator[SEP] operator[SEP] }
public int getInt24(int index) throws IOException { validateIndex(index, 3); if (_isMotorolaByteOrder) { // Motorola - MSB first (big endian) return (((int)getByte(index )) << 16 & 0xFF0000) | (((int)getByte(index + 1)) << 8 & 0xFF00) | (((int)getByte(index + 2)) & 0xFF); } else { // Intel ordering - LSB first (little endian) return (((int)getByte(index + 2)) << 16 & 0xFF0000) | (((int)getByte(index + 1)) << 8 & 0xFF00) | (((int)getByte(index )) & 0xFF); } }
class class_name[name] begin[{] method[getInt24, return_type[type[int]], modifier[public], parameter[index]] begin[{] call[.validateIndex, parameter[member[.index], literal[3]]] if[member[._isMotorolaByteOrder]] begin[{] return[binary_operation[binary_operation[binary_operation[binary_operation[Cast(expression=MethodInvocation(arguments=[MemberReference(member=index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getByte, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), type=BasicType(dimensions=[], name=int)), <<, literal[16]], &, literal[0xFF0000]], |, binary_operation[binary_operation[Cast(expression=MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+)], member=getByte, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), type=BasicType(dimensions=[], name=int)), <<, literal[8]], &, literal[0xFF00]]], |, binary_operation[Cast(expression=MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), operator=+)], member=getByte, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), type=BasicType(dimensions=[], name=int)), &, literal[0xFF]]]] else begin[{] return[binary_operation[binary_operation[binary_operation[binary_operation[Cast(expression=MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), operator=+)], member=getByte, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), type=BasicType(dimensions=[], name=int)), <<, literal[16]], &, literal[0xFF0000]], |, binary_operation[binary_operation[Cast(expression=MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+)], member=getByte, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), type=BasicType(dimensions=[], name=int)), <<, literal[8]], &, literal[0xFF00]]], |, binary_operation[Cast(expression=MethodInvocation(arguments=[MemberReference(member=index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getByte, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), type=BasicType(dimensions=[], name=int)), &, literal[0xFF]]]] end[}] end[}] END[}]
Keyword[public] Keyword[int] identifier[getInt24] operator[SEP] Keyword[int] identifier[index] operator[SEP] Keyword[throws] identifier[IOException] { identifier[validateIndex] operator[SEP] identifier[index] , Other[3] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[_isMotorolaByteOrder] operator[SEP] { Keyword[return] operator[SEP] operator[SEP] operator[SEP] Keyword[int] operator[SEP] identifier[getByte] operator[SEP] identifier[index] operator[SEP] operator[SEP] operator[<<] Other[16] operator[&] literal[Integer] operator[SEP] operator[|] operator[SEP] operator[SEP] operator[SEP] Keyword[int] operator[SEP] identifier[getByte] operator[SEP] identifier[index] operator[+] Other[1] operator[SEP] operator[SEP] operator[<<] Other[8] operator[&] literal[Integer] operator[SEP] operator[|] operator[SEP] operator[SEP] operator[SEP] Keyword[int] operator[SEP] identifier[getByte] operator[SEP] identifier[index] operator[+] Other[2] operator[SEP] operator[SEP] operator[&] literal[Integer] operator[SEP] operator[SEP] } Keyword[else] { Keyword[return] operator[SEP] operator[SEP] operator[SEP] Keyword[int] operator[SEP] identifier[getByte] operator[SEP] identifier[index] operator[+] Other[2] operator[SEP] operator[SEP] operator[<<] Other[16] operator[&] literal[Integer] operator[SEP] operator[|] operator[SEP] operator[SEP] operator[SEP] Keyword[int] operator[SEP] identifier[getByte] operator[SEP] identifier[index] operator[+] Other[1] operator[SEP] operator[SEP] operator[<<] Other[8] operator[&] literal[Integer] operator[SEP] operator[|] operator[SEP] operator[SEP] operator[SEP] Keyword[int] operator[SEP] identifier[getByte] operator[SEP] identifier[index] operator[SEP] operator[SEP] operator[&] literal[Integer] operator[SEP] operator[SEP] } }
public static void main(String[] args){ RandomRBFGeneratorEvents stream = new RandomRBFGeneratorEvents(); AbstractClusterer clusterer = new WithKmeans(); boolean[] measureCollection = {true,true,true,true,true,true,true,true}; int amountInstances = 20000; String testfile = "d:\\data\\test.csv"; runBatch(stream, clusterer, measureCollection, amountInstances, testfile); }
class class_name[name] begin[{] method[main, return_type[void], modifier[public static], parameter[args]] begin[{] local_variable[type[RandomRBFGeneratorEvents], stream] local_variable[type[AbstractClusterer], clusterer] local_variable[type[boolean], measureCollection] local_variable[type[int], amountInstances] local_variable[type[String], testfile] call[.runBatch, parameter[member[.stream], member[.clusterer], member[.measureCollection], member[.amountInstances], member[.testfile]]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[main] operator[SEP] identifier[String] operator[SEP] operator[SEP] identifier[args] operator[SEP] { identifier[RandomRBFGeneratorEvents] identifier[stream] operator[=] Keyword[new] identifier[RandomRBFGeneratorEvents] operator[SEP] operator[SEP] operator[SEP] identifier[AbstractClusterer] identifier[clusterer] operator[=] Keyword[new] identifier[WithKmeans] operator[SEP] operator[SEP] operator[SEP] Keyword[boolean] operator[SEP] operator[SEP] identifier[measureCollection] operator[=] { literal[boolean] , literal[boolean] , literal[boolean] , literal[boolean] , literal[boolean] , literal[boolean] , literal[boolean] , literal[boolean] } operator[SEP] Keyword[int] identifier[amountInstances] operator[=] Other[20000] operator[SEP] identifier[String] identifier[testfile] operator[=] literal[String] operator[SEP] identifier[runBatch] operator[SEP] identifier[stream] , identifier[clusterer] , identifier[measureCollection] , identifier[amountInstances] , identifier[testfile] operator[SEP] operator[SEP] }
private void trySwitchingEditLog() throws IOException { if (shouldSwitchEditLog()) { curStreamFinished = true; if (LOG.isDebugEnabled()) { LOG.debug("Should switch edit log. rollImageCount=" + rollImageCount + ". curStreamConsumed=" + curStreamConsumed); } if (curStreamConsumed) { if (LOG.isDebugEnabled()) { LOG.debug("Reloading edit log ..."); } openEditLog(); rollImageCount.decrementAndGet(); } } }
class class_name[name] begin[{] method[trySwitchingEditLog, return_type[void], modifier[private], parameter[]] begin[{] if[call[.shouldSwitchEditLog, parameter[]]] begin[{] assign[member[.curStreamFinished], literal[true]] if[call[LOG.isDebugEnabled, parameter[]]] begin[{] call[LOG.debug, parameter[binary_operation[binary_operation[binary_operation[literal["Should switch edit log. rollImageCount="], +, member[.rollImageCount]], +, literal[". curStreamConsumed="]], +, member[.curStreamConsumed]]]] else begin[{] None end[}] if[member[.curStreamConsumed]] begin[{] if[call[LOG.isDebugEnabled, parameter[]]] begin[{] call[LOG.debug, parameter[literal["Reloading edit log ..."]]] else begin[{] None end[}] call[.openEditLog, parameter[]] call[rollImageCount.decrementAndGet, parameter[]] else begin[{] None end[}] else begin[{] None end[}] end[}] END[}]
Keyword[private] Keyword[void] identifier[trySwitchingEditLog] operator[SEP] operator[SEP] Keyword[throws] identifier[IOException] { Keyword[if] operator[SEP] identifier[shouldSwitchEditLog] operator[SEP] operator[SEP] operator[SEP] { identifier[curStreamFinished] operator[=] literal[boolean] 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[rollImageCount] operator[+] literal[String] operator[+] identifier[curStreamConsumed] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[curStreamConsumed] 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[SEP] operator[SEP] } identifier[openEditLog] operator[SEP] operator[SEP] operator[SEP] identifier[rollImageCount] operator[SEP] identifier[decrementAndGet] operator[SEP] operator[SEP] operator[SEP] } } }
@Override @SuppressWarnings({ "unchecked", "SuspiciousToArrayCall" }) public void close() { final AddressResolver<T>[] rArray; synchronized (resolvers) { rArray = (AddressResolver<T>[]) resolvers.values().toArray(new AddressResolver[0]); resolvers.clear(); } for (AddressResolver<T> r: rArray) { try { r.close(); } catch (Throwable t) { logger.warn("Failed to close a resolver:", t); } } }
class class_name[name] begin[{] method[close, return_type[void], modifier[public], parameter[]] begin[{] local_variable[type[AddressResolver], rArray] SYNCHRONIZED[member[.resolvers]] BEGIN[{] assign[member[.rArray], Cast(expression=MethodInvocation(arguments=[], member=values, postfix_operators=[], prefix_operators=[], qualifier=resolvers, selectors=[MethodInvocation(arguments=[ArrayCreator(dimensions=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=AddressResolver, sub_type=None))], member=toArray, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None))], dimensions=[None], name=AddressResolver, sub_type=None))] call[resolvers.clear, parameter[]] END[}] ForStatement(body=BlockStatement(label=None, statements=[TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=close, postfix_operators=[], prefix_operators=[], qualifier=r, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Failed to close a resolver:"), MemberReference(member=t, 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=t, types=['Throwable']))], finally_block=None, label=None, resources=None)]), control=EnhancedForControl(iterable=MemberReference(member=rArray, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=r)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None))], dimensions=[], name=AddressResolver, sub_type=None))), label=None) end[}] END[}]
annotation[@] identifier[Override] annotation[@] identifier[SuppressWarnings] operator[SEP] { literal[String] , literal[String] } operator[SEP] Keyword[public] Keyword[void] identifier[close] operator[SEP] operator[SEP] { Keyword[final] identifier[AddressResolver] operator[<] identifier[T] operator[>] operator[SEP] operator[SEP] identifier[rArray] operator[SEP] Keyword[synchronized] operator[SEP] identifier[resolvers] operator[SEP] { identifier[rArray] operator[=] operator[SEP] identifier[AddressResolver] operator[<] identifier[T] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[resolvers] operator[SEP] identifier[values] operator[SEP] operator[SEP] operator[SEP] identifier[toArray] operator[SEP] Keyword[new] identifier[AddressResolver] operator[SEP] Other[0] operator[SEP] operator[SEP] operator[SEP] identifier[resolvers] operator[SEP] identifier[clear] operator[SEP] operator[SEP] operator[SEP] } Keyword[for] operator[SEP] identifier[AddressResolver] operator[<] identifier[T] operator[>] identifier[r] operator[:] identifier[rArray] operator[SEP] { Keyword[try] { identifier[r] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Throwable] identifier[t] operator[SEP] { identifier[logger] operator[SEP] identifier[warn] operator[SEP] literal[String] , identifier[t] operator[SEP] operator[SEP] } } }
@Override public ListVolumeRecoveryPointsResult listVolumeRecoveryPoints(ListVolumeRecoveryPointsRequest request) { request = beforeClientExecution(request); return executeListVolumeRecoveryPoints(request); }
class class_name[name] begin[{] method[listVolumeRecoveryPoints, return_type[type[ListVolumeRecoveryPointsResult]], modifier[public], parameter[request]] begin[{] assign[member[.request], call[.beforeClientExecution, parameter[member[.request]]]] return[call[.executeListVolumeRecoveryPoints, parameter[member[.request]]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[ListVolumeRecoveryPointsResult] identifier[listVolumeRecoveryPoints] operator[SEP] identifier[ListVolumeRecoveryPointsRequest] identifier[request] operator[SEP] { identifier[request] operator[=] identifier[beforeClientExecution] operator[SEP] identifier[request] operator[SEP] operator[SEP] Keyword[return] identifier[executeListVolumeRecoveryPoints] operator[SEP] identifier[request] operator[SEP] operator[SEP] }
public SearchResults query(WaybackRequest wbRequest) throws ResourceIndexNotAvailableException, ResourceNotInArchiveException, BadQueryException, AccessControlException { RangeGroup group = getRangeGroupForRequest(wbRequest); return group.query(wbRequest); }
class class_name[name] begin[{] method[query, return_type[type[SearchResults]], modifier[public], parameter[wbRequest]] begin[{] local_variable[type[RangeGroup], group] return[call[group.query, parameter[member[.wbRequest]]]] end[}] END[}]
Keyword[public] identifier[SearchResults] identifier[query] operator[SEP] identifier[WaybackRequest] identifier[wbRequest] operator[SEP] Keyword[throws] identifier[ResourceIndexNotAvailableException] , identifier[ResourceNotInArchiveException] , identifier[BadQueryException] , identifier[AccessControlException] { identifier[RangeGroup] identifier[group] operator[=] identifier[getRangeGroupForRequest] operator[SEP] identifier[wbRequest] operator[SEP] operator[SEP] Keyword[return] identifier[group] operator[SEP] identifier[query] operator[SEP] identifier[wbRequest] operator[SEP] operator[SEP] }
private Integer getReleaseId() { final String[] versionParts = stringVersion.split("-"); if(isBranch() && versionParts.length >= 3){ return Integer.valueOf(versionParts[2]); } else if(versionParts.length >= 2){ return Integer.valueOf(versionParts[1]); } return 0; }
class class_name[name] begin[{] method[getReleaseId, return_type[type[Integer]], modifier[private], parameter[]] begin[{] local_variable[type[String], versionParts] if[binary_operation[call[.isBranch, parameter[]], &&, binary_operation[member[versionParts.length], >=, literal[3]]]] begin[{] return[call[Integer.valueOf, parameter[member[.versionParts]]]] else begin[{] if[binary_operation[member[versionParts.length], >=, literal[2]]] begin[{] return[call[Integer.valueOf, parameter[member[.versionParts]]]] else begin[{] None end[}] end[}] return[literal[0]] end[}] END[}]
Keyword[private] identifier[Integer] identifier[getReleaseId] operator[SEP] operator[SEP] { Keyword[final] identifier[String] operator[SEP] operator[SEP] identifier[versionParts] operator[=] identifier[stringVersion] operator[SEP] identifier[split] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[isBranch] operator[SEP] operator[SEP] operator[&&] identifier[versionParts] operator[SEP] identifier[length] operator[>=] Other[3] operator[SEP] { Keyword[return] identifier[Integer] operator[SEP] identifier[valueOf] operator[SEP] identifier[versionParts] operator[SEP] Other[2] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[versionParts] operator[SEP] identifier[length] operator[>=] Other[2] operator[SEP] { Keyword[return] identifier[Integer] operator[SEP] identifier[valueOf] operator[SEP] identifier[versionParts] operator[SEP] Other[1] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] Other[0] operator[SEP] }
public void clearDataListState(String key) { Map<String, Object> sessionMap = getFacesContext().getExternalContext().getSessionMap(); Map<String, TableState> dtState = (Map) sessionMap.get(Constants.DATALIST_STATE); if (dtState != null) { dtState.remove(key); } }
class class_name[name] begin[{] method[clearDataListState, return_type[void], modifier[public], parameter[key]] begin[{] local_variable[type[Map], sessionMap] local_variable[type[Map], dtState] if[binary_operation[member[.dtState], !=, literal[null]]] begin[{] call[dtState.remove, parameter[member[.key]]] else begin[{] None end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[clearDataListState] operator[SEP] identifier[String] identifier[key] operator[SEP] { identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] identifier[sessionMap] operator[=] identifier[getFacesContext] operator[SEP] operator[SEP] operator[SEP] identifier[getExternalContext] operator[SEP] operator[SEP] operator[SEP] identifier[getSessionMap] operator[SEP] operator[SEP] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[TableState] operator[>] identifier[dtState] operator[=] operator[SEP] identifier[Map] operator[SEP] identifier[sessionMap] operator[SEP] identifier[get] operator[SEP] identifier[Constants] operator[SEP] identifier[DATALIST_STATE] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[dtState] operator[!=] Other[null] operator[SEP] { identifier[dtState] operator[SEP] identifier[remove] operator[SEP] identifier[key] operator[SEP] operator[SEP] } }
public static void createThumb( InputStream input, OutputStream output, int thumbWidth, int thumbHeight, String format) throws IOException { try { try { ImageInputStream imageInput = ImageIO .createImageInputStream(input); BufferedImage image = ImageIO.read(imageInput); BufferedImage thumbImage = createThumb( image, thumbWidth, thumbHeight); ImageIO.write(thumbImage, format, output); } finally { output.close(); } } finally { input.close(); } }
class class_name[name] begin[{] method[createThumb, return_type[void], modifier[public static], parameter[input, output, thumbWidth, thumbHeight, format]] begin[{] TryStatement(block=[TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=input, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=createImageInputStream, postfix_operators=[], prefix_operators=[], qualifier=ImageIO, selectors=[], type_arguments=None), name=imageInput)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ImageInputStream, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=imageInput, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=read, postfix_operators=[], prefix_operators=[], qualifier=ImageIO, selectors=[], type_arguments=None), name=image)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=BufferedImage, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=image, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=thumbWidth, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=thumbHeight, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=createThumb, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=thumbImage)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=BufferedImage, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=thumbImage, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=format, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=output, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=write, postfix_operators=[], prefix_operators=[], qualifier=ImageIO, selectors=[], type_arguments=None), label=None)], catches=None, finally_block=[StatementExpression(expression=MethodInvocation(arguments=[], member=close, postfix_operators=[], prefix_operators=[], qualifier=output, selectors=[], type_arguments=None), label=None)], label=None, resources=None)], catches=None, finally_block=[StatementExpression(expression=MethodInvocation(arguments=[], member=close, postfix_operators=[], prefix_operators=[], qualifier=input, selectors=[], type_arguments=None), label=None)], label=None, resources=None) end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[createThumb] operator[SEP] identifier[InputStream] identifier[input] , identifier[OutputStream] identifier[output] , Keyword[int] identifier[thumbWidth] , Keyword[int] identifier[thumbHeight] , identifier[String] identifier[format] operator[SEP] Keyword[throws] identifier[IOException] { Keyword[try] { Keyword[try] { identifier[ImageInputStream] identifier[imageInput] operator[=] identifier[ImageIO] operator[SEP] identifier[createImageInputStream] operator[SEP] identifier[input] operator[SEP] operator[SEP] identifier[BufferedImage] identifier[image] operator[=] identifier[ImageIO] operator[SEP] identifier[read] operator[SEP] identifier[imageInput] operator[SEP] operator[SEP] identifier[BufferedImage] identifier[thumbImage] operator[=] identifier[createThumb] operator[SEP] identifier[image] , identifier[thumbWidth] , identifier[thumbHeight] operator[SEP] operator[SEP] identifier[ImageIO] operator[SEP] identifier[write] operator[SEP] identifier[thumbImage] , identifier[format] , identifier[output] operator[SEP] operator[SEP] } Keyword[finally] { identifier[output] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP] } } Keyword[finally] { identifier[input] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP] } }
public boolean containsAll(IntBitSet set) { int i, end; if (data.length < set.data.length) { end = data.length; for (i = end; i < set.data.length; i++) { if (set.data[i] != 0) { return false; } } } else { end = set.data.length; } for (i = 0; i < end; i++) { // any bits in set where this has none? -> false if ((set.data[i] & ~data[i])!= 0) { return false; } } return true; }
class class_name[name] begin[{] method[containsAll, return_type[type[boolean]], modifier[public], parameter[set]] begin[{] local_variable[type[int], i] if[binary_operation[member[data.length], <, member[set.data.length]]] begin[{] assign[member[.end], member[data.length]] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=data, postfix_operators=[], prefix_operators=[], qualifier=set, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=set.data, selectors=[]), operator=<), init=[Assignment(expressionl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=end, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))], update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) else begin[{] assign[member[.end], member[set.data.length]] end[}] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=data, postfix_operators=[], prefix_operators=[], qualifier=set, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operandr=MemberReference(member=data, postfix_operators=[], prefix_operators=['~'], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operator=&), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=end, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=[Assignment(expressionl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))], update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) return[literal[true]] end[}] END[}]
Keyword[public] Keyword[boolean] identifier[containsAll] operator[SEP] identifier[IntBitSet] identifier[set] operator[SEP] { Keyword[int] identifier[i] , identifier[end] operator[SEP] Keyword[if] operator[SEP] identifier[data] operator[SEP] identifier[length] operator[<] identifier[set] operator[SEP] identifier[data] operator[SEP] identifier[length] operator[SEP] { identifier[end] operator[=] identifier[data] operator[SEP] identifier[length] operator[SEP] Keyword[for] operator[SEP] identifier[i] operator[=] identifier[end] operator[SEP] identifier[i] operator[<] identifier[set] operator[SEP] identifier[data] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] { Keyword[if] operator[SEP] identifier[set] operator[SEP] identifier[data] operator[SEP] identifier[i] operator[SEP] operator[!=] Other[0] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } } } Keyword[else] { identifier[end] operator[=] identifier[set] operator[SEP] identifier[data] operator[SEP] identifier[length] operator[SEP] } Keyword[for] operator[SEP] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[end] operator[SEP] identifier[i] operator[++] operator[SEP] { Keyword[if] operator[SEP] operator[SEP] identifier[set] operator[SEP] identifier[data] operator[SEP] identifier[i] operator[SEP] operator[&] operator[~] identifier[data] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[!=] Other[0] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } } Keyword[return] literal[boolean] operator[SEP] }
@Override public List<QueryRow> reducedQuery(QueryOptions options) throws CouchbaseLiteException { Predicate<QueryRow> postFilter = options.getPostFilter(); int groupLevel = options.getGroupLevel(); boolean group = options.isGroup() || (groupLevel > 0); Reducer reduce = delegate.getReduce(); if (options.isReduceSpecified()) { if (options.isReduce() && reduce == null) { Log.w(TAG, "Cannot use reduce option in view %s which has no reduce block defined", name); throw new CouchbaseLiteException(new Status(Status.BAD_PARAM)); } } final List<Object> keysToReduce = new ArrayList<Object>(REDUCE_BATCH_SIZE); final List<Object> valuesToReduce = new ArrayList<Object>(REDUCE_BATCH_SIZE); final Object[] lastKeys = new Object[1]; lastKeys[0] = null; final ForestDBViewStore that = this; final List<QueryRow> rows = new ArrayList<QueryRow>(); try { openIndex(); } catch (ForestException e) { throw new CouchbaseLiteException(e.code); } QueryIterator itr; try { itr = forestQuery(options); while (itr.next()) { byte[] bKey = itr.keyJSON(); byte[] bValue = itr.valueJSON(); Object keyObject = fromJSON(bKey, Object.class); Object valueObject = fromJSON(bValue, Object.class); if (group && !groupTogether(keyObject, lastKeys[0], groupLevel)) { if (lastKeys[0] != null) { // This pair starts a new group, so reduce & record the last one: Object key = groupKey(lastKeys[0], groupLevel); Object reduced = (reduce != null) ? reduce.reduce(keysToReduce, valuesToReduce, false) : null; QueryRow row = new QueryRow(null, 0, key, reduced, null); if (postFilter == null || postFilter.apply(row)) rows.add(row); keysToReduce.clear(); valuesToReduce.clear(); } lastKeys[0] = keyObject; } keysToReduce.add(keyObject); valuesToReduce.add(valueObject); } } catch (ForestException e) { Log.e(TAG, "Error in reducedQuery()", e); } catch (IOException e) { Log.e(TAG, "Error in reducedQuery()", e); throw new CouchbaseLiteException(Status.UNKNOWN); } if (keysToReduce != null && keysToReduce.size() > 0) { // Finish the last group (or the entire list, if no grouping): Object key = group ? groupKey(lastKeys[0], groupLevel) : null; Object reduced = (reduce != null) ? reduce.reduce(keysToReduce, valuesToReduce, false) : null; Log.v(TAG, String.format(Locale.ENGLISH, "Query %s: Reduced to key=%s, value=%s", name, key, reduced)); QueryRow row = new QueryRow(null, 0, key, reduced, null); if (postFilter == null || postFilter.apply(row)) rows.add(row); } return rows; }
class class_name[name] begin[{] method[reducedQuery, return_type[type[List]], modifier[public], parameter[options]] begin[{] local_variable[type[Predicate], postFilter] local_variable[type[int], groupLevel] local_variable[type[boolean], group] local_variable[type[Reducer], reduce] if[call[options.isReduceSpecified, parameter[]]] begin[{] if[binary_operation[call[options.isReduce, parameter[]], &&, binary_operation[member[.reduce], ==, literal[null]]]] begin[{] call[Log.w, parameter[member[.TAG], literal["Cannot use reduce option in view %s which has no reduce block defined"], member[.name]]] ThrowStatement(expression=ClassCreator(arguments=[ClassCreator(arguments=[MemberReference(member=BAD_PARAM, postfix_operators=[], prefix_operators=[], qualifier=Status, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Status, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=CouchbaseLiteException, sub_type=None)), label=None) else begin[{] None end[}] else begin[{] None end[}] local_variable[type[List], keysToReduce] local_variable[type[List], valuesToReduce] local_variable[type[Object], lastKeys] assign[member[.lastKeys], literal[null]] local_variable[type[ForestDBViewStore], that] local_variable[type[List], rows] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=openIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=code, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=CouchbaseLiteException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['ForestException']))], finally_block=None, label=None, resources=None) local_variable[type[QueryIterator], itr] TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=itr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=options, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=forestQuery, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), WhileStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=keyJSON, postfix_operators=[], prefix_operators=[], qualifier=itr, selectors=[], type_arguments=None), name=bKey)], modifiers=set(), type=BasicType(dimensions=[None], name=byte)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=valueJSON, postfix_operators=[], prefix_operators=[], qualifier=itr, selectors=[], type_arguments=None), name=bValue)], modifiers=set(), type=BasicType(dimensions=[None], name=byte)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=bKey, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Object, sub_type=None))], member=fromJSON, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=keyObject)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=bValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Object, sub_type=None))], member=fromJSON, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=valueObject)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=group, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[MemberReference(member=keyObject, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=lastKeys, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))]), MemberReference(member=groupLevel, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=groupTogether, postfix_operators=[], prefix_operators=['!'], qualifier=, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=lastKeys, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=lastKeys, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))]), MemberReference(member=groupLevel, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=groupKey, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=key)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=reduce, 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=[MemberReference(member=keysToReduce, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=valuesToReduce, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)], member=reduce, postfix_operators=[], prefix_operators=[], qualifier=reduce, selectors=[], type_arguments=None)), name=reduced)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=reduced, 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=QueryRow, sub_type=None)), name=row)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=QueryRow, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=postFilter, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), operandr=MethodInvocation(arguments=[MemberReference(member=row, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=apply, postfix_operators=[], prefix_operators=[], qualifier=postFilter, selectors=[], type_arguments=None), operator=||), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=row, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=rows, selectors=[], type_arguments=None), label=None)), StatementExpression(expression=MethodInvocation(arguments=[], member=clear, postfix_operators=[], prefix_operators=[], qualifier=keysToReduce, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=clear, postfix_operators=[], prefix_operators=[], qualifier=valuesToReduce, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=lastKeys, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))]), type==, value=MemberReference(member=keyObject, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=keyObject, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=keysToReduce, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=valueObject, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=valuesToReduce, selectors=[], type_arguments=None), label=None)]), condition=MethodInvocation(arguments=[], member=next, postfix_operators=[], prefix_operators=[], qualifier=itr, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=TAG, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Error in reducedQuery()"), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=e, postfix_operators=[], prefix_operators=[], qualifier=Log, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['ForestException'])), CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=TAG, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Error in reducedQuery()"), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=e, postfix_operators=[], prefix_operators=[], qualifier=Log, selectors=[], type_arguments=None), label=None), ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=UNKNOWN, postfix_operators=[], prefix_operators=[], qualifier=Status, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=CouchbaseLiteException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IOException']))], finally_block=None, label=None, resources=None) if[binary_operation[binary_operation[member[.keysToReduce], !=, literal[null]], &&, binary_operation[call[keysToReduce.size, parameter[]], >, literal[0]]]] begin[{] local_variable[type[Object], key] local_variable[type[Object], reduced] call[Log.v, parameter[member[.TAG], call[String.format, parameter[member[Locale.ENGLISH], literal["Query %s: Reduced to key=%s, value=%s"], member[.name], member[.key], member[.reduced]]]]] local_variable[type[QueryRow], row] if[binary_operation[binary_operation[member[.postFilter], ==, literal[null]], ||, call[postFilter.apply, parameter[member[.row]]]]] begin[{] call[rows.add, parameter[member[.row]]] else begin[{] None end[}] else begin[{] None end[}] return[member[.rows]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[List] operator[<] identifier[QueryRow] operator[>] identifier[reducedQuery] operator[SEP] identifier[QueryOptions] identifier[options] operator[SEP] Keyword[throws] identifier[CouchbaseLiteException] { identifier[Predicate] operator[<] identifier[QueryRow] operator[>] identifier[postFilter] operator[=] identifier[options] operator[SEP] identifier[getPostFilter] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[groupLevel] operator[=] identifier[options] operator[SEP] identifier[getGroupLevel] operator[SEP] operator[SEP] operator[SEP] Keyword[boolean] identifier[group] operator[=] identifier[options] operator[SEP] identifier[isGroup] operator[SEP] operator[SEP] operator[||] operator[SEP] identifier[groupLevel] operator[>] Other[0] operator[SEP] operator[SEP] identifier[Reducer] identifier[reduce] operator[=] identifier[delegate] operator[SEP] identifier[getReduce] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[options] operator[SEP] identifier[isReduceSpecified] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[options] operator[SEP] identifier[isReduce] operator[SEP] operator[SEP] operator[&&] identifier[reduce] operator[==] Other[null] operator[SEP] { identifier[Log] operator[SEP] identifier[w] operator[SEP] identifier[TAG] , literal[String] , identifier[name] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[CouchbaseLiteException] operator[SEP] Keyword[new] identifier[Status] operator[SEP] identifier[Status] operator[SEP] identifier[BAD_PARAM] operator[SEP] operator[SEP] operator[SEP] } } Keyword[final] identifier[List] operator[<] identifier[Object] operator[>] identifier[keysToReduce] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[Object] operator[>] operator[SEP] identifier[REDUCE_BATCH_SIZE] operator[SEP] operator[SEP] Keyword[final] identifier[List] operator[<] identifier[Object] operator[>] identifier[valuesToReduce] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[Object] operator[>] operator[SEP] identifier[REDUCE_BATCH_SIZE] operator[SEP] operator[SEP] Keyword[final] identifier[Object] operator[SEP] operator[SEP] identifier[lastKeys] operator[=] Keyword[new] identifier[Object] operator[SEP] Other[1] operator[SEP] operator[SEP] identifier[lastKeys] operator[SEP] Other[0] operator[SEP] operator[=] Other[null] operator[SEP] Keyword[final] identifier[ForestDBViewStore] identifier[that] operator[=] Keyword[this] operator[SEP] Keyword[final] identifier[List] operator[<] identifier[QueryRow] operator[>] identifier[rows] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[QueryRow] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[try] { identifier[openIndex] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[ForestException] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[CouchbaseLiteException] operator[SEP] identifier[e] operator[SEP] identifier[code] operator[SEP] operator[SEP] } identifier[QueryIterator] identifier[itr] operator[SEP] Keyword[try] { identifier[itr] operator[=] identifier[forestQuery] operator[SEP] identifier[options] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[itr] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] { Keyword[byte] operator[SEP] operator[SEP] identifier[bKey] operator[=] identifier[itr] operator[SEP] identifier[keyJSON] operator[SEP] operator[SEP] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[bValue] operator[=] identifier[itr] operator[SEP] identifier[valueJSON] operator[SEP] operator[SEP] operator[SEP] identifier[Object] identifier[keyObject] operator[=] identifier[fromJSON] operator[SEP] identifier[bKey] , identifier[Object] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[Object] identifier[valueObject] operator[=] identifier[fromJSON] operator[SEP] identifier[bValue] , identifier[Object] operator[SEP] Keyword[class] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[group] operator[&&] operator[!] identifier[groupTogether] operator[SEP] identifier[keyObject] , identifier[lastKeys] operator[SEP] Other[0] operator[SEP] , identifier[groupLevel] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[lastKeys] operator[SEP] Other[0] operator[SEP] operator[!=] Other[null] operator[SEP] { identifier[Object] identifier[key] operator[=] identifier[groupKey] operator[SEP] identifier[lastKeys] operator[SEP] Other[0] operator[SEP] , identifier[groupLevel] operator[SEP] operator[SEP] identifier[Object] identifier[reduced] operator[=] operator[SEP] identifier[reduce] operator[!=] Other[null] operator[SEP] operator[?] identifier[reduce] operator[SEP] identifier[reduce] operator[SEP] identifier[keysToReduce] , identifier[valuesToReduce] , literal[boolean] operator[SEP] operator[:] Other[null] operator[SEP] identifier[QueryRow] identifier[row] operator[=] Keyword[new] identifier[QueryRow] operator[SEP] Other[null] , Other[0] , identifier[key] , identifier[reduced] , Other[null] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[postFilter] operator[==] Other[null] operator[||] identifier[postFilter] operator[SEP] identifier[apply] operator[SEP] identifier[row] operator[SEP] operator[SEP] identifier[rows] operator[SEP] identifier[add] operator[SEP] identifier[row] operator[SEP] operator[SEP] identifier[keysToReduce] operator[SEP] identifier[clear] operator[SEP] operator[SEP] operator[SEP] identifier[valuesToReduce] operator[SEP] identifier[clear] operator[SEP] operator[SEP] operator[SEP] } identifier[lastKeys] operator[SEP] Other[0] operator[SEP] operator[=] identifier[keyObject] operator[SEP] } identifier[keysToReduce] operator[SEP] identifier[add] operator[SEP] identifier[keyObject] operator[SEP] operator[SEP] identifier[valuesToReduce] operator[SEP] identifier[add] operator[SEP] identifier[valueObject] operator[SEP] operator[SEP] } } Keyword[catch] operator[SEP] identifier[ForestException] identifier[e] operator[SEP] { identifier[Log] operator[SEP] identifier[e] operator[SEP] identifier[TAG] , literal[String] , identifier[e] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[IOException] identifier[e] operator[SEP] { identifier[Log] operator[SEP] identifier[e] operator[SEP] identifier[TAG] , literal[String] , identifier[e] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[CouchbaseLiteException] operator[SEP] identifier[Status] operator[SEP] identifier[UNKNOWN] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[keysToReduce] operator[!=] Other[null] operator[&&] identifier[keysToReduce] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] { identifier[Object] identifier[key] operator[=] identifier[group] operator[?] identifier[groupKey] operator[SEP] identifier[lastKeys] operator[SEP] Other[0] operator[SEP] , identifier[groupLevel] operator[SEP] operator[:] Other[null] operator[SEP] identifier[Object] identifier[reduced] operator[=] operator[SEP] identifier[reduce] operator[!=] Other[null] operator[SEP] operator[?] identifier[reduce] operator[SEP] identifier[reduce] operator[SEP] identifier[keysToReduce] , identifier[valuesToReduce] , literal[boolean] operator[SEP] operator[:] Other[null] operator[SEP] identifier[Log] operator[SEP] identifier[v] operator[SEP] identifier[TAG] , identifier[String] operator[SEP] identifier[format] operator[SEP] identifier[Locale] operator[SEP] identifier[ENGLISH] , literal[String] , identifier[name] , identifier[key] , identifier[reduced] operator[SEP] operator[SEP] operator[SEP] identifier[QueryRow] identifier[row] operator[=] Keyword[new] identifier[QueryRow] operator[SEP] Other[null] , Other[0] , identifier[key] , identifier[reduced] , Other[null] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[postFilter] operator[==] Other[null] operator[||] identifier[postFilter] operator[SEP] identifier[apply] operator[SEP] identifier[row] operator[SEP] operator[SEP] identifier[rows] operator[SEP] identifier[add] operator[SEP] identifier[row] operator[SEP] operator[SEP] } Keyword[return] identifier[rows] operator[SEP] }
public ThumborUrlBuilder buildImage(String image) { if (image == null || image.length() == 0) { throw new IllegalArgumentException("Image must not be blank."); } return new ThumborUrlBuilder(host, key, image); }
class class_name[name] begin[{] method[buildImage, return_type[type[ThumborUrlBuilder]], modifier[public], parameter[image]] begin[{] if[binary_operation[binary_operation[member[.image], ==, literal[null]], ||, binary_operation[call[image.length, parameter[]], ==, literal[0]]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Image must not be blank.")], 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[ClassCreator(arguments=[MemberReference(member=host, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=image, 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=ThumborUrlBuilder, sub_type=None))] end[}] END[}]
Keyword[public] identifier[ThumborUrlBuilder] identifier[buildImage] operator[SEP] identifier[String] identifier[image] operator[SEP] { Keyword[if] operator[SEP] identifier[image] operator[==] Other[null] operator[||] identifier[image] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[==] Other[0] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[return] Keyword[new] identifier[ThumborUrlBuilder] operator[SEP] identifier[host] , identifier[key] , identifier[image] operator[SEP] operator[SEP] }
@Override public String getLocation() { WsResource res = _resolvedLocation.get(); if (res != null && res.exists()) { return res.asFile().getAbsolutePath(); } else { return _config.getLocation(); } }
class class_name[name] begin[{] method[getLocation, return_type[type[String]], modifier[public], parameter[]] begin[{] local_variable[type[WsResource], res] if[binary_operation[binary_operation[member[.res], !=, literal[null]], &&, call[res.exists, parameter[]]]] begin[{] return[call[res.asFile, parameter[]]] else begin[{] return[call[_config.getLocation, parameter[]]] end[}] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[String] identifier[getLocation] operator[SEP] operator[SEP] { identifier[WsResource] identifier[res] operator[=] identifier[_resolvedLocation] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[res] operator[!=] Other[null] operator[&&] identifier[res] operator[SEP] identifier[exists] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] identifier[res] operator[SEP] identifier[asFile] operator[SEP] operator[SEP] operator[SEP] identifier[getAbsolutePath] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { Keyword[return] identifier[_config] operator[SEP] identifier[getLocation] operator[SEP] operator[SEP] operator[SEP] } }
protected String generateFileName(int subBucket, String oldName) { int dotPos = oldName.lastIndexOf("."); int slashPos = Math.max(oldName.lastIndexOf("/"), oldName.lastIndexOf("\\")); String prefix; String suffix; if (dotPos > slashPos) { prefix = oldName.substring(0, dotPos); suffix = oldName.substring(dotPos); } else { prefix = oldName; suffix = ""; } return prefix + "_" + subBucket + suffix; }
class class_name[name] begin[{] method[generateFileName, return_type[type[String]], modifier[protected], parameter[subBucket, oldName]] begin[{] local_variable[type[int], dotPos] local_variable[type[int], slashPos] local_variable[type[String], prefix] local_variable[type[String], suffix] if[binary_operation[member[.dotPos], >, member[.slashPos]]] begin[{] assign[member[.prefix], call[oldName.substring, parameter[literal[0], member[.dotPos]]]] assign[member[.suffix], call[oldName.substring, parameter[member[.dotPos]]]] else begin[{] assign[member[.prefix], member[.oldName]] assign[member[.suffix], literal[""]] end[}] return[binary_operation[binary_operation[binary_operation[member[.prefix], +, literal["_"]], +, member[.subBucket]], +, member[.suffix]]] end[}] END[}]
Keyword[protected] identifier[String] identifier[generateFileName] operator[SEP] Keyword[int] identifier[subBucket] , identifier[String] identifier[oldName] operator[SEP] { Keyword[int] identifier[dotPos] operator[=] identifier[oldName] operator[SEP] identifier[lastIndexOf] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[int] identifier[slashPos] operator[=] identifier[Math] operator[SEP] identifier[max] operator[SEP] identifier[oldName] operator[SEP] identifier[lastIndexOf] operator[SEP] literal[String] operator[SEP] , identifier[oldName] operator[SEP] identifier[lastIndexOf] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[prefix] operator[SEP] identifier[String] identifier[suffix] operator[SEP] Keyword[if] operator[SEP] identifier[dotPos] operator[>] identifier[slashPos] operator[SEP] { identifier[prefix] operator[=] identifier[oldName] operator[SEP] identifier[substring] operator[SEP] Other[0] , identifier[dotPos] operator[SEP] operator[SEP] identifier[suffix] operator[=] identifier[oldName] operator[SEP] identifier[substring] operator[SEP] identifier[dotPos] operator[SEP] operator[SEP] } Keyword[else] { identifier[prefix] operator[=] identifier[oldName] operator[SEP] identifier[suffix] operator[=] literal[String] operator[SEP] } Keyword[return] identifier[prefix] operator[+] literal[String] operator[+] identifier[subBucket] operator[+] identifier[suffix] operator[SEP] }
public final hqlParser.expression_return expression() throws RecognitionException { hqlParser.expression_return retval = new hqlParser.expression_return(); retval.start = input.LT(1); CommonTree root_0 = null; ParserRuleReturnScope logicalOrExpression154 =null; try { // hql.g:410:2: ( logicalOrExpression ) // hql.g:410:4: logicalOrExpression { root_0 = (CommonTree)adaptor.nil(); pushFollow(FOLLOW_logicalOrExpression_in_expression1878); logicalOrExpression154=logicalOrExpression(); state._fsp--; adaptor.addChild(root_0, logicalOrExpression154.getTree()); } retval.stop = input.LT(-1); retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0); adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop); } catch (RecognitionException re) { reportError(re); recover(input,re); retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re); } finally { // do for sure before leaving } return retval; }
class class_name[name] begin[{] method[expression, return_type[type[hqlParser]], modifier[final public], parameter[]] begin[{] local_variable[type[hqlParser], retval] assign[member[retval.start], call[input.LT, parameter[literal[1]]]] local_variable[type[CommonTree], root_0] local_variable[type[ParserRuleReturnScope], logicalOrExpression154] TryStatement(block=[BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=root_0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Cast(expression=MethodInvocation(arguments=[], member=nil, postfix_operators=[], prefix_operators=[], qualifier=adaptor, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=CommonTree, sub_type=None))), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=FOLLOW_logicalOrExpression_in_expression1878, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=pushFollow, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=logicalOrExpression154, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=logicalOrExpression, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=MemberReference(member=_fsp, postfix_operators=['--'], prefix_operators=[], qualifier=state, selectors=[]), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=root_0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getTree, postfix_operators=[], prefix_operators=[], qualifier=logicalOrExpression154, selectors=[], type_arguments=None)], member=addChild, postfix_operators=[], prefix_operators=[], qualifier=adaptor, selectors=[], type_arguments=None), label=None)]), StatementExpression(expression=Assignment(expressionl=MemberReference(member=stop, postfix_operators=[], prefix_operators=[], qualifier=retval, selectors=[]), type==, value=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=1)], member=LT, postfix_operators=[], prefix_operators=[], qualifier=input, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=tree, postfix_operators=[], prefix_operators=[], qualifier=retval, selectors=[]), type==, value=Cast(expression=MethodInvocation(arguments=[MemberReference(member=root_0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=rulePostProcessing, postfix_operators=[], prefix_operators=[], qualifier=adaptor, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=CommonTree, sub_type=None))), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=tree, postfix_operators=[], prefix_operators=[], qualifier=retval, selectors=[]), MemberReference(member=start, postfix_operators=[], prefix_operators=[], qualifier=retval, selectors=[]), MemberReference(member=stop, postfix_operators=[], prefix_operators=[], qualifier=retval, selectors=[])], member=setTokenBoundaries, postfix_operators=[], prefix_operators=[], qualifier=adaptor, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=re, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=reportError, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=input, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=re, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=recover, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=tree, postfix_operators=[], prefix_operators=[], qualifier=retval, selectors=[]), type==, value=Cast(expression=MethodInvocation(arguments=[MemberReference(member=input, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=start, postfix_operators=[], prefix_operators=[], qualifier=retval, selectors=[]), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=1)], member=LT, postfix_operators=[], prefix_operators=[], qualifier=input, selectors=[], type_arguments=None), MemberReference(member=re, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=errorNode, postfix_operators=[], prefix_operators=[], qualifier=adaptor, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=CommonTree, sub_type=None))), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=re, types=['RecognitionException']))], finally_block=[], label=None, resources=None) return[member[.retval]] end[}] END[}]
Keyword[public] Keyword[final] identifier[hqlParser] operator[SEP] identifier[expression_return] identifier[expression] operator[SEP] operator[SEP] Keyword[throws] identifier[RecognitionException] { identifier[hqlParser] operator[SEP] identifier[expression_return] identifier[retval] operator[=] Keyword[new] identifier[hqlParser] operator[SEP] identifier[expression_return] operator[SEP] operator[SEP] operator[SEP] identifier[retval] operator[SEP] identifier[start] operator[=] identifier[input] operator[SEP] identifier[LT] operator[SEP] Other[1] operator[SEP] operator[SEP] identifier[CommonTree] identifier[root_0] operator[=] Other[null] operator[SEP] identifier[ParserRuleReturnScope] identifier[logicalOrExpression154] operator[=] Other[null] operator[SEP] Keyword[try] { { identifier[root_0] operator[=] operator[SEP] identifier[CommonTree] operator[SEP] identifier[adaptor] operator[SEP] identifier[nil] operator[SEP] operator[SEP] operator[SEP] identifier[pushFollow] operator[SEP] identifier[FOLLOW_logicalOrExpression_in_expression1878] operator[SEP] operator[SEP] identifier[logicalOrExpression154] operator[=] identifier[logicalOrExpression] operator[SEP] operator[SEP] operator[SEP] identifier[state] operator[SEP] identifier[_fsp] operator[--] operator[SEP] identifier[adaptor] operator[SEP] identifier[addChild] operator[SEP] identifier[root_0] , identifier[logicalOrExpression154] operator[SEP] identifier[getTree] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[retval] operator[SEP] identifier[stop] operator[=] identifier[input] operator[SEP] identifier[LT] operator[SEP] operator[-] Other[1] operator[SEP] operator[SEP] identifier[retval] operator[SEP] identifier[tree] operator[=] operator[SEP] identifier[CommonTree] operator[SEP] identifier[adaptor] operator[SEP] identifier[rulePostProcessing] operator[SEP] identifier[root_0] operator[SEP] operator[SEP] identifier[adaptor] operator[SEP] identifier[setTokenBoundaries] operator[SEP] identifier[retval] operator[SEP] identifier[tree] , identifier[retval] operator[SEP] identifier[start] , identifier[retval] operator[SEP] identifier[stop] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[RecognitionException] identifier[re] operator[SEP] { identifier[reportError] operator[SEP] identifier[re] operator[SEP] operator[SEP] identifier[recover] operator[SEP] identifier[input] , identifier[re] operator[SEP] operator[SEP] identifier[retval] operator[SEP] identifier[tree] operator[=] operator[SEP] identifier[CommonTree] operator[SEP] identifier[adaptor] operator[SEP] identifier[errorNode] operator[SEP] identifier[input] , identifier[retval] operator[SEP] identifier[start] , identifier[input] operator[SEP] identifier[LT] operator[SEP] operator[-] Other[1] operator[SEP] , identifier[re] operator[SEP] operator[SEP] } Keyword[finally] { } Keyword[return] identifier[retval] operator[SEP] }
public void loop(float pitch, float volume) { sound.playAsSoundEffect(pitch, volume * SoundStore.get().getSoundVolume(), true); }
class class_name[name] begin[{] method[loop, return_type[void], modifier[public], parameter[pitch, volume]] begin[{] call[sound.playAsSoundEffect, parameter[member[.pitch], binary_operation[member[.volume], *, call[SoundStore.get, parameter[]]], literal[true]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[loop] operator[SEP] Keyword[float] identifier[pitch] , Keyword[float] identifier[volume] operator[SEP] { identifier[sound] operator[SEP] identifier[playAsSoundEffect] operator[SEP] identifier[pitch] , identifier[volume] operator[*] identifier[SoundStore] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[getSoundVolume] operator[SEP] operator[SEP] , literal[boolean] operator[SEP] operator[SEP] }
@Override public int countByG_B_A(long groupId, boolean billingAllowed, boolean active) { FinderPath finderPath = FINDER_PATH_COUNT_BY_G_B_A; Object[] finderArgs = new Object[] { groupId, billingAllowed, active }; Long count = (Long)finderCache.getResult(finderPath, finderArgs, this); if (count == null) { StringBundler query = new StringBundler(4); query.append(_SQL_COUNT_COMMERCECOUNTRY_WHERE); query.append(_FINDER_COLUMN_G_B_A_GROUPID_2); query.append(_FINDER_COLUMN_G_B_A_BILLINGALLOWED_2); query.append(_FINDER_COLUMN_G_B_A_ACTIVE_2); String sql = query.toString(); Session session = null; try { session = openSession(); Query q = session.createQuery(sql); QueryPos qPos = QueryPos.getInstance(q); qPos.add(groupId); qPos.add(billingAllowed); qPos.add(active); count = (Long)q.uniqueResult(); finderCache.putResult(finderPath, finderArgs, count); } catch (Exception e) { finderCache.removeResult(finderPath, finderArgs); throw processException(e); } finally { closeSession(session); } } return count.intValue(); }
class class_name[name] begin[{] method[countByG_B_A, return_type[type[int]], modifier[public], parameter[groupId, billingAllowed, active]] begin[{] local_variable[type[FinderPath], finderPath] local_variable[type[Object], finderArgs] local_variable[type[Long], count] if[binary_operation[member[.count], ==, literal[null]]] begin[{] local_variable[type[StringBundler], query] call[query.append, parameter[member[._SQL_COUNT_COMMERCECOUNTRY_WHERE]]] call[query.append, parameter[member[._FINDER_COLUMN_G_B_A_GROUPID_2]]] call[query.append, parameter[member[._FINDER_COLUMN_G_B_A_BILLINGALLOWED_2]]] call[query.append, parameter[member[._FINDER_COLUMN_G_B_A_ACTIVE_2]]] local_variable[type[String], sql] local_variable[type[Session], session] TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=session, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=openSession, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=sql, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=createQuery, postfix_operators=[], prefix_operators=[], qualifier=session, selectors=[], type_arguments=None), name=q)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Query, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=q, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getInstance, postfix_operators=[], prefix_operators=[], qualifier=QueryPos, selectors=[], type_arguments=None), name=qPos)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=QueryPos, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=groupId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=qPos, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=billingAllowed, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=qPos, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=active, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=qPos, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=count, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Cast(expression=MethodInvocation(arguments=[], member=uniqueResult, postfix_operators=[], prefix_operators=[], qualifier=q, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=Long, sub_type=None))), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=finderPath, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=finderArgs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=count, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=putResult, postfix_operators=[], prefix_operators=[], qualifier=finderCache, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=finderPath, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=finderArgs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=removeResult, postfix_operators=[], prefix_operators=[], qualifier=finderCache, selectors=[], type_arguments=None), label=None), ThrowStatement(expression=MethodInvocation(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=processException, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=session, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=closeSession, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], label=None, resources=None) else begin[{] None end[}] return[call[count.intValue, parameter[]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[int] identifier[countByG_B_A] operator[SEP] Keyword[long] identifier[groupId] , Keyword[boolean] identifier[billingAllowed] , Keyword[boolean] identifier[active] operator[SEP] { identifier[FinderPath] identifier[finderPath] operator[=] identifier[FINDER_PATH_COUNT_BY_G_B_A] operator[SEP] identifier[Object] operator[SEP] operator[SEP] identifier[finderArgs] operator[=] Keyword[new] identifier[Object] operator[SEP] operator[SEP] { identifier[groupId] , identifier[billingAllowed] , identifier[active] } operator[SEP] identifier[Long] identifier[count] operator[=] operator[SEP] identifier[Long] operator[SEP] identifier[finderCache] operator[SEP] identifier[getResult] operator[SEP] identifier[finderPath] , identifier[finderArgs] , Keyword[this] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[count] operator[==] Other[null] operator[SEP] { identifier[StringBundler] identifier[query] operator[=] Keyword[new] identifier[StringBundler] operator[SEP] Other[4] operator[SEP] operator[SEP] identifier[query] operator[SEP] identifier[append] operator[SEP] identifier[_SQL_COUNT_COMMERCECOUNTRY_WHERE] operator[SEP] operator[SEP] identifier[query] operator[SEP] identifier[append] operator[SEP] identifier[_FINDER_COLUMN_G_B_A_GROUPID_2] operator[SEP] operator[SEP] identifier[query] operator[SEP] identifier[append] operator[SEP] identifier[_FINDER_COLUMN_G_B_A_BILLINGALLOWED_2] operator[SEP] operator[SEP] identifier[query] operator[SEP] identifier[append] operator[SEP] identifier[_FINDER_COLUMN_G_B_A_ACTIVE_2] operator[SEP] operator[SEP] identifier[String] identifier[sql] operator[=] identifier[query] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] identifier[Session] identifier[session] operator[=] Other[null] operator[SEP] Keyword[try] { identifier[session] operator[=] identifier[openSession] operator[SEP] operator[SEP] operator[SEP] identifier[Query] identifier[q] operator[=] identifier[session] operator[SEP] identifier[createQuery] operator[SEP] identifier[sql] operator[SEP] operator[SEP] identifier[QueryPos] identifier[qPos] operator[=] identifier[QueryPos] operator[SEP] identifier[getInstance] operator[SEP] identifier[q] operator[SEP] operator[SEP] identifier[qPos] operator[SEP] identifier[add] operator[SEP] identifier[groupId] operator[SEP] operator[SEP] identifier[qPos] operator[SEP] identifier[add] operator[SEP] identifier[billingAllowed] operator[SEP] operator[SEP] identifier[qPos] operator[SEP] identifier[add] operator[SEP] identifier[active] operator[SEP] operator[SEP] identifier[count] operator[=] operator[SEP] identifier[Long] operator[SEP] identifier[q] operator[SEP] identifier[uniqueResult] operator[SEP] operator[SEP] operator[SEP] identifier[finderCache] operator[SEP] identifier[putResult] operator[SEP] identifier[finderPath] , identifier[finderArgs] , identifier[count] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { identifier[finderCache] operator[SEP] identifier[removeResult] operator[SEP] identifier[finderPath] , identifier[finderArgs] operator[SEP] operator[SEP] Keyword[throw] identifier[processException] operator[SEP] identifier[e] operator[SEP] operator[SEP] } Keyword[finally] { identifier[closeSession] operator[SEP] identifier[session] operator[SEP] operator[SEP] } } Keyword[return] identifier[count] operator[SEP] identifier[intValue] operator[SEP] operator[SEP] operator[SEP] }
public static Status find(final CIType _ciType, final String _key) throws CacheReloadException { return Status.get(_ciType.uuid).get(_key); }
class class_name[name] begin[{] method[find, return_type[type[Status]], modifier[public static], parameter[_ciType, _key]] begin[{] return[call[Status.get, parameter[member[_ciType.uuid]]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[Status] identifier[find] operator[SEP] Keyword[final] identifier[CIType] identifier[_ciType] , Keyword[final] identifier[String] identifier[_key] operator[SEP] Keyword[throws] identifier[CacheReloadException] { Keyword[return] identifier[Status] operator[SEP] identifier[get] operator[SEP] identifier[_ciType] operator[SEP] identifier[uuid] operator[SEP] operator[SEP] identifier[get] operator[SEP] identifier[_key] operator[SEP] operator[SEP] }
public void addProvider(String urlScheme, FileProvider provider) throws FileSystemException { ((DefaultFileSystemManager)fileSystemManager).addProvider(urlScheme, provider); }
class class_name[name] begin[{] method[addProvider, return_type[void], modifier[public], parameter[urlScheme, provider]] begin[{] Cast(expression=MemberReference(member=fileSystemManager, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=DefaultFileSystemManager, sub_type=None)) end[}] END[}]
Keyword[public] Keyword[void] identifier[addProvider] operator[SEP] identifier[String] identifier[urlScheme] , identifier[FileProvider] identifier[provider] operator[SEP] Keyword[throws] identifier[FileSystemException] { operator[SEP] operator[SEP] identifier[DefaultFileSystemManager] operator[SEP] identifier[fileSystemManager] operator[SEP] operator[SEP] identifier[addProvider] operator[SEP] identifier[urlScheme] , identifier[provider] operator[SEP] operator[SEP] }
public SizeableLinkedList<WAMInstruction> compileBodyCall(Functor expression, boolean isFirstBody, boolean isLastBody, boolean chainRule, int permVarsRemaining) { SizeableLinkedList<WAMInstruction> instructions = new SizeableLinkedList<WAMInstruction>(); instructions.add(new WAMInstruction(WAMInstruction.WAMInstructionSet.Execute, new FunctorName("__fail__", 0))); return instructions; }
class class_name[name] begin[{] method[compileBodyCall, return_type[type[SizeableLinkedList]], modifier[public], parameter[expression, isFirstBody, isLastBody, chainRule, permVarsRemaining]] begin[{] local_variable[type[SizeableLinkedList], instructions] call[instructions.add, parameter[ClassCreator(arguments=[MemberReference(member=Execute, postfix_operators=[], prefix_operators=[], qualifier=WAMInstruction.WAMInstructionSet, selectors=[]), ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="__fail__"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=FunctorName, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=WAMInstruction, sub_type=None))]] return[member[.instructions]] end[}] END[}]
Keyword[public] identifier[SizeableLinkedList] operator[<] identifier[WAMInstruction] operator[>] identifier[compileBodyCall] operator[SEP] identifier[Functor] identifier[expression] , Keyword[boolean] identifier[isFirstBody] , Keyword[boolean] identifier[isLastBody] , Keyword[boolean] identifier[chainRule] , Keyword[int] identifier[permVarsRemaining] operator[SEP] { identifier[SizeableLinkedList] operator[<] identifier[WAMInstruction] operator[>] identifier[instructions] operator[=] Keyword[new] identifier[SizeableLinkedList] operator[<] identifier[WAMInstruction] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[instructions] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[WAMInstruction] operator[SEP] identifier[WAMInstruction] operator[SEP] identifier[WAMInstructionSet] operator[SEP] identifier[Execute] , Keyword[new] identifier[FunctorName] operator[SEP] literal[String] , Other[0] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[instructions] operator[SEP] }
public MBeanServerConnection getConnection(String jmxUrl, Hashtable attributes, boolean wait) { JMXMonConnection connection = (JMXMonConnection)pool.get(jmxUrl); if (connection == null) { connection = new JMXMonConnection(jmxUrl); pool.put(jmxUrl, connection); } return connection.connect(attributes, wait); }
class class_name[name] begin[{] method[getConnection, return_type[type[MBeanServerConnection]], modifier[public], parameter[jmxUrl, attributes, wait]] begin[{] local_variable[type[JMXMonConnection], connection] if[binary_operation[member[.connection], ==, literal[null]]] begin[{] assign[member[.connection], ClassCreator(arguments=[MemberReference(member=jmxUrl, 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=JMXMonConnection, sub_type=None))] call[pool.put, parameter[member[.jmxUrl], member[.connection]]] else begin[{] None end[}] return[call[connection.connect, parameter[member[.attributes], member[.wait]]]] end[}] END[}]
Keyword[public] identifier[MBeanServerConnection] identifier[getConnection] operator[SEP] identifier[String] identifier[jmxUrl] , identifier[Hashtable] identifier[attributes] , Keyword[boolean] identifier[wait] operator[SEP] { identifier[JMXMonConnection] identifier[connection] operator[=] operator[SEP] identifier[JMXMonConnection] operator[SEP] identifier[pool] operator[SEP] identifier[get] operator[SEP] identifier[jmxUrl] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[connection] operator[==] Other[null] operator[SEP] { identifier[connection] operator[=] Keyword[new] identifier[JMXMonConnection] operator[SEP] identifier[jmxUrl] operator[SEP] operator[SEP] identifier[pool] operator[SEP] identifier[put] operator[SEP] identifier[jmxUrl] , identifier[connection] operator[SEP] operator[SEP] } Keyword[return] identifier[connection] operator[SEP] identifier[connect] operator[SEP] identifier[attributes] , identifier[wait] operator[SEP] operator[SEP] }
public void setBillingRecords(java.util.Collection<BillingRecord> billingRecords) { if (billingRecords == null) { this.billingRecords = null; return; } this.billingRecords = new com.amazonaws.internal.SdkInternalList<BillingRecord>(billingRecords); }
class class_name[name] begin[{] method[setBillingRecords, return_type[void], modifier[public], parameter[billingRecords]] begin[{] if[binary_operation[member[.billingRecords], ==, literal[null]]] begin[{] assign[THIS[member[None.billingRecords]], literal[null]] return[None] else begin[{] None end[}] assign[THIS[member[None.billingRecords]], ClassCreator(arguments=[MemberReference(member=billingRecords, 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=BillingRecord, sub_type=None))], dimensions=None, name=SdkInternalList, sub_type=None)))))] end[}] END[}]
Keyword[public] Keyword[void] identifier[setBillingRecords] operator[SEP] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[Collection] operator[<] identifier[BillingRecord] operator[>] identifier[billingRecords] operator[SEP] { Keyword[if] operator[SEP] identifier[billingRecords] operator[==] Other[null] operator[SEP] { Keyword[this] operator[SEP] identifier[billingRecords] operator[=] Other[null] operator[SEP] Keyword[return] operator[SEP] } Keyword[this] operator[SEP] identifier[billingRecords] operator[=] Keyword[new] identifier[com] operator[SEP] identifier[amazonaws] operator[SEP] identifier[internal] operator[SEP] identifier[SdkInternalList] operator[<] identifier[BillingRecord] operator[>] operator[SEP] identifier[billingRecords] operator[SEP] operator[SEP] }
public void marshall(ListAvailableManagementCidrRangesRequest listAvailableManagementCidrRangesRequest, ProtocolMarshaller protocolMarshaller) { if (listAvailableManagementCidrRangesRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(listAvailableManagementCidrRangesRequest.getManagementCidrRangeConstraint(), MANAGEMENTCIDRRANGECONSTRAINT_BINDING); protocolMarshaller.marshall(listAvailableManagementCidrRangesRequest.getMaxResults(), MAXRESULTS_BINDING); protocolMarshaller.marshall(listAvailableManagementCidrRangesRequest.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[listAvailableManagementCidrRangesRequest, protocolMarshaller]] begin[{] if[binary_operation[member[.listAvailableManagementCidrRangesRequest], ==, 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=getManagementCidrRangeConstraint, postfix_operators=[], prefix_operators=[], qualifier=listAvailableManagementCidrRangesRequest, selectors=[], type_arguments=None), MemberReference(member=MANAGEMENTCIDRRANGECONSTRAINT_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=listAvailableManagementCidrRangesRequest, 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=listAvailableManagementCidrRangesRequest, 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[ListAvailableManagementCidrRangesRequest] identifier[listAvailableManagementCidrRangesRequest] , identifier[ProtocolMarshaller] identifier[protocolMarshaller] operator[SEP] { Keyword[if] operator[SEP] identifier[listAvailableManagementCidrRangesRequest] 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[listAvailableManagementCidrRangesRequest] operator[SEP] identifier[getManagementCidrRangeConstraint] operator[SEP] operator[SEP] , identifier[MANAGEMENTCIDRRANGECONSTRAINT_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[listAvailableManagementCidrRangesRequest] operator[SEP] identifier[getMaxResults] operator[SEP] operator[SEP] , identifier[MAXRESULTS_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[listAvailableManagementCidrRangesRequest] 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] } }
@Override public @Nonnull MachineImage registerImageBundle(@Nonnull ImageCreateOptions options) throws CloudException, InternalException { APITrace.begin(getProvider(), "Image.registerImageBundle"); try { if( !MachineImageFormat.AWS.equals(options.getBundleFormat()) ) { throw new CloudException("Unsupported bundle format: " + options.getBundleFormat()); } if( options.getBundleLocation() == null ) { throw new OperationNotSupportedException("A valid bundle location in object storage was not provided"); } Map<String,String> parameters = getProvider(). getStandardParameters(getProvider(). getContext(), EC2Method.REGISTER_IMAGE); NodeList blocks; EC2Method method; Document doc; parameters.put("ImageLocation", options.getBundleLocation()); method = new EC2Method(getProvider(), parameters); try { doc = method.invoke(); } catch( EC2Exception e ) { logger.error(e.getSummary()); throw new CloudException(e); } blocks = doc.getElementsByTagName("imageId"); if( blocks.getLength() > 0 ) { Node imageIdNode = blocks.item(0); String id = imageIdNode.getFirstChild().getNodeValue().trim(); MachineImage img = getMachineImage(id); if( img == null ) { throw new CloudException("Expected to find newly registered machine image '" + id + "', but none was found"); } return img; } throw new CloudException("No machine image was registered, but no error was thrown"); } finally { APITrace.end(); } }
class class_name[name] begin[{] method[registerImageBundle, return_type[type[MachineImage]], modifier[public], parameter[options]] begin[{] call[APITrace.begin, parameter[call[.getProvider, parameter[]], literal["Image.registerImageBundle"]]] TryStatement(block=[IfStatement(condition=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getBundleFormat, postfix_operators=[], prefix_operators=[], qualifier=options, selectors=[], type_arguments=None)], member=equals, postfix_operators=[], prefix_operators=['!'], qualifier=MachineImageFormat.AWS, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unsupported bundle format: "), operandr=MethodInvocation(arguments=[], member=getBundleFormat, postfix_operators=[], prefix_operators=[], qualifier=options, selectors=[], type_arguments=None), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=CloudException, sub_type=None)), label=None)])), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getBundleLocation, postfix_operators=[], prefix_operators=[], qualifier=options, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="A valid bundle location in object storage was not provided")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=OperationNotSupportedException, sub_type=None)), label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getProvider, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getProvider, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[], member=getContext, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), MemberReference(member=REGISTER_IMAGE, postfix_operators=[], prefix_operators=[], qualifier=EC2Method, selectors=[])], member=getStandardParameters, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=parameters)], 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=Map, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=None, name=blocks)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=NodeList, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=None, name=method)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=EC2Method, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=None, name=doc)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Document, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="ImageLocation"), MethodInvocation(arguments=[], member=getBundleLocation, postfix_operators=[], prefix_operators=[], qualifier=options, selectors=[], type_arguments=None)], member=put, postfix_operators=[], prefix_operators=[], qualifier=parameters, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=method, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[MethodInvocation(arguments=[], member=getProvider, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), MemberReference(member=parameters, 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=EC2Method, sub_type=None))), label=None), TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=doc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=invoke, postfix_operators=[], prefix_operators=[], qualifier=method, selectors=[], type_arguments=None)), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getSummary, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None)], 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=CloudException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['EC2Exception']))], finally_block=None, label=None, resources=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=blocks, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="imageId")], member=getElementsByTagName, postfix_operators=[], prefix_operators=[], qualifier=doc, selectors=[], type_arguments=None)), label=None), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getLength, postfix_operators=[], prefix_operators=[], qualifier=blocks, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], member=item, postfix_operators=[], prefix_operators=[], qualifier=blocks, selectors=[], type_arguments=None), name=imageIdNode)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Node, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getFirstChild, postfix_operators=[], prefix_operators=[], qualifier=imageIdNode, selectors=[MethodInvocation(arguments=[], member=getNodeValue, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=trim, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=id)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=id, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getMachineImage, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=img)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=MachineImage, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=img, 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=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Expected to find newly registered machine image '"), operandr=MemberReference(member=id, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="', but none was found"), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=CloudException, sub_type=None)), label=None)])), ReturnStatement(expression=MemberReference(member=img, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)])), ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="No machine image was registered, but no error was thrown")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=CloudException, sub_type=None)), label=None)], catches=None, finally_block=[StatementExpression(expression=MethodInvocation(arguments=[], member=end, postfix_operators=[], prefix_operators=[], qualifier=APITrace, selectors=[], type_arguments=None), label=None)], label=None, resources=None) end[}] END[}]
annotation[@] identifier[Override] Keyword[public] annotation[@] identifier[Nonnull] identifier[MachineImage] identifier[registerImageBundle] operator[SEP] annotation[@] identifier[Nonnull] identifier[ImageCreateOptions] identifier[options] operator[SEP] Keyword[throws] identifier[CloudException] , identifier[InternalException] { identifier[APITrace] operator[SEP] identifier[begin] operator[SEP] identifier[getProvider] operator[SEP] operator[SEP] , literal[String] operator[SEP] operator[SEP] Keyword[try] { Keyword[if] operator[SEP] operator[!] identifier[MachineImageFormat] operator[SEP] identifier[AWS] operator[SEP] identifier[equals] operator[SEP] identifier[options] operator[SEP] identifier[getBundleFormat] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { Keyword[throw] Keyword[new] identifier[CloudException] operator[SEP] literal[String] operator[+] identifier[options] operator[SEP] identifier[getBundleFormat] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[options] operator[SEP] identifier[getBundleLocation] operator[SEP] operator[SEP] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[OperationNotSupportedException] operator[SEP] literal[String] operator[SEP] operator[SEP] } identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[parameters] operator[=] identifier[getProvider] operator[SEP] operator[SEP] operator[SEP] identifier[getStandardParameters] operator[SEP] identifier[getProvider] operator[SEP] operator[SEP] operator[SEP] identifier[getContext] operator[SEP] operator[SEP] , identifier[EC2Method] operator[SEP] identifier[REGISTER_IMAGE] operator[SEP] operator[SEP] identifier[NodeList] identifier[blocks] operator[SEP] identifier[EC2Method] identifier[method] operator[SEP] identifier[Document] identifier[doc] operator[SEP] identifier[parameters] operator[SEP] identifier[put] operator[SEP] literal[String] , identifier[options] operator[SEP] identifier[getBundleLocation] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[method] operator[=] Keyword[new] identifier[EC2Method] operator[SEP] identifier[getProvider] operator[SEP] operator[SEP] , identifier[parameters] operator[SEP] operator[SEP] Keyword[try] { identifier[doc] operator[=] identifier[method] operator[SEP] identifier[invoke] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[EC2Exception] identifier[e] operator[SEP] { identifier[logger] operator[SEP] identifier[error] operator[SEP] identifier[e] operator[SEP] identifier[getSummary] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[CloudException] operator[SEP] identifier[e] operator[SEP] operator[SEP] } identifier[blocks] operator[=] identifier[doc] operator[SEP] identifier[getElementsByTagName] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[blocks] operator[SEP] identifier[getLength] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] { identifier[Node] identifier[imageIdNode] operator[=] identifier[blocks] operator[SEP] identifier[item] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[String] identifier[id] operator[=] identifier[imageIdNode] operator[SEP] identifier[getFirstChild] operator[SEP] operator[SEP] operator[SEP] identifier[getNodeValue] operator[SEP] operator[SEP] operator[SEP] identifier[trim] operator[SEP] operator[SEP] operator[SEP] identifier[MachineImage] identifier[img] operator[=] identifier[getMachineImage] operator[SEP] identifier[id] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[img] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[CloudException] operator[SEP] literal[String] operator[+] identifier[id] operator[+] literal[String] operator[SEP] operator[SEP] } Keyword[return] identifier[img] operator[SEP] } Keyword[throw] Keyword[new] identifier[CloudException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[finally] { identifier[APITrace] operator[SEP] identifier[end] operator[SEP] operator[SEP] operator[SEP] } }
public void setTimeout(long connectTimeout, long writeTimeout, long readTimeout) { this.httpClient = this.httpClient.newBuilder() .connectTimeout(connectTimeout, TimeUnit.MILLISECONDS) .writeTimeout(writeTimeout, TimeUnit.MILLISECONDS) .readTimeout(readTimeout, TimeUnit.MILLISECONDS) .build(); }
class class_name[name] begin[{] method[setTimeout, return_type[void], modifier[public], parameter[connectTimeout, writeTimeout, readTimeout]] begin[{] assign[THIS[member[None.httpClient]], THIS[member[None.httpClient]call[None.newBuilder, parameter[]]call[None.connectTimeout, parameter[member[.connectTimeout], member[TimeUnit.MILLISECONDS]]]call[None.writeTimeout, parameter[member[.writeTimeout], member[TimeUnit.MILLISECONDS]]]call[None.readTimeout, parameter[member[.readTimeout], member[TimeUnit.MILLISECONDS]]]call[None.build, parameter[]]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[setTimeout] operator[SEP] Keyword[long] identifier[connectTimeout] , Keyword[long] identifier[writeTimeout] , Keyword[long] identifier[readTimeout] operator[SEP] { Keyword[this] operator[SEP] identifier[httpClient] operator[=] Keyword[this] operator[SEP] identifier[httpClient] operator[SEP] identifier[newBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[connectTimeout] operator[SEP] identifier[connectTimeout] , identifier[TimeUnit] operator[SEP] identifier[MILLISECONDS] operator[SEP] operator[SEP] identifier[writeTimeout] operator[SEP] identifier[writeTimeout] , identifier[TimeUnit] operator[SEP] identifier[MILLISECONDS] operator[SEP] operator[SEP] identifier[readTimeout] operator[SEP] identifier[readTimeout] , identifier[TimeUnit] operator[SEP] identifier[MILLISECONDS] operator[SEP] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP] }
public HomeRecord getHomeRecord(J2EEName name) { //LIDB859-4 HomeRecord hr = homesByName.get(name); // d366845.3 return hr; }
class class_name[name] begin[{] method[getHomeRecord, return_type[type[HomeRecord]], modifier[public], parameter[name]] begin[{] local_variable[type[HomeRecord], hr] return[member[.hr]] end[}] END[}]
Keyword[public] identifier[HomeRecord] identifier[getHomeRecord] operator[SEP] identifier[J2EEName] identifier[name] operator[SEP] { identifier[HomeRecord] identifier[hr] operator[=] identifier[homesByName] operator[SEP] identifier[get] operator[SEP] identifier[name] operator[SEP] operator[SEP] Keyword[return] identifier[hr] operator[SEP] }
public static String serializeObject(final Object obj, final int indentWidth, final boolean onlySerializePublicFields, final ClassFieldCache classFieldCache) { final HashMap<ReferenceEqualityKey<Object>, JSONObject> objToJSONVal = new HashMap<>(); final Object rootJsonVal = toJSONGraph(obj, new HashSet<ReferenceEqualityKey<Object>>(), new HashSet<ReferenceEqualityKey<Object>>(), classFieldCache, objToJSONVal, onlySerializePublicFields); final Map<ReferenceEqualityKey<JSONReference>, CharSequence> jsonReferenceToId = new HashMap<>(); final AtomicInteger objId = new AtomicInteger(0); assignObjectIds(rootJsonVal, objToJSONVal, classFieldCache, jsonReferenceToId, objId, onlySerializePublicFields); final StringBuilder buf = new StringBuilder(32768); jsonValToJSONString(rootJsonVal, jsonReferenceToId, /* includeNullValuedFields = */ false, 0, indentWidth, buf); return buf.toString(); }
class class_name[name] begin[{] method[serializeObject, return_type[type[String]], modifier[public static], parameter[obj, indentWidth, onlySerializePublicFields, classFieldCache]] begin[{] local_variable[type[HashMap], objToJSONVal] local_variable[type[Object], rootJsonVal] local_variable[type[Map], jsonReferenceToId] local_variable[type[AtomicInteger], objId] call[.assignObjectIds, parameter[member[.rootJsonVal], member[.objToJSONVal], member[.classFieldCache], member[.jsonReferenceToId], member[.objId], member[.onlySerializePublicFields]]] local_variable[type[StringBuilder], buf] call[.jsonValToJSONString, parameter[member[.rootJsonVal], member[.jsonReferenceToId], literal[false], literal[0], member[.indentWidth], member[.buf]]] return[call[buf.toString, parameter[]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[String] identifier[serializeObject] operator[SEP] Keyword[final] identifier[Object] identifier[obj] , Keyword[final] Keyword[int] identifier[indentWidth] , Keyword[final] Keyword[boolean] identifier[onlySerializePublicFields] , Keyword[final] identifier[ClassFieldCache] identifier[classFieldCache] operator[SEP] { Keyword[final] identifier[HashMap] operator[<] identifier[ReferenceEqualityKey] operator[<] identifier[Object] operator[>] , identifier[JSONObject] operator[>] identifier[objToJSONVal] operator[=] Keyword[new] identifier[HashMap] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[Object] identifier[rootJsonVal] operator[=] identifier[toJSONGraph] operator[SEP] identifier[obj] , Keyword[new] identifier[HashSet] operator[<] identifier[ReferenceEqualityKey] operator[<] identifier[Object] operator[>] operator[>] operator[SEP] operator[SEP] , Keyword[new] identifier[HashSet] operator[<] identifier[ReferenceEqualityKey] operator[<] identifier[Object] operator[>] operator[>] operator[SEP] operator[SEP] , identifier[classFieldCache] , identifier[objToJSONVal] , identifier[onlySerializePublicFields] operator[SEP] operator[SEP] Keyword[final] identifier[Map] operator[<] identifier[ReferenceEqualityKey] operator[<] identifier[JSONReference] operator[>] , identifier[CharSequence] operator[>] identifier[jsonReferenceToId] operator[=] Keyword[new] identifier[HashMap] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[AtomicInteger] identifier[objId] operator[=] Keyword[new] identifier[AtomicInteger] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[assignObjectIds] operator[SEP] identifier[rootJsonVal] , identifier[objToJSONVal] , identifier[classFieldCache] , identifier[jsonReferenceToId] , identifier[objId] , identifier[onlySerializePublicFields] operator[SEP] operator[SEP] Keyword[final] identifier[StringBuilder] identifier[buf] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] Other[32768] operator[SEP] operator[SEP] identifier[jsonValToJSONString] operator[SEP] identifier[rootJsonVal] , identifier[jsonReferenceToId] , literal[boolean] , Other[0] , identifier[indentWidth] , identifier[buf] operator[SEP] operator[SEP] Keyword[return] identifier[buf] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] }
@Override public void writeEnc(Writer w) throws IOException { w.write("<!ENTITY "); w.write(mName); w.write(" \""); TextEscaper.outputDTDText(w, mRepl, 0, mRepl.length); w.write("\">"); }
class class_name[name] begin[{] method[writeEnc, return_type[void], modifier[public], parameter[w]] begin[{] call[w.write, parameter[literal["<!ENTITY "]]] call[w.write, parameter[member[.mName]]] call[w.write, parameter[literal[" \""]]] call[TextEscaper.outputDTDText, parameter[member[.w], member[.mRepl], literal[0], member[mRepl.length]]] call[w.write, parameter[literal["\">"]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[writeEnc] operator[SEP] identifier[Writer] identifier[w] operator[SEP] Keyword[throws] identifier[IOException] { identifier[w] operator[SEP] identifier[write] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[w] operator[SEP] identifier[write] operator[SEP] identifier[mName] operator[SEP] operator[SEP] identifier[w] operator[SEP] identifier[write] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[TextEscaper] operator[SEP] identifier[outputDTDText] operator[SEP] identifier[w] , identifier[mRepl] , Other[0] , identifier[mRepl] operator[SEP] identifier[length] operator[SEP] operator[SEP] identifier[w] operator[SEP] identifier[write] operator[SEP] literal[String] operator[SEP] operator[SEP] }
public Object getDefault() { Object objDefault = super.getDefault(); if (objDefault == null) objDefault = RunProcessInField.REMOTE_PROCESS; return objDefault; }
class class_name[name] begin[{] method[getDefault, return_type[type[Object]], modifier[public], parameter[]] begin[{] local_variable[type[Object], objDefault] if[binary_operation[member[.objDefault], ==, literal[null]]] begin[{] assign[member[.objDefault], member[RunProcessInField.REMOTE_PROCESS]] else begin[{] None end[}] return[member[.objDefault]] end[}] END[}]
Keyword[public] identifier[Object] identifier[getDefault] operator[SEP] operator[SEP] { identifier[Object] identifier[objDefault] operator[=] Keyword[super] operator[SEP] identifier[getDefault] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[objDefault] operator[==] Other[null] operator[SEP] identifier[objDefault] operator[=] identifier[RunProcessInField] operator[SEP] identifier[REMOTE_PROCESS] operator[SEP] Keyword[return] identifier[objDefault] operator[SEP] }
static BsonDocument executeCommand(final WriteBinding binding, final String database, final BsonDocument command) { return executeCommand(binding, database, command, new IdentityWriteTransformer<BsonDocument>()); }
class class_name[name] begin[{] method[executeCommand, return_type[type[BsonDocument]], modifier[static], parameter[binding, database, command]] begin[{] return[call[.executeCommand, parameter[member[.binding], member[.database], member[.command], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=BsonDocument, sub_type=None))], dimensions=None, name=IdentityWriteTransformer, sub_type=None))]]] end[}] END[}]
Keyword[static] identifier[BsonDocument] identifier[executeCommand] operator[SEP] Keyword[final] identifier[WriteBinding] identifier[binding] , Keyword[final] identifier[String] identifier[database] , Keyword[final] identifier[BsonDocument] identifier[command] operator[SEP] { Keyword[return] identifier[executeCommand] operator[SEP] identifier[binding] , identifier[database] , identifier[command] , Keyword[new] identifier[IdentityWriteTransformer] operator[<] identifier[BsonDocument] operator[>] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }