code
stringlengths
63
466k
code_sememe
stringlengths
141
3.79M
token_type
stringlengths
274
1.23M
public EList<LLERG> getRG() { if (rg == null) { rg = new EObjectContainmentEList.Resolving<LLERG>(LLERG.class, this, AfplibPackage.LLE__RG); } return rg; }
class class_name[name] begin[{] method[getRG, return_type[type[EList]], modifier[public], parameter[]] begin[{] if[binary_operation[member[.rg], ==, literal[null]]] begin[{] assign[member[.rg], ClassCreator(arguments=[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=LLERG, sub_type=None)), This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), MemberReference(member=LLE__RG, postfix_operators=[], prefix_operators=[], qualifier=AfplibPackage, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=EObjectContainmentEList, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=LLERG, sub_type=None))], dimensions=None, name=Resolving, sub_type=None)))] else begin[{] None end[}] return[member[.rg]] end[}] END[}]
Keyword[public] identifier[EList] operator[<] identifier[LLERG] operator[>] identifier[getRG] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[rg] operator[==] Other[null] operator[SEP] { identifier[rg] operator[=] Keyword[new] identifier[EObjectContainmentEList] operator[SEP] identifier[Resolving] operator[<] identifier[LLERG] operator[>] operator[SEP] identifier[LLERG] operator[SEP] Keyword[class] , Keyword[this] , identifier[AfplibPackage] operator[SEP] identifier[LLE__RG] operator[SEP] operator[SEP] } Keyword[return] identifier[rg] operator[SEP] }
public SocketIOChannel createInboundSocketIOChannel(SocketChannel sc) throws IOException { AsyncSocketChannel asc = new AsyncSocketChannel(sc, getAsyncChannelGroup()); return AioSocketIOChannel.createIOChannel(sc.socket(), asc, this); }
class class_name[name] begin[{] method[createInboundSocketIOChannel, return_type[type[SocketIOChannel]], modifier[public], parameter[sc]] begin[{] local_variable[type[AsyncSocketChannel], asc] return[call[AioSocketIOChannel.createIOChannel, parameter[call[sc.socket, parameter[]], member[.asc], THIS[]]]] end[}] END[}]
Keyword[public] identifier[SocketIOChannel] identifier[createInboundSocketIOChannel] operator[SEP] identifier[SocketChannel] identifier[sc] operator[SEP] Keyword[throws] identifier[IOException] { identifier[AsyncSocketChannel] identifier[asc] operator[=] Keyword[new] identifier[AsyncSocketChannel] operator[SEP] identifier[sc] , identifier[getAsyncChannelGroup] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[AioSocketIOChannel] operator[SEP] identifier[createIOChannel] operator[SEP] identifier[sc] operator[SEP] identifier[socket] operator[SEP] operator[SEP] , identifier[asc] , Keyword[this] operator[SEP] operator[SEP] }
private static String decodeLine(LineString line, float scale) { if (line == null || line.isEmpty()) { return ""; } StringBuilder buffer = new StringBuilder(); addCoordinates(buffer, line.getCoordinates(), scale); buffer.append(" e "); return buffer.toString(); }
class class_name[name] begin[{] method[decodeLine, return_type[type[String]], modifier[private static], parameter[line, scale]] begin[{] if[binary_operation[binary_operation[member[.line], ==, literal[null]], ||, call[line.isEmpty, parameter[]]]] begin[{] return[literal[""]] else begin[{] None end[}] local_variable[type[StringBuilder], buffer] call[.addCoordinates, parameter[member[.buffer], call[line.getCoordinates, parameter[]], member[.scale]]] call[buffer.append, parameter[literal[" e "]]] return[call[buffer.toString, parameter[]]] end[}] END[}]
Keyword[private] Keyword[static] identifier[String] identifier[decodeLine] operator[SEP] identifier[LineString] identifier[line] , Keyword[float] identifier[scale] operator[SEP] { Keyword[if] operator[SEP] identifier[line] operator[==] Other[null] operator[||] identifier[line] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] literal[String] operator[SEP] } identifier[StringBuilder] identifier[buffer] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[addCoordinates] operator[SEP] identifier[buffer] , identifier[line] operator[SEP] identifier[getCoordinates] operator[SEP] operator[SEP] , identifier[scale] operator[SEP] operator[SEP] identifier[buffer] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[buffer] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] }
private void scheduleNextAction(String queryId) { log(TAG, "handler is scheduling next action"); QueryInfo qd = queries.get(queryId); if (qd == null) { return; } if (qd.getRemainingSignals() > 0) { Message msg = handler.obtainMessage(SearchMessages.SEND_SIGNAL, queryId); handler.sendMessageDelayed(msg, qd.getSignalPeriod()); qd.decrementRemainingSignals(); } else { Message message = handler.obtainMessage(SearchMessages.SEARCH_STOPPED,qd); handler.sendMessageDelayed(message, qd.getSignalPeriod()); } }
class class_name[name] begin[{] method[scheduleNextAction, return_type[void], modifier[private], parameter[queryId]] begin[{] call[.log, parameter[member[.TAG], literal["handler is scheduling next action"]]] local_variable[type[QueryInfo], qd] if[binary_operation[member[.qd], ==, literal[null]]] begin[{] return[None] else begin[{] None end[}] if[binary_operation[call[qd.getRemainingSignals, parameter[]], >, literal[0]]] begin[{] local_variable[type[Message], msg] call[handler.sendMessageDelayed, parameter[member[.msg], call[qd.getSignalPeriod, parameter[]]]] call[qd.decrementRemainingSignals, parameter[]] else begin[{] local_variable[type[Message], message] call[handler.sendMessageDelayed, parameter[member[.message], call[qd.getSignalPeriod, parameter[]]]] end[}] end[}] END[}]
Keyword[private] Keyword[void] identifier[scheduleNextAction] operator[SEP] identifier[String] identifier[queryId] operator[SEP] { identifier[log] operator[SEP] identifier[TAG] , literal[String] operator[SEP] operator[SEP] identifier[QueryInfo] identifier[qd] operator[=] identifier[queries] operator[SEP] identifier[get] operator[SEP] identifier[queryId] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[qd] operator[==] Other[null] operator[SEP] { Keyword[return] operator[SEP] } Keyword[if] operator[SEP] identifier[qd] operator[SEP] identifier[getRemainingSignals] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] { identifier[Message] identifier[msg] operator[=] identifier[handler] operator[SEP] identifier[obtainMessage] operator[SEP] identifier[SearchMessages] operator[SEP] identifier[SEND_SIGNAL] , identifier[queryId] operator[SEP] operator[SEP] identifier[handler] operator[SEP] identifier[sendMessageDelayed] operator[SEP] identifier[msg] , identifier[qd] operator[SEP] identifier[getSignalPeriod] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[qd] operator[SEP] identifier[decrementRemainingSignals] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[Message] identifier[message] operator[=] identifier[handler] operator[SEP] identifier[obtainMessage] operator[SEP] identifier[SearchMessages] operator[SEP] identifier[SEARCH_STOPPED] , identifier[qd] operator[SEP] operator[SEP] identifier[handler] operator[SEP] identifier[sendMessageDelayed] operator[SEP] identifier[message] , identifier[qd] operator[SEP] identifier[getSignalPeriod] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } }
public void setDisplay(int display) { if (!Platform.getCurrent().is(LINUX)) { throw new UnsupportedOperationException("Unsupported platform: " + Platform.getCurrent()); } options.get(DISPLAY).setValue(display); }
class class_name[name] begin[{] method[setDisplay, return_type[void], modifier[public], parameter[display]] begin[{] if[call[Platform.getCurrent, parameter[]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unsupported platform: "), operandr=MethodInvocation(arguments=[], member=getCurrent, postfix_operators=[], prefix_operators=[], qualifier=Platform, 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=UnsupportedOperationException, sub_type=None)), label=None) else begin[{] None end[}] call[options.get, parameter[member[.DISPLAY]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[setDisplay] operator[SEP] Keyword[int] identifier[display] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[Platform] operator[SEP] identifier[getCurrent] operator[SEP] operator[SEP] operator[SEP] identifier[is] operator[SEP] identifier[LINUX] operator[SEP] operator[SEP] { Keyword[throw] Keyword[new] identifier[UnsupportedOperationException] operator[SEP] literal[String] operator[+] identifier[Platform] operator[SEP] identifier[getCurrent] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[options] operator[SEP] identifier[get] operator[SEP] identifier[DISPLAY] operator[SEP] operator[SEP] identifier[setValue] operator[SEP] identifier[display] operator[SEP] operator[SEP] }
public Defect defect(String name, Project project) { return defect(name, project, null); }
class class_name[name] begin[{] method[defect, return_type[type[Defect]], modifier[public], parameter[name, project]] begin[{] return[call[.defect, parameter[member[.name], member[.project], literal[null]]]] end[}] END[}]
Keyword[public] identifier[Defect] identifier[defect] operator[SEP] identifier[String] identifier[name] , identifier[Project] identifier[project] operator[SEP] { Keyword[return] identifier[defect] operator[SEP] identifier[name] , identifier[project] , Other[null] operator[SEP] operator[SEP] }
@Override public void sawOpcode(int seen) { Integer tosIsPriority = null; try { stack.precomputation(this); switch (seen) { case Const.GETFIELD: tosIsPriority = OWNED; break; case Const.ALOAD: case Const.ALOAD_0: case Const.ALOAD_1: case Const.ALOAD_2: case Const.ALOAD_3: { int reg = RegisterUtils.getALoadReg(this, seen); if ((reg == 0) && getMethod().isStatic()) { tosIsPriority = Values.LOW_BUG_PRIORITY; } else { tosIsPriority = regPriorities.get(Integer.valueOf(reg)); if (tosIsPriority == null) { tosIsPriority = Values.NORMAL_BUG_PRIORITY; } } } break; case Const.ASTORE: case Const.ASTORE_0: case Const.ASTORE_1: case Const.ASTORE_2: case Const.ASTORE_3: { if (stack.getStackDepth() > 0) { OpcodeStack.Item item = stack.getStackItem(0); Integer priority = (Integer) item.getUserValue(); regPriorities.put(Integer.valueOf(RegisterUtils.getAStoreReg(this, seen)), priority); } } break; case Const.INVOKEVIRTUAL: case Const.INVOKEINTERFACE: { String sig = getSigConstantOperand(); if (SignatureUtils.getReturnSignature(sig).startsWith(Values.SIG_QUALIFIED_CLASS_PREFIX)) { int parmCnt = SignatureUtils.getNumParameters(sig); if (stack.getStackDepth() > parmCnt) { OpcodeStack.Item itm = stack.getStackItem(parmCnt); Integer priority = (Integer) itm.getUserValue(); if ((priority != null) && OWNED.equals(priority)) { tosIsPriority = OWNED; } else { int reg = itm.getRegisterNumber(); if (reg > 0) { tosIsPriority = regPriorities.get(Integer.valueOf(reg)); } else { tosIsPriority = OWNED; } } } } } break; case Const.INVOKESTATIC: { String sig = getSigConstantOperand(); if (SignatureUtils.getReturnSignature(sig).startsWith(Values.SIG_QUALIFIED_CLASS_PREFIX)) { tosIsPriority = OWNED; // can't be sure } } break; case Const.INVOKESPECIAL: { String name = getNameConstantOperand(); if (Values.CONSTRUCTOR.equals(name)) { tosIsPriority = OWNED; } } break; case Const.MONITORENTER: { if (stack.getStackDepth() > 0) { OpcodeStack.Item itm = stack.getStackItem(0); Integer priority = (Integer) itm.getUserValue(); if ((priority != null) && (!priority.equals(OWNED))) { bugReporter.reportBug(new BugInstance(this, BugType.NOS_NON_OWNED_SYNCHRONIZATION.name(), priority.intValue()).addClass(this) .addMethod(this).addSourceLine(this)); } } } break; default: break; } } finally { TernaryPatcher.pre(stack, seen); stack.sawOpcode(this, seen); TernaryPatcher.post(stack, seen); if ((tosIsPriority != null) && (stack.getStackDepth() > 0)) { OpcodeStack.Item itm = stack.getStackItem(0); itm.setUserValue(tosIsPriority); } } }
class class_name[name] begin[{] method[sawOpcode, return_type[void], modifier[public], parameter[seen]] begin[{] local_variable[type[Integer], tosIsPriority] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[])], member=precomputation, postfix_operators=[], prefix_operators=[], qualifier=stack, selectors=[], type_arguments=None), label=None), SwitchStatement(cases=[SwitchStatementCase(case=[MemberReference(member=GETFIELD, postfix_operators=[], prefix_operators=[], qualifier=Const, selectors=[])], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=tosIsPriority, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=OWNED, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[MemberReference(member=ALOAD, postfix_operators=[], prefix_operators=[], qualifier=Const, selectors=[]), MemberReference(member=ALOAD_0, postfix_operators=[], prefix_operators=[], qualifier=Const, selectors=[]), MemberReference(member=ALOAD_1, postfix_operators=[], prefix_operators=[], qualifier=Const, selectors=[]), MemberReference(member=ALOAD_2, postfix_operators=[], prefix_operators=[], qualifier=Const, selectors=[]), MemberReference(member=ALOAD_3, postfix_operators=[], prefix_operators=[], qualifier=Const, selectors=[])], statements=[BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), MemberReference(member=seen, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getALoadReg, postfix_operators=[], prefix_operators=[], qualifier=RegisterUtils, selectors=[], type_arguments=None), name=reg)], modifiers=set(), type=BasicType(dimensions=[], name=int)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=reg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator===), operandr=MethodInvocation(arguments=[], member=getMethod, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[], member=isStatic, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operator=&&), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=tosIsPriority, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=reg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=valueOf, postfix_operators=[], prefix_operators=[], qualifier=Integer, selectors=[], type_arguments=None)], member=get, postfix_operators=[], prefix_operators=[], qualifier=regPriorities, selectors=[], type_arguments=None)), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=tosIsPriority, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=tosIsPriority, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=NORMAL_BUG_PRIORITY, postfix_operators=[], prefix_operators=[], qualifier=Values, selectors=[])), label=None)]))]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=tosIsPriority, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=LOW_BUG_PRIORITY, postfix_operators=[], prefix_operators=[], qualifier=Values, selectors=[])), label=None)]))]), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[MemberReference(member=ASTORE, postfix_operators=[], prefix_operators=[], qualifier=Const, selectors=[]), MemberReference(member=ASTORE_0, postfix_operators=[], prefix_operators=[], qualifier=Const, selectors=[]), MemberReference(member=ASTORE_1, postfix_operators=[], prefix_operators=[], qualifier=Const, selectors=[]), MemberReference(member=ASTORE_2, postfix_operators=[], prefix_operators=[], qualifier=Const, selectors=[]), MemberReference(member=ASTORE_3, postfix_operators=[], prefix_operators=[], qualifier=Const, selectors=[])], statements=[BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getStackDepth, postfix_operators=[], prefix_operators=[], qualifier=stack, 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=getStackItem, postfix_operators=[], prefix_operators=[], qualifier=stack, selectors=[], type_arguments=None), name=item)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=OpcodeStack, sub_type=ReferenceType(arguments=None, dimensions=None, name=Item, sub_type=None))), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MethodInvocation(arguments=[], member=getUserValue, postfix_operators=[], prefix_operators=[], qualifier=item, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=Integer, sub_type=None)), name=priority)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Integer, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), MemberReference(member=seen, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getAStoreReg, postfix_operators=[], prefix_operators=[], qualifier=RegisterUtils, selectors=[], type_arguments=None)], member=valueOf, postfix_operators=[], prefix_operators=[], qualifier=Integer, selectors=[], type_arguments=None), MemberReference(member=priority, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=put, postfix_operators=[], prefix_operators=[], qualifier=regPriorities, selectors=[], type_arguments=None), label=None)]))]), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[MemberReference(member=INVOKEVIRTUAL, postfix_operators=[], prefix_operators=[], qualifier=Const, selectors=[]), MemberReference(member=INVOKEINTERFACE, postfix_operators=[], prefix_operators=[], qualifier=Const, selectors=[])], statements=[BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getSigConstantOperand, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=sig)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=sig, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getReturnSignature, postfix_operators=[], prefix_operators=[], qualifier=SignatureUtils, selectors=[MethodInvocation(arguments=[MemberReference(member=SIG_QUALIFIED_CLASS_PREFIX, postfix_operators=[], prefix_operators=[], qualifier=Values, selectors=[])], member=startsWith, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=sig, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getNumParameters, postfix_operators=[], prefix_operators=[], qualifier=SignatureUtils, selectors=[], type_arguments=None), name=parmCnt)], modifiers=set(), type=BasicType(dimensions=[], name=int)), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getStackDepth, postfix_operators=[], prefix_operators=[], qualifier=stack, selectors=[], type_arguments=None), operandr=MemberReference(member=parmCnt, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=>), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=parmCnt, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getStackItem, postfix_operators=[], prefix_operators=[], qualifier=stack, selectors=[], type_arguments=None), name=itm)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=OpcodeStack, sub_type=ReferenceType(arguments=None, dimensions=None, name=Item, sub_type=None))), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MethodInvocation(arguments=[], member=getUserValue, postfix_operators=[], prefix_operators=[], qualifier=itm, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=Integer, sub_type=None)), name=priority)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Integer, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=priority, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operandr=MethodInvocation(arguments=[MemberReference(member=priority, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equals, postfix_operators=[], prefix_operators=[], qualifier=OWNED, selectors=[], type_arguments=None), operator=&&), else_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getRegisterNumber, postfix_operators=[], prefix_operators=[], qualifier=itm, selectors=[], type_arguments=None), name=reg)], modifiers=set(), type=BasicType(dimensions=[], name=int)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=reg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=tosIsPriority, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=OWNED, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=tosIsPriority, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=reg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=valueOf, postfix_operators=[], prefix_operators=[], qualifier=Integer, selectors=[], type_arguments=None)], member=get, postfix_operators=[], prefix_operators=[], qualifier=regPriorities, selectors=[], type_arguments=None)), label=None)]))]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=tosIsPriority, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=OWNED, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)]))]))]))]), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[MemberReference(member=INVOKESTATIC, postfix_operators=[], prefix_operators=[], qualifier=Const, selectors=[])], statements=[BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getSigConstantOperand, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=sig)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=sig, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getReturnSignature, postfix_operators=[], prefix_operators=[], qualifier=SignatureUtils, selectors=[MethodInvocation(arguments=[MemberReference(member=SIG_QUALIFIED_CLASS_PREFIX, postfix_operators=[], prefix_operators=[], qualifier=Values, selectors=[])], member=startsWith, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=tosIsPriority, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=OWNED, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)]))]), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[MemberReference(member=INVOKESPECIAL, postfix_operators=[], prefix_operators=[], qualifier=Const, selectors=[])], statements=[BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getNameConstantOperand, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=name)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equals, postfix_operators=[], prefix_operators=[], qualifier=Values.CONSTRUCTOR, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=tosIsPriority, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=OWNED, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)]))]), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[MemberReference(member=MONITORENTER, postfix_operators=[], prefix_operators=[], qualifier=Const, selectors=[])], statements=[BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getStackDepth, postfix_operators=[], prefix_operators=[], qualifier=stack, 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=getStackItem, postfix_operators=[], prefix_operators=[], qualifier=stack, selectors=[], type_arguments=None), name=itm)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=OpcodeStack, sub_type=ReferenceType(arguments=None, dimensions=None, name=Item, sub_type=None))), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MethodInvocation(arguments=[], member=getUserValue, postfix_operators=[], prefix_operators=[], qualifier=itm, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=Integer, sub_type=None)), name=priority)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Integer, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=priority, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operandr=MethodInvocation(arguments=[MemberReference(member=OWNED, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equals, postfix_operators=[], prefix_operators=[], qualifier=priority, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[ClassCreator(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), MethodInvocation(arguments=[], member=name, postfix_operators=[], prefix_operators=[], qualifier=BugType.NOS_NON_OWNED_SYNCHRONIZATION, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=intValue, postfix_operators=[], prefix_operators=[], qualifier=priority, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[])], member=addClass, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[])], member=addMethod, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[])], member=addSourceLine, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=BugInstance, sub_type=None))], member=reportBug, postfix_operators=[], prefix_operators=[], qualifier=bugReporter, selectors=[], type_arguments=None), label=None)]))]))]), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[], statements=[BreakStatement(goto=None, label=None)])], expression=MemberReference(member=seen, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], catches=None, finally_block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=stack, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=seen, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=pre, postfix_operators=[], prefix_operators=[], qualifier=TernaryPatcher, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), MemberReference(member=seen, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=sawOpcode, postfix_operators=[], prefix_operators=[], qualifier=stack, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=stack, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=seen, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=post, postfix_operators=[], prefix_operators=[], qualifier=TernaryPatcher, selectors=[], type_arguments=None), label=None), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=tosIsPriority, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getStackDepth, postfix_operators=[], prefix_operators=[], qualifier=stack, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], member=getStackItem, postfix_operators=[], prefix_operators=[], qualifier=stack, selectors=[], type_arguments=None), name=itm)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=OpcodeStack, sub_type=ReferenceType(arguments=None, dimensions=None, name=Item, sub_type=None))), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=tosIsPriority, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setUserValue, postfix_operators=[], prefix_operators=[], qualifier=itm, selectors=[], type_arguments=None), label=None)]))], label=None, resources=None) end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[sawOpcode] operator[SEP] Keyword[int] identifier[seen] operator[SEP] { identifier[Integer] identifier[tosIsPriority] operator[=] Other[null] operator[SEP] Keyword[try] { identifier[stack] operator[SEP] identifier[precomputation] operator[SEP] Keyword[this] operator[SEP] operator[SEP] Keyword[switch] operator[SEP] identifier[seen] operator[SEP] { Keyword[case] identifier[Const] operator[SEP] identifier[GETFIELD] operator[:] identifier[tosIsPriority] operator[=] identifier[OWNED] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[Const] operator[SEP] identifier[ALOAD] operator[:] Keyword[case] identifier[Const] operator[SEP] identifier[ALOAD_0] operator[:] Keyword[case] identifier[Const] operator[SEP] identifier[ALOAD_1] operator[:] Keyword[case] identifier[Const] operator[SEP] identifier[ALOAD_2] operator[:] Keyword[case] identifier[Const] operator[SEP] identifier[ALOAD_3] operator[:] { Keyword[int] identifier[reg] operator[=] identifier[RegisterUtils] operator[SEP] identifier[getALoadReg] operator[SEP] Keyword[this] , identifier[seen] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[SEP] identifier[reg] operator[==] Other[0] operator[SEP] operator[&&] identifier[getMethod] operator[SEP] operator[SEP] operator[SEP] identifier[isStatic] operator[SEP] operator[SEP] operator[SEP] { identifier[tosIsPriority] operator[=] identifier[Values] operator[SEP] identifier[LOW_BUG_PRIORITY] operator[SEP] } Keyword[else] { identifier[tosIsPriority] operator[=] identifier[regPriorities] operator[SEP] identifier[get] operator[SEP] identifier[Integer] operator[SEP] identifier[valueOf] operator[SEP] identifier[reg] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[tosIsPriority] operator[==] Other[null] operator[SEP] { identifier[tosIsPriority] operator[=] identifier[Values] operator[SEP] identifier[NORMAL_BUG_PRIORITY] operator[SEP] } } } Keyword[break] operator[SEP] Keyword[case] identifier[Const] operator[SEP] identifier[ASTORE] operator[:] Keyword[case] identifier[Const] operator[SEP] identifier[ASTORE_0] operator[:] Keyword[case] identifier[Const] operator[SEP] identifier[ASTORE_1] operator[:] Keyword[case] identifier[Const] operator[SEP] identifier[ASTORE_2] operator[:] Keyword[case] identifier[Const] operator[SEP] identifier[ASTORE_3] operator[:] { Keyword[if] operator[SEP] identifier[stack] operator[SEP] identifier[getStackDepth] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] { identifier[OpcodeStack] operator[SEP] identifier[Item] identifier[item] operator[=] identifier[stack] operator[SEP] identifier[getStackItem] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[Integer] identifier[priority] operator[=] operator[SEP] identifier[Integer] operator[SEP] identifier[item] operator[SEP] identifier[getUserValue] operator[SEP] operator[SEP] operator[SEP] identifier[regPriorities] operator[SEP] identifier[put] operator[SEP] identifier[Integer] operator[SEP] identifier[valueOf] operator[SEP] identifier[RegisterUtils] operator[SEP] identifier[getAStoreReg] operator[SEP] Keyword[this] , identifier[seen] operator[SEP] operator[SEP] , identifier[priority] operator[SEP] operator[SEP] } } Keyword[break] operator[SEP] Keyword[case] identifier[Const] operator[SEP] identifier[INVOKEVIRTUAL] operator[:] Keyword[case] identifier[Const] operator[SEP] identifier[INVOKEINTERFACE] operator[:] { identifier[String] identifier[sig] operator[=] identifier[getSigConstantOperand] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[SignatureUtils] operator[SEP] identifier[getReturnSignature] operator[SEP] identifier[sig] operator[SEP] operator[SEP] identifier[startsWith] operator[SEP] identifier[Values] operator[SEP] identifier[SIG_QUALIFIED_CLASS_PREFIX] operator[SEP] operator[SEP] { Keyword[int] identifier[parmCnt] operator[=] identifier[SignatureUtils] operator[SEP] identifier[getNumParameters] operator[SEP] identifier[sig] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[stack] operator[SEP] identifier[getStackDepth] operator[SEP] operator[SEP] operator[>] identifier[parmCnt] operator[SEP] { identifier[OpcodeStack] operator[SEP] identifier[Item] identifier[itm] operator[=] identifier[stack] operator[SEP] identifier[getStackItem] operator[SEP] identifier[parmCnt] operator[SEP] operator[SEP] identifier[Integer] identifier[priority] operator[=] operator[SEP] identifier[Integer] operator[SEP] identifier[itm] operator[SEP] identifier[getUserValue] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[SEP] identifier[priority] operator[!=] Other[null] operator[SEP] operator[&&] identifier[OWNED] operator[SEP] identifier[equals] operator[SEP] identifier[priority] operator[SEP] operator[SEP] { identifier[tosIsPriority] operator[=] identifier[OWNED] operator[SEP] } Keyword[else] { Keyword[int] identifier[reg] operator[=] identifier[itm] operator[SEP] identifier[getRegisterNumber] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[reg] operator[>] Other[0] operator[SEP] { identifier[tosIsPriority] operator[=] identifier[regPriorities] operator[SEP] identifier[get] operator[SEP] identifier[Integer] operator[SEP] identifier[valueOf] operator[SEP] identifier[reg] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[tosIsPriority] operator[=] identifier[OWNED] operator[SEP] } } } } } Keyword[break] operator[SEP] Keyword[case] identifier[Const] operator[SEP] identifier[INVOKESTATIC] operator[:] { identifier[String] identifier[sig] operator[=] identifier[getSigConstantOperand] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[SignatureUtils] operator[SEP] identifier[getReturnSignature] operator[SEP] identifier[sig] operator[SEP] operator[SEP] identifier[startsWith] operator[SEP] identifier[Values] operator[SEP] identifier[SIG_QUALIFIED_CLASS_PREFIX] operator[SEP] operator[SEP] { identifier[tosIsPriority] operator[=] identifier[OWNED] operator[SEP] } } Keyword[break] operator[SEP] Keyword[case] identifier[Const] operator[SEP] identifier[INVOKESPECIAL] operator[:] { identifier[String] identifier[name] operator[=] identifier[getNameConstantOperand] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[Values] operator[SEP] identifier[CONSTRUCTOR] operator[SEP] identifier[equals] operator[SEP] identifier[name] operator[SEP] operator[SEP] { identifier[tosIsPriority] operator[=] identifier[OWNED] operator[SEP] } } Keyword[break] operator[SEP] Keyword[case] identifier[Const] operator[SEP] identifier[MONITORENTER] operator[:] { Keyword[if] operator[SEP] identifier[stack] operator[SEP] identifier[getStackDepth] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] { identifier[OpcodeStack] operator[SEP] identifier[Item] identifier[itm] operator[=] identifier[stack] operator[SEP] identifier[getStackItem] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[Integer] identifier[priority] operator[=] operator[SEP] identifier[Integer] operator[SEP] identifier[itm] operator[SEP] identifier[getUserValue] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[SEP] identifier[priority] operator[!=] Other[null] operator[SEP] operator[&&] operator[SEP] operator[!] identifier[priority] operator[SEP] identifier[equals] operator[SEP] identifier[OWNED] operator[SEP] operator[SEP] operator[SEP] { identifier[bugReporter] operator[SEP] identifier[reportBug] operator[SEP] Keyword[new] identifier[BugInstance] operator[SEP] Keyword[this] , identifier[BugType] operator[SEP] identifier[NOS_NON_OWNED_SYNCHRONIZATION] operator[SEP] identifier[name] operator[SEP] operator[SEP] , identifier[priority] operator[SEP] identifier[intValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[addClass] operator[SEP] Keyword[this] operator[SEP] operator[SEP] identifier[addMethod] operator[SEP] Keyword[this] operator[SEP] operator[SEP] identifier[addSourceLine] operator[SEP] Keyword[this] operator[SEP] operator[SEP] operator[SEP] } } } Keyword[break] operator[SEP] Keyword[default] operator[:] Keyword[break] operator[SEP] } } Keyword[finally] { identifier[TernaryPatcher] operator[SEP] identifier[pre] operator[SEP] identifier[stack] , identifier[seen] operator[SEP] operator[SEP] identifier[stack] operator[SEP] identifier[sawOpcode] operator[SEP] Keyword[this] , identifier[seen] operator[SEP] operator[SEP] identifier[TernaryPatcher] operator[SEP] identifier[post] operator[SEP] identifier[stack] , identifier[seen] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[SEP] identifier[tosIsPriority] operator[!=] Other[null] operator[SEP] operator[&&] operator[SEP] identifier[stack] operator[SEP] identifier[getStackDepth] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] operator[SEP] { identifier[OpcodeStack] operator[SEP] identifier[Item] identifier[itm] operator[=] identifier[stack] operator[SEP] identifier[getStackItem] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[itm] operator[SEP] identifier[setUserValue] operator[SEP] identifier[tosIsPriority] operator[SEP] operator[SEP] } } }
public int getRow() { if(_currentRow != null) { int row = _currentRow.intValue(); /* if the row is out of range, simply adjust to the last row */ if(_dataSetSize != null && (row > _dataSetSize.intValue())) row = _dataSetSize.intValue(); if(row % getPageSize() != 0) { int adjustedPage = row - (row % getPageSize()); return adjustedPage; } else return row; } else return DEFAULT_ROW; }
class class_name[name] begin[{] method[getRow, return_type[type[int]], modifier[public], parameter[]] begin[{] if[binary_operation[member[._currentRow], !=, literal[null]]] begin[{] local_variable[type[int], row] if[binary_operation[binary_operation[member[._dataSetSize], !=, literal[null]], &&, binary_operation[member[.row], >, call[_dataSetSize.intValue, parameter[]]]]] begin[{] assign[member[.row], call[_dataSetSize.intValue, parameter[]]] else begin[{] None end[}] if[binary_operation[binary_operation[member[.row], %, call[.getPageSize, parameter[]]], !=, literal[0]]] begin[{] local_variable[type[int], adjustedPage] return[member[.adjustedPage]] else begin[{] return[member[.row]] end[}] else begin[{] return[member[.DEFAULT_ROW]] end[}] end[}] END[}]
Keyword[public] Keyword[int] identifier[getRow] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[_currentRow] operator[!=] Other[null] operator[SEP] { Keyword[int] identifier[row] operator[=] identifier[_currentRow] operator[SEP] identifier[intValue] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[_dataSetSize] operator[!=] Other[null] operator[&&] operator[SEP] identifier[row] operator[>] identifier[_dataSetSize] operator[SEP] identifier[intValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[row] operator[=] identifier[_dataSetSize] operator[SEP] identifier[intValue] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[row] operator[%] identifier[getPageSize] operator[SEP] operator[SEP] operator[!=] Other[0] operator[SEP] { Keyword[int] identifier[adjustedPage] operator[=] identifier[row] operator[-] operator[SEP] identifier[row] operator[%] identifier[getPageSize] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[adjustedPage] operator[SEP] } Keyword[else] Keyword[return] identifier[row] operator[SEP] } Keyword[else] Keyword[return] identifier[DEFAULT_ROW] operator[SEP] }
@Override public void setAttributeProperties(final String deviceName, final String attributeName, final Map<String, String[]> properties) throws DevFailed { cache.setAttributeProperties(deviceName, attributeName, properties); }
class class_name[name] begin[{] method[setAttributeProperties, return_type[void], modifier[public], parameter[deviceName, attributeName, properties]] begin[{] call[cache.setAttributeProperties, parameter[member[.deviceName], member[.attributeName], member[.properties]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[setAttributeProperties] operator[SEP] Keyword[final] identifier[String] identifier[deviceName] , Keyword[final] identifier[String] identifier[attributeName] , Keyword[final] identifier[Map] operator[<] identifier[String] , identifier[String] operator[SEP] operator[SEP] operator[>] identifier[properties] operator[SEP] Keyword[throws] identifier[DevFailed] { identifier[cache] operator[SEP] identifier[setAttributeProperties] operator[SEP] identifier[deviceName] , identifier[attributeName] , identifier[properties] operator[SEP] operator[SEP] }
String getTransformationPath() { String path = System.getProperty("opencms.config.transform"); if (path == null) { path = CmsStringUtil.joinPaths(m_baseFolder.getAbsolutePath(), DEFAULT_XSLT_FILENAME); } return path; }
class class_name[name] begin[{] method[getTransformationPath, return_type[type[String]], modifier[default], parameter[]] begin[{] local_variable[type[String], path] if[binary_operation[member[.path], ==, literal[null]]] begin[{] assign[member[.path], call[CmsStringUtil.joinPaths, parameter[call[m_baseFolder.getAbsolutePath, parameter[]], member[.DEFAULT_XSLT_FILENAME]]]] else begin[{] None end[}] return[member[.path]] end[}] END[}]
identifier[String] identifier[getTransformationPath] operator[SEP] operator[SEP] { identifier[String] identifier[path] operator[=] identifier[System] operator[SEP] identifier[getProperty] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[path] operator[==] Other[null] operator[SEP] { identifier[path] operator[=] identifier[CmsStringUtil] operator[SEP] identifier[joinPaths] operator[SEP] identifier[m_baseFolder] operator[SEP] identifier[getAbsolutePath] operator[SEP] operator[SEP] , identifier[DEFAULT_XSLT_FILENAME] operator[SEP] operator[SEP] } Keyword[return] identifier[path] operator[SEP] }
public static List<URL> getClasspathURLs(ClassLoader loader) { List<URL> urls = Lists.newArrayList(); if (loader != null) { final Enumeration<URL> resources; try { resources = loader.getResources(""); } catch (IOException e) { throw new RuntimeException(e); } while (resources.hasMoreElements()) { URL location = resources.nextElement(); urls.add(location); } } return urls; }
class class_name[name] begin[{] method[getClasspathURLs, return_type[type[List]], modifier[public static], parameter[loader]] begin[{] local_variable[type[List], urls] if[binary_operation[member[.loader], !=, literal[null]]] begin[{] local_variable[type[Enumeration], resources] TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=resources, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="")], member=getResources, postfix_operators=[], prefix_operators=[], qualifier=loader, selectors=[], type_arguments=None)), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=RuntimeException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IOException']))], finally_block=None, label=None, resources=None) while[call[resources.hasMoreElements, parameter[]]] begin[{] local_variable[type[URL], location] call[urls.add, parameter[member[.location]]] end[}] else begin[{] None end[}] return[member[.urls]] end[}] END[}]
Keyword[public] Keyword[static] identifier[List] operator[<] identifier[URL] operator[>] identifier[getClasspathURLs] operator[SEP] identifier[ClassLoader] identifier[loader] operator[SEP] { identifier[List] operator[<] identifier[URL] operator[>] identifier[urls] operator[=] identifier[Lists] operator[SEP] identifier[newArrayList] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[loader] operator[!=] Other[null] operator[SEP] { Keyword[final] identifier[Enumeration] operator[<] identifier[URL] operator[>] identifier[resources] operator[SEP] Keyword[try] { identifier[resources] operator[=] identifier[loader] operator[SEP] identifier[getResources] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[IOException] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[RuntimeException] operator[SEP] identifier[e] operator[SEP] operator[SEP] } Keyword[while] operator[SEP] identifier[resources] operator[SEP] identifier[hasMoreElements] operator[SEP] operator[SEP] operator[SEP] { identifier[URL] identifier[location] operator[=] identifier[resources] operator[SEP] identifier[nextElement] operator[SEP] operator[SEP] operator[SEP] identifier[urls] operator[SEP] identifier[add] operator[SEP] identifier[location] operator[SEP] operator[SEP] } } Keyword[return] identifier[urls] operator[SEP] }
public void interpret(Specification table) { Example row = table.nextExample(); Action action = Action.parse(actionCells(row)); Date start = new Date(); try { Call call = action.checkAgainst(fitFixture != null ? fitFixture : fixture); call.will(Do.both(Annotate.right(Group.composedOf(keywordCells(row)))).and(countRowOf(table).right())).when(ResultIs.equalTo(true)); call.will(Do.both(Annotate.wrong(Group.composedOf(keywordCells(row)))).and(countRowOf(table).wrong())).when(ResultIs.equalTo(false)); call.will(Do.both(Annotate.exception(CollectionUtil.first(keywordCells(row)))).and(countRowOf(table).exception())).when(ResultIs.exception()); call.execute(); } catch (Exception e) { CollectionUtil.first(keywordCells(row)).annotate(Annotations.exception(e)); reportException(table); } finally { if(timed) { long split = new Date().getTime() - start.getTime(); row.addChild().setContent(Fit.format.format(start)); row.addChild().setContent(split<1000 ? "&nbsp;" : Double.toString((split)/1000.0)); } } }
class class_name[name] begin[{] method[interpret, return_type[void], modifier[public], parameter[table]] begin[{] local_variable[type[Example], row] local_variable[type[Action], action] local_variable[type[Date], start] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=fitFixture, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), if_false=MemberReference(member=fixture, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_true=MemberReference(member=fitFixture, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))], member=checkAgainst, postfix_operators=[], prefix_operators=[], qualifier=action, selectors=[], type_arguments=None), name=call)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Call, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MethodInvocation(arguments=[MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=row, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=keywordCells, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=composedOf, postfix_operators=[], prefix_operators=[], qualifier=Group, selectors=[], type_arguments=None)], member=right, postfix_operators=[], prefix_operators=[], qualifier=Annotate, selectors=[], type_arguments=None)], member=both, postfix_operators=[], prefix_operators=[], qualifier=Do, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=table, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=countRowOf, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[], member=right, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=and, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=will, postfix_operators=[], prefix_operators=[], qualifier=call, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], member=equalTo, postfix_operators=[], prefix_operators=[], qualifier=ResultIs, selectors=[], type_arguments=None)], member=when, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MethodInvocation(arguments=[MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=row, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=keywordCells, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=composedOf, postfix_operators=[], prefix_operators=[], qualifier=Group, selectors=[], type_arguments=None)], member=wrong, postfix_operators=[], prefix_operators=[], qualifier=Annotate, selectors=[], type_arguments=None)], member=both, postfix_operators=[], prefix_operators=[], qualifier=Do, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=table, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=countRowOf, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[], member=wrong, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=and, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=will, postfix_operators=[], prefix_operators=[], qualifier=call, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)], member=equalTo, postfix_operators=[], prefix_operators=[], qualifier=ResultIs, selectors=[], type_arguments=None)], member=when, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MethodInvocation(arguments=[MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=row, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=keywordCells, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=first, postfix_operators=[], prefix_operators=[], qualifier=CollectionUtil, selectors=[], type_arguments=None)], member=exception, postfix_operators=[], prefix_operators=[], qualifier=Annotate, selectors=[], type_arguments=None)], member=both, postfix_operators=[], prefix_operators=[], qualifier=Do, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=table, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=countRowOf, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[], member=exception, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=and, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=will, postfix_operators=[], prefix_operators=[], qualifier=call, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=exception, postfix_operators=[], prefix_operators=[], qualifier=ResultIs, selectors=[], type_arguments=None)], member=when, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=execute, postfix_operators=[], prefix_operators=[], qualifier=call, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=row, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=keywordCells, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=first, postfix_operators=[], prefix_operators=[], qualifier=CollectionUtil, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=exception, postfix_operators=[], prefix_operators=[], qualifier=Annotations, selectors=[], type_arguments=None)], member=annotate, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=table, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=reportException, 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=[IfStatement(condition=MemberReference(member=timed, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[], member=getTime, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=Date, sub_type=None)), operandr=MethodInvocation(arguments=[], member=getTime, postfix_operators=[], prefix_operators=[], qualifier=start, selectors=[], type_arguments=None), operator=-), name=split)], modifiers=set(), type=BasicType(dimensions=[], name=long)), StatementExpression(expression=MethodInvocation(arguments=[], member=addChild, postfix_operators=[], prefix_operators=[], qualifier=row, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=start, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=format, postfix_operators=[], prefix_operators=[], qualifier=Fit.format, selectors=[], type_arguments=None)], member=setContent, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=addChild, postfix_operators=[], prefix_operators=[], qualifier=row, selectors=[MethodInvocation(arguments=[TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=split, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1000), operator=<), if_false=MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=split, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1000.0), operator=/)], member=toString, postfix_operators=[], prefix_operators=[], qualifier=Double, selectors=[], type_arguments=None), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="&nbsp;"))], member=setContent, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)]))], label=None, resources=None) end[}] END[}]
Keyword[public] Keyword[void] identifier[interpret] operator[SEP] identifier[Specification] identifier[table] operator[SEP] { identifier[Example] identifier[row] operator[=] identifier[table] operator[SEP] identifier[nextExample] operator[SEP] operator[SEP] operator[SEP] identifier[Action] identifier[action] operator[=] identifier[Action] operator[SEP] identifier[parse] operator[SEP] identifier[actionCells] operator[SEP] identifier[row] operator[SEP] operator[SEP] operator[SEP] identifier[Date] identifier[start] operator[=] Keyword[new] identifier[Date] operator[SEP] operator[SEP] operator[SEP] Keyword[try] { identifier[Call] identifier[call] operator[=] identifier[action] operator[SEP] identifier[checkAgainst] operator[SEP] identifier[fitFixture] operator[!=] Other[null] operator[?] identifier[fitFixture] operator[:] identifier[fixture] operator[SEP] operator[SEP] identifier[call] operator[SEP] identifier[will] operator[SEP] identifier[Do] operator[SEP] identifier[both] operator[SEP] identifier[Annotate] operator[SEP] identifier[right] operator[SEP] identifier[Group] operator[SEP] identifier[composedOf] operator[SEP] identifier[keywordCells] operator[SEP] identifier[row] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[and] operator[SEP] identifier[countRowOf] operator[SEP] identifier[table] operator[SEP] operator[SEP] identifier[right] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[when] operator[SEP] identifier[ResultIs] operator[SEP] identifier[equalTo] operator[SEP] literal[boolean] operator[SEP] operator[SEP] operator[SEP] identifier[call] operator[SEP] identifier[will] operator[SEP] identifier[Do] operator[SEP] identifier[both] operator[SEP] identifier[Annotate] operator[SEP] identifier[wrong] operator[SEP] identifier[Group] operator[SEP] identifier[composedOf] operator[SEP] identifier[keywordCells] operator[SEP] identifier[row] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[and] operator[SEP] identifier[countRowOf] operator[SEP] identifier[table] operator[SEP] operator[SEP] identifier[wrong] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[when] operator[SEP] identifier[ResultIs] operator[SEP] identifier[equalTo] operator[SEP] literal[boolean] operator[SEP] operator[SEP] operator[SEP] identifier[call] operator[SEP] identifier[will] operator[SEP] identifier[Do] operator[SEP] identifier[both] operator[SEP] identifier[Annotate] operator[SEP] identifier[exception] operator[SEP] identifier[CollectionUtil] operator[SEP] identifier[first] operator[SEP] identifier[keywordCells] operator[SEP] identifier[row] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[and] operator[SEP] identifier[countRowOf] operator[SEP] identifier[table] operator[SEP] operator[SEP] identifier[exception] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[when] operator[SEP] identifier[ResultIs] operator[SEP] identifier[exception] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[call] operator[SEP] identifier[execute] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { identifier[CollectionUtil] operator[SEP] identifier[first] operator[SEP] identifier[keywordCells] operator[SEP] identifier[row] operator[SEP] operator[SEP] operator[SEP] identifier[annotate] operator[SEP] identifier[Annotations] operator[SEP] identifier[exception] operator[SEP] identifier[e] operator[SEP] operator[SEP] operator[SEP] identifier[reportException] operator[SEP] identifier[table] operator[SEP] operator[SEP] } Keyword[finally] { Keyword[if] operator[SEP] identifier[timed] operator[SEP] { Keyword[long] identifier[split] operator[=] Keyword[new] identifier[Date] operator[SEP] operator[SEP] operator[SEP] identifier[getTime] operator[SEP] operator[SEP] operator[-] identifier[start] operator[SEP] identifier[getTime] operator[SEP] operator[SEP] operator[SEP] identifier[row] operator[SEP] identifier[addChild] operator[SEP] operator[SEP] operator[SEP] identifier[setContent] operator[SEP] identifier[Fit] operator[SEP] identifier[format] operator[SEP] identifier[format] operator[SEP] identifier[start] operator[SEP] operator[SEP] operator[SEP] identifier[row] operator[SEP] identifier[addChild] operator[SEP] operator[SEP] operator[SEP] identifier[setContent] operator[SEP] identifier[split] operator[<] Other[1000] operator[?] literal[String] operator[:] identifier[Double] operator[SEP] identifier[toString] operator[SEP] operator[SEP] identifier[split] operator[SEP] operator[/] literal[Float] operator[SEP] operator[SEP] operator[SEP] } } }
protected String getParameterString(Map<String, String> parameters, Class<? extends EndpointConfiguration> endpointConfigurationType) { StringBuilder paramString = new StringBuilder(); for (Map.Entry<String, String> parameterEntry : parameters.entrySet()) { Field field = ReflectionUtils.findField(endpointConfigurationType, parameterEntry.getKey()); if (field == null) { if (paramString.length() == 0) { paramString.append("?").append(parameterEntry.getKey()); if (parameterEntry.getValue() != null) { paramString.append("=").append(parameterEntry.getValue()); } } else { paramString.append("&").append(parameterEntry.getKey()); if (parameterEntry.getValue() != null) { paramString.append("=").append(parameterEntry.getValue()); } } } } return paramString.toString(); }
class class_name[name] begin[{] method[getParameterString, return_type[type[String]], modifier[protected], parameter[parameters, endpointConfigurationType]] begin[{] local_variable[type[StringBuilder], paramString] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=endpointConfigurationType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getKey, postfix_operators=[], prefix_operators=[], qualifier=parameterEntry, selectors=[], type_arguments=None)], member=findField, postfix_operators=[], prefix_operators=[], qualifier=ReflectionUtils, selectors=[], type_arguments=None), name=field)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Field, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=field, 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=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=paramString, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator===), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="&")], member=append, postfix_operators=[], prefix_operators=[], qualifier=paramString, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getKey, postfix_operators=[], prefix_operators=[], qualifier=parameterEntry, selectors=[], type_arguments=None)], member=append, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=parameterEntry, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="=")], member=append, postfix_operators=[], prefix_operators=[], qualifier=paramString, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=parameterEntry, selectors=[], type_arguments=None)], member=append, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)]))]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="?")], member=append, postfix_operators=[], prefix_operators=[], qualifier=paramString, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getKey, postfix_operators=[], prefix_operators=[], qualifier=parameterEntry, selectors=[], type_arguments=None)], member=append, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=parameterEntry, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="=")], member=append, postfix_operators=[], prefix_operators=[], qualifier=paramString, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=parameterEntry, selectors=[], type_arguments=None)], member=append, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)]))]))]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=entrySet, postfix_operators=[], prefix_operators=[], qualifier=parameters, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=parameterEntry)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Map, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=None, name=Entry, sub_type=None)))), label=None) return[call[paramString.toString, parameter[]]] end[}] END[}]
Keyword[protected] identifier[String] identifier[getParameterString] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[parameters] , identifier[Class] operator[<] operator[?] Keyword[extends] identifier[EndpointConfiguration] operator[>] identifier[endpointConfigurationType] operator[SEP] { identifier[StringBuilder] identifier[paramString] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Map] operator[SEP] identifier[Entry] operator[<] identifier[String] , identifier[String] operator[>] identifier[parameterEntry] operator[:] identifier[parameters] operator[SEP] identifier[entrySet] operator[SEP] operator[SEP] operator[SEP] { identifier[Field] identifier[field] operator[=] identifier[ReflectionUtils] operator[SEP] identifier[findField] operator[SEP] identifier[endpointConfigurationType] , identifier[parameterEntry] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[field] operator[==] Other[null] operator[SEP] { Keyword[if] operator[SEP] identifier[paramString] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[==] Other[0] operator[SEP] { identifier[paramString] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[parameterEntry] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[parameterEntry] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] { identifier[paramString] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[parameterEntry] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } Keyword[else] { identifier[paramString] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[parameterEntry] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[parameterEntry] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] { identifier[paramString] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[parameterEntry] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } } } Keyword[return] identifier[paramString] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] }
static Parameter createParameter(final String name, final String value) { if (value != null && isQuoted(value)) { return new QuotedParameter(name, value); } return new Parameter(name, value); }
class class_name[name] begin[{] method[createParameter, return_type[type[Parameter]], modifier[static], parameter[name, value]] begin[{] if[binary_operation[binary_operation[member[.value], !=, literal[null]], &&, call[.isQuoted, parameter[member[.value]]]]] begin[{] return[ClassCreator(arguments=[MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=QuotedParameter, sub_type=None))] else begin[{] None end[}] return[ClassCreator(arguments=[MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Parameter, sub_type=None))] end[}] END[}]
Keyword[static] identifier[Parameter] identifier[createParameter] operator[SEP] Keyword[final] identifier[String] identifier[name] , Keyword[final] identifier[String] identifier[value] operator[SEP] { Keyword[if] operator[SEP] identifier[value] operator[!=] Other[null] operator[&&] identifier[isQuoted] operator[SEP] identifier[value] operator[SEP] operator[SEP] { Keyword[return] Keyword[new] identifier[QuotedParameter] operator[SEP] identifier[name] , identifier[value] operator[SEP] operator[SEP] } Keyword[return] Keyword[new] identifier[Parameter] operator[SEP] identifier[name] , identifier[value] operator[SEP] operator[SEP] }
public void ensureCapacity(int minCapacity) { modCount++; int oldCapacity = elementData.length; if (minCapacity > oldCapacity) { int oldData[] = elementData; int newCapacity = (oldCapacity * 3)/2 + 1; if (newCapacity < minCapacity) newCapacity = minCapacity; elementData = new int[newCapacity]; System.arraycopy(oldData, 0, elementData, 0, size); } }
class class_name[name] begin[{] method[ensureCapacity, return_type[void], modifier[public], parameter[minCapacity]] begin[{] member[.modCount] local_variable[type[int], oldCapacity] if[binary_operation[member[.minCapacity], >, member[.oldCapacity]]] begin[{] local_variable[type[int], oldData] local_variable[type[int], newCapacity] if[binary_operation[member[.newCapacity], <, member[.minCapacity]]] begin[{] assign[member[.newCapacity], member[.minCapacity]] else begin[{] None end[}] assign[member[.elementData], ArrayCreator(dimensions=[MemberReference(member=newCapacity, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=None, name=int))] call[System.arraycopy, parameter[member[.oldData], literal[0], member[.elementData], literal[0], member[.size]]] else begin[{] None end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[ensureCapacity] operator[SEP] Keyword[int] identifier[minCapacity] operator[SEP] { identifier[modCount] operator[++] operator[SEP] Keyword[int] identifier[oldCapacity] operator[=] identifier[elementData] operator[SEP] identifier[length] operator[SEP] Keyword[if] operator[SEP] identifier[minCapacity] operator[>] identifier[oldCapacity] operator[SEP] { Keyword[int] identifier[oldData] operator[SEP] operator[SEP] operator[=] identifier[elementData] operator[SEP] Keyword[int] identifier[newCapacity] operator[=] operator[SEP] identifier[oldCapacity] operator[*] Other[3] operator[SEP] operator[/] Other[2] operator[+] Other[1] operator[SEP] Keyword[if] operator[SEP] identifier[newCapacity] operator[<] identifier[minCapacity] operator[SEP] identifier[newCapacity] operator[=] identifier[minCapacity] operator[SEP] identifier[elementData] operator[=] Keyword[new] Keyword[int] operator[SEP] identifier[newCapacity] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[arraycopy] operator[SEP] identifier[oldData] , Other[0] , identifier[elementData] , Other[0] , identifier[size] operator[SEP] operator[SEP] } }
private void routeMessage(Message message) { Class messageClass = message.getClass(); // Dispatch message to all specific listeners for the message class type if (messageListenerMap.containsKey(messageClass)) { dispatchMessage(messageListenerMap.get(messageClass), message); } // Dispatch message to all generic listeners if (messageListenerMap.containsKey(Message.class)) { dispatchMessage(messageListenerMap.get(Message.class), message); } }
class class_name[name] begin[{] method[routeMessage, return_type[void], modifier[private], parameter[message]] begin[{] local_variable[type[Class], messageClass] if[call[messageListenerMap.containsKey, parameter[member[.messageClass]]]] begin[{] call[.dispatchMessage, parameter[call[messageListenerMap.get, parameter[member[.messageClass]]], member[.message]]] else begin[{] None end[}] if[call[messageListenerMap.containsKey, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Message, sub_type=None))]]] begin[{] call[.dispatchMessage, parameter[call[messageListenerMap.get, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Message, sub_type=None))]], member[.message]]] else begin[{] None end[}] end[}] END[}]
Keyword[private] Keyword[void] identifier[routeMessage] operator[SEP] identifier[Message] identifier[message] operator[SEP] { identifier[Class] identifier[messageClass] operator[=] identifier[message] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[messageListenerMap] operator[SEP] identifier[containsKey] operator[SEP] identifier[messageClass] operator[SEP] operator[SEP] { identifier[dispatchMessage] operator[SEP] identifier[messageListenerMap] operator[SEP] identifier[get] operator[SEP] identifier[messageClass] operator[SEP] , identifier[message] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[messageListenerMap] operator[SEP] identifier[containsKey] operator[SEP] identifier[Message] operator[SEP] Keyword[class] operator[SEP] operator[SEP] { identifier[dispatchMessage] operator[SEP] identifier[messageListenerMap] operator[SEP] identifier[get] operator[SEP] identifier[Message] operator[SEP] Keyword[class] operator[SEP] , identifier[message] operator[SEP] operator[SEP] } }
public <K, V> RedisAsyncConnection<K, V> connectAsync(RedisCodec<K, V> codec) { BlockingQueue<Command<K, V, ?>> queue = new LinkedBlockingQueue<Command<K, V, ?>>(); CommandHandler<K, V> handler = new CommandHandler<K, V>(queue); RedisAsyncConnection<K, V> connection = new RedisAsyncConnection<K, V>(queue, codec, timeout, unit); return connect(handler, connection); }
class class_name[name] begin[{] method[connectAsync, return_type[type[RedisAsyncConnection]], modifier[public], parameter[codec]] begin[{] local_variable[type[BlockingQueue], queue] local_variable[type[CommandHandler], handler] local_variable[type[RedisAsyncConnection], connection] return[call[.connect, parameter[member[.handler], member[.connection]]]] end[}] END[}]
Keyword[public] operator[<] identifier[K] , identifier[V] operator[>] identifier[RedisAsyncConnection] operator[<] identifier[K] , identifier[V] operator[>] identifier[connectAsync] operator[SEP] identifier[RedisCodec] operator[<] identifier[K] , identifier[V] operator[>] identifier[codec] operator[SEP] { identifier[BlockingQueue] operator[<] identifier[Command] operator[<] identifier[K] , identifier[V] , operator[?] operator[>] operator[>] identifier[queue] operator[=] Keyword[new] identifier[LinkedBlockingQueue] operator[<] identifier[Command] operator[<] identifier[K] , identifier[V] , operator[?] operator[>] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[CommandHandler] operator[<] identifier[K] , identifier[V] operator[>] identifier[handler] operator[=] Keyword[new] identifier[CommandHandler] operator[<] identifier[K] , identifier[V] operator[>] operator[SEP] identifier[queue] operator[SEP] operator[SEP] identifier[RedisAsyncConnection] operator[<] identifier[K] , identifier[V] operator[>] identifier[connection] operator[=] Keyword[new] identifier[RedisAsyncConnection] operator[<] identifier[K] , identifier[V] operator[>] operator[SEP] identifier[queue] , identifier[codec] , identifier[timeout] , identifier[unit] operator[SEP] operator[SEP] Keyword[return] identifier[connect] operator[SEP] identifier[handler] , identifier[connection] operator[SEP] operator[SEP] }
@SuppressWarnings("unchecked") @Override public Vector<Long> readVectorUInt() { log.debug("readVectorUInt"); int type = readInteger(); if ((type & 1) == 0) { return (Vector<Long>) getReference(type >> 1); } int len = type >> 1; Vector<Long> array = new Vector<Long>(len); storeReference(array); @SuppressWarnings("unused") int ref2 = readInteger(); for (int j = 0; j < len; ++j) { long value = (buf.get() & 0xff) << 24L; value += (buf.get() & 0xff) << 16L; value += (buf.get() & 0xff) << 8L; value += (buf.get() & 0xff); array.add(value); } return array; }
class class_name[name] begin[{] method[readVectorUInt, return_type[type[Vector]], modifier[public], parameter[]] begin[{] call[log.debug, parameter[literal["readVectorUInt"]]] local_variable[type[int], type] if[binary_operation[binary_operation[member[.type], &, literal[1]], ==, literal[0]]] begin[{] return[Cast(expression=MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=>>)], member=getReference, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Long, sub_type=None))], dimensions=[], name=Vector, sub_type=None))] else begin[{] None end[}] local_variable[type[int], len] local_variable[type[Vector], array] call[.storeReference, parameter[member[.array]]] local_variable[type[int], ref2] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[], member=get, postfix_operators=[], prefix_operators=[], qualifier=buf, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0xff), operator=&), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=24L), operator=<<), name=value)], modifiers=set(), type=BasicType(dimensions=[], name=long)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[], member=get, postfix_operators=[], prefix_operators=[], qualifier=buf, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0xff), operator=&), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=16L), operator=<<)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[], member=get, postfix_operators=[], prefix_operators=[], qualifier=buf, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0xff), operator=&), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=8L), operator=<<)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=BinaryOperation(operandl=MethodInvocation(arguments=[], member=get, postfix_operators=[], prefix_operators=[], qualifier=buf, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0xff), operator=&)), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=array, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=len, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=j)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=j, postfix_operators=[], prefix_operators=['++'], qualifier=, selectors=[])]), label=None) return[member[.array]] end[}] END[}]
annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] annotation[@] identifier[Override] Keyword[public] identifier[Vector] operator[<] identifier[Long] operator[>] identifier[readVectorUInt] operator[SEP] operator[SEP] { identifier[log] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[int] identifier[type] operator[=] identifier[readInteger] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[SEP] identifier[type] operator[&] Other[1] operator[SEP] operator[==] Other[0] operator[SEP] { Keyword[return] operator[SEP] identifier[Vector] operator[<] identifier[Long] operator[>] operator[SEP] identifier[getReference] operator[SEP] identifier[type] operator[>] operator[>] Other[1] operator[SEP] operator[SEP] } Keyword[int] identifier[len] operator[=] identifier[type] operator[>] operator[>] Other[1] operator[SEP] identifier[Vector] operator[<] identifier[Long] operator[>] identifier[array] operator[=] Keyword[new] identifier[Vector] operator[<] identifier[Long] operator[>] operator[SEP] identifier[len] operator[SEP] operator[SEP] identifier[storeReference] operator[SEP] identifier[array] operator[SEP] operator[SEP] annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] Keyword[int] identifier[ref2] operator[=] identifier[readInteger] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[j] operator[=] Other[0] operator[SEP] identifier[j] operator[<] identifier[len] operator[SEP] operator[++] identifier[j] operator[SEP] { Keyword[long] identifier[value] operator[=] operator[SEP] identifier[buf] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[&] literal[Integer] operator[SEP] operator[<<] Other[24L] operator[SEP] identifier[value] operator[+=] operator[SEP] identifier[buf] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[&] literal[Integer] operator[SEP] operator[<<] Other[16L] operator[SEP] identifier[value] operator[+=] operator[SEP] identifier[buf] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[&] literal[Integer] operator[SEP] operator[<<] Other[8L] operator[SEP] identifier[value] operator[+=] operator[SEP] identifier[buf] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[&] literal[Integer] operator[SEP] operator[SEP] identifier[array] operator[SEP] identifier[add] operator[SEP] identifier[value] operator[SEP] operator[SEP] } Keyword[return] identifier[array] operator[SEP] }
@Override public DescribeAssociationExecutionsResult describeAssociationExecutions(DescribeAssociationExecutionsRequest request) { request = beforeClientExecution(request); return executeDescribeAssociationExecutions(request); }
class class_name[name] begin[{] method[describeAssociationExecutions, return_type[type[DescribeAssociationExecutionsResult]], modifier[public], parameter[request]] begin[{] assign[member[.request], call[.beforeClientExecution, parameter[member[.request]]]] return[call[.executeDescribeAssociationExecutions, parameter[member[.request]]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[DescribeAssociationExecutionsResult] identifier[describeAssociationExecutions] operator[SEP] identifier[DescribeAssociationExecutionsRequest] identifier[request] operator[SEP] { identifier[request] operator[=] identifier[beforeClientExecution] operator[SEP] identifier[request] operator[SEP] operator[SEP] Keyword[return] identifier[executeDescribeAssociationExecutions] operator[SEP] identifier[request] operator[SEP] operator[SEP] }
public Resource createRelative(String relativePath) { if (relativePath.startsWith("/")) { relativePath = relativePath.substring(1); } try { return new UrlResource(new URL(url, relativePath)); } catch (MalformedURLException e) { return null; } }
class class_name[name] begin[{] method[createRelative, return_type[type[Resource]], modifier[public], parameter[relativePath]] begin[{] if[call[relativePath.startsWith, parameter[literal["/"]]]] begin[{] assign[member[.relativePath], call[relativePath.substring, parameter[literal[1]]]] else begin[{] None end[}] TryStatement(block=[ReturnStatement(expression=ClassCreator(arguments=[ClassCreator(arguments=[MemberReference(member=url, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=relativePath, 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=URL, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=UrlResource, sub_type=None)), label=None)], catches=[CatchClause(block=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['MalformedURLException']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[public] identifier[Resource] identifier[createRelative] operator[SEP] identifier[String] identifier[relativePath] operator[SEP] { Keyword[if] operator[SEP] identifier[relativePath] operator[SEP] identifier[startsWith] operator[SEP] literal[String] operator[SEP] operator[SEP] { identifier[relativePath] operator[=] identifier[relativePath] operator[SEP] identifier[substring] operator[SEP] Other[1] operator[SEP] operator[SEP] } Keyword[try] { Keyword[return] Keyword[new] identifier[UrlResource] operator[SEP] Keyword[new] identifier[URL] operator[SEP] identifier[url] , identifier[relativePath] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[MalformedURLException] identifier[e] operator[SEP] { Keyword[return] Other[null] operator[SEP] } }
public static Class<?> getClass(Type type) { if (null != type) { if (type instanceof Class) { return (Class<?>) type; } else if (type instanceof ParameterizedType) { return (Class<?>) ((ParameterizedType) type).getRawType(); } else if (type instanceof TypeVariable) { return (Class<?>) ((TypeVariable<?>) type).getBounds()[0]; } else if (type instanceof WildcardType) { final Type[] upperBounds = ((WildcardType) type).getUpperBounds(); if (upperBounds.length == 1) { return getClass(upperBounds[0]); } } } return null; }
class class_name[name] begin[{] method[getClass, return_type[type[Class]], modifier[public static], parameter[type]] begin[{] if[binary_operation[literal[null], !=, member[.type]]] begin[{] if[binary_operation[member[.type], instanceof, type[Class]]] begin[{] return[Cast(expression=MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=[TypeArgument(pattern_type=?, type=None)], dimensions=[], name=Class, sub_type=None))] else begin[{] if[binary_operation[member[.type], instanceof, type[ParameterizedType]]] begin[{] return[Cast(expression=Cast(expression=MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=ParameterizedType, sub_type=None)), type=ReferenceType(arguments=[TypeArgument(pattern_type=?, type=None)], dimensions=[], name=Class, sub_type=None))] else begin[{] if[binary_operation[member[.type], instanceof, type[TypeVariable]]] begin[{] return[Cast(expression=Cast(expression=MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=[TypeArgument(pattern_type=?, type=None)], dimensions=[], name=TypeVariable, sub_type=None)), type=ReferenceType(arguments=[TypeArgument(pattern_type=?, type=None)], dimensions=[], name=Class, sub_type=None))] else begin[{] if[binary_operation[member[.type], instanceof, type[WildcardType]]] begin[{] local_variable[type[Type], upperBounds] if[binary_operation[member[upperBounds.length], ==, literal[1]]] begin[{] return[call[.getClass, parameter[member[.upperBounds]]]] else begin[{] None end[}] else begin[{] None end[}] end[}] end[}] end[}] else begin[{] None end[}] return[literal[null]] end[}] END[}]
Keyword[public] Keyword[static] identifier[Class] operator[<] operator[?] operator[>] identifier[getClass] operator[SEP] identifier[Type] identifier[type] operator[SEP] { Keyword[if] operator[SEP] Other[null] operator[!=] identifier[type] operator[SEP] { Keyword[if] operator[SEP] identifier[type] Keyword[instanceof] identifier[Class] operator[SEP] { Keyword[return] operator[SEP] identifier[Class] operator[<] operator[?] operator[>] operator[SEP] identifier[type] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[type] Keyword[instanceof] identifier[ParameterizedType] operator[SEP] { Keyword[return] operator[SEP] identifier[Class] operator[<] operator[?] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[ParameterizedType] operator[SEP] identifier[type] operator[SEP] operator[SEP] identifier[getRawType] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[type] Keyword[instanceof] identifier[TypeVariable] operator[SEP] { Keyword[return] operator[SEP] identifier[Class] operator[<] operator[?] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[TypeVariable] operator[<] operator[?] operator[>] operator[SEP] identifier[type] operator[SEP] operator[SEP] identifier[getBounds] operator[SEP] operator[SEP] operator[SEP] Other[0] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[type] Keyword[instanceof] identifier[WildcardType] operator[SEP] { Keyword[final] identifier[Type] operator[SEP] operator[SEP] identifier[upperBounds] operator[=] operator[SEP] operator[SEP] identifier[WildcardType] operator[SEP] identifier[type] operator[SEP] operator[SEP] identifier[getUpperBounds] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[upperBounds] operator[SEP] identifier[length] operator[==] Other[1] operator[SEP] { Keyword[return] identifier[getClass] operator[SEP] identifier[upperBounds] operator[SEP] Other[0] operator[SEP] operator[SEP] operator[SEP] } } } Keyword[return] Other[null] operator[SEP] }
public <R> SingleOutputStreamOperator<R> select( final PatternSelectFunction<T, R> patternSelectFunction, final TypeInformation<R> outTypeInfo) { final PatternProcessFunction<T, R> processFunction = fromSelect(builder.clean(patternSelectFunction)).build(); return process(processFunction, outTypeInfo); }
class class_name[name] begin[{] method[select, return_type[type[SingleOutputStreamOperator]], modifier[public], parameter[patternSelectFunction, outTypeInfo]] begin[{] local_variable[type[PatternProcessFunction], processFunction] return[call[.process, parameter[member[.processFunction], member[.outTypeInfo]]]] end[}] END[}]
Keyword[public] operator[<] identifier[R] operator[>] identifier[SingleOutputStreamOperator] operator[<] identifier[R] operator[>] identifier[select] operator[SEP] Keyword[final] identifier[PatternSelectFunction] operator[<] identifier[T] , identifier[R] operator[>] identifier[patternSelectFunction] , Keyword[final] identifier[TypeInformation] operator[<] identifier[R] operator[>] identifier[outTypeInfo] operator[SEP] { Keyword[final] identifier[PatternProcessFunction] operator[<] identifier[T] , identifier[R] operator[>] identifier[processFunction] operator[=] identifier[fromSelect] operator[SEP] identifier[builder] operator[SEP] identifier[clean] operator[SEP] identifier[patternSelectFunction] operator[SEP] operator[SEP] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[process] operator[SEP] identifier[processFunction] , identifier[outTypeInfo] operator[SEP] operator[SEP] }
public List<FacesConfigManagedBeanType<FacesConfigType<T>>> getAllManagedBean() { List<FacesConfigManagedBeanType<FacesConfigType<T>>> list = new ArrayList<FacesConfigManagedBeanType<FacesConfigType<T>>>(); List<Node> nodeList = childNode.get("managed-bean"); for(Node node: nodeList) { FacesConfigManagedBeanType<FacesConfigType<T>> type = new FacesConfigManagedBeanTypeImpl<FacesConfigType<T>>(this, "managed-bean", childNode, node); list.add(type); } return list; }
class class_name[name] begin[{] method[getAllManagedBean, return_type[type[List]], modifier[public], parameter[]] begin[{] local_variable[type[List], list] local_variable[type[List], nodeList] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="managed-bean"), MemberReference(member=childNode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=node, 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=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None))], dimensions=[], name=FacesConfigType, sub_type=None))], dimensions=None, name=FacesConfigManagedBeanTypeImpl, sub_type=None)), name=type)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None))], dimensions=[], name=FacesConfigType, sub_type=None))], dimensions=[], name=FacesConfigManagedBeanType, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=list, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=nodeList, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=node)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Node, sub_type=None))), label=None) return[member[.list]] end[}] END[}]
Keyword[public] identifier[List] operator[<] identifier[FacesConfigManagedBeanType] operator[<] identifier[FacesConfigType] operator[<] identifier[T] operator[>] operator[>] operator[>] identifier[getAllManagedBean] operator[SEP] operator[SEP] { identifier[List] operator[<] identifier[FacesConfigManagedBeanType] operator[<] identifier[FacesConfigType] operator[<] identifier[T] operator[>] operator[>] operator[>] identifier[list] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[FacesConfigManagedBeanType] operator[<] identifier[FacesConfigType] operator[<] identifier[T] operator[>] operator[>] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[Node] operator[>] identifier[nodeList] operator[=] identifier[childNode] operator[SEP] identifier[get] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Node] identifier[node] operator[:] identifier[nodeList] operator[SEP] { identifier[FacesConfigManagedBeanType] operator[<] identifier[FacesConfigType] operator[<] identifier[T] operator[>] operator[>] identifier[type] operator[=] Keyword[new] identifier[FacesConfigManagedBeanTypeImpl] operator[<] identifier[FacesConfigType] operator[<] identifier[T] operator[>] operator[>] operator[SEP] Keyword[this] , literal[String] , identifier[childNode] , identifier[node] operator[SEP] operator[SEP] identifier[list] operator[SEP] identifier[add] operator[SEP] identifier[type] operator[SEP] operator[SEP] } Keyword[return] identifier[list] operator[SEP] }
private void performTransformationStep(TransformationStep step) throws IllegalAccessException { try { TransformationOperation operation = operationLoader.loadTransformationOperationByName(step.getOperationName()); Object value = operation.performOperation(getSourceFieldValues(step), step.getOperationParams()); setObjectToTargetField(step.getTargetField(), value); } catch (TransformationStepException e) { LOGGER.debug(e.getMessage(), e); } catch (Exception e) { LOGGER.error("Unable to perform transformation step {}.", step, e); } }
class class_name[name] begin[{] method[performTransformationStep, return_type[void], modifier[private], parameter[step]] begin[{] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getOperationName, postfix_operators=[], prefix_operators=[], qualifier=step, selectors=[], type_arguments=None)], member=loadTransformationOperationByName, postfix_operators=[], prefix_operators=[], qualifier=operationLoader, selectors=[], type_arguments=None), name=operation)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=TransformationOperation, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=step, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getSourceFieldValues, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getOperationParams, postfix_operators=[], prefix_operators=[], qualifier=step, selectors=[], type_arguments=None)], member=performOperation, postfix_operators=[], prefix_operators=[], qualifier=operation, selectors=[], type_arguments=None), name=value)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getTargetField, postfix_operators=[], prefix_operators=[], qualifier=step, selectors=[], type_arguments=None), MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setObjectToTargetField, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=debug, postfix_operators=[], prefix_operators=[], qualifier=LOGGER, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['TransformationStepException'])), CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unable to perform transformation step {}."), MemberReference(member=step, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=LOGGER, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[private] Keyword[void] identifier[performTransformationStep] operator[SEP] identifier[TransformationStep] identifier[step] operator[SEP] Keyword[throws] identifier[IllegalAccessException] { Keyword[try] { identifier[TransformationOperation] identifier[operation] operator[=] identifier[operationLoader] operator[SEP] identifier[loadTransformationOperationByName] operator[SEP] identifier[step] operator[SEP] identifier[getOperationName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[Object] identifier[value] operator[=] identifier[operation] operator[SEP] identifier[performOperation] operator[SEP] identifier[getSourceFieldValues] operator[SEP] identifier[step] operator[SEP] , identifier[step] operator[SEP] identifier[getOperationParams] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[setObjectToTargetField] operator[SEP] identifier[step] operator[SEP] identifier[getTargetField] operator[SEP] operator[SEP] , identifier[value] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[TransformationStepException] identifier[e] operator[SEP] { identifier[LOGGER] operator[SEP] identifier[debug] operator[SEP] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { identifier[LOGGER] operator[SEP] identifier[error] operator[SEP] literal[String] , identifier[step] , identifier[e] operator[SEP] operator[SEP] } }
public void setPerspective(double fov, double aspect, double zNear, double zFar) { matrixMode(MatrixMode.PROJECTION); resetMatrix(); glu.gluPerspective(fov, aspect, zNear, zFar); matrixMode(MatrixMode.MODELVIEW); resetMatrix(); }
class class_name[name] begin[{] method[setPerspective, return_type[void], modifier[public], parameter[fov, aspect, zNear, zFar]] begin[{] call[.matrixMode, parameter[member[MatrixMode.PROJECTION]]] call[.resetMatrix, parameter[]] call[glu.gluPerspective, parameter[member[.fov], member[.aspect], member[.zNear], member[.zFar]]] call[.matrixMode, parameter[member[MatrixMode.MODELVIEW]]] call[.resetMatrix, parameter[]] end[}] END[}]
Keyword[public] Keyword[void] identifier[setPerspective] operator[SEP] Keyword[double] identifier[fov] , Keyword[double] identifier[aspect] , Keyword[double] identifier[zNear] , Keyword[double] identifier[zFar] operator[SEP] { identifier[matrixMode] operator[SEP] identifier[MatrixMode] operator[SEP] identifier[PROJECTION] operator[SEP] operator[SEP] identifier[resetMatrix] operator[SEP] operator[SEP] operator[SEP] identifier[glu] operator[SEP] identifier[gluPerspective] operator[SEP] identifier[fov] , identifier[aspect] , identifier[zNear] , identifier[zFar] operator[SEP] operator[SEP] identifier[matrixMode] operator[SEP] identifier[MatrixMode] operator[SEP] identifier[MODELVIEW] operator[SEP] operator[SEP] identifier[resetMatrix] operator[SEP] operator[SEP] operator[SEP] }
@Check public void checkManualInlineDefinition(XtendAnnotationTarget annotationTarget) { if (!isIgnored(MANUAL_INLINE_DEFINITION)) { if (annotationTarget.getAnnotations().isEmpty() || !isRelevantAnnotationTarget(annotationTarget)) { return; } final String inlineAnnotation = Inline.class.getName(); for (final XAnnotation annotation : annotationTarget.getAnnotations()) { final JvmType type = annotation.getAnnotationType(); if (type != null && !type.eIsProxy()) { if (Objects.equal(type.getIdentifier(), inlineAnnotation)) { addIssue( Messages.SARLValidator_16, annotation, MANUAL_INLINE_DEFINITION); } } } } }
class class_name[name] begin[{] method[checkManualInlineDefinition, return_type[void], modifier[public], parameter[annotationTarget]] begin[{] if[call[.isIgnored, parameter[member[.MANUAL_INLINE_DEFINITION]]]] begin[{] if[binary_operation[call[annotationTarget.getAnnotations, parameter[]], ||, call[.isRelevantAnnotationTarget, parameter[member[.annotationTarget]]]]] begin[{] return[None] else begin[{] None end[}] local_variable[type[String], inlineAnnotation] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getAnnotationType, postfix_operators=[], prefix_operators=[], qualifier=annotation, selectors=[], type_arguments=None), name=type)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=JvmType, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operandr=MethodInvocation(arguments=[], member=eIsProxy, postfix_operators=[], prefix_operators=['!'], qualifier=type, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getIdentifier, postfix_operators=[], prefix_operators=[], qualifier=type, selectors=[], type_arguments=None), MemberReference(member=inlineAnnotation, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equal, postfix_operators=[], prefix_operators=[], qualifier=Objects, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=SARLValidator_16, postfix_operators=[], prefix_operators=[], qualifier=Messages, selectors=[]), MemberReference(member=annotation, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=MANUAL_INLINE_DEFINITION, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addIssue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]))]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getAnnotations, postfix_operators=[], prefix_operators=[], qualifier=annotationTarget, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=annotation)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=XAnnotation, sub_type=None))), label=None) else begin[{] None end[}] end[}] END[}]
annotation[@] identifier[Check] Keyword[public] Keyword[void] identifier[checkManualInlineDefinition] operator[SEP] identifier[XtendAnnotationTarget] identifier[annotationTarget] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[isIgnored] operator[SEP] identifier[MANUAL_INLINE_DEFINITION] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[annotationTarget] operator[SEP] identifier[getAnnotations] operator[SEP] operator[SEP] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[||] operator[!] identifier[isRelevantAnnotationTarget] operator[SEP] identifier[annotationTarget] operator[SEP] operator[SEP] { Keyword[return] operator[SEP] } Keyword[final] identifier[String] identifier[inlineAnnotation] operator[=] identifier[Inline] operator[SEP] Keyword[class] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[final] identifier[XAnnotation] identifier[annotation] operator[:] identifier[annotationTarget] operator[SEP] identifier[getAnnotations] operator[SEP] operator[SEP] operator[SEP] { Keyword[final] identifier[JvmType] identifier[type] operator[=] identifier[annotation] operator[SEP] identifier[getAnnotationType] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[type] operator[!=] Other[null] operator[&&] operator[!] identifier[type] operator[SEP] identifier[eIsProxy] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[Objects] operator[SEP] identifier[equal] operator[SEP] identifier[type] operator[SEP] identifier[getIdentifier] operator[SEP] operator[SEP] , identifier[inlineAnnotation] operator[SEP] operator[SEP] { identifier[addIssue] operator[SEP] identifier[Messages] operator[SEP] identifier[SARLValidator_16] , identifier[annotation] , identifier[MANUAL_INLINE_DEFINITION] operator[SEP] operator[SEP] } } } } }
public Optional<ZonedDateTime> nextExecution(final ZonedDateTime date) { Preconditions.checkNotNull(date); try { ZonedDateTime nextMatch = nextClosestMatch(date); if (nextMatch.equals(date)) { nextMatch = nextClosestMatch(date.plusSeconds(1)); } return Optional.of(nextMatch); } catch (final NoSuchValueException e) { return Optional.empty(); } }
class class_name[name] begin[{] method[nextExecution, return_type[type[Optional]], modifier[public], parameter[date]] begin[{] call[Preconditions.checkNotNull, parameter[member[.date]]] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=date, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=nextClosestMatch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=nextMatch)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ZonedDateTime, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=date, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equals, postfix_operators=[], prefix_operators=[], qualifier=nextMatch, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=nextMatch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], member=plusSeconds, postfix_operators=[], prefix_operators=[], qualifier=date, selectors=[], type_arguments=None)], member=nextClosestMatch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None)])), ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=nextMatch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=of, postfix_operators=[], prefix_operators=[], qualifier=Optional, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ReturnStatement(expression=MethodInvocation(arguments=[], member=empty, postfix_operators=[], prefix_operators=[], qualifier=Optional, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['NoSuchValueException']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[public] identifier[Optional] operator[<] identifier[ZonedDateTime] operator[>] identifier[nextExecution] operator[SEP] Keyword[final] identifier[ZonedDateTime] identifier[date] operator[SEP] { identifier[Preconditions] operator[SEP] identifier[checkNotNull] operator[SEP] identifier[date] operator[SEP] operator[SEP] Keyword[try] { identifier[ZonedDateTime] identifier[nextMatch] operator[=] identifier[nextClosestMatch] operator[SEP] identifier[date] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[nextMatch] operator[SEP] identifier[equals] operator[SEP] identifier[date] operator[SEP] operator[SEP] { identifier[nextMatch] operator[=] identifier[nextClosestMatch] operator[SEP] identifier[date] operator[SEP] identifier[plusSeconds] operator[SEP] Other[1] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[Optional] operator[SEP] identifier[of] operator[SEP] identifier[nextMatch] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] Keyword[final] identifier[NoSuchValueException] identifier[e] operator[SEP] { Keyword[return] identifier[Optional] operator[SEP] identifier[empty] operator[SEP] operator[SEP] operator[SEP] } }
@Deprecated public static String select(String string, CodePointPredicate predicate) { return StringIterate.selectCodePoint(string, predicate); }
class class_name[name] begin[{] method[select, return_type[type[String]], modifier[public static], parameter[string, predicate]] begin[{] return[call[StringIterate.selectCodePoint, parameter[member[.string], member[.predicate]]]] end[}] END[}]
annotation[@] identifier[Deprecated] Keyword[public] Keyword[static] identifier[String] identifier[select] operator[SEP] identifier[String] identifier[string] , identifier[CodePointPredicate] identifier[predicate] operator[SEP] { Keyword[return] identifier[StringIterate] operator[SEP] identifier[selectCodePoint] operator[SEP] identifier[string] , identifier[predicate] operator[SEP] operator[SEP] }
@SuppressWarnings("deprecation") ServerConfig buildServerConfig() { vallidateServerConfig(); final int serverPort = SimpleOptional.ofNullable(port).orElse(transportStrategy.getDefaultServerPort()); return new ServerConfigImpl(assumeNonNull(getHost()), serverPort, getUsername(), getPassword()); }
class class_name[name] begin[{] method[buildServerConfig, return_type[type[ServerConfig]], modifier[default], parameter[]] begin[{] call[.vallidateServerConfig, parameter[]] local_variable[type[int], serverPort] return[ClassCreator(arguments=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getHost, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=assumeNonNull, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), MemberReference(member=serverPort, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getUsername, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getPassword, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ServerConfigImpl, sub_type=None))] end[}] END[}]
annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] identifier[ServerConfig] identifier[buildServerConfig] operator[SEP] operator[SEP] { identifier[vallidateServerConfig] operator[SEP] operator[SEP] operator[SEP] Keyword[final] Keyword[int] identifier[serverPort] operator[=] identifier[SimpleOptional] operator[SEP] identifier[ofNullable] operator[SEP] identifier[port] operator[SEP] operator[SEP] identifier[orElse] operator[SEP] identifier[transportStrategy] operator[SEP] identifier[getDefaultServerPort] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[ServerConfigImpl] operator[SEP] identifier[assumeNonNull] operator[SEP] identifier[getHost] operator[SEP] operator[SEP] operator[SEP] , identifier[serverPort] , identifier[getUsername] operator[SEP] operator[SEP] , identifier[getPassword] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
static void delete(long ledgerId, BookKeeper bookKeeper) throws DurableDataLogException { try { Exceptions.handleInterrupted(() -> bookKeeper.deleteLedger(ledgerId)); } catch (BKException bkEx) { throw new DurableDataLogException(String.format("Unable to delete Ledger %d.", ledgerId), bkEx); } }
class class_name[name] begin[{] method[delete, return_type[void], modifier[static], parameter[ledgerId, bookKeeper]] begin[{] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[LambdaExpression(body=MethodInvocation(arguments=[MemberReference(member=ledgerId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=deleteLedger, postfix_operators=[], prefix_operators=[], qualifier=bookKeeper, selectors=[], type_arguments=None), parameters=[])], member=handleInterrupted, postfix_operators=[], prefix_operators=[], qualifier=Exceptions, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unable to delete Ledger %d."), MemberReference(member=ledgerId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=format, postfix_operators=[], prefix_operators=[], qualifier=String, selectors=[], type_arguments=None), MemberReference(member=bkEx, 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=DurableDataLogException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=bkEx, types=['BKException']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[static] Keyword[void] identifier[delete] operator[SEP] Keyword[long] identifier[ledgerId] , identifier[BookKeeper] identifier[bookKeeper] operator[SEP] Keyword[throws] identifier[DurableDataLogException] { Keyword[try] { identifier[Exceptions] operator[SEP] identifier[handleInterrupted] operator[SEP] operator[SEP] operator[SEP] operator[->] identifier[bookKeeper] operator[SEP] identifier[deleteLedger] operator[SEP] identifier[ledgerId] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[BKException] identifier[bkEx] operator[SEP] { Keyword[throw] Keyword[new] identifier[DurableDataLogException] operator[SEP] identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[ledgerId] operator[SEP] , identifier[bkEx] operator[SEP] operator[SEP] } }
public void setBoolean(Enum<?> key, boolean value) { if (key == null) { return; } setBoolean(key.name(), value); }
class class_name[name] begin[{] method[setBoolean, return_type[void], modifier[public], parameter[key, value]] begin[{] if[binary_operation[member[.key], ==, literal[null]]] begin[{] return[None] else begin[{] None end[}] call[.setBoolean, parameter[call[key.name, parameter[]], member[.value]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[setBoolean] operator[SEP] identifier[Enum] operator[<] operator[?] operator[>] identifier[key] , Keyword[boolean] identifier[value] operator[SEP] { Keyword[if] operator[SEP] identifier[key] operator[==] Other[null] operator[SEP] { Keyword[return] operator[SEP] } identifier[setBoolean] operator[SEP] identifier[key] operator[SEP] identifier[name] operator[SEP] operator[SEP] , identifier[value] operator[SEP] operator[SEP] }
public Observable<ServiceResponse<AzureVMResourceFeatureSupportResponseInner>> validateWithServiceResponseAsync(String azureRegion, FeatureSupportRequest parameters) { if (azureRegion == null) { throw new IllegalArgumentException("Parameter azureRegion is required and cannot be null."); } if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } if (parameters == null) { throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); } Validator.validate(parameters); final String apiVersion = "2017-07-01"; return service.validate(azureRegion, this.client.subscriptionId(), apiVersion, parameters, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<AzureVMResourceFeatureSupportResponseInner>>>() { @Override public Observable<ServiceResponse<AzureVMResourceFeatureSupportResponseInner>> call(Response<ResponseBody> response) { try { ServiceResponse<AzureVMResourceFeatureSupportResponseInner> clientResponse = validateDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); } } }); }
class class_name[name] begin[{] method[validateWithServiceResponseAsync, return_type[type[Observable]], modifier[public], parameter[azureRegion, parameters]] begin[{] if[binary_operation[member[.azureRegion], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Parameter azureRegion is required and cannot be null.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None) else begin[{] None end[}] if[binary_operation[THIS[member[None.client]call[None.subscriptionId, parameter[]]], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Parameter this.client.subscriptionId() is required and cannot be null.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None) else begin[{] None end[}] if[binary_operation[member[.parameters], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Parameter parameters is required and cannot be null.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None) else begin[{] None end[}] call[Validator.validate, parameter[member[.parameters]]] local_variable[type[String], apiVersion] return[call[service.validate, parameter[member[.azureRegion], THIS[member[None.client]call[None.subscriptionId, parameter[]]], member[.apiVersion], member[.parameters], THIS[member[None.client]call[None.acceptLanguage, parameter[]]], THIS[member[None.client]call[None.userAgent, parameter[]]]]]] end[}] END[}]
Keyword[public] identifier[Observable] operator[<] identifier[ServiceResponse] operator[<] identifier[AzureVMResourceFeatureSupportResponseInner] operator[>] operator[>] identifier[validateWithServiceResponseAsync] operator[SEP] identifier[String] identifier[azureRegion] , identifier[FeatureSupportRequest] identifier[parameters] operator[SEP] { Keyword[if] operator[SEP] identifier[azureRegion] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[client] operator[SEP] identifier[subscriptionId] operator[SEP] operator[SEP] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[parameters] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] } identifier[Validator] operator[SEP] identifier[validate] operator[SEP] identifier[parameters] operator[SEP] operator[SEP] Keyword[final] identifier[String] identifier[apiVersion] operator[=] literal[String] operator[SEP] Keyword[return] identifier[service] operator[SEP] identifier[validate] operator[SEP] identifier[azureRegion] , Keyword[this] operator[SEP] identifier[client] operator[SEP] identifier[subscriptionId] operator[SEP] operator[SEP] , identifier[apiVersion] , identifier[parameters] , Keyword[this] operator[SEP] identifier[client] operator[SEP] identifier[acceptLanguage] operator[SEP] operator[SEP] , Keyword[this] operator[SEP] identifier[client] operator[SEP] identifier[userAgent] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[flatMap] operator[SEP] Keyword[new] identifier[Func1] operator[<] identifier[Response] operator[<] identifier[ResponseBody] operator[>] , identifier[Observable] operator[<] identifier[ServiceResponse] operator[<] identifier[AzureVMResourceFeatureSupportResponseInner] operator[>] operator[>] operator[>] operator[SEP] operator[SEP] { annotation[@] identifier[Override] Keyword[public] identifier[Observable] operator[<] identifier[ServiceResponse] operator[<] identifier[AzureVMResourceFeatureSupportResponseInner] operator[>] operator[>] identifier[call] operator[SEP] identifier[Response] operator[<] identifier[ResponseBody] operator[>] identifier[response] operator[SEP] { Keyword[try] { identifier[ServiceResponse] operator[<] identifier[AzureVMResourceFeatureSupportResponseInner] operator[>] identifier[clientResponse] operator[=] identifier[validateDelegate] operator[SEP] identifier[response] operator[SEP] operator[SEP] Keyword[return] identifier[Observable] operator[SEP] identifier[just] operator[SEP] identifier[clientResponse] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Throwable] identifier[t] operator[SEP] { Keyword[return] identifier[Observable] operator[SEP] identifier[error] operator[SEP] identifier[t] operator[SEP] operator[SEP] } } } operator[SEP] operator[SEP] }
public void setMonetaryDecimalSeparatorString(String sep) { if (sep == null) { throw new NullPointerException("The input monetary decimal separator is null"); } this.monetarySeparatorString = sep; if (sep.length() == 1) { this.monetarySeparator = sep.charAt(0); } else { // Use default decimap separator character as fallbacl this.monetarySeparator = DEF_DECIMAL_SEPARATOR; } }
class class_name[name] begin[{] method[setMonetaryDecimalSeparatorString, return_type[void], modifier[public], parameter[sep]] begin[{] if[binary_operation[member[.sep], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="The input monetary decimal separator is null")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=NullPointerException, sub_type=None)), label=None) else begin[{] None end[}] assign[THIS[member[None.monetarySeparatorString]], member[.sep]] if[binary_operation[call[sep.length, parameter[]], ==, literal[1]]] begin[{] assign[THIS[member[None.monetarySeparator]], call[sep.charAt, parameter[literal[0]]]] else begin[{] assign[THIS[member[None.monetarySeparator]], member[.DEF_DECIMAL_SEPARATOR]] end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[setMonetaryDecimalSeparatorString] operator[SEP] identifier[String] identifier[sep] operator[SEP] { Keyword[if] operator[SEP] identifier[sep] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[NullPointerException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[this] operator[SEP] identifier[monetarySeparatorString] operator[=] identifier[sep] operator[SEP] Keyword[if] operator[SEP] identifier[sep] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[==] Other[1] operator[SEP] { Keyword[this] operator[SEP] identifier[monetarySeparator] operator[=] identifier[sep] operator[SEP] identifier[charAt] operator[SEP] Other[0] operator[SEP] operator[SEP] } Keyword[else] { Keyword[this] operator[SEP] identifier[monetarySeparator] operator[=] identifier[DEF_DECIMAL_SEPARATOR] operator[SEP] } }
@HiddenApi @Implementation(minSdk = LOLLIPOP) public void recycleUnchecked() { if (getApiLevel() >= LOLLIPOP) { unschedule(); directlyOn(realMessage, Message.class, "recycleUnchecked"); } else { // provide forward compatibility with SDK 21. recycle(); } }
class class_name[name] begin[{] method[recycleUnchecked, return_type[void], modifier[public], parameter[]] begin[{] if[binary_operation[call[.getApiLevel, parameter[]], >=, member[.LOLLIPOP]]] begin[{] call[.unschedule, parameter[]] call[.directlyOn, parameter[member[.realMessage], ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Message, sub_type=None)), literal["recycleUnchecked"]]] else begin[{] call[.recycle, parameter[]] end[}] end[}] END[}]
annotation[@] identifier[HiddenApi] annotation[@] identifier[Implementation] operator[SEP] identifier[minSdk] operator[=] identifier[LOLLIPOP] operator[SEP] Keyword[public] Keyword[void] identifier[recycleUnchecked] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[getApiLevel] operator[SEP] operator[SEP] operator[>=] identifier[LOLLIPOP] operator[SEP] { identifier[unschedule] operator[SEP] operator[SEP] operator[SEP] identifier[directlyOn] operator[SEP] identifier[realMessage] , identifier[Message] operator[SEP] Keyword[class] , literal[String] operator[SEP] operator[SEP] } Keyword[else] { identifier[recycle] operator[SEP] operator[SEP] operator[SEP] } }
public final int[] getTable (final int offset) { final int[] table = new int[SIZE_OF_TABLE]; long numberToCalculate; for (int number = 0; number < table.length; number++) { numberToCalculate = Integer.reverseBytes(Integer.reverse(number)); table[number] = calculateCRC32(numberToCalculate << offset); } return table; }
class class_name[name] begin[{] method[getTable, return_type[type[int]], modifier[final public], parameter[offset]] begin[{] local_variable[type[int], table] local_variable[type[long], numberToCalculate] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=numberToCalculate, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=number, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=reverse, postfix_operators=[], prefix_operators=[], qualifier=Integer, selectors=[], type_arguments=None)], member=reverseBytes, postfix_operators=[], prefix_operators=[], qualifier=Integer, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=table, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=number, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=numberToCalculate, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=offset, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<<)], member=calculateCRC32, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=number, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=table, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=number)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=number, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) return[member[.table]] end[}] END[}]
Keyword[public] Keyword[final] Keyword[int] operator[SEP] operator[SEP] identifier[getTable] operator[SEP] Keyword[final] Keyword[int] identifier[offset] operator[SEP] { Keyword[final] Keyword[int] operator[SEP] operator[SEP] identifier[table] operator[=] Keyword[new] Keyword[int] operator[SEP] identifier[SIZE_OF_TABLE] operator[SEP] operator[SEP] Keyword[long] identifier[numberToCalculate] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[number] operator[=] Other[0] operator[SEP] identifier[number] operator[<] identifier[table] operator[SEP] identifier[length] operator[SEP] identifier[number] operator[++] operator[SEP] { identifier[numberToCalculate] operator[=] identifier[Integer] operator[SEP] identifier[reverseBytes] operator[SEP] identifier[Integer] operator[SEP] identifier[reverse] operator[SEP] identifier[number] operator[SEP] operator[SEP] operator[SEP] identifier[table] operator[SEP] identifier[number] operator[SEP] operator[=] identifier[calculateCRC32] operator[SEP] identifier[numberToCalculate] operator[<<] identifier[offset] operator[SEP] operator[SEP] } Keyword[return] identifier[table] operator[SEP] }
@GwtIncompatible("incompatible method") private static boolean arrayMemberEquals(final Class<?> componentType, final Object o1, final Object o2) { if (componentType.isAnnotation()) { return annotationArrayMemberEquals((Annotation[]) o1, (Annotation[]) o2); } if (componentType.equals(Byte.TYPE)) { return Arrays.equals((byte[]) o1, (byte[]) o2); } if (componentType.equals(Short.TYPE)) { return Arrays.equals((short[]) o1, (short[]) o2); } if (componentType.equals(Integer.TYPE)) { return Arrays.equals((int[]) o1, (int[]) o2); } if (componentType.equals(Character.TYPE)) { return Arrays.equals((char[]) o1, (char[]) o2); } if (componentType.equals(Long.TYPE)) { return Arrays.equals((long[]) o1, (long[]) o2); } if (componentType.equals(Float.TYPE)) { return Arrays.equals((float[]) o1, (float[]) o2); } if (componentType.equals(Double.TYPE)) { return Arrays.equals((double[]) o1, (double[]) o2); } if (componentType.equals(Boolean.TYPE)) { return Arrays.equals((boolean[]) o1, (boolean[]) o2); } return Arrays.equals((Object[]) o1, (Object[]) o2); }
class class_name[name] begin[{] method[arrayMemberEquals, return_type[type[boolean]], modifier[private static], parameter[componentType, o1, o2]] begin[{] if[call[componentType.isAnnotation, parameter[]]] begin[{] return[call[.annotationArrayMemberEquals, parameter[Cast(expression=MemberReference(member=o1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[None], name=Annotation, sub_type=None)), Cast(expression=MemberReference(member=o2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[None], name=Annotation, sub_type=None))]]] else begin[{] None end[}] if[call[componentType.equals, parameter[member[Byte.TYPE]]]] begin[{] return[call[Arrays.equals, parameter[Cast(expression=MemberReference(member=o1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=BasicType(dimensions=[None], name=byte)), Cast(expression=MemberReference(member=o2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=BasicType(dimensions=[None], name=byte))]]] else begin[{] None end[}] if[call[componentType.equals, parameter[member[Short.TYPE]]]] begin[{] return[call[Arrays.equals, parameter[Cast(expression=MemberReference(member=o1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=BasicType(dimensions=[None], name=short)), Cast(expression=MemberReference(member=o2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=BasicType(dimensions=[None], name=short))]]] else begin[{] None end[}] if[call[componentType.equals, parameter[member[Integer.TYPE]]]] begin[{] return[call[Arrays.equals, parameter[Cast(expression=MemberReference(member=o1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=BasicType(dimensions=[None], name=int)), Cast(expression=MemberReference(member=o2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=BasicType(dimensions=[None], name=int))]]] else begin[{] None end[}] if[call[componentType.equals, parameter[member[Character.TYPE]]]] begin[{] return[call[Arrays.equals, parameter[Cast(expression=MemberReference(member=o1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=BasicType(dimensions=[None], name=char)), Cast(expression=MemberReference(member=o2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=BasicType(dimensions=[None], name=char))]]] else begin[{] None end[}] if[call[componentType.equals, parameter[member[Long.TYPE]]]] begin[{] return[call[Arrays.equals, parameter[Cast(expression=MemberReference(member=o1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=BasicType(dimensions=[None], name=long)), Cast(expression=MemberReference(member=o2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=BasicType(dimensions=[None], name=long))]]] else begin[{] None end[}] if[call[componentType.equals, parameter[member[Float.TYPE]]]] begin[{] return[call[Arrays.equals, parameter[Cast(expression=MemberReference(member=o1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=BasicType(dimensions=[None], name=float)), Cast(expression=MemberReference(member=o2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=BasicType(dimensions=[None], name=float))]]] else begin[{] None end[}] if[call[componentType.equals, parameter[member[Double.TYPE]]]] begin[{] return[call[Arrays.equals, parameter[Cast(expression=MemberReference(member=o1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=BasicType(dimensions=[None], name=double)), Cast(expression=MemberReference(member=o2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=BasicType(dimensions=[None], name=double))]]] else begin[{] None end[}] if[call[componentType.equals, parameter[member[Boolean.TYPE]]]] begin[{] return[call[Arrays.equals, parameter[Cast(expression=MemberReference(member=o1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=BasicType(dimensions=[None], name=boolean)), Cast(expression=MemberReference(member=o2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=BasicType(dimensions=[None], name=boolean))]]] else begin[{] None end[}] return[call[Arrays.equals, parameter[Cast(expression=MemberReference(member=o1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[None], name=Object, sub_type=None)), Cast(expression=MemberReference(member=o2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[None], name=Object, sub_type=None))]]] end[}] END[}]
annotation[@] identifier[GwtIncompatible] operator[SEP] literal[String] operator[SEP] Keyword[private] Keyword[static] Keyword[boolean] identifier[arrayMemberEquals] operator[SEP] Keyword[final] identifier[Class] operator[<] operator[?] operator[>] identifier[componentType] , Keyword[final] identifier[Object] identifier[o1] , Keyword[final] identifier[Object] identifier[o2] operator[SEP] { Keyword[if] operator[SEP] identifier[componentType] operator[SEP] identifier[isAnnotation] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] identifier[annotationArrayMemberEquals] operator[SEP] operator[SEP] identifier[Annotation] operator[SEP] operator[SEP] operator[SEP] identifier[o1] , operator[SEP] identifier[Annotation] operator[SEP] operator[SEP] operator[SEP] identifier[o2] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[componentType] operator[SEP] identifier[equals] operator[SEP] identifier[Byte] operator[SEP] identifier[TYPE] operator[SEP] operator[SEP] { Keyword[return] identifier[Arrays] operator[SEP] identifier[equals] operator[SEP] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] operator[SEP] identifier[o1] , operator[SEP] Keyword[byte] operator[SEP] operator[SEP] operator[SEP] identifier[o2] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[componentType] operator[SEP] identifier[equals] operator[SEP] identifier[Short] operator[SEP] identifier[TYPE] operator[SEP] operator[SEP] { Keyword[return] identifier[Arrays] operator[SEP] identifier[equals] operator[SEP] operator[SEP] Keyword[short] operator[SEP] operator[SEP] operator[SEP] identifier[o1] , operator[SEP] Keyword[short] operator[SEP] operator[SEP] operator[SEP] identifier[o2] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[componentType] operator[SEP] identifier[equals] operator[SEP] identifier[Integer] operator[SEP] identifier[TYPE] operator[SEP] operator[SEP] { Keyword[return] identifier[Arrays] operator[SEP] identifier[equals] operator[SEP] operator[SEP] Keyword[int] operator[SEP] operator[SEP] operator[SEP] identifier[o1] , operator[SEP] Keyword[int] operator[SEP] operator[SEP] operator[SEP] identifier[o2] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[componentType] operator[SEP] identifier[equals] operator[SEP] identifier[Character] operator[SEP] identifier[TYPE] operator[SEP] operator[SEP] { Keyword[return] identifier[Arrays] operator[SEP] identifier[equals] operator[SEP] operator[SEP] Keyword[char] operator[SEP] operator[SEP] operator[SEP] identifier[o1] , operator[SEP] Keyword[char] operator[SEP] operator[SEP] operator[SEP] identifier[o2] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[componentType] operator[SEP] identifier[equals] operator[SEP] identifier[Long] operator[SEP] identifier[TYPE] operator[SEP] operator[SEP] { Keyword[return] identifier[Arrays] operator[SEP] identifier[equals] operator[SEP] operator[SEP] Keyword[long] operator[SEP] operator[SEP] operator[SEP] identifier[o1] , operator[SEP] Keyword[long] operator[SEP] operator[SEP] operator[SEP] identifier[o2] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[componentType] operator[SEP] identifier[equals] operator[SEP] identifier[Float] operator[SEP] identifier[TYPE] operator[SEP] operator[SEP] { Keyword[return] identifier[Arrays] operator[SEP] identifier[equals] operator[SEP] operator[SEP] Keyword[float] operator[SEP] operator[SEP] operator[SEP] identifier[o1] , operator[SEP] Keyword[float] operator[SEP] operator[SEP] operator[SEP] identifier[o2] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[componentType] operator[SEP] identifier[equals] operator[SEP] identifier[Double] operator[SEP] identifier[TYPE] operator[SEP] operator[SEP] { Keyword[return] identifier[Arrays] operator[SEP] identifier[equals] operator[SEP] operator[SEP] Keyword[double] operator[SEP] operator[SEP] operator[SEP] identifier[o1] , operator[SEP] Keyword[double] operator[SEP] operator[SEP] operator[SEP] identifier[o2] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[componentType] operator[SEP] identifier[equals] operator[SEP] identifier[Boolean] operator[SEP] identifier[TYPE] operator[SEP] operator[SEP] { Keyword[return] identifier[Arrays] operator[SEP] identifier[equals] operator[SEP] operator[SEP] Keyword[boolean] operator[SEP] operator[SEP] operator[SEP] identifier[o1] , operator[SEP] Keyword[boolean] operator[SEP] operator[SEP] operator[SEP] identifier[o2] operator[SEP] operator[SEP] } Keyword[return] identifier[Arrays] operator[SEP] identifier[equals] operator[SEP] operator[SEP] identifier[Object] operator[SEP] operator[SEP] operator[SEP] identifier[o1] , operator[SEP] identifier[Object] operator[SEP] operator[SEP] operator[SEP] identifier[o2] operator[SEP] operator[SEP] }
private static StringBuilder reuseOrCreate(final StringBuilder builder, final int capacity) { if (builder == null) { return new StringBuilder(capacity); } else { builder.setLength(0); return builder; } }
class class_name[name] begin[{] method[reuseOrCreate, return_type[type[StringBuilder]], modifier[private static], parameter[builder, capacity]] begin[{] if[binary_operation[member[.builder], ==, literal[null]]] begin[{] return[ClassCreator(arguments=[MemberReference(member=capacity, 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=StringBuilder, sub_type=None))] else begin[{] call[builder.setLength, parameter[literal[0]]] return[member[.builder]] end[}] end[}] END[}]
Keyword[private] Keyword[static] identifier[StringBuilder] identifier[reuseOrCreate] operator[SEP] Keyword[final] identifier[StringBuilder] identifier[builder] , Keyword[final] Keyword[int] identifier[capacity] operator[SEP] { Keyword[if] operator[SEP] identifier[builder] operator[==] Other[null] operator[SEP] { Keyword[return] Keyword[new] identifier[StringBuilder] operator[SEP] identifier[capacity] operator[SEP] operator[SEP] } Keyword[else] { identifier[builder] operator[SEP] identifier[setLength] operator[SEP] Other[0] operator[SEP] operator[SEP] Keyword[return] identifier[builder] operator[SEP] } }
synchronized Statement compile(Session session, Result cmd) throws Throwable { String sql = cmd.getMainString(); long csid = getStatementID(session.currentSchema, sql); Statement cs = (Statement) csidMap.get(csid); if (cs == null || !cs.isValid() || !session.isAdmin()) { Session sys = database.sessionManager.getSysSession( session.currentSchema.name, session.getUser()); cs = sys.compileStatement(sql); csid = registerStatement(csid, cs); } linkSession(csid, session.getId()); return cs; }
class class_name[name] begin[{] method[compile, return_type[type[Statement]], modifier[synchronized], parameter[session, cmd]] begin[{] local_variable[type[String], sql] local_variable[type[long], csid] local_variable[type[Statement], cs] if[binary_operation[binary_operation[binary_operation[member[.cs], ==, literal[null]], ||, call[cs.isValid, parameter[]]], ||, call[session.isAdmin, parameter[]]]] begin[{] local_variable[type[Session], sys] assign[member[.cs], call[sys.compileStatement, parameter[member[.sql]]]] assign[member[.csid], call[.registerStatement, parameter[member[.csid], member[.cs]]]] else begin[{] None end[}] call[.linkSession, parameter[member[.csid], call[session.getId, parameter[]]]] return[member[.cs]] end[}] END[}]
Keyword[synchronized] identifier[Statement] identifier[compile] operator[SEP] identifier[Session] identifier[session] , identifier[Result] identifier[cmd] operator[SEP] Keyword[throws] identifier[Throwable] { identifier[String] identifier[sql] operator[=] identifier[cmd] operator[SEP] identifier[getMainString] operator[SEP] operator[SEP] operator[SEP] Keyword[long] identifier[csid] operator[=] identifier[getStatementID] operator[SEP] identifier[session] operator[SEP] identifier[currentSchema] , identifier[sql] operator[SEP] operator[SEP] identifier[Statement] identifier[cs] operator[=] operator[SEP] identifier[Statement] operator[SEP] identifier[csidMap] operator[SEP] identifier[get] operator[SEP] identifier[csid] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[cs] operator[==] Other[null] operator[||] operator[!] identifier[cs] operator[SEP] identifier[isValid] operator[SEP] operator[SEP] operator[||] operator[!] identifier[session] operator[SEP] identifier[isAdmin] operator[SEP] operator[SEP] operator[SEP] { identifier[Session] identifier[sys] operator[=] identifier[database] operator[SEP] identifier[sessionManager] operator[SEP] identifier[getSysSession] operator[SEP] identifier[session] operator[SEP] identifier[currentSchema] operator[SEP] identifier[name] , identifier[session] operator[SEP] identifier[getUser] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[cs] operator[=] identifier[sys] operator[SEP] identifier[compileStatement] operator[SEP] identifier[sql] operator[SEP] operator[SEP] identifier[csid] operator[=] identifier[registerStatement] operator[SEP] identifier[csid] , identifier[cs] operator[SEP] operator[SEP] } identifier[linkSession] operator[SEP] identifier[csid] , identifier[session] operator[SEP] identifier[getId] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[cs] operator[SEP] }
public static DataBuffer shapeOf(DataBuffer buffer) { int rank = (int) buffer.getLong(0); return Nd4j.createBuffer(buffer, 1, rank); }
class class_name[name] begin[{] method[shapeOf, return_type[type[DataBuffer]], modifier[public static], parameter[buffer]] begin[{] local_variable[type[int], rank] return[call[Nd4j.createBuffer, parameter[member[.buffer], literal[1], member[.rank]]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[DataBuffer] identifier[shapeOf] operator[SEP] identifier[DataBuffer] identifier[buffer] operator[SEP] { Keyword[int] identifier[rank] operator[=] operator[SEP] Keyword[int] operator[SEP] identifier[buffer] operator[SEP] identifier[getLong] operator[SEP] Other[0] operator[SEP] operator[SEP] Keyword[return] identifier[Nd4j] operator[SEP] identifier[createBuffer] operator[SEP] identifier[buffer] , Other[1] , identifier[rank] operator[SEP] operator[SEP] }
@SuppressWarnings("unchecked") public void printType(Type type) throws IOException { if (type instanceof Class<?>) { printTypeClass((Class<?>) type); } else if (type instanceof ParameterizedType) { ParameterizedType parameterizedType = (ParameterizedType) type; printParameterizedType(parameterizedType); } else if (type instanceof WildcardType) { WildcardType wildcardType = (WildcardType) type; printWildcardType(wildcardType); } else if (type instanceof TypeVariable<?>) { TypeVariable<? extends GenericDeclaration> typeVariable = (TypeVariable<? extends GenericDeclaration>) type; printTypeVariable(typeVariable); } else if (type instanceof GenericArrayType) { GenericArrayType genericArrayType = (GenericArrayType) type; printType(genericArrayType.getGenericComponentType()); print("[]"); } else { throw new UnsupportedOperationException(type.getClass().getName() + " " + String.valueOf(type)); } }
class class_name[name] begin[{] method[printType, return_type[void], modifier[public], parameter[type]] begin[{] if[binary_operation[member[.type], instanceof, type[Class]]] begin[{] call[.printTypeClass, parameter[Cast(expression=MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=[TypeArgument(pattern_type=?, type=None)], dimensions=[], name=Class, sub_type=None))]] else begin[{] if[binary_operation[member[.type], instanceof, type[ParameterizedType]]] begin[{] local_variable[type[ParameterizedType], parameterizedType] call[.printParameterizedType, parameter[member[.parameterizedType]]] else begin[{] if[binary_operation[member[.type], instanceof, type[WildcardType]]] begin[{] local_variable[type[WildcardType], wildcardType] call[.printWildcardType, parameter[member[.wildcardType]]] else begin[{] if[binary_operation[member[.type], instanceof, type[TypeVariable]]] begin[{] local_variable[type[TypeVariable], typeVariable] call[.printTypeVariable, parameter[member[.typeVariable]]] else begin[{] if[binary_operation[member[.type], instanceof, type[GenericArrayType]]] begin[{] local_variable[type[GenericArrayType], genericArrayType] call[.printType, parameter[call[genericArrayType.getGenericComponentType, parameter[]]]] call[.print, parameter[literal["[]"]]] else begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getClass, postfix_operators=[], prefix_operators=[], qualifier=type, selectors=[MethodInvocation(arguments=[], member=getName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" "), operator=+), operandr=MethodInvocation(arguments=[MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=valueOf, postfix_operators=[], prefix_operators=[], qualifier=String, 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=UnsupportedOperationException, sub_type=None)), label=None) end[}] end[}] end[}] end[}] end[}] end[}] END[}]
annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] Keyword[public] Keyword[void] identifier[printType] operator[SEP] identifier[Type] identifier[type] operator[SEP] Keyword[throws] identifier[IOException] { Keyword[if] operator[SEP] identifier[type] Keyword[instanceof] identifier[Class] operator[<] operator[?] operator[>] operator[SEP] { identifier[printTypeClass] operator[SEP] operator[SEP] identifier[Class] operator[<] operator[?] operator[>] operator[SEP] identifier[type] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[type] Keyword[instanceof] identifier[ParameterizedType] operator[SEP] { identifier[ParameterizedType] identifier[parameterizedType] operator[=] operator[SEP] identifier[ParameterizedType] operator[SEP] identifier[type] operator[SEP] identifier[printParameterizedType] operator[SEP] identifier[parameterizedType] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[type] Keyword[instanceof] identifier[WildcardType] operator[SEP] { identifier[WildcardType] identifier[wildcardType] operator[=] operator[SEP] identifier[WildcardType] operator[SEP] identifier[type] operator[SEP] identifier[printWildcardType] operator[SEP] identifier[wildcardType] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[type] Keyword[instanceof] identifier[TypeVariable] operator[<] operator[?] operator[>] operator[SEP] { identifier[TypeVariable] operator[<] operator[?] Keyword[extends] identifier[GenericDeclaration] operator[>] identifier[typeVariable] operator[=] operator[SEP] identifier[TypeVariable] operator[<] operator[?] Keyword[extends] identifier[GenericDeclaration] operator[>] operator[SEP] identifier[type] operator[SEP] identifier[printTypeVariable] operator[SEP] identifier[typeVariable] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[type] Keyword[instanceof] identifier[GenericArrayType] operator[SEP] { identifier[GenericArrayType] identifier[genericArrayType] operator[=] operator[SEP] identifier[GenericArrayType] operator[SEP] identifier[type] operator[SEP] identifier[printType] operator[SEP] identifier[genericArrayType] operator[SEP] identifier[getGenericComponentType] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[print] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[else] { Keyword[throw] Keyword[new] identifier[UnsupportedOperationException] operator[SEP] identifier[type] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[String] operator[SEP] identifier[valueOf] operator[SEP] identifier[type] operator[SEP] operator[SEP] operator[SEP] } }
public String getPendingChanges() { JsonObject jsonObject = this.getPendingJSONObject(); if (jsonObject == null) { return null; } return jsonObject.toString(); }
class class_name[name] begin[{] method[getPendingChanges, return_type[type[String]], modifier[public], parameter[]] begin[{] local_variable[type[JsonObject], jsonObject] if[binary_operation[member[.jsonObject], ==, literal[null]]] begin[{] return[literal[null]] else begin[{] None end[}] return[call[jsonObject.toString, parameter[]]] end[}] END[}]
Keyword[public] identifier[String] identifier[getPendingChanges] operator[SEP] operator[SEP] { identifier[JsonObject] identifier[jsonObject] operator[=] Keyword[this] operator[SEP] identifier[getPendingJSONObject] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[jsonObject] operator[==] Other[null] operator[SEP] { Keyword[return] Other[null] operator[SEP] } Keyword[return] identifier[jsonObject] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] }
protected final void usePreparedStatement( PreparedStatement pPreparedStatement ) throws SQLException { ResultSet lResultSet = null; pPreparedStatement.setFetchSize( 1000 ); setParameter( pPreparedStatement ); try { lResultSet = pPreparedStatement.executeQuery(); useResultSet( lResultSet ); } finally { if( lResultSet != null ) { lResultSet.close(); } } }
class class_name[name] begin[{] method[usePreparedStatement, return_type[void], modifier[final protected], parameter[pPreparedStatement]] begin[{] local_variable[type[ResultSet], lResultSet] call[pPreparedStatement.setFetchSize, parameter[literal[1000]]] call[.setParameter, parameter[member[.pPreparedStatement]]] TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=lResultSet, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=executeQuery, postfix_operators=[], prefix_operators=[], qualifier=pPreparedStatement, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=lResultSet, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=useResultSet, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], catches=None, finally_block=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=lResultSet, 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=close, postfix_operators=[], prefix_operators=[], qualifier=lResultSet, selectors=[], type_arguments=None), label=None)]))], label=None, resources=None) end[}] END[}]
Keyword[protected] Keyword[final] Keyword[void] identifier[usePreparedStatement] operator[SEP] identifier[PreparedStatement] identifier[pPreparedStatement] operator[SEP] Keyword[throws] identifier[SQLException] { identifier[ResultSet] identifier[lResultSet] operator[=] Other[null] operator[SEP] identifier[pPreparedStatement] operator[SEP] identifier[setFetchSize] operator[SEP] Other[1000] operator[SEP] operator[SEP] identifier[setParameter] operator[SEP] identifier[pPreparedStatement] operator[SEP] operator[SEP] Keyword[try] { identifier[lResultSet] operator[=] identifier[pPreparedStatement] operator[SEP] identifier[executeQuery] operator[SEP] operator[SEP] operator[SEP] identifier[useResultSet] operator[SEP] identifier[lResultSet] operator[SEP] operator[SEP] } Keyword[finally] { Keyword[if] operator[SEP] identifier[lResultSet] operator[!=] Other[null] operator[SEP] { identifier[lResultSet] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP] } } }
public boolean checkIntensity( boolean insideDark , double threshold ) { if( insideDark ) return averageOutside-averageInside >= threshold; else return averageInside-averageOutside >= threshold; }
class class_name[name] begin[{] method[checkIntensity, return_type[type[boolean]], modifier[public], parameter[insideDark, threshold]] begin[{] if[member[.insideDark]] begin[{] return[binary_operation[binary_operation[member[.averageOutside], -, member[.averageInside]], >=, member[.threshold]]] else begin[{] return[binary_operation[binary_operation[member[.averageInside], -, member[.averageOutside]], >=, member[.threshold]]] end[}] end[}] END[}]
Keyword[public] Keyword[boolean] identifier[checkIntensity] operator[SEP] Keyword[boolean] identifier[insideDark] , Keyword[double] identifier[threshold] operator[SEP] { Keyword[if] operator[SEP] identifier[insideDark] operator[SEP] Keyword[return] identifier[averageOutside] operator[-] identifier[averageInside] operator[>=] identifier[threshold] operator[SEP] Keyword[else] Keyword[return] identifier[averageInside] operator[-] identifier[averageOutside] operator[>=] identifier[threshold] operator[SEP] }
public int lastIndexOf(java.util.List<Character> list) { return lastIndexOf((CharSequence) FastStr.of(list)); }
class class_name[name] begin[{] method[lastIndexOf, return_type[type[int]], modifier[public], parameter[list]] begin[{] return[call[.lastIndexOf, parameter[Cast(expression=MethodInvocation(arguments=[MemberReference(member=list, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=of, postfix_operators=[], prefix_operators=[], qualifier=FastStr, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=CharSequence, sub_type=None))]]] end[}] END[}]
Keyword[public] Keyword[int] identifier[lastIndexOf] operator[SEP] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[List] operator[<] identifier[Character] operator[>] identifier[list] operator[SEP] { Keyword[return] identifier[lastIndexOf] operator[SEP] operator[SEP] identifier[CharSequence] operator[SEP] identifier[FastStr] operator[SEP] identifier[of] operator[SEP] identifier[list] operator[SEP] operator[SEP] operator[SEP] }
@BetaApi public final Snapshot getSnapshot(ProjectGlobalSnapshotName snapshot) { GetSnapshotHttpRequest request = GetSnapshotHttpRequest.newBuilder() .setSnapshot(snapshot == null ? null : snapshot.toString()) .build(); return getSnapshot(request); }
class class_name[name] begin[{] method[getSnapshot, return_type[type[Snapshot]], modifier[final public], parameter[snapshot]] begin[{] local_variable[type[GetSnapshotHttpRequest], request] return[call[.getSnapshot, parameter[member[.request]]]] end[}] END[}]
annotation[@] identifier[BetaApi] Keyword[public] Keyword[final] identifier[Snapshot] identifier[getSnapshot] operator[SEP] identifier[ProjectGlobalSnapshotName] identifier[snapshot] operator[SEP] { identifier[GetSnapshotHttpRequest] identifier[request] operator[=] identifier[GetSnapshotHttpRequest] operator[SEP] identifier[newBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[setSnapshot] operator[SEP] identifier[snapshot] operator[==] Other[null] operator[?] Other[null] operator[:] identifier[snapshot] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[getSnapshot] operator[SEP] identifier[request] operator[SEP] operator[SEP] }
@Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { case SarlPackage.SARL_CAPACITY_USES__CAPACITIES: return getCapacities(); } 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=SARL_CAPACITY_USES__CAPACITIES, postfix_operators=[], prefix_operators=[], qualifier=SarlPackage, selectors=[])], statements=[ReturnStatement(expression=MethodInvocation(arguments=[], member=getCapacities, 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[SarlPackage] operator[SEP] identifier[SARL_CAPACITY_USES__CAPACITIES] operator[:] Keyword[return] identifier[getCapacities] 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 void awaitTermination(boolean waitQuietPeriod) { LOG.info("{}: Journal checkpointer shutdown has been initiated.", mMaster.getName()); mWaitQuietPeriod = waitQuietPeriod; mShutdownInitiated = true; // Actively interrupt to cancel slow checkpoints. synchronized (mCheckpointingLock) { if (mCheckpointing) { interrupt(); } } try { // Wait for the thread to finish. join(); LOG.info("{}: Journal shutdown complete", mMaster.getName()); } catch (InterruptedException e) { LOG.error("{}: journal checkpointer shutdown is interrupted.", mMaster.getName(), e); // Kills the master. This can happen in the following two scenarios: // 1. The user Ctrl-C the server. // 2. Zookeeper selects this master as standby before the master finishes the previous // standby->leader transition. It is safer to crash the server because the behavior is // undefined to have two journal checkpointer running concurrently. throw new RuntimeException(e); } mStopped = true; }
class class_name[name] begin[{] method[awaitTermination, return_type[void], modifier[public], parameter[waitQuietPeriod]] begin[{] call[LOG.info, parameter[literal["{}: Journal checkpointer shutdown has been initiated."], call[mMaster.getName, parameter[]]]] assign[member[.mWaitQuietPeriod], member[.waitQuietPeriod]] assign[member[.mShutdownInitiated], literal[true]] SYNCHRONIZED[member[.mCheckpointingLock]] BEGIN[{] if[member[.mCheckpointing]] begin[{] call[.interrupt, parameter[]] else begin[{] None end[}] END[}] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=join, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="{}: Journal shutdown complete"), MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=mMaster, selectors=[], type_arguments=None)], member=info, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="{}: journal checkpointer shutdown is interrupted."), MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=mMaster, selectors=[], type_arguments=None), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), label=None), ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=RuntimeException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['InterruptedException']))], finally_block=None, label=None, resources=None) assign[member[.mStopped], literal[true]] end[}] END[}]
Keyword[public] Keyword[void] identifier[awaitTermination] operator[SEP] Keyword[boolean] identifier[waitQuietPeriod] operator[SEP] { identifier[LOG] operator[SEP] identifier[info] operator[SEP] literal[String] , identifier[mMaster] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[mWaitQuietPeriod] operator[=] identifier[waitQuietPeriod] operator[SEP] identifier[mShutdownInitiated] operator[=] literal[boolean] operator[SEP] Keyword[synchronized] operator[SEP] identifier[mCheckpointingLock] operator[SEP] { Keyword[if] operator[SEP] identifier[mCheckpointing] operator[SEP] { identifier[interrupt] operator[SEP] operator[SEP] operator[SEP] } } Keyword[try] { identifier[join] operator[SEP] operator[SEP] operator[SEP] identifier[LOG] operator[SEP] identifier[info] operator[SEP] literal[String] , identifier[mMaster] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[InterruptedException] identifier[e] operator[SEP] { identifier[LOG] operator[SEP] identifier[error] operator[SEP] literal[String] , identifier[mMaster] operator[SEP] identifier[getName] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[RuntimeException] operator[SEP] identifier[e] operator[SEP] operator[SEP] } identifier[mStopped] operator[=] literal[boolean] operator[SEP] }
public static int findEdge(Poly node, MeshData tile, float value, int comp) { float error = Float.MAX_VALUE; int edge = 0; for (int i = 0; i < node.vertCount; i++) { int j = (i + 1) % node.vertCount; float v1 = tile.verts[3 * node.verts[i] + comp] - value; float v2 = tile.verts[3 * node.verts[j] + comp] - value; float d = v1 * v1 + v2 * v2; if (d < error) { error = d; edge = i; } } return edge; }
class class_name[name] begin[{] method[findEdge, return_type[type[int]], modifier[public static], parameter[node, tile, value, comp]] begin[{] local_variable[type[float], error] local_variable[type[int], edge] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+), operandr=MemberReference(member=vertCount, postfix_operators=[], prefix_operators=[], qualifier=node, selectors=[]), operator=%), name=j)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=MemberReference(member=verts, postfix_operators=[], prefix_operators=[], qualifier=tile, selectors=[ArraySelector(index=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=3), operandr=MemberReference(member=verts, postfix_operators=[], prefix_operators=[], qualifier=node, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operator=*), operandr=MemberReference(member=comp, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+))]), operandr=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=-), name=v1)], modifiers=set(), type=BasicType(dimensions=[], name=float)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=MemberReference(member=verts, postfix_operators=[], prefix_operators=[], qualifier=tile, selectors=[ArraySelector(index=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=3), operandr=MemberReference(member=verts, postfix_operators=[], prefix_operators=[], qualifier=node, selectors=[ArraySelector(index=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operator=*), operandr=MemberReference(member=comp, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+))]), operandr=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=-), name=v2)], modifiers=set(), type=BasicType(dimensions=[], name=float)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=v1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=v1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=*), operandr=BinaryOperation(operandl=MemberReference(member=v2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=v2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=*), operator=+), name=d)], modifiers=set(), type=BasicType(dimensions=[], name=float)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=d, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=error, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=error, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=d, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=edge, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=vertCount, postfix_operators=[], prefix_operators=[], qualifier=node, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) return[member[.edge]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[int] identifier[findEdge] operator[SEP] identifier[Poly] identifier[node] , identifier[MeshData] identifier[tile] , Keyword[float] identifier[value] , Keyword[int] identifier[comp] operator[SEP] { Keyword[float] identifier[error] operator[=] identifier[Float] operator[SEP] identifier[MAX_VALUE] operator[SEP] Keyword[int] identifier[edge] operator[=] Other[0] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[node] operator[SEP] identifier[vertCount] operator[SEP] identifier[i] operator[++] operator[SEP] { Keyword[int] identifier[j] operator[=] operator[SEP] identifier[i] operator[+] Other[1] operator[SEP] operator[%] identifier[node] operator[SEP] identifier[vertCount] operator[SEP] Keyword[float] identifier[v1] operator[=] identifier[tile] operator[SEP] identifier[verts] operator[SEP] Other[3] operator[*] identifier[node] operator[SEP] identifier[verts] operator[SEP] identifier[i] operator[SEP] operator[+] identifier[comp] operator[SEP] operator[-] identifier[value] operator[SEP] Keyword[float] identifier[v2] operator[=] identifier[tile] operator[SEP] identifier[verts] operator[SEP] Other[3] operator[*] identifier[node] operator[SEP] identifier[verts] operator[SEP] identifier[j] operator[SEP] operator[+] identifier[comp] operator[SEP] operator[-] identifier[value] operator[SEP] Keyword[float] identifier[d] operator[=] identifier[v1] operator[*] identifier[v1] operator[+] identifier[v2] operator[*] identifier[v2] operator[SEP] Keyword[if] operator[SEP] identifier[d] operator[<] identifier[error] operator[SEP] { identifier[error] operator[=] identifier[d] operator[SEP] identifier[edge] operator[=] identifier[i] operator[SEP] } } Keyword[return] identifier[edge] operator[SEP] }
private Void doConcat(SegmentHandle targetHandle, long offset, String sourceSegment) throws IOException { long traceId = LoggerHelpers.traceEnter(log, "concat", targetHandle.getSegmentName(), offset, sourceSegment); Path sourcePath = Paths.get(config.getRoot(), sourceSegment); Path targetPath = Paths.get(config.getRoot(), targetHandle.getSegmentName()); long length = Files.size(sourcePath); try (FileChannel targetChannel = FileChannel.open(targetPath, StandardOpenOption.WRITE); RandomAccessFile sourceFile = new RandomAccessFile(String.valueOf(sourcePath), "r")) { if (isWritableFile(sourcePath)) { throw new IllegalStateException(String.format("Source segment (%s) is not sealed.", sourceSegment)); } while (length > 0) { long bytesTransferred = targetChannel.transferFrom(sourceFile.getChannel(), offset, length); offset += bytesTransferred; length -= bytesTransferred; } targetChannel.force(false); Files.delete(sourcePath); LoggerHelpers.traceLeave(log, "concat", traceId); return null; } }
class class_name[name] begin[{] method[doConcat, return_type[type[Void]], modifier[private], parameter[targetHandle, offset, sourceSegment]] begin[{] local_variable[type[long], traceId] local_variable[type[Path], sourcePath] local_variable[type[Path], targetPath] local_variable[type[long], length] TryStatement(block=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=sourcePath, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isWritableFile, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Source segment (%s) is not sealed."), MemberReference(member=sourceSegment, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=format, postfix_operators=[], prefix_operators=[], qualifier=String, selectors=[], type_arguments=None)], 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)])), WhileStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getChannel, postfix_operators=[], prefix_operators=[], qualifier=sourceFile, selectors=[], type_arguments=None), MemberReference(member=offset, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=transferFrom, postfix_operators=[], prefix_operators=[], qualifier=targetChannel, selectors=[], type_arguments=None), name=bytesTransferred)], modifiers=set(), type=BasicType(dimensions=[], name=long)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=offset, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=MemberReference(member=bytesTransferred, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=-=, value=MemberReference(member=bytesTransferred, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)]), condition=BinaryOperation(operandl=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)], member=force, postfix_operators=[], prefix_operators=[], qualifier=targetChannel, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=sourcePath, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=delete, postfix_operators=[], prefix_operators=[], qualifier=Files, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=log, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="concat"), MemberReference(member=traceId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=traceLeave, postfix_operators=[], prefix_operators=[], qualifier=LoggerHelpers, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), label=None)], catches=None, finally_block=None, label=None, resources=[TryResource(annotations=[], modifiers=set(), name=targetChannel, type=ReferenceType(arguments=None, dimensions=[], name=FileChannel, sub_type=None), value=MethodInvocation(arguments=[MemberReference(member=targetPath, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=WRITE, postfix_operators=[], prefix_operators=[], qualifier=StandardOpenOption, selectors=[])], member=open, postfix_operators=[], prefix_operators=[], qualifier=FileChannel, selectors=[], type_arguments=None)), TryResource(annotations=[], modifiers=set(), name=sourceFile, type=ReferenceType(arguments=None, dimensions=[], name=RandomAccessFile, sub_type=None), value=ClassCreator(arguments=[MethodInvocation(arguments=[MemberReference(member=sourcePath, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=valueOf, postfix_operators=[], prefix_operators=[], qualifier=String, selectors=[], type_arguments=None), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="r")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=RandomAccessFile, sub_type=None)))]) end[}] END[}]
Keyword[private] identifier[Void] identifier[doConcat] operator[SEP] identifier[SegmentHandle] identifier[targetHandle] , Keyword[long] identifier[offset] , identifier[String] identifier[sourceSegment] operator[SEP] Keyword[throws] identifier[IOException] { Keyword[long] identifier[traceId] operator[=] identifier[LoggerHelpers] operator[SEP] identifier[traceEnter] operator[SEP] identifier[log] , literal[String] , identifier[targetHandle] operator[SEP] identifier[getSegmentName] operator[SEP] operator[SEP] , identifier[offset] , identifier[sourceSegment] operator[SEP] operator[SEP] identifier[Path] identifier[sourcePath] operator[=] identifier[Paths] operator[SEP] identifier[get] operator[SEP] identifier[config] operator[SEP] identifier[getRoot] operator[SEP] operator[SEP] , identifier[sourceSegment] operator[SEP] operator[SEP] identifier[Path] identifier[targetPath] operator[=] identifier[Paths] operator[SEP] identifier[get] operator[SEP] identifier[config] operator[SEP] identifier[getRoot] operator[SEP] operator[SEP] , identifier[targetHandle] operator[SEP] identifier[getSegmentName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[long] identifier[length] operator[=] identifier[Files] operator[SEP] identifier[size] operator[SEP] identifier[sourcePath] operator[SEP] operator[SEP] Keyword[try] operator[SEP] identifier[FileChannel] identifier[targetChannel] operator[=] identifier[FileChannel] operator[SEP] identifier[open] operator[SEP] identifier[targetPath] , identifier[StandardOpenOption] operator[SEP] identifier[WRITE] operator[SEP] operator[SEP] identifier[RandomAccessFile] identifier[sourceFile] operator[=] Keyword[new] identifier[RandomAccessFile] operator[SEP] identifier[String] operator[SEP] identifier[valueOf] operator[SEP] identifier[sourcePath] operator[SEP] , literal[String] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[isWritableFile] operator[SEP] identifier[sourcePath] operator[SEP] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[sourceSegment] operator[SEP] operator[SEP] operator[SEP] } Keyword[while] operator[SEP] identifier[length] operator[>] Other[0] operator[SEP] { Keyword[long] identifier[bytesTransferred] operator[=] identifier[targetChannel] operator[SEP] identifier[transferFrom] operator[SEP] identifier[sourceFile] operator[SEP] identifier[getChannel] operator[SEP] operator[SEP] , identifier[offset] , identifier[length] operator[SEP] operator[SEP] identifier[offset] operator[+=] identifier[bytesTransferred] operator[SEP] identifier[length] operator[-=] identifier[bytesTransferred] operator[SEP] } identifier[targetChannel] operator[SEP] identifier[force] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[Files] operator[SEP] identifier[delete] operator[SEP] identifier[sourcePath] operator[SEP] operator[SEP] identifier[LoggerHelpers] operator[SEP] identifier[traceLeave] operator[SEP] identifier[log] , literal[String] , identifier[traceId] operator[SEP] operator[SEP] Keyword[return] Other[null] operator[SEP] } }
public void addAction(String firstName, String lastName, String actionType, String actionValue) { // Create a new UserActionsModel, and add a new actions map to it with a // single action value. Even if one exists in this row, since it has a lone // keyAsColumn field, it won't remove any actions that already exist in the // actions column family. UserActionsModel actionsModel = UserActionsModel.newBuilder() .setLastName(lastName).setFirstName(firstName) .setActions(new HashMap<String, String>()).build(); actionsModel.getActions().put(actionType, actionValue); // Perform the put. userActionsDao.put(actionsModel); }
class class_name[name] begin[{] method[addAction, return_type[void], modifier[public], parameter[firstName, lastName, actionType, actionValue]] begin[{] local_variable[type[UserActionsModel], actionsModel] call[actionsModel.getActions, parameter[]] call[userActionsDao.put, parameter[member[.actionsModel]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[addAction] operator[SEP] identifier[String] identifier[firstName] , identifier[String] identifier[lastName] , identifier[String] identifier[actionType] , identifier[String] identifier[actionValue] operator[SEP] { identifier[UserActionsModel] identifier[actionsModel] operator[=] identifier[UserActionsModel] operator[SEP] identifier[newBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[setLastName] operator[SEP] identifier[lastName] operator[SEP] operator[SEP] identifier[setFirstName] operator[SEP] identifier[firstName] operator[SEP] operator[SEP] identifier[setActions] operator[SEP] Keyword[new] identifier[HashMap] operator[<] identifier[String] , identifier[String] operator[>] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP] identifier[actionsModel] operator[SEP] identifier[getActions] operator[SEP] operator[SEP] operator[SEP] identifier[put] operator[SEP] identifier[actionType] , identifier[actionValue] operator[SEP] operator[SEP] identifier[userActionsDao] operator[SEP] identifier[put] operator[SEP] identifier[actionsModel] operator[SEP] operator[SEP] }
public void setKernel(float[] values, float colorAdj) { if (values.length != KERNEL_SIZE) { throw new IllegalArgumentException("Kernel size is " + values.length + " vs. " + KERNEL_SIZE); } System.arraycopy(values, 0, mKernel, 0, KERNEL_SIZE); mColorAdjust = colorAdj; //Log.d(TAG, "filt kernel: " + Arrays.toString(mKernel) + ", adj=" + colorAdj); }
class class_name[name] begin[{] method[setKernel, return_type[void], modifier[public], parameter[values, colorAdj]] begin[{] if[binary_operation[member[values.length], !=, member[.KERNEL_SIZE]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Kernel size is "), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=values, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" vs. "), operator=+), operandr=MemberReference(member=KERNEL_SIZE, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None) else begin[{] None end[}] call[System.arraycopy, parameter[member[.values], literal[0], member[.mKernel], literal[0], member[.KERNEL_SIZE]]] assign[member[.mColorAdjust], member[.colorAdj]] end[}] END[}]
Keyword[public] Keyword[void] identifier[setKernel] operator[SEP] Keyword[float] operator[SEP] operator[SEP] identifier[values] , Keyword[float] identifier[colorAdj] operator[SEP] { Keyword[if] operator[SEP] identifier[values] operator[SEP] identifier[length] operator[!=] identifier[KERNEL_SIZE] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[+] identifier[values] operator[SEP] identifier[length] operator[+] literal[String] operator[+] identifier[KERNEL_SIZE] operator[SEP] operator[SEP] } identifier[System] operator[SEP] identifier[arraycopy] operator[SEP] identifier[values] , Other[0] , identifier[mKernel] , Other[0] , identifier[KERNEL_SIZE] operator[SEP] operator[SEP] identifier[mColorAdjust] operator[=] identifier[colorAdj] operator[SEP] }
public boolean isEmpty() { if (isFull || isFullSelect || isFullInsert || isFullUpdate || isFullReferences || isFullDelete) { return false; } if (selectColumnSet != null && !selectColumnSet.isEmpty()) { return false; } if (insertColumnSet != null && !insertColumnSet.isEmpty()) { return false; } if (updateColumnSet != null && !updateColumnSet.isEmpty()) { return false; } if (referencesColumnSet != null && !referencesColumnSet.isEmpty()) { return false; } if (triggerColumnSet != null && !triggerColumnSet.isEmpty()) { return false; } return true; }
class class_name[name] begin[{] method[isEmpty, return_type[type[boolean]], modifier[public], parameter[]] begin[{] if[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[member[.isFull], ||, member[.isFullSelect]], ||, member[.isFullInsert]], ||, member[.isFullUpdate]], ||, member[.isFullReferences]], ||, member[.isFullDelete]]] begin[{] return[literal[false]] else begin[{] None end[}] if[binary_operation[binary_operation[member[.selectColumnSet], !=, literal[null]], &&, call[selectColumnSet.isEmpty, parameter[]]]] begin[{] return[literal[false]] else begin[{] None end[}] if[binary_operation[binary_operation[member[.insertColumnSet], !=, literal[null]], &&, call[insertColumnSet.isEmpty, parameter[]]]] begin[{] return[literal[false]] else begin[{] None end[}] if[binary_operation[binary_operation[member[.updateColumnSet], !=, literal[null]], &&, call[updateColumnSet.isEmpty, parameter[]]]] begin[{] return[literal[false]] else begin[{] None end[}] if[binary_operation[binary_operation[member[.referencesColumnSet], !=, literal[null]], &&, call[referencesColumnSet.isEmpty, parameter[]]]] begin[{] return[literal[false]] else begin[{] None end[}] if[binary_operation[binary_operation[member[.triggerColumnSet], !=, literal[null]], &&, call[triggerColumnSet.isEmpty, parameter[]]]] begin[{] return[literal[false]] else begin[{] None end[}] return[literal[true]] end[}] END[}]
Keyword[public] Keyword[boolean] identifier[isEmpty] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[isFull] operator[||] identifier[isFullSelect] operator[||] identifier[isFullInsert] operator[||] identifier[isFullUpdate] operator[||] identifier[isFullReferences] operator[||] identifier[isFullDelete] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } Keyword[if] operator[SEP] identifier[selectColumnSet] operator[!=] Other[null] operator[&&] operator[!] identifier[selectColumnSet] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } Keyword[if] operator[SEP] identifier[insertColumnSet] operator[!=] Other[null] operator[&&] operator[!] identifier[insertColumnSet] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } Keyword[if] operator[SEP] identifier[updateColumnSet] operator[!=] Other[null] operator[&&] operator[!] identifier[updateColumnSet] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } Keyword[if] operator[SEP] identifier[referencesColumnSet] operator[!=] Other[null] operator[&&] operator[!] identifier[referencesColumnSet] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } Keyword[if] operator[SEP] identifier[triggerColumnSet] operator[!=] Other[null] operator[&&] operator[!] identifier[triggerColumnSet] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } Keyword[return] literal[boolean] operator[SEP] }
private JsonObject loadModuleConfig(ModuleIdentifier modID, File modJsonFile) { try (@SuppressWarnings("resource") Scanner scanner = new Scanner(modJsonFile, "UTF-8").useDelimiter("\\A")) { return new JsonObject(scanner.next()); } catch (FileNotFoundException e) { throw new PlatformManagerException("Module " + modID + " does not contains a mod.json file"); } catch (NoSuchElementException e) { throw new PlatformManagerException("Module " + modID + " contains an empty mod.json"); } catch (DecodeException e) { throw new PlatformManagerException("Module " + modID + " mod.json contains invalid json"); } }
class class_name[name] begin[{] method[loadModuleConfig, return_type[type[JsonObject]], modifier[private], parameter[modID, modJsonFile]] begin[{] TryStatement(block=[ReturnStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[], member=next, postfix_operators=[], prefix_operators=[], qualifier=scanner, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=JsonObject, sub_type=None)), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Module "), operandr=MemberReference(member=modID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" does not contains a mod.json file"), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=PlatformManagerException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['FileNotFoundException'])), CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Module "), operandr=MemberReference(member=modID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" contains an empty mod.json"), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=PlatformManagerException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['NoSuchElementException'])), CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Module "), operandr=MemberReference(member=modID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" mod.json contains invalid json"), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=PlatformManagerException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['DecodeException']))], finally_block=None, label=None, resources=[TryResource(annotations=[Annotation(element=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="resource"), name=SuppressWarnings)], modifiers=set(), name=scanner, type=ReferenceType(arguments=None, dimensions=[], name=Scanner, sub_type=None), value=ClassCreator(arguments=[MemberReference(member=modJsonFile, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="UTF-8")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\\A")], member=useDelimiter, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=Scanner, sub_type=None)))]) end[}] END[}]
Keyword[private] identifier[JsonObject] identifier[loadModuleConfig] operator[SEP] identifier[ModuleIdentifier] identifier[modID] , identifier[File] identifier[modJsonFile] operator[SEP] { Keyword[try] operator[SEP] annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] identifier[Scanner] identifier[scanner] operator[=] Keyword[new] identifier[Scanner] operator[SEP] identifier[modJsonFile] , literal[String] operator[SEP] operator[SEP] identifier[useDelimiter] operator[SEP] literal[String] operator[SEP] operator[SEP] { Keyword[return] Keyword[new] identifier[JsonObject] operator[SEP] identifier[scanner] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[FileNotFoundException] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[PlatformManagerException] operator[SEP] literal[String] operator[+] identifier[modID] operator[+] literal[String] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[NoSuchElementException] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[PlatformManagerException] operator[SEP] literal[String] operator[+] identifier[modID] operator[+] literal[String] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[DecodeException] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[PlatformManagerException] operator[SEP] literal[String] operator[+] identifier[modID] operator[+] literal[String] operator[SEP] operator[SEP] } }
public static final void sortKeyValuePairs(long[] keys, double[] values, int startInd, int endInd) { // Base case. if (endInd - startInd <= 1) { return; } // Choose pivot. int pivotInd = (int) (Math.random() * (endInd - startInd)) + startInd; // Perform swaps to partition array around the pivot. swap(keys, values, startInd, pivotInd); pivotInd = startInd; for (int i = startInd + 1; i < endInd; i++) { if (keys[i] < keys[pivotInd]) { swap(keys, values, pivotInd, pivotInd + 1); if (i != pivotInd + 1) { swap(keys, values, pivotInd, i); } pivotInd++; } } // Recursively sort the subcomponents of the arrays. sortKeyValuePairs(keys, values, startInd, pivotInd); sortKeyValuePairs(keys, values, pivotInd + 1, endInd); }
class class_name[name] begin[{] method[sortKeyValuePairs, return_type[void], modifier[final public static], parameter[keys, values, startInd, endInd]] begin[{] if[binary_operation[binary_operation[member[.endInd], -, member[.startInd]], <=, literal[1]]] begin[{] return[None] else begin[{] None end[}] local_variable[type[int], pivotInd] call[.swap, parameter[member[.keys], member[.values], member[.startInd], member[.pivotInd]]] assign[member[.pivotInd], member[.startInd]] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=keys, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operandr=MemberReference(member=keys, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=pivotInd, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operator=<), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=keys, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=values, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=pivotInd, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=MemberReference(member=pivotInd, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+)], member=swap, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=BinaryOperation(operandl=MemberReference(member=pivotInd, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=keys, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=values, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=pivotInd, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=swap, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=MemberReference(member=pivotInd, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=endInd, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=BinaryOperation(operandl=MemberReference(member=startInd, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) call[.sortKeyValuePairs, parameter[member[.keys], member[.values], member[.startInd], member[.pivotInd]]] call[.sortKeyValuePairs, parameter[member[.keys], member[.values], binary_operation[member[.pivotInd], +, literal[1]], member[.endInd]]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[final] Keyword[void] identifier[sortKeyValuePairs] operator[SEP] Keyword[long] operator[SEP] operator[SEP] identifier[keys] , Keyword[double] operator[SEP] operator[SEP] identifier[values] , Keyword[int] identifier[startInd] , Keyword[int] identifier[endInd] operator[SEP] { Keyword[if] operator[SEP] identifier[endInd] operator[-] identifier[startInd] operator[<=] Other[1] operator[SEP] { Keyword[return] operator[SEP] } Keyword[int] identifier[pivotInd] operator[=] operator[SEP] Keyword[int] operator[SEP] operator[SEP] identifier[Math] operator[SEP] identifier[random] operator[SEP] operator[SEP] operator[*] operator[SEP] identifier[endInd] operator[-] identifier[startInd] operator[SEP] operator[SEP] operator[+] identifier[startInd] operator[SEP] identifier[swap] operator[SEP] identifier[keys] , identifier[values] , identifier[startInd] , identifier[pivotInd] operator[SEP] operator[SEP] identifier[pivotInd] operator[=] identifier[startInd] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] identifier[startInd] operator[+] Other[1] operator[SEP] identifier[i] operator[<] identifier[endInd] operator[SEP] identifier[i] operator[++] operator[SEP] { Keyword[if] operator[SEP] identifier[keys] operator[SEP] identifier[i] operator[SEP] operator[<] identifier[keys] operator[SEP] identifier[pivotInd] operator[SEP] operator[SEP] { identifier[swap] operator[SEP] identifier[keys] , identifier[values] , identifier[pivotInd] , identifier[pivotInd] operator[+] Other[1] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[i] operator[!=] identifier[pivotInd] operator[+] Other[1] operator[SEP] { identifier[swap] operator[SEP] identifier[keys] , identifier[values] , identifier[pivotInd] , identifier[i] operator[SEP] operator[SEP] } identifier[pivotInd] operator[++] operator[SEP] } } identifier[sortKeyValuePairs] operator[SEP] identifier[keys] , identifier[values] , identifier[startInd] , identifier[pivotInd] operator[SEP] operator[SEP] identifier[sortKeyValuePairs] operator[SEP] identifier[keys] , identifier[values] , identifier[pivotInd] operator[+] Other[1] , identifier[endInd] operator[SEP] operator[SEP] }
public void setMessageAttributeNames(java.util.Collection<String> messageAttributeNames) { if (messageAttributeNames == null) { this.messageAttributeNames = null; return; } this.messageAttributeNames = new com.amazonaws.internal.SdkInternalList<String>(messageAttributeNames); }
class class_name[name] begin[{] method[setMessageAttributeNames, return_type[void], modifier[public], parameter[messageAttributeNames]] begin[{] if[binary_operation[member[.messageAttributeNames], ==, literal[null]]] begin[{] assign[THIS[member[None.messageAttributeNames]], literal[null]] return[None] else begin[{] None end[}] assign[THIS[member[None.messageAttributeNames]], ClassCreator(arguments=[MemberReference(member=messageAttributeNames, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=com, sub_type=ReferenceType(arguments=None, dimensions=None, name=amazonaws, sub_type=ReferenceType(arguments=None, dimensions=None, name=internal, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=None, name=SdkInternalList, sub_type=None)))))] end[}] END[}]
Keyword[public] Keyword[void] identifier[setMessageAttributeNames] operator[SEP] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[Collection] operator[<] identifier[String] operator[>] identifier[messageAttributeNames] operator[SEP] { Keyword[if] operator[SEP] identifier[messageAttributeNames] operator[==] Other[null] operator[SEP] { Keyword[this] operator[SEP] identifier[messageAttributeNames] operator[=] Other[null] operator[SEP] Keyword[return] operator[SEP] } Keyword[this] operator[SEP] identifier[messageAttributeNames] operator[=] Keyword[new] identifier[com] operator[SEP] identifier[amazonaws] operator[SEP] identifier[internal] operator[SEP] identifier[SdkInternalList] operator[<] identifier[String] operator[>] operator[SEP] identifier[messageAttributeNames] operator[SEP] operator[SEP] }
public final void execute () throws InternetSCSIException { final ProtocolDataUnit protocolDataUnit = connection.receive(); LOGGER.trace("1" + protocolDataUnit); if (protocolDataUnit.getBasicHeaderSegment().getParser() instanceof Ready2TransferParser) { LOGGER.trace("2"); final Ready2TransferParser parser = (Ready2TransferParser) protocolDataUnit.getBasicHeaderSegment().getParser(); final int targetTransferTag = parser.getTargetTransferTag(); if (LOGGER.isDebugEnabled()) { LOGGER.debug("R2T has TTT set to " + targetTransferTag); } final int desiredDataTransferLength = parser.getDesiredDataTransferLength(); if (desiredDataTransferLength > connection.getSettingAsInt(OperationalTextKey.MAX_BURST_LENGTH)) { if (LOGGER.isErrorEnabled()) { LOGGER.error("MaxBurstLength limit is exceed."); } throw new InternetSCSIException("MaxBurstLength limit is exceed."); } connection.nextState(new WriteSecondBurstState(connection, iterator, targetTransferTag, desiredDataTransferLength, dataSequenceNumber, bufferOffset)); super.stateFollowing = true; // return true; return; } else if (protocolDataUnit.getBasicHeaderSegment().getParser() instanceof SCSIResponseParser) { final SCSIResponseParser parser = (SCSIResponseParser) protocolDataUnit.getBasicHeaderSegment().getParser(); if (!iterator.hasNext() && parser.getStatus() == SCSIStatus.GOOD) { connection.getSession().incrementInitiatorTaskTag(); // return false; super.stateFollowing = false; return; } } throw new RuntimeException(protocolDataUnit.getBasicHeaderSegment().getParser().toString()); }
class class_name[name] begin[{] method[execute, return_type[void], modifier[final public], parameter[]] begin[{] local_variable[type[ProtocolDataUnit], protocolDataUnit] call[LOGGER.trace, parameter[binary_operation[literal["1"], +, member[.protocolDataUnit]]]] if[binary_operation[call[protocolDataUnit.getBasicHeaderSegment, parameter[]], instanceof, type[Ready2TransferParser]]] begin[{] call[LOGGER.trace, parameter[literal["2"]]] local_variable[type[Ready2TransferParser], parser] local_variable[type[int], targetTransferTag] if[call[LOGGER.isDebugEnabled, parameter[]]] begin[{] call[LOGGER.debug, parameter[binary_operation[literal["R2T has TTT set to "], +, member[.targetTransferTag]]]] else begin[{] None end[}] local_variable[type[int], desiredDataTransferLength] if[binary_operation[member[.desiredDataTransferLength], >, call[connection.getSettingAsInt, parameter[member[OperationalTextKey.MAX_BURST_LENGTH]]]]] begin[{] if[call[LOGGER.isErrorEnabled, parameter[]]] begin[{] call[LOGGER.error, parameter[literal["MaxBurstLength limit is exceed."]]] else begin[{] None end[}] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="MaxBurstLength limit is exceed.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=InternetSCSIException, sub_type=None)), label=None) else begin[{] None end[}] call[connection.nextState, parameter[ClassCreator(arguments=[MemberReference(member=connection, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=iterator, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=targetTransferTag, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=desiredDataTransferLength, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=dataSequenceNumber, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=bufferOffset, 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=WriteSecondBurstState, sub_type=None))]] assign[SuperMemberReference(member=stateFollowing, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), literal[true]] return[None] else begin[{] if[binary_operation[call[protocolDataUnit.getBasicHeaderSegment, parameter[]], instanceof, type[SCSIResponseParser]]] begin[{] local_variable[type[SCSIResponseParser], parser] if[binary_operation[call[iterator.hasNext, parameter[]], &&, binary_operation[call[parser.getStatus, parameter[]], ==, member[SCSIStatus.GOOD]]]] begin[{] call[connection.getSession, parameter[]] assign[SuperMemberReference(member=stateFollowing, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), literal[false]] return[None] else begin[{] None end[}] else begin[{] None end[}] end[}] ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[], member=getBasicHeaderSegment, postfix_operators=[], prefix_operators=[], qualifier=protocolDataUnit, selectors=[MethodInvocation(arguments=[], member=getParser, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=toString, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=RuntimeException, sub_type=None)), label=None) end[}] END[}]
Keyword[public] Keyword[final] Keyword[void] identifier[execute] operator[SEP] operator[SEP] Keyword[throws] identifier[InternetSCSIException] { Keyword[final] identifier[ProtocolDataUnit] identifier[protocolDataUnit] operator[=] identifier[connection] operator[SEP] identifier[receive] operator[SEP] operator[SEP] operator[SEP] identifier[LOGGER] operator[SEP] identifier[trace] operator[SEP] literal[String] operator[+] identifier[protocolDataUnit] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[protocolDataUnit] operator[SEP] identifier[getBasicHeaderSegment] operator[SEP] operator[SEP] operator[SEP] identifier[getParser] operator[SEP] operator[SEP] Keyword[instanceof] identifier[Ready2TransferParser] operator[SEP] { identifier[LOGGER] operator[SEP] identifier[trace] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[final] identifier[Ready2TransferParser] identifier[parser] operator[=] operator[SEP] identifier[Ready2TransferParser] operator[SEP] identifier[protocolDataUnit] operator[SEP] identifier[getBasicHeaderSegment] operator[SEP] operator[SEP] operator[SEP] identifier[getParser] operator[SEP] operator[SEP] operator[SEP] Keyword[final] Keyword[int] identifier[targetTransferTag] operator[=] identifier[parser] operator[SEP] identifier[getTargetTransferTag] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[LOGGER] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] { identifier[LOGGER] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[+] identifier[targetTransferTag] operator[SEP] operator[SEP] } Keyword[final] Keyword[int] identifier[desiredDataTransferLength] operator[=] identifier[parser] operator[SEP] identifier[getDesiredDataTransferLength] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[desiredDataTransferLength] operator[>] identifier[connection] operator[SEP] identifier[getSettingAsInt] operator[SEP] identifier[OperationalTextKey] operator[SEP] identifier[MAX_BURST_LENGTH] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[LOGGER] operator[SEP] identifier[isErrorEnabled] operator[SEP] operator[SEP] operator[SEP] { identifier[LOGGER] operator[SEP] identifier[error] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[throw] Keyword[new] identifier[InternetSCSIException] operator[SEP] literal[String] operator[SEP] operator[SEP] } identifier[connection] operator[SEP] identifier[nextState] operator[SEP] Keyword[new] identifier[WriteSecondBurstState] operator[SEP] identifier[connection] , identifier[iterator] , identifier[targetTransferTag] , identifier[desiredDataTransferLength] , identifier[dataSequenceNumber] , identifier[bufferOffset] operator[SEP] operator[SEP] operator[SEP] Keyword[super] operator[SEP] identifier[stateFollowing] operator[=] literal[boolean] operator[SEP] Keyword[return] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[protocolDataUnit] operator[SEP] identifier[getBasicHeaderSegment] operator[SEP] operator[SEP] operator[SEP] identifier[getParser] operator[SEP] operator[SEP] Keyword[instanceof] identifier[SCSIResponseParser] operator[SEP] { Keyword[final] identifier[SCSIResponseParser] identifier[parser] operator[=] operator[SEP] identifier[SCSIResponseParser] operator[SEP] identifier[protocolDataUnit] operator[SEP] identifier[getBasicHeaderSegment] operator[SEP] operator[SEP] operator[SEP] identifier[getParser] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[iterator] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[&&] identifier[parser] operator[SEP] identifier[getStatus] operator[SEP] operator[SEP] operator[==] identifier[SCSIStatus] operator[SEP] identifier[GOOD] operator[SEP] { identifier[connection] operator[SEP] identifier[getSession] operator[SEP] operator[SEP] operator[SEP] identifier[incrementInitiatorTaskTag] operator[SEP] operator[SEP] operator[SEP] Keyword[super] operator[SEP] identifier[stateFollowing] operator[=] literal[boolean] operator[SEP] Keyword[return] operator[SEP] } } Keyword[throw] Keyword[new] identifier[RuntimeException] operator[SEP] identifier[protocolDataUnit] operator[SEP] identifier[getBasicHeaderSegment] operator[SEP] operator[SEP] operator[SEP] identifier[getParser] operator[SEP] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
public Gather<Entry<K, V>> entryGather() { return Gather.from(delegate.get().entrySet()); }
class class_name[name] begin[{] method[entryGather, return_type[type[Gather]], modifier[public], parameter[]] begin[{] return[call[Gather.from, parameter[call[delegate.get, parameter[]]]]] end[}] END[}]
Keyword[public] identifier[Gather] operator[<] identifier[Entry] operator[<] identifier[K] , identifier[V] operator[>] operator[>] identifier[entryGather] operator[SEP] operator[SEP] { Keyword[return] identifier[Gather] operator[SEP] identifier[from] operator[SEP] identifier[delegate] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[entrySet] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
public boolean removeSpace() { int start = pos; while (pos < text.length && lcText[pos] == ' ') { pos++; } return (start < pos); }
class class_name[name] begin[{] method[removeSpace, return_type[type[boolean]], modifier[public], parameter[]] begin[{] local_variable[type[int], start] while[binary_operation[binary_operation[member[.pos], <, member[text.length]], &&, binary_operation[member[.lcText], ==, literal[' ']]]] begin[{] member[.pos] end[}] return[binary_operation[member[.start], <, member[.pos]]] end[}] END[}]
Keyword[public] Keyword[boolean] identifier[removeSpace] operator[SEP] operator[SEP] { Keyword[int] identifier[start] operator[=] identifier[pos] operator[SEP] Keyword[while] operator[SEP] identifier[pos] operator[<] identifier[text] operator[SEP] identifier[length] operator[&&] identifier[lcText] operator[SEP] identifier[pos] operator[SEP] operator[==] literal[String] operator[SEP] { identifier[pos] operator[++] operator[SEP] } Keyword[return] operator[SEP] identifier[start] operator[<] identifier[pos] operator[SEP] operator[SEP] }
protected Map<Integer, Object> fromParamPath(ActionExecute execute, String paramPath, List<Class<?>> pathParamTypeList, Map<Integer, Class<?>> optGenTypeMap) { // _/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/ // e.g. index(String first) /product/list/2/ // => urlPatternRegexp=^([^/]+)$, paramPath=2, pathParamTypeList=[String] // // e.g. sea(String first) /product/list/sea/2/ // => urlPatternRegexp=^sea/([^/]+)$, paramPath=2, pathParamTypeList=[String] // // e.g. land(String first, String second) /product/list/sea/2/3/ // => urlPatternRegexp=^land/([^/]+)/([^/]+)$, paramPath=2/3, pathParamTypeList=[String, String] // _/_/_/_/_/_/_/_/_/_/ final List<String> paramList = prepareParamList(execute, paramPath, pathParamTypeList); final Map<Integer, Object> valueMap = new LinkedHashMap<Integer, Object>(pathParamTypeList.size()); int index = 0; for (Class<?> paramType : pathParamTypeList) { final String plainValue = paramList.get(index); valueMap.put(index, filterPathParam(execute, index, paramType, optGenTypeMap, plainValue)); ++index; } return Collections.unmodifiableMap(valueMap); }
class class_name[name] begin[{] method[fromParamPath, return_type[type[Map]], modifier[protected], parameter[execute, paramPath, pathParamTypeList, optGenTypeMap]] begin[{] local_variable[type[List], paramList] local_variable[type[Map], valueMap] local_variable[type[int], index] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=paramList, selectors=[], type_arguments=None), name=plainValue)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[MemberReference(member=execute, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=paramType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=optGenTypeMap, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=plainValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=filterPathParam, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=put, postfix_operators=[], prefix_operators=[], qualifier=valueMap, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MemberReference(member=index, postfix_operators=[], prefix_operators=['++'], qualifier=, selectors=[]), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=pathParamTypeList, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=paramType)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=?, type=None)], dimensions=[], name=Class, sub_type=None))), label=None) return[call[Collections.unmodifiableMap, parameter[member[.valueMap]]]] end[}] END[}]
Keyword[protected] identifier[Map] operator[<] identifier[Integer] , identifier[Object] operator[>] identifier[fromParamPath] operator[SEP] identifier[ActionExecute] identifier[execute] , identifier[String] identifier[paramPath] , identifier[List] operator[<] identifier[Class] operator[<] operator[?] operator[>] operator[>] identifier[pathParamTypeList] , identifier[Map] operator[<] identifier[Integer] , identifier[Class] operator[<] operator[?] operator[>] operator[>] identifier[optGenTypeMap] operator[SEP] { Keyword[final] identifier[List] operator[<] identifier[String] operator[>] identifier[paramList] operator[=] identifier[prepareParamList] operator[SEP] identifier[execute] , identifier[paramPath] , identifier[pathParamTypeList] operator[SEP] operator[SEP] Keyword[final] identifier[Map] operator[<] identifier[Integer] , identifier[Object] operator[>] identifier[valueMap] operator[=] Keyword[new] identifier[LinkedHashMap] operator[<] identifier[Integer] , identifier[Object] operator[>] operator[SEP] identifier[pathParamTypeList] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[index] operator[=] Other[0] operator[SEP] Keyword[for] operator[SEP] identifier[Class] operator[<] operator[?] operator[>] identifier[paramType] operator[:] identifier[pathParamTypeList] operator[SEP] { Keyword[final] identifier[String] identifier[plainValue] operator[=] identifier[paramList] operator[SEP] identifier[get] operator[SEP] identifier[index] operator[SEP] operator[SEP] identifier[valueMap] operator[SEP] identifier[put] operator[SEP] identifier[index] , identifier[filterPathParam] operator[SEP] identifier[execute] , identifier[index] , identifier[paramType] , identifier[optGenTypeMap] , identifier[plainValue] operator[SEP] operator[SEP] operator[SEP] operator[++] identifier[index] operator[SEP] } Keyword[return] identifier[Collections] operator[SEP] identifier[unmodifiableMap] operator[SEP] identifier[valueMap] operator[SEP] operator[SEP] }
public String getAssetURL(String id) { String url = getRepositoryUrl() + "/assets/" + id + "?"; if (getUserId() != null) { url += "userId=" + getUserId(); } if (getUserId() != null && getPassword() != null) { url += "&password=" + getPassword(); } if (getApiKey() != null) { url += "&apiKey=" + getApiKey(); } return url; }
class class_name[name] begin[{] method[getAssetURL, return_type[type[String]], modifier[public], parameter[id]] begin[{] local_variable[type[String], url] if[binary_operation[call[.getUserId, parameter[]], !=, literal[null]]] begin[{] assign[member[.url], binary_operation[literal["userId="], +, call[.getUserId, parameter[]]]] else begin[{] None end[}] if[binary_operation[binary_operation[call[.getUserId, parameter[]], !=, literal[null]], &&, binary_operation[call[.getPassword, parameter[]], !=, literal[null]]]] begin[{] assign[member[.url], binary_operation[literal["&password="], +, call[.getPassword, parameter[]]]] else begin[{] None end[}] if[binary_operation[call[.getApiKey, parameter[]], !=, literal[null]]] begin[{] assign[member[.url], binary_operation[literal["&apiKey="], +, call[.getApiKey, parameter[]]]] else begin[{] None end[}] return[member[.url]] end[}] END[}]
Keyword[public] identifier[String] identifier[getAssetURL] operator[SEP] identifier[String] identifier[id] operator[SEP] { identifier[String] identifier[url] operator[=] identifier[getRepositoryUrl] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[id] operator[+] literal[String] operator[SEP] Keyword[if] operator[SEP] identifier[getUserId] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] { identifier[url] operator[+=] literal[String] operator[+] identifier[getUserId] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[getUserId] operator[SEP] operator[SEP] operator[!=] Other[null] operator[&&] identifier[getPassword] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] { identifier[url] operator[+=] literal[String] operator[+] identifier[getPassword] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[getApiKey] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] { identifier[url] operator[+=] literal[String] operator[+] identifier[getApiKey] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[url] operator[SEP] }
public Object call(Collection coll, Closure c) { return call((Iterable)coll, c); }
class class_name[name] begin[{] method[call, return_type[type[Object]], modifier[public], parameter[coll, c]] begin[{] return[call[.call, parameter[Cast(expression=MemberReference(member=coll, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Iterable, sub_type=None)), member[.c]]]] end[}] END[}]
Keyword[public] identifier[Object] identifier[call] operator[SEP] identifier[Collection] identifier[coll] , identifier[Closure] identifier[c] operator[SEP] { Keyword[return] identifier[call] operator[SEP] operator[SEP] identifier[Iterable] operator[SEP] identifier[coll] , identifier[c] operator[SEP] operator[SEP] }
@Override public Iterator<Vertex> vertices(Object... ids) { // get current session Neo4JSession session = currentSession(); // transaction should be ready for io operations transaction.readWrite(); // find vertices return session.vertices(ids); }
class class_name[name] begin[{] method[vertices, return_type[type[Iterator]], modifier[public], parameter[ids]] begin[{] local_variable[type[Neo4JSession], session] call[transaction.readWrite, parameter[]] return[call[session.vertices, parameter[member[.ids]]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[Iterator] operator[<] identifier[Vertex] operator[>] identifier[vertices] operator[SEP] identifier[Object] operator[...] identifier[ids] operator[SEP] { identifier[Neo4JSession] identifier[session] operator[=] identifier[currentSession] operator[SEP] operator[SEP] operator[SEP] identifier[transaction] operator[SEP] identifier[readWrite] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[session] operator[SEP] identifier[vertices] operator[SEP] identifier[ids] operator[SEP] operator[SEP] }
public static <T> PVectorByteBufferedIntegral4s64<T> createWithBase( final ByteBuffer b, final MutableLongType base, final int offset) { return new PVectorByteBufferedIntegral4s64<>(b, base, offset); }
class class_name[name] begin[{] method[createWithBase, return_type[type[PVectorByteBufferedIntegral4s64]], modifier[public static], parameter[b, base, offset]] begin[{] return[ClassCreator(arguments=[MemberReference(member=b, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=base, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=offset, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=PVectorByteBufferedIntegral4s64, sub_type=None))] end[}] END[}]
Keyword[public] Keyword[static] operator[<] identifier[T] operator[>] identifier[PVectorByteBufferedIntegral4s64] operator[<] identifier[T] operator[>] identifier[createWithBase] operator[SEP] Keyword[final] identifier[ByteBuffer] identifier[b] , Keyword[final] identifier[MutableLongType] identifier[base] , Keyword[final] Keyword[int] identifier[offset] operator[SEP] { Keyword[return] Keyword[new] identifier[PVectorByteBufferedIntegral4s64] operator[<] operator[>] operator[SEP] identifier[b] , identifier[base] , identifier[offset] operator[SEP] operator[SEP] }
@Override public JsonElement serialize (CustomCommand customCommand, Type typeOfSrc, JsonSerializationContext context) { JsonObject jObject = new JsonObject(); HashMap<String,String> commands = customCommand.getCommands(); for (Map.Entry<String, String> entry : commands.entrySet()) { jObject.addProperty(entry.getKey(),entry.getValue()); } return jObject; }
class class_name[name] begin[{] method[serialize, return_type[type[JsonElement]], modifier[public], parameter[customCommand, typeOfSrc, context]] begin[{] local_variable[type[JsonObject], jObject] local_variable[type[HashMap], commands] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getKey, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None)], member=addProperty, postfix_operators=[], prefix_operators=[], qualifier=jObject, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=entrySet, postfix_operators=[], prefix_operators=[], qualifier=commands, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=entry)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Map, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=None, name=Entry, sub_type=None)))), label=None) return[member[.jObject]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[JsonElement] identifier[serialize] operator[SEP] identifier[CustomCommand] identifier[customCommand] , identifier[Type] identifier[typeOfSrc] , identifier[JsonSerializationContext] identifier[context] operator[SEP] { identifier[JsonObject] identifier[jObject] operator[=] Keyword[new] identifier[JsonObject] operator[SEP] operator[SEP] operator[SEP] identifier[HashMap] operator[<] identifier[String] , identifier[String] operator[>] identifier[commands] operator[=] identifier[customCommand] operator[SEP] identifier[getCommands] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Map] operator[SEP] identifier[Entry] operator[<] identifier[String] , identifier[String] operator[>] identifier[entry] operator[:] identifier[commands] operator[SEP] identifier[entrySet] operator[SEP] operator[SEP] operator[SEP] { identifier[jObject] operator[SEP] identifier[addProperty] operator[SEP] identifier[entry] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] , identifier[entry] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[jObject] operator[SEP] }
private void buttonExportActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonExportActionPerformed final File toSave = DialogProviderManager.getInstance().getDialogProvider().msgSaveFileDialog(null, "note-editor", UiUtils.BUNDLE.getString("PlainTextEditor.buttonSaveActionPerformed.saveTitle"), null, true, TEXT_FILE_FILTER, "Save"); //NOI18N if (toSave != null) { try { final String text = getText(); FileUtils.writeStringToFile(toSave, text, "UTF-8"); //NOI18N } catch (Exception ex) { LOGGER.error("Error during text file saving", ex); //NOI18N DialogProviderManager.getInstance().getDialogProvider().msgError(Main.getApplicationFrame(), UiUtils.BUNDLE.getString("PlainTextEditor.buttonSaveActionPerformed.msgError")); } } }
class class_name[name] begin[{] method[buttonExportActionPerformed, return_type[void], modifier[private], parameter[evt]] begin[{] local_variable[type[File], toSave] if[binary_operation[member[.toSave], !=, literal[null]]] begin[{] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getText, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=text)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=toSave, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=text, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="UTF-8")], member=writeStringToFile, postfix_operators=[], prefix_operators=[], qualifier=FileUtils, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Error during text file saving"), MemberReference(member=ex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=LOGGER, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=getInstance, postfix_operators=[], prefix_operators=[], qualifier=DialogProviderManager, selectors=[MethodInvocation(arguments=[], member=getDialogProvider, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getApplicationFrame, postfix_operators=[], prefix_operators=[], qualifier=Main, selectors=[], type_arguments=None), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="PlainTextEditor.buttonSaveActionPerformed.msgError")], member=getString, postfix_operators=[], prefix_operators=[], qualifier=UiUtils.BUNDLE, selectors=[], type_arguments=None)], member=msgError, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ex, types=['Exception']))], finally_block=None, label=None, resources=None) else begin[{] None end[}] end[}] END[}]
Keyword[private] Keyword[void] identifier[buttonExportActionPerformed] operator[SEP] identifier[java] operator[SEP] identifier[awt] operator[SEP] identifier[event] operator[SEP] identifier[ActionEvent] identifier[evt] operator[SEP] { Keyword[final] identifier[File] identifier[toSave] operator[=] identifier[DialogProviderManager] operator[SEP] identifier[getInstance] operator[SEP] operator[SEP] operator[SEP] identifier[getDialogProvider] operator[SEP] operator[SEP] operator[SEP] identifier[msgSaveFileDialog] operator[SEP] Other[null] , literal[String] , identifier[UiUtils] operator[SEP] identifier[BUNDLE] operator[SEP] identifier[getString] operator[SEP] literal[String] operator[SEP] , Other[null] , literal[boolean] , identifier[TEXT_FILE_FILTER] , literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[toSave] operator[!=] Other[null] operator[SEP] { Keyword[try] { Keyword[final] identifier[String] identifier[text] operator[=] identifier[getText] operator[SEP] operator[SEP] operator[SEP] identifier[FileUtils] operator[SEP] identifier[writeStringToFile] operator[SEP] identifier[toSave] , identifier[text] , literal[String] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[ex] operator[SEP] { identifier[LOGGER] operator[SEP] identifier[error] operator[SEP] literal[String] , identifier[ex] operator[SEP] operator[SEP] identifier[DialogProviderManager] operator[SEP] identifier[getInstance] operator[SEP] operator[SEP] operator[SEP] identifier[getDialogProvider] operator[SEP] operator[SEP] operator[SEP] identifier[msgError] operator[SEP] identifier[Main] operator[SEP] identifier[getApplicationFrame] operator[SEP] operator[SEP] , identifier[UiUtils] operator[SEP] identifier[BUNDLE] operator[SEP] identifier[getString] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] } } }
@Override public void removeClient(long clientId) { LOG.info("Removing client " + clientId + " ..."); synchronized (clientModificationsLock) { removedClients.add(clientId); } }
class class_name[name] begin[{] method[removeClient, return_type[void], modifier[public], parameter[clientId]] begin[{] call[LOG.info, parameter[binary_operation[binary_operation[literal["Removing client "], +, member[.clientId]], +, literal[" ..."]]]] SYNCHRONIZED[member[.clientModificationsLock]] BEGIN[{] call[removedClients.add, parameter[member[.clientId]]] END[}] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[removeClient] operator[SEP] Keyword[long] identifier[clientId] operator[SEP] { identifier[LOG] operator[SEP] identifier[info] operator[SEP] literal[String] operator[+] identifier[clientId] operator[+] literal[String] operator[SEP] operator[SEP] Keyword[synchronized] operator[SEP] identifier[clientModificationsLock] operator[SEP] { identifier[removedClients] operator[SEP] identifier[add] operator[SEP] identifier[clientId] operator[SEP] operator[SEP] } }
Object insertByRightShift( int ix, Object new1) { Object old1 = null; if (isFull()) { old1 = rightMostKey(); rightMove(ix+1); _nodeKey[ix+1] = new1; } else { rightShift(ix+1); _nodeKey[ix+1] = new1; _population++; if (midPoint() > rightMostIndex()) _nodeKey[midPoint()] = rightMostKey(); } return old1; }
class class_name[name] begin[{] method[insertByRightShift, return_type[type[Object]], modifier[default], parameter[ix, new1]] begin[{] local_variable[type[Object], old1] if[call[.isFull, parameter[]]] begin[{] assign[member[.old1], call[.rightMostKey, parameter[]]] call[.rightMove, parameter[binary_operation[member[.ix], +, literal[1]]]] assign[member[._nodeKey], member[.new1]] else begin[{] call[.rightShift, parameter[binary_operation[member[.ix], +, literal[1]]]] assign[member[._nodeKey], member[.new1]] member[._population] if[binary_operation[call[.midPoint, parameter[]], >, call[.rightMostIndex, parameter[]]]] begin[{] assign[member[._nodeKey], call[.rightMostKey, parameter[]]] else begin[{] None end[}] end[}] return[member[.old1]] end[}] END[}]
identifier[Object] identifier[insertByRightShift] operator[SEP] Keyword[int] identifier[ix] , identifier[Object] identifier[new1] operator[SEP] { identifier[Object] identifier[old1] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[isFull] operator[SEP] operator[SEP] operator[SEP] { identifier[old1] operator[=] identifier[rightMostKey] operator[SEP] operator[SEP] operator[SEP] identifier[rightMove] operator[SEP] identifier[ix] operator[+] Other[1] operator[SEP] operator[SEP] identifier[_nodeKey] operator[SEP] identifier[ix] operator[+] Other[1] operator[SEP] operator[=] identifier[new1] operator[SEP] } Keyword[else] { identifier[rightShift] operator[SEP] identifier[ix] operator[+] Other[1] operator[SEP] operator[SEP] identifier[_nodeKey] operator[SEP] identifier[ix] operator[+] Other[1] operator[SEP] operator[=] identifier[new1] operator[SEP] identifier[_population] operator[++] operator[SEP] Keyword[if] operator[SEP] identifier[midPoint] operator[SEP] operator[SEP] operator[>] identifier[rightMostIndex] operator[SEP] operator[SEP] operator[SEP] identifier[_nodeKey] operator[SEP] identifier[midPoint] operator[SEP] operator[SEP] operator[SEP] operator[=] identifier[rightMostKey] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[old1] operator[SEP] }
public static ErrorProneOptions processArgs(Iterable<String> args) { Preconditions.checkNotNull(args); ImmutableList.Builder<String> remainingArgs = ImmutableList.builder(); /* By default, we throw an error when an unknown option is passed in, if for example you * try to disable a check that doesn't match any of the known checks. This catches typos from * the command line. * * You can pass the IGNORE_UNKNOWN_CHECKS_FLAG to opt-out of that checking. This allows you to * use command lines from different versions of error-prone interchangeably. */ Builder builder = new Builder(); for (String arg : args) { switch (arg) { case IGNORE_SUPPRESSION_ANNOTATIONS: builder.setIgnoreSuppressionAnnotations(true); break; case IGNORE_UNKNOWN_CHECKS_FLAG: builder.setIgnoreUnknownChecks(true); break; case DISABLE_WARNINGS_IN_GENERATED_CODE_FLAG: builder.setDisableWarningsInGeneratedCode(true); break; case ERRORS_AS_WARNINGS_FLAG: builder.setDropErrorsToWarnings(true); break; case ENABLE_ALL_CHECKS: builder.setEnableAllChecksAsWarnings(true); break; case DISABLE_ALL_CHECKS: builder.setDisableAllChecks(true); break; case COMPILING_TEST_ONLY_CODE: builder.setTestOnlyTarget(true); break; default: if (arg.startsWith(SEVERITY_PREFIX)) { builder.parseSeverity(arg); } else if (arg.startsWith(ErrorProneFlags.PREFIX)) { builder.parseFlag(arg); } else if (arg.startsWith(PATCH_OUTPUT_LOCATION)) { String remaining = arg.substring(PATCH_OUTPUT_LOCATION.length()); if (remaining.equals("IN_PLACE")) { builder.patchingOptionsBuilder().inPlace(true); } else { if (remaining.isEmpty()) { throw new InvalidCommandLineOptionException("invalid flag: " + arg); } builder.patchingOptionsBuilder().baseDirectory(remaining); } } else if (arg.startsWith(PATCH_CHECKS_PREFIX)) { String remaining = arg.substring(PATCH_CHECKS_PREFIX.length()); if (remaining.startsWith("refaster:")) { // Refaster rule, load from InputStream at file builder .patchingOptionsBuilder() .customRefactorer( () -> { String path = remaining.substring("refaster:".length()); try (InputStream in = Files.newInputStream(FileSystems.getDefault().getPath(path)); ObjectInputStream ois = new ObjectInputStream(in)) { return (CodeTransformer) ois.readObject(); } catch (IOException | ClassNotFoundException e) { throw new RuntimeException("Can't load Refaster rule from " + path, e); } }); } else { Iterable<String> checks = Splitter.on(',').trimResults().split(remaining); builder.patchingOptionsBuilder().namedCheckers(ImmutableSet.copyOf(checks)); } } else if (arg.startsWith(PATCH_IMPORT_ORDER_PREFIX)) { String remaining = arg.substring(PATCH_IMPORT_ORDER_PREFIX.length()); ImportOrganizer importOrganizer = ImportOrderParser.getImportOrganizer(remaining); builder.patchingOptionsBuilder().importOrganizer(importOrganizer); } else if (arg.startsWith(EXCLUDED_PATHS_PREFIX)) { String pathRegex = arg.substring(EXCLUDED_PATHS_PREFIX.length()); builder.setExcludedPattern(Pattern.compile(pathRegex)); } else { remainingArgs.add(arg); } } } return builder.build(remainingArgs.build()); }
class class_name[name] begin[{] method[processArgs, return_type[type[ErrorProneOptions]], modifier[public static], parameter[args]] begin[{] call[Preconditions.checkNotNull, parameter[member[.args]]] local_variable[type[ImmutableList], remainingArgs] local_variable[type[Builder], builder] ForStatement(body=BlockStatement(label=None, statements=[SwitchStatement(cases=[SwitchStatementCase(case=['IGNORE_SUPPRESSION_ANNOTATIONS'], statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], member=setIgnoreSuppressionAnnotations, postfix_operators=[], prefix_operators=[], qualifier=builder, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=['IGNORE_UNKNOWN_CHECKS_FLAG'], statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], member=setIgnoreUnknownChecks, postfix_operators=[], prefix_operators=[], qualifier=builder, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=['DISABLE_WARNINGS_IN_GENERATED_CODE_FLAG'], statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], member=setDisableWarningsInGeneratedCode, postfix_operators=[], prefix_operators=[], qualifier=builder, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=['ERRORS_AS_WARNINGS_FLAG'], statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], member=setDropErrorsToWarnings, postfix_operators=[], prefix_operators=[], qualifier=builder, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=['ENABLE_ALL_CHECKS'], statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], member=setEnableAllChecksAsWarnings, postfix_operators=[], prefix_operators=[], qualifier=builder, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=['DISABLE_ALL_CHECKS'], statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], member=setDisableAllChecks, postfix_operators=[], prefix_operators=[], qualifier=builder, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=['COMPILING_TEST_ONLY_CODE'], statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], member=setTestOnlyTarget, postfix_operators=[], prefix_operators=[], qualifier=builder, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[], statements=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=SEVERITY_PREFIX, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=startsWith, postfix_operators=[], prefix_operators=[], qualifier=arg, selectors=[], type_arguments=None), else_statement=IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=PREFIX, postfix_operators=[], prefix_operators=[], qualifier=ErrorProneFlags, selectors=[])], member=startsWith, postfix_operators=[], prefix_operators=[], qualifier=arg, selectors=[], type_arguments=None), else_statement=IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=PATCH_OUTPUT_LOCATION, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=startsWith, postfix_operators=[], prefix_operators=[], qualifier=arg, selectors=[], type_arguments=None), else_statement=IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=PATCH_CHECKS_PREFIX, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=startsWith, postfix_operators=[], prefix_operators=[], qualifier=arg, selectors=[], type_arguments=None), else_statement=IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=PATCH_IMPORT_ORDER_PREFIX, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=startsWith, postfix_operators=[], prefix_operators=[], qualifier=arg, selectors=[], type_arguments=None), else_statement=IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=EXCLUDED_PATHS_PREFIX, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=startsWith, postfix_operators=[], prefix_operators=[], qualifier=arg, selectors=[], type_arguments=None), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=arg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=remainingArgs, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=EXCLUDED_PATHS_PREFIX, selectors=[], type_arguments=None)], member=substring, postfix_operators=[], prefix_operators=[], qualifier=arg, selectors=[], type_arguments=None), name=pathRegex)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=pathRegex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=compile, postfix_operators=[], prefix_operators=[], qualifier=Pattern, selectors=[], type_arguments=None)], member=setExcludedPattern, postfix_operators=[], prefix_operators=[], qualifier=builder, selectors=[], type_arguments=None), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=PATCH_IMPORT_ORDER_PREFIX, selectors=[], type_arguments=None)], member=substring, postfix_operators=[], prefix_operators=[], qualifier=arg, selectors=[], type_arguments=None), name=remaining)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=remaining, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getImportOrganizer, postfix_operators=[], prefix_operators=[], qualifier=ImportOrderParser, selectors=[], type_arguments=None), name=importOrganizer)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ImportOrganizer, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[], member=patchingOptionsBuilder, postfix_operators=[], prefix_operators=[], qualifier=builder, selectors=[MethodInvocation(arguments=[MemberReference(member=importOrganizer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=importOrganizer, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=PATCH_CHECKS_PREFIX, selectors=[], type_arguments=None)], member=substring, postfix_operators=[], prefix_operators=[], qualifier=arg, selectors=[], type_arguments=None), name=remaining)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="refaster:")], member=startsWith, postfix_operators=[], prefix_operators=[], qualifier=remaining, selectors=[], type_arguments=None), else_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=',')], member=on, postfix_operators=[], prefix_operators=[], qualifier=Splitter, selectors=[MethodInvocation(arguments=[], member=trimResults, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=remaining, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=split, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=checks)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=[], name=Iterable, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[], member=patchingOptionsBuilder, postfix_operators=[], prefix_operators=[], qualifier=builder, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=checks, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=copyOf, postfix_operators=[], prefix_operators=[], qualifier=ImmutableSet, selectors=[], type_arguments=None)], member=namedCheckers, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=patchingOptionsBuilder, postfix_operators=[], prefix_operators=[], qualifier=builder, selectors=[MethodInvocation(arguments=[LambdaExpression(body=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[], member=length, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], value="refaster:")], member=substring, postfix_operators=[], prefix_operators=[], qualifier=remaining, selectors=[], type_arguments=None), name=path)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TryStatement(block=[ReturnStatement(expression=Cast(expression=MethodInvocation(arguments=[], member=readObject, postfix_operators=[], prefix_operators=[], qualifier=ois, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=CodeTransformer, sub_type=None)), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Can't load Refaster rule from "), operandr=MemberReference(member=path, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=RuntimeException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IOException', 'ClassNotFoundException']))], finally_block=None, label=None, resources=[TryResource(annotations=[], modifiers=set(), name=in, type=ReferenceType(arguments=None, dimensions=[], name=InputStream, sub_type=None), value=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getDefault, postfix_operators=[], prefix_operators=[], qualifier=FileSystems, selectors=[MethodInvocation(arguments=[MemberReference(member=path, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getPath, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=newInputStream, postfix_operators=[], prefix_operators=[], qualifier=Files, selectors=[], type_arguments=None)), TryResource(annotations=[], modifiers=set(), name=ois, type=ReferenceType(arguments=None, dimensions=[], name=ObjectInputStream, sub_type=None), value=ClassCreator(arguments=[MemberReference(member=in, 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=ObjectInputStream, sub_type=None)))])], parameters=[])], member=customRefactorer, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)]))])), label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=PATCH_OUTPUT_LOCATION, selectors=[], type_arguments=None)], member=substring, postfix_operators=[], prefix_operators=[], qualifier=arg, selectors=[], type_arguments=None), name=remaining)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="IN_PLACE")], member=equals, postfix_operators=[], prefix_operators=[], qualifier=remaining, selectors=[], type_arguments=None), else_statement=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[], member=isEmpty, postfix_operators=[], prefix_operators=[], qualifier=remaining, 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="invalid flag: "), operandr=MemberReference(member=arg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=InvalidCommandLineOptionException, sub_type=None)), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[], member=patchingOptionsBuilder, postfix_operators=[], prefix_operators=[], qualifier=builder, selectors=[MethodInvocation(arguments=[MemberReference(member=remaining, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=baseDirectory, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=patchingOptionsBuilder, postfix_operators=[], prefix_operators=[], qualifier=builder, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], member=inPlace, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)]))])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=arg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=parseFlag, postfix_operators=[], prefix_operators=[], qualifier=builder, selectors=[], type_arguments=None), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=arg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=parseSeverity, postfix_operators=[], prefix_operators=[], qualifier=builder, selectors=[], type_arguments=None), label=None)]))])], expression=MemberReference(member=arg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=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) return[call[builder.build, parameter[call[remainingArgs.build, parameter[]]]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[ErrorProneOptions] identifier[processArgs] operator[SEP] identifier[Iterable] operator[<] identifier[String] operator[>] identifier[args] operator[SEP] { identifier[Preconditions] operator[SEP] identifier[checkNotNull] operator[SEP] identifier[args] operator[SEP] operator[SEP] identifier[ImmutableList] operator[SEP] identifier[Builder] operator[<] identifier[String] operator[>] identifier[remainingArgs] operator[=] identifier[ImmutableList] operator[SEP] identifier[builder] operator[SEP] operator[SEP] operator[SEP] identifier[Builder] identifier[builder] operator[=] Keyword[new] identifier[Builder] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[String] identifier[arg] operator[:] identifier[args] operator[SEP] { Keyword[switch] operator[SEP] identifier[arg] operator[SEP] { Keyword[case] identifier[IGNORE_SUPPRESSION_ANNOTATIONS] operator[:] identifier[builder] operator[SEP] identifier[setIgnoreSuppressionAnnotations] operator[SEP] literal[boolean] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[IGNORE_UNKNOWN_CHECKS_FLAG] operator[:] identifier[builder] operator[SEP] identifier[setIgnoreUnknownChecks] operator[SEP] literal[boolean] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[DISABLE_WARNINGS_IN_GENERATED_CODE_FLAG] operator[:] identifier[builder] operator[SEP] identifier[setDisableWarningsInGeneratedCode] operator[SEP] literal[boolean] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[ERRORS_AS_WARNINGS_FLAG] operator[:] identifier[builder] operator[SEP] identifier[setDropErrorsToWarnings] operator[SEP] literal[boolean] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[ENABLE_ALL_CHECKS] operator[:] identifier[builder] operator[SEP] identifier[setEnableAllChecksAsWarnings] operator[SEP] literal[boolean] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[DISABLE_ALL_CHECKS] operator[:] identifier[builder] operator[SEP] identifier[setDisableAllChecks] operator[SEP] literal[boolean] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[COMPILING_TEST_ONLY_CODE] operator[:] identifier[builder] operator[SEP] identifier[setTestOnlyTarget] operator[SEP] literal[boolean] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[default] operator[:] Keyword[if] operator[SEP] identifier[arg] operator[SEP] identifier[startsWith] operator[SEP] identifier[SEVERITY_PREFIX] operator[SEP] operator[SEP] { identifier[builder] operator[SEP] identifier[parseSeverity] operator[SEP] identifier[arg] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[arg] operator[SEP] identifier[startsWith] operator[SEP] identifier[ErrorProneFlags] operator[SEP] identifier[PREFIX] operator[SEP] operator[SEP] { identifier[builder] operator[SEP] identifier[parseFlag] operator[SEP] identifier[arg] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[arg] operator[SEP] identifier[startsWith] operator[SEP] identifier[PATCH_OUTPUT_LOCATION] operator[SEP] operator[SEP] { identifier[String] identifier[remaining] operator[=] identifier[arg] operator[SEP] identifier[substring] operator[SEP] identifier[PATCH_OUTPUT_LOCATION] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[remaining] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] { identifier[builder] operator[SEP] identifier[patchingOptionsBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[inPlace] operator[SEP] literal[boolean] operator[SEP] operator[SEP] } Keyword[else] { Keyword[if] operator[SEP] identifier[remaining] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { Keyword[throw] Keyword[new] identifier[InvalidCommandLineOptionException] operator[SEP] literal[String] operator[+] identifier[arg] operator[SEP] operator[SEP] } identifier[builder] operator[SEP] identifier[patchingOptionsBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[baseDirectory] operator[SEP] identifier[remaining] operator[SEP] operator[SEP] } } Keyword[else] Keyword[if] operator[SEP] identifier[arg] operator[SEP] identifier[startsWith] operator[SEP] identifier[PATCH_CHECKS_PREFIX] operator[SEP] operator[SEP] { identifier[String] identifier[remaining] operator[=] identifier[arg] operator[SEP] identifier[substring] operator[SEP] identifier[PATCH_CHECKS_PREFIX] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[remaining] operator[SEP] identifier[startsWith] operator[SEP] literal[String] operator[SEP] operator[SEP] { identifier[builder] operator[SEP] identifier[patchingOptionsBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[customRefactorer] operator[SEP] operator[SEP] operator[SEP] operator[->] { identifier[String] identifier[path] operator[=] identifier[remaining] operator[SEP] identifier[substring] operator[SEP] literal[String] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[try] operator[SEP] identifier[InputStream] identifier[in] operator[=] identifier[Files] operator[SEP] identifier[newInputStream] operator[SEP] identifier[FileSystems] operator[SEP] identifier[getDefault] operator[SEP] operator[SEP] operator[SEP] identifier[getPath] operator[SEP] identifier[path] operator[SEP] operator[SEP] operator[SEP] identifier[ObjectInputStream] identifier[ois] operator[=] Keyword[new] identifier[ObjectInputStream] operator[SEP] identifier[in] operator[SEP] operator[SEP] { Keyword[return] operator[SEP] identifier[CodeTransformer] operator[SEP] identifier[ois] operator[SEP] identifier[readObject] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[IOException] operator[|] identifier[ClassNotFoundException] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[RuntimeException] operator[SEP] literal[String] operator[+] identifier[path] , identifier[e] operator[SEP] operator[SEP] } } operator[SEP] operator[SEP] } Keyword[else] { identifier[Iterable] operator[<] identifier[String] operator[>] identifier[checks] operator[=] identifier[Splitter] operator[SEP] identifier[on] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[trimResults] operator[SEP] operator[SEP] operator[SEP] identifier[split] operator[SEP] identifier[remaining] operator[SEP] operator[SEP] identifier[builder] operator[SEP] identifier[patchingOptionsBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[namedCheckers] operator[SEP] identifier[ImmutableSet] operator[SEP] identifier[copyOf] operator[SEP] identifier[checks] operator[SEP] operator[SEP] operator[SEP] } } Keyword[else] Keyword[if] operator[SEP] identifier[arg] operator[SEP] identifier[startsWith] operator[SEP] identifier[PATCH_IMPORT_ORDER_PREFIX] operator[SEP] operator[SEP] { identifier[String] identifier[remaining] operator[=] identifier[arg] operator[SEP] identifier[substring] operator[SEP] identifier[PATCH_IMPORT_ORDER_PREFIX] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[ImportOrganizer] identifier[importOrganizer] operator[=] identifier[ImportOrderParser] operator[SEP] identifier[getImportOrganizer] operator[SEP] identifier[remaining] operator[SEP] operator[SEP] identifier[builder] operator[SEP] identifier[patchingOptionsBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[importOrganizer] operator[SEP] identifier[importOrganizer] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[arg] operator[SEP] identifier[startsWith] operator[SEP] identifier[EXCLUDED_PATHS_PREFIX] operator[SEP] operator[SEP] { identifier[String] identifier[pathRegex] operator[=] identifier[arg] operator[SEP] identifier[substring] operator[SEP] identifier[EXCLUDED_PATHS_PREFIX] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[builder] operator[SEP] identifier[setExcludedPattern] operator[SEP] identifier[Pattern] operator[SEP] identifier[compile] operator[SEP] identifier[pathRegex] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[remainingArgs] operator[SEP] identifier[add] operator[SEP] identifier[arg] operator[SEP] operator[SEP] } } } Keyword[return] identifier[builder] operator[SEP] identifier[build] operator[SEP] identifier[remainingArgs] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
public static ModelBean createModel(Class<?> clazz, IncludeValidation includeValidation) { OutputConfig outputConfig = new OutputConfig(); outputConfig.setIncludeValidation(includeValidation); return createModel(clazz, outputConfig); }
class class_name[name] begin[{] method[createModel, return_type[type[ModelBean]], modifier[public static], parameter[clazz, includeValidation]] begin[{] local_variable[type[OutputConfig], outputConfig] call[outputConfig.setIncludeValidation, parameter[member[.includeValidation]]] return[call[.createModel, parameter[member[.clazz], member[.outputConfig]]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[ModelBean] identifier[createModel] operator[SEP] identifier[Class] operator[<] operator[?] operator[>] identifier[clazz] , identifier[IncludeValidation] identifier[includeValidation] operator[SEP] { identifier[OutputConfig] identifier[outputConfig] operator[=] Keyword[new] identifier[OutputConfig] operator[SEP] operator[SEP] operator[SEP] identifier[outputConfig] operator[SEP] identifier[setIncludeValidation] operator[SEP] identifier[includeValidation] operator[SEP] operator[SEP] Keyword[return] identifier[createModel] operator[SEP] identifier[clazz] , identifier[outputConfig] operator[SEP] operator[SEP] }
public static boolean isSameMonth(Date date1, Date date2) { return isSameMonth(toCalendar(date1), toCalendar(date2)); }
class class_name[name] begin[{] method[isSameMonth, return_type[type[boolean]], modifier[public static], parameter[date1, date2]] begin[{] return[call[.isSameMonth, parameter[call[.toCalendar, parameter[member[.date1]]], call[.toCalendar, parameter[member[.date2]]]]]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[boolean] identifier[isSameMonth] operator[SEP] identifier[Date] identifier[date1] , identifier[Date] identifier[date2] operator[SEP] { Keyword[return] identifier[isSameMonth] operator[SEP] identifier[toCalendar] operator[SEP] identifier[date1] operator[SEP] , identifier[toCalendar] operator[SEP] identifier[date2] operator[SEP] operator[SEP] operator[SEP] }
public String formatInterval(Interval interval, DataColumn column) { // Raw values if (column == null || column.getColumnGroup() == null) { return interval.getName(); } // Date interval String type = interval.getType(); if (StringUtils.isBlank(type)) type = column.getIntervalType(); if (StringUtils.isBlank(type)) type = column.getColumnGroup().getIntervalSize(); DateIntervalType intervalType = DateIntervalType.getByName(type); if (intervalType != null) { ColumnSettings columnSettings = displayerSettings.getColumnSettings(column.getId()); String pattern = columnSettings != null ? columnSettings.getValuePattern() : ColumnSettings.getDatePattern(intervalType); String expression = columnSettings != null ? columnSettings.getValueExpression() : null; if (pattern == null) { pattern = ColumnSettings.getDatePattern(intervalType); } if (expression == null && column.getColumnGroup().getStrategy().equals(GroupStrategy.FIXED)) { expression = ColumnSettings.getFixedExpression(intervalType); } return formatDate(intervalType, column.getColumnGroup().getStrategy(), interval.getName(), pattern, expression); } // Label interval ColumnSettings columnSettings = displayerSettings.getColumnSettings(column); String expression = columnSettings.getValueExpression(); if (StringUtils.isBlank(expression)) return interval.getName(); return getEvaluator().evalExpression(interval.getName(), expression); }
class class_name[name] begin[{] method[formatInterval, return_type[type[String]], modifier[public], parameter[interval, column]] begin[{] if[binary_operation[binary_operation[member[.column], ==, literal[null]], ||, binary_operation[call[column.getColumnGroup, parameter[]], ==, literal[null]]]] begin[{] return[call[interval.getName, parameter[]]] else begin[{] None end[}] local_variable[type[String], type] if[call[StringUtils.isBlank, parameter[member[.type]]]] begin[{] assign[member[.type], call[column.getIntervalType, parameter[]]] else begin[{] None end[}] if[call[StringUtils.isBlank, parameter[member[.type]]]] begin[{] assign[member[.type], call[column.getColumnGroup, parameter[]]] else begin[{] None end[}] local_variable[type[DateIntervalType], intervalType] if[binary_operation[member[.intervalType], !=, literal[null]]] begin[{] local_variable[type[ColumnSettings], columnSettings] local_variable[type[String], pattern] local_variable[type[String], expression] if[binary_operation[member[.pattern], ==, literal[null]]] begin[{] assign[member[.pattern], call[ColumnSettings.getDatePattern, parameter[member[.intervalType]]]] else begin[{] None end[}] if[binary_operation[binary_operation[member[.expression], ==, literal[null]], &&, call[column.getColumnGroup, parameter[]]]] begin[{] assign[member[.expression], call[ColumnSettings.getFixedExpression, parameter[member[.intervalType]]]] else begin[{] None end[}] return[call[.formatDate, parameter[member[.intervalType], call[column.getColumnGroup, parameter[]], call[interval.getName, parameter[]], member[.pattern], member[.expression]]]] else begin[{] None end[}] local_variable[type[ColumnSettings], columnSettings] local_variable[type[String], expression] if[call[StringUtils.isBlank, parameter[member[.expression]]]] begin[{] return[call[interval.getName, parameter[]]] else begin[{] None end[}] return[call[.getEvaluator, parameter[]]] end[}] END[}]
Keyword[public] identifier[String] identifier[formatInterval] operator[SEP] identifier[Interval] identifier[interval] , identifier[DataColumn] identifier[column] operator[SEP] { Keyword[if] operator[SEP] identifier[column] operator[==] Other[null] operator[||] identifier[column] operator[SEP] identifier[getColumnGroup] operator[SEP] operator[SEP] operator[==] Other[null] operator[SEP] { Keyword[return] identifier[interval] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] } identifier[String] identifier[type] operator[=] identifier[interval] operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[StringUtils] operator[SEP] identifier[isBlank] operator[SEP] identifier[type] operator[SEP] operator[SEP] identifier[type] operator[=] identifier[column] operator[SEP] identifier[getIntervalType] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[StringUtils] operator[SEP] identifier[isBlank] operator[SEP] identifier[type] operator[SEP] operator[SEP] identifier[type] operator[=] identifier[column] operator[SEP] identifier[getColumnGroup] operator[SEP] operator[SEP] operator[SEP] identifier[getIntervalSize] operator[SEP] operator[SEP] operator[SEP] identifier[DateIntervalType] identifier[intervalType] operator[=] identifier[DateIntervalType] operator[SEP] identifier[getByName] operator[SEP] identifier[type] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[intervalType] operator[!=] Other[null] operator[SEP] { identifier[ColumnSettings] identifier[columnSettings] operator[=] identifier[displayerSettings] operator[SEP] identifier[getColumnSettings] operator[SEP] identifier[column] operator[SEP] identifier[getId] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[pattern] operator[=] identifier[columnSettings] operator[!=] Other[null] operator[?] identifier[columnSettings] operator[SEP] identifier[getValuePattern] operator[SEP] operator[SEP] operator[:] identifier[ColumnSettings] operator[SEP] identifier[getDatePattern] operator[SEP] identifier[intervalType] operator[SEP] operator[SEP] identifier[String] identifier[expression] operator[=] identifier[columnSettings] operator[!=] Other[null] operator[?] identifier[columnSettings] operator[SEP] identifier[getValueExpression] operator[SEP] operator[SEP] operator[:] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[pattern] operator[==] Other[null] operator[SEP] { identifier[pattern] operator[=] identifier[ColumnSettings] operator[SEP] identifier[getDatePattern] operator[SEP] identifier[intervalType] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[expression] operator[==] Other[null] operator[&&] identifier[column] operator[SEP] identifier[getColumnGroup] operator[SEP] operator[SEP] operator[SEP] identifier[getStrategy] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[GroupStrategy] operator[SEP] identifier[FIXED] operator[SEP] operator[SEP] { identifier[expression] operator[=] identifier[ColumnSettings] operator[SEP] identifier[getFixedExpression] operator[SEP] identifier[intervalType] operator[SEP] operator[SEP] } Keyword[return] identifier[formatDate] operator[SEP] identifier[intervalType] , identifier[column] operator[SEP] identifier[getColumnGroup] operator[SEP] operator[SEP] operator[SEP] identifier[getStrategy] operator[SEP] operator[SEP] , identifier[interval] operator[SEP] identifier[getName] operator[SEP] operator[SEP] , identifier[pattern] , identifier[expression] operator[SEP] operator[SEP] } identifier[ColumnSettings] identifier[columnSettings] operator[=] identifier[displayerSettings] operator[SEP] identifier[getColumnSettings] operator[SEP] identifier[column] operator[SEP] operator[SEP] identifier[String] identifier[expression] operator[=] identifier[columnSettings] operator[SEP] identifier[getValueExpression] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[StringUtils] operator[SEP] identifier[isBlank] operator[SEP] identifier[expression] operator[SEP] operator[SEP] Keyword[return] identifier[interval] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[getEvaluator] operator[SEP] operator[SEP] operator[SEP] identifier[evalExpression] operator[SEP] identifier[interval] operator[SEP] identifier[getName] operator[SEP] operator[SEP] , identifier[expression] operator[SEP] operator[SEP] }
@Override public <H> Choice8<A, B, C, D, E, F, G, H> diverge() { return match(Choice8::a, Choice8::b, Choice8::c, Choice8::d, Choice8::e, Choice8::f, Choice8::g); }
class class_name[name] begin[{] method[diverge, return_type[type[Choice8]], modifier[public], parameter[]] begin[{] return[call[.match, parameter[MethodReference(expression=MemberReference(member=Choice8, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), method=MemberReference(member=a, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type_arguments=[]), MethodReference(expression=MemberReference(member=Choice8, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), method=MemberReference(member=b, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type_arguments=[]), MethodReference(expression=MemberReference(member=Choice8, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), method=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type_arguments=[]), MethodReference(expression=MemberReference(member=Choice8, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), method=MemberReference(member=d, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type_arguments=[]), MethodReference(expression=MemberReference(member=Choice8, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), method=MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type_arguments=[]), MethodReference(expression=MemberReference(member=Choice8, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), method=MemberReference(member=f, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type_arguments=[]), MethodReference(expression=MemberReference(member=Choice8, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), method=MemberReference(member=g, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type_arguments=[])]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] operator[<] identifier[H] operator[>] identifier[Choice8] operator[<] identifier[A] , identifier[B] , identifier[C] , identifier[D] , identifier[E] , identifier[F] , identifier[G] , identifier[H] operator[>] identifier[diverge] operator[SEP] operator[SEP] { Keyword[return] identifier[match] operator[SEP] identifier[Choice8] operator[::] identifier[a] , identifier[Choice8] operator[::] identifier[b] , identifier[Choice8] operator[::] identifier[c] , identifier[Choice8] operator[::] identifier[d] , identifier[Choice8] operator[::] identifier[e] , identifier[Choice8] operator[::] identifier[f] , identifier[Choice8] operator[::] identifier[g] operator[SEP] operator[SEP] }
protected static <E> List<E> rebaseList(List<E> externalObjectList, ScoreDirector<?> destinationScoreDirector) { List<E> rebasedObjectList = new ArrayList<>(externalObjectList.size()); for (E entity : externalObjectList) { rebasedObjectList.add(destinationScoreDirector.lookUpWorkingObject(entity)); } return rebasedObjectList; }
class class_name[name] begin[{] method[rebaseList, return_type[type[List]], modifier[static protected], parameter[externalObjectList, destinationScoreDirector]] begin[{] local_variable[type[List], rebasedObjectList] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=entity, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=lookUpWorkingObject, postfix_operators=[], prefix_operators=[], qualifier=destinationScoreDirector, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=rebasedObjectList, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=externalObjectList, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=entity)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=E, sub_type=None))), label=None) return[member[.rebasedObjectList]] end[}] END[}]
Keyword[protected] Keyword[static] operator[<] identifier[E] operator[>] identifier[List] operator[<] identifier[E] operator[>] identifier[rebaseList] operator[SEP] identifier[List] operator[<] identifier[E] operator[>] identifier[externalObjectList] , identifier[ScoreDirector] operator[<] operator[?] operator[>] identifier[destinationScoreDirector] operator[SEP] { identifier[List] operator[<] identifier[E] operator[>] identifier[rebasedObjectList] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] identifier[externalObjectList] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[E] identifier[entity] operator[:] identifier[externalObjectList] operator[SEP] { identifier[rebasedObjectList] operator[SEP] identifier[add] operator[SEP] identifier[destinationScoreDirector] operator[SEP] identifier[lookUpWorkingObject] operator[SEP] identifier[entity] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[rebasedObjectList] operator[SEP] }
void buildPT_T() { int numTags = tagIndex.size(); m_TT = new double[numTags][numTags]; m_T = new double[numTags]; double[] tmp = new double[numTags]; for (IntTaggedWord word : words) { double tot = 0.0; for (int t = 0; t < numTags; t++) { IntTaggedWord iTW = new IntTaggedWord(word.word, t); tmp[t] = seenCounter.getCount(iTW); tot += tmp[t]; } if (tot < 10) { continue; } for (int t = 0; t < numTags; t++) { for (int t2 = 0; t2 < numTags; t2++) { if (tmp[t2] > 0.0) { double c = tmp[t] / tot; m_T[t] += c; m_TT[t2][t] += c; } } } } }
class class_name[name] begin[{] method[buildPT_T, return_type[void], modifier[default], parameter[]] begin[{] local_variable[type[int], numTags] assign[member[.m_TT], ArrayCreator(dimensions=[MemberReference(member=numTags, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=numTags, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=None, name=double))] assign[member[.m_T], ArrayCreator(dimensions=[MemberReference(member=numTags, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=None, name=double))] local_variable[type[double], tmp] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0.0), name=tot)], modifiers=set(), type=BasicType(dimensions=[], name=double)), ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MemberReference(member=word, postfix_operators=[], prefix_operators=[], qualifier=word, selectors=[]), MemberReference(member=t, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IntTaggedWord, sub_type=None)), name=iTW)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=IntTaggedWord, sub_type=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=tmp, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=t, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MethodInvocation(arguments=[MemberReference(member=iTW, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getCount, postfix_operators=[], prefix_operators=[], qualifier=seenCounter, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=tot, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=MemberReference(member=tmp, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=t, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=t, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=numTags, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=t)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=t, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=tot, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=10), operator=<), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ContinueStatement(goto=None, label=None)])), ForStatement(body=BlockStatement(label=None, statements=[ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=tmp, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=t2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0.0), operator=>), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=MemberReference(member=tmp, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=t, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operandr=MemberReference(member=tot, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=/), name=c)], modifiers=set(), type=BasicType(dimensions=[], name=double)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=m_T, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=t, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type=+=, value=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=m_TT, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=t2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), ArraySelector(index=MemberReference(member=t, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type=+=, value=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=t2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=numTags, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=t2)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=t2, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=t, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=numTags, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=t)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=t, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=words, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=word)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=IntTaggedWord, sub_type=None))), label=None) end[}] END[}]
Keyword[void] identifier[buildPT_T] operator[SEP] operator[SEP] { Keyword[int] identifier[numTags] operator[=] identifier[tagIndex] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] identifier[m_TT] operator[=] Keyword[new] Keyword[double] operator[SEP] identifier[numTags] operator[SEP] operator[SEP] identifier[numTags] operator[SEP] operator[SEP] identifier[m_T] operator[=] Keyword[new] Keyword[double] operator[SEP] identifier[numTags] operator[SEP] operator[SEP] Keyword[double] operator[SEP] operator[SEP] identifier[tmp] operator[=] Keyword[new] Keyword[double] operator[SEP] identifier[numTags] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[IntTaggedWord] identifier[word] operator[:] identifier[words] operator[SEP] { Keyword[double] identifier[tot] operator[=] literal[Float] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[t] operator[=] Other[0] operator[SEP] identifier[t] operator[<] identifier[numTags] operator[SEP] identifier[t] operator[++] operator[SEP] { identifier[IntTaggedWord] identifier[iTW] operator[=] Keyword[new] identifier[IntTaggedWord] operator[SEP] identifier[word] operator[SEP] identifier[word] , identifier[t] operator[SEP] operator[SEP] identifier[tmp] operator[SEP] identifier[t] operator[SEP] operator[=] identifier[seenCounter] operator[SEP] identifier[getCount] operator[SEP] identifier[iTW] operator[SEP] operator[SEP] identifier[tot] operator[+=] identifier[tmp] operator[SEP] identifier[t] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[tot] operator[<] Other[10] operator[SEP] { Keyword[continue] operator[SEP] } Keyword[for] operator[SEP] Keyword[int] identifier[t] operator[=] Other[0] operator[SEP] identifier[t] operator[<] identifier[numTags] operator[SEP] identifier[t] operator[++] operator[SEP] { Keyword[for] operator[SEP] Keyword[int] identifier[t2] operator[=] Other[0] operator[SEP] identifier[t2] operator[<] identifier[numTags] operator[SEP] identifier[t2] operator[++] operator[SEP] { Keyword[if] operator[SEP] identifier[tmp] operator[SEP] identifier[t2] operator[SEP] operator[>] literal[Float] operator[SEP] { Keyword[double] identifier[c] operator[=] identifier[tmp] operator[SEP] identifier[t] operator[SEP] operator[/] identifier[tot] operator[SEP] identifier[m_T] operator[SEP] identifier[t] operator[SEP] operator[+=] identifier[c] operator[SEP] identifier[m_TT] operator[SEP] identifier[t2] operator[SEP] operator[SEP] identifier[t] operator[SEP] operator[+=] identifier[c] operator[SEP] } } } } }
@JRubyMethod public static IRubyObject yaml_initialize(IRubyObject self, IRubyObject klass, IRubyObject ivars) { ((RubyObject)self).fastSetInstanceVariable("@class", klass); ((RubyObject)self).fastSetInstanceVariable("@ivars", ivars); return self; }
class class_name[name] begin[{] method[yaml_initialize, return_type[type[IRubyObject]], modifier[public static], parameter[self, klass, ivars]] begin[{] Cast(expression=MemberReference(member=self, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=RubyObject, sub_type=None)) Cast(expression=MemberReference(member=self, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=RubyObject, sub_type=None)) return[member[.self]] end[}] END[}]
annotation[@] identifier[JRubyMethod] Keyword[public] Keyword[static] identifier[IRubyObject] identifier[yaml_initialize] operator[SEP] identifier[IRubyObject] identifier[self] , identifier[IRubyObject] identifier[klass] , identifier[IRubyObject] identifier[ivars] operator[SEP] { operator[SEP] operator[SEP] identifier[RubyObject] operator[SEP] identifier[self] operator[SEP] operator[SEP] identifier[fastSetInstanceVariable] operator[SEP] literal[String] , identifier[klass] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[RubyObject] operator[SEP] identifier[self] operator[SEP] operator[SEP] identifier[fastSetInstanceVariable] operator[SEP] literal[String] , identifier[ivars] operator[SEP] operator[SEP] Keyword[return] identifier[self] operator[SEP] }
public void marshall(GetCurrentMetricDataRequest getCurrentMetricDataRequest, ProtocolMarshaller protocolMarshaller) { if (getCurrentMetricDataRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(getCurrentMetricDataRequest.getInstanceId(), INSTANCEID_BINDING); protocolMarshaller.marshall(getCurrentMetricDataRequest.getFilters(), FILTERS_BINDING); protocolMarshaller.marshall(getCurrentMetricDataRequest.getGroupings(), GROUPINGS_BINDING); protocolMarshaller.marshall(getCurrentMetricDataRequest.getCurrentMetrics(), CURRENTMETRICS_BINDING); protocolMarshaller.marshall(getCurrentMetricDataRequest.getNextToken(), NEXTTOKEN_BINDING); protocolMarshaller.marshall(getCurrentMetricDataRequest.getMaxResults(), MAXRESULTS_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[getCurrentMetricDataRequest, protocolMarshaller]] begin[{] if[binary_operation[member[.getCurrentMetricDataRequest], ==, 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=getInstanceId, postfix_operators=[], prefix_operators=[], qualifier=getCurrentMetricDataRequest, selectors=[], type_arguments=None), MemberReference(member=INSTANCEID_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=getFilters, postfix_operators=[], prefix_operators=[], qualifier=getCurrentMetricDataRequest, selectors=[], type_arguments=None), MemberReference(member=FILTERS_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=getGroupings, postfix_operators=[], prefix_operators=[], qualifier=getCurrentMetricDataRequest, selectors=[], type_arguments=None), MemberReference(member=GROUPINGS_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=getCurrentMetrics, postfix_operators=[], prefix_operators=[], qualifier=getCurrentMetricDataRequest, selectors=[], type_arguments=None), MemberReference(member=CURRENTMETRICS_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=getCurrentMetricDataRequest, 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), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getMaxResults, postfix_operators=[], prefix_operators=[], qualifier=getCurrentMetricDataRequest, 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)], 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[GetCurrentMetricDataRequest] identifier[getCurrentMetricDataRequest] , identifier[ProtocolMarshaller] identifier[protocolMarshaller] operator[SEP] { Keyword[if] operator[SEP] identifier[getCurrentMetricDataRequest] 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[getCurrentMetricDataRequest] operator[SEP] identifier[getInstanceId] operator[SEP] operator[SEP] , identifier[INSTANCEID_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[getCurrentMetricDataRequest] operator[SEP] identifier[getFilters] operator[SEP] operator[SEP] , identifier[FILTERS_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[getCurrentMetricDataRequest] operator[SEP] identifier[getGroupings] operator[SEP] operator[SEP] , identifier[GROUPINGS_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[getCurrentMetricDataRequest] operator[SEP] identifier[getCurrentMetrics] operator[SEP] operator[SEP] , identifier[CURRENTMETRICS_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[getCurrentMetricDataRequest] operator[SEP] identifier[getNextToken] operator[SEP] operator[SEP] , identifier[NEXTTOKEN_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[getCurrentMetricDataRequest] operator[SEP] identifier[getMaxResults] operator[SEP] operator[SEP] , identifier[MAXRESULTS_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 SelectIterator<T, ID> buildIterator(BaseDaoImpl<T, ID> classDao, ConnectionSource connectionSource, int resultFlags, ObjectCache objectCache) throws SQLException { prepareQueryForAll(); return buildIterator(classDao, connectionSource, preparedQueryForAll, objectCache, resultFlags); }
class class_name[name] begin[{] method[buildIterator, return_type[type[SelectIterator]], modifier[public], parameter[classDao, connectionSource, resultFlags, objectCache]] begin[{] call[.prepareQueryForAll, parameter[]] return[call[.buildIterator, parameter[member[.classDao], member[.connectionSource], member[.preparedQueryForAll], member[.objectCache], member[.resultFlags]]]] end[}] END[}]
Keyword[public] identifier[SelectIterator] operator[<] identifier[T] , identifier[ID] operator[>] identifier[buildIterator] operator[SEP] identifier[BaseDaoImpl] operator[<] identifier[T] , identifier[ID] operator[>] identifier[classDao] , identifier[ConnectionSource] identifier[connectionSource] , Keyword[int] identifier[resultFlags] , identifier[ObjectCache] identifier[objectCache] operator[SEP] Keyword[throws] identifier[SQLException] { identifier[prepareQueryForAll] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[buildIterator] operator[SEP] identifier[classDao] , identifier[connectionSource] , identifier[preparedQueryForAll] , identifier[objectCache] , identifier[resultFlags] operator[SEP] operator[SEP] }
protected static StopwatchSource<HttpServletRequest> initStopwatchSource(FilterConfig filterConfig, Manager manager) { String stopwatchSourceClass = filterConfig.getInitParameter(SimonServletFilter.INIT_PARAM_STOPWATCH_SOURCE_CLASS); StopwatchSource<HttpServletRequest> stopwatchSource = createMonitorSource(stopwatchSourceClass, manager); injectSimonPrefixIntoMonitorSource(filterConfig, stopwatchSource); String cache = filterConfig.getInitParameter(SimonServletFilter.INIT_PARAM_STOPWATCH_SOURCE_CACHE); stopwatchSource = wrapMonitorSourceWithCacheIfNeeded(stopwatchSource, cache); return stopwatchSource; }
class class_name[name] begin[{] method[initStopwatchSource, return_type[type[StopwatchSource]], modifier[static protected], parameter[filterConfig, manager]] begin[{] local_variable[type[String], stopwatchSourceClass] local_variable[type[StopwatchSource], stopwatchSource] call[.injectSimonPrefixIntoMonitorSource, parameter[member[.filterConfig], member[.stopwatchSource]]] local_variable[type[String], cache] assign[member[.stopwatchSource], call[.wrapMonitorSourceWithCacheIfNeeded, parameter[member[.stopwatchSource], member[.cache]]]] return[member[.stopwatchSource]] end[}] END[}]
Keyword[protected] Keyword[static] identifier[StopwatchSource] operator[<] identifier[HttpServletRequest] operator[>] identifier[initStopwatchSource] operator[SEP] identifier[FilterConfig] identifier[filterConfig] , identifier[Manager] identifier[manager] operator[SEP] { identifier[String] identifier[stopwatchSourceClass] operator[=] identifier[filterConfig] operator[SEP] identifier[getInitParameter] operator[SEP] identifier[SimonServletFilter] operator[SEP] identifier[INIT_PARAM_STOPWATCH_SOURCE_CLASS] operator[SEP] operator[SEP] identifier[StopwatchSource] operator[<] identifier[HttpServletRequest] operator[>] identifier[stopwatchSource] operator[=] identifier[createMonitorSource] operator[SEP] identifier[stopwatchSourceClass] , identifier[manager] operator[SEP] operator[SEP] identifier[injectSimonPrefixIntoMonitorSource] operator[SEP] identifier[filterConfig] , identifier[stopwatchSource] operator[SEP] operator[SEP] identifier[String] identifier[cache] operator[=] identifier[filterConfig] operator[SEP] identifier[getInitParameter] operator[SEP] identifier[SimonServletFilter] operator[SEP] identifier[INIT_PARAM_STOPWATCH_SOURCE_CACHE] operator[SEP] operator[SEP] identifier[stopwatchSource] operator[=] identifier[wrapMonitorSourceWithCacheIfNeeded] operator[SEP] identifier[stopwatchSource] , identifier[cache] operator[SEP] operator[SEP] Keyword[return] identifier[stopwatchSource] operator[SEP] }
public void setTokens(int i, String v) { if (FeatureTokens_Type.featOkTst && ((FeatureTokens_Type)jcasType).casFeat_tokens == null) jcasType.jcas.throwFeatMissing("tokens", "ch.epfl.bbp.uima.types.FeatureTokens"); jcasType.jcas.checkArrayBounds(jcasType.ll_cas.ll_getRefValue(addr, ((FeatureTokens_Type)jcasType).casFeatCode_tokens), i); jcasType.ll_cas.ll_setStringArrayValue(jcasType.ll_cas.ll_getRefValue(addr, ((FeatureTokens_Type)jcasType).casFeatCode_tokens), i, v);}
class class_name[name] begin[{] method[setTokens, return_type[void], modifier[public], parameter[i, v]] begin[{] if[binary_operation[member[FeatureTokens_Type.featOkTst], &&, binary_operation[Cast(expression=MemberReference(member=jcasType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=FeatureTokens_Type, sub_type=None)), ==, literal[null]]]] begin[{] call[jcasType.jcas.throwFeatMissing, parameter[literal["tokens"], literal["ch.epfl.bbp.uima.types.FeatureTokens"]]] else begin[{] None end[}] call[jcasType.jcas.checkArrayBounds, parameter[call[jcasType.ll_cas.ll_getRefValue, parameter[member[.addr], Cast(expression=MemberReference(member=jcasType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=FeatureTokens_Type, sub_type=None))]], member[.i]]] call[jcasType.ll_cas.ll_setStringArrayValue, parameter[call[jcasType.ll_cas.ll_getRefValue, parameter[member[.addr], Cast(expression=MemberReference(member=jcasType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=FeatureTokens_Type, sub_type=None))]], member[.i], member[.v]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[setTokens] operator[SEP] Keyword[int] identifier[i] , identifier[String] identifier[v] operator[SEP] { Keyword[if] operator[SEP] identifier[FeatureTokens_Type] operator[SEP] identifier[featOkTst] operator[&&] operator[SEP] operator[SEP] identifier[FeatureTokens_Type] operator[SEP] identifier[jcasType] operator[SEP] operator[SEP] identifier[casFeat_tokens] operator[==] Other[null] operator[SEP] identifier[jcasType] operator[SEP] identifier[jcas] operator[SEP] identifier[throwFeatMissing] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[jcasType] operator[SEP] identifier[jcas] operator[SEP] identifier[checkArrayBounds] operator[SEP] identifier[jcasType] operator[SEP] identifier[ll_cas] operator[SEP] identifier[ll_getRefValue] operator[SEP] identifier[addr] , operator[SEP] operator[SEP] identifier[FeatureTokens_Type] operator[SEP] identifier[jcasType] operator[SEP] operator[SEP] identifier[casFeatCode_tokens] operator[SEP] , identifier[i] operator[SEP] operator[SEP] identifier[jcasType] operator[SEP] identifier[ll_cas] operator[SEP] identifier[ll_setStringArrayValue] operator[SEP] identifier[jcasType] operator[SEP] identifier[ll_cas] operator[SEP] identifier[ll_getRefValue] operator[SEP] identifier[addr] , operator[SEP] operator[SEP] identifier[FeatureTokens_Type] operator[SEP] identifier[jcasType] operator[SEP] operator[SEP] identifier[casFeatCode_tokens] operator[SEP] , identifier[i] , identifier[v] operator[SEP] operator[SEP] }
public static boolean adjustProtonation(IMolecularFormula mf, int hcnt) { if (mf == null) throw new NullPointerException("No formula provided"); if (hcnt == 0) return false; // no protons to add final IChemObjectBuilder bldr = mf.getBuilder(); final int chg = mf.getCharge() != null ? mf.getCharge() : 0; IIsotope proton = null; int pcount = 0; for (IIsotope iso : mf.isotopes()) { if ("H".equals(iso.getSymbol())) { final int count = mf.getIsotopeCount(iso); if (count < hcnt) continue; // acceptable if (proton == null && (iso.getMassNumber() == null || iso.getMassNumber() == 1)) { proton = iso; pcount = count; } // better else if (proton != null && iso.getMassNumber() != null && iso.getMassNumber() == 1 && proton.getMassNumber() == null) { proton = iso; pcount = count; } } } if (proton == null && hcnt < 0) { return false; } else if (proton == null && hcnt > 0) { proton = bldr.newInstance(IIsotope.class, "H"); proton.setMassNumber(1); } mf.removeIsotope(proton); if (pcount + hcnt > 0) mf.addIsotope(proton, pcount + hcnt); mf.setCharge(chg + hcnt); return true; }
class class_name[name] begin[{] method[adjustProtonation, return_type[type[boolean]], modifier[public static], parameter[mf, hcnt]] begin[{] if[binary_operation[member[.mf], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="No formula provided")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=NullPointerException, sub_type=None)), label=None) else begin[{] None end[}] if[binary_operation[member[.hcnt], ==, literal[0]]] begin[{] return[literal[false]] else begin[{] None end[}] local_variable[type[IChemObjectBuilder], bldr] local_variable[type[int], chg] local_variable[type[IIsotope], proton] local_variable[type[int], pcount] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getSymbol, postfix_operators=[], prefix_operators=[], qualifier=iso, selectors=[], type_arguments=None)], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], value="H"), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=iso, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getIsotopeCount, postfix_operators=[], prefix_operators=[], qualifier=mf, selectors=[], type_arguments=None), name=count)], modifiers={'final'}, type=BasicType(dimensions=[], name=int)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=count, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=hcnt, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), else_statement=None, label=None, then_statement=ContinueStatement(goto=None, label=None)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=proton, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), operandr=BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getMassNumber, postfix_operators=[], prefix_operators=[], qualifier=iso, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getMassNumber, postfix_operators=[], prefix_operators=[], qualifier=iso, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator===), operator=||), operator=&&), else_statement=IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=proton, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getMassNumber, postfix_operators=[], prefix_operators=[], qualifier=iso, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operator=&&), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getMassNumber, postfix_operators=[], prefix_operators=[], qualifier=iso, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator===), operator=&&), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getMassNumber, postfix_operators=[], prefix_operators=[], qualifier=proton, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=proton, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=iso, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=pcount, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=count, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=proton, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=iso, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=pcount, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=count, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)]))]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=isotopes, postfix_operators=[], prefix_operators=[], qualifier=mf, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=iso)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=IIsotope, sub_type=None))), label=None) if[binary_operation[binary_operation[member[.proton], ==, literal[null]], &&, binary_operation[member[.hcnt], <, literal[0]]]] begin[{] return[literal[false]] else begin[{] if[binary_operation[binary_operation[member[.proton], ==, literal[null]], &&, binary_operation[member[.hcnt], >, literal[0]]]] begin[{] assign[member[.proton], call[bldr.newInstance, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IIsotope, sub_type=None)), literal["H"]]]] call[proton.setMassNumber, parameter[literal[1]]] else begin[{] None end[}] end[}] call[mf.removeIsotope, parameter[member[.proton]]] if[binary_operation[binary_operation[member[.pcount], +, member[.hcnt]], >, literal[0]]] begin[{] call[mf.addIsotope, parameter[member[.proton], binary_operation[member[.pcount], +, member[.hcnt]]]] else begin[{] None end[}] call[mf.setCharge, parameter[binary_operation[member[.chg], +, member[.hcnt]]]] return[literal[true]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[boolean] identifier[adjustProtonation] operator[SEP] identifier[IMolecularFormula] identifier[mf] , Keyword[int] identifier[hcnt] operator[SEP] { Keyword[if] operator[SEP] identifier[mf] operator[==] Other[null] operator[SEP] Keyword[throw] Keyword[new] identifier[NullPointerException] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[hcnt] operator[==] Other[0] operator[SEP] Keyword[return] literal[boolean] operator[SEP] Keyword[final] identifier[IChemObjectBuilder] identifier[bldr] operator[=] identifier[mf] operator[SEP] identifier[getBuilder] operator[SEP] operator[SEP] operator[SEP] Keyword[final] Keyword[int] identifier[chg] operator[=] identifier[mf] operator[SEP] identifier[getCharge] operator[SEP] operator[SEP] operator[!=] Other[null] operator[?] identifier[mf] operator[SEP] identifier[getCharge] operator[SEP] operator[SEP] operator[:] Other[0] operator[SEP] identifier[IIsotope] identifier[proton] operator[=] Other[null] operator[SEP] Keyword[int] identifier[pcount] operator[=] Other[0] operator[SEP] Keyword[for] operator[SEP] identifier[IIsotope] identifier[iso] operator[:] identifier[mf] operator[SEP] identifier[isotopes] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] literal[String] operator[SEP] identifier[equals] operator[SEP] identifier[iso] operator[SEP] identifier[getSymbol] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { Keyword[final] Keyword[int] identifier[count] operator[=] identifier[mf] operator[SEP] identifier[getIsotopeCount] operator[SEP] identifier[iso] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[count] operator[<] identifier[hcnt] operator[SEP] Keyword[continue] operator[SEP] Keyword[if] operator[SEP] identifier[proton] operator[==] Other[null] operator[&&] operator[SEP] identifier[iso] operator[SEP] identifier[getMassNumber] operator[SEP] operator[SEP] operator[==] Other[null] operator[||] identifier[iso] operator[SEP] identifier[getMassNumber] operator[SEP] operator[SEP] operator[==] Other[1] operator[SEP] operator[SEP] { identifier[proton] operator[=] identifier[iso] operator[SEP] identifier[pcount] operator[=] identifier[count] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[proton] operator[!=] Other[null] operator[&&] identifier[iso] operator[SEP] identifier[getMassNumber] operator[SEP] operator[SEP] operator[!=] Other[null] operator[&&] identifier[iso] operator[SEP] identifier[getMassNumber] operator[SEP] operator[SEP] operator[==] Other[1] operator[&&] identifier[proton] operator[SEP] identifier[getMassNumber] operator[SEP] operator[SEP] operator[==] Other[null] operator[SEP] { identifier[proton] operator[=] identifier[iso] operator[SEP] identifier[pcount] operator[=] identifier[count] operator[SEP] } } } Keyword[if] operator[SEP] identifier[proton] operator[==] Other[null] operator[&&] identifier[hcnt] operator[<] Other[0] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[proton] operator[==] Other[null] operator[&&] identifier[hcnt] operator[>] Other[0] operator[SEP] { identifier[proton] operator[=] identifier[bldr] operator[SEP] identifier[newInstance] operator[SEP] identifier[IIsotope] operator[SEP] Keyword[class] , literal[String] operator[SEP] operator[SEP] identifier[proton] operator[SEP] identifier[setMassNumber] operator[SEP] Other[1] operator[SEP] operator[SEP] } identifier[mf] operator[SEP] identifier[removeIsotope] operator[SEP] identifier[proton] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[pcount] operator[+] identifier[hcnt] operator[>] Other[0] operator[SEP] identifier[mf] operator[SEP] identifier[addIsotope] operator[SEP] identifier[proton] , identifier[pcount] operator[+] identifier[hcnt] operator[SEP] operator[SEP] identifier[mf] operator[SEP] identifier[setCharge] operator[SEP] identifier[chg] operator[+] identifier[hcnt] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP] }
@SuppressWarnings("squid:S1168") public String[] selectOptions() { if (isNotPresentSelect()) { return null; // returning an empty array could be confused with no options available } WebElement webElement = element.getWebElement(); Select dropdown = new Select(webElement); List<WebElement> options = dropdown.getOptions(); String[] stringOptions = new String[options.size()]; for (int i = 0; i < options.size(); i++) { stringOptions[i] = options.get(i).getText(); } return stringOptions; }
class class_name[name] begin[{] method[selectOptions, return_type[type[String]], modifier[public], parameter[]] begin[{] if[call[.isNotPresentSelect, parameter[]]] begin[{] return[literal[null]] else begin[{] None end[}] local_variable[type[WebElement], webElement] local_variable[type[Select], dropdown] local_variable[type[List], options] local_variable[type[String], stringOptions] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=stringOptions, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=options, selectors=[MethodInvocation(arguments=[], member=getText, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=options, selectors=[], type_arguments=None), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) return[member[.stringOptions]] end[}] END[}]
annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] Keyword[public] identifier[String] operator[SEP] operator[SEP] identifier[selectOptions] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[isNotPresentSelect] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] Other[null] operator[SEP] } identifier[WebElement] identifier[webElement] operator[=] identifier[element] operator[SEP] identifier[getWebElement] operator[SEP] operator[SEP] operator[SEP] identifier[Select] identifier[dropdown] operator[=] Keyword[new] identifier[Select] operator[SEP] identifier[webElement] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[WebElement] operator[>] identifier[options] operator[=] identifier[dropdown] operator[SEP] identifier[getOptions] operator[SEP] operator[SEP] operator[SEP] identifier[String] operator[SEP] operator[SEP] identifier[stringOptions] operator[=] Keyword[new] identifier[String] operator[SEP] identifier[options] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[options] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[stringOptions] operator[SEP] identifier[i] operator[SEP] operator[=] identifier[options] operator[SEP] identifier[get] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[getText] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[stringOptions] operator[SEP] }
public static <K, V> HashBiMap<K, V> create(Map<? extends K, ? extends V> map) { HashBiMap<K, V> bimap = create(map.size()); bimap.putAll(map); return bimap; }
class class_name[name] begin[{] method[create, return_type[type[HashBiMap]], modifier[public static], parameter[map]] begin[{] local_variable[type[HashBiMap], bimap] call[bimap.putAll, parameter[member[.map]]] return[member[.bimap]] end[}] END[}]
Keyword[public] Keyword[static] operator[<] identifier[K] , identifier[V] operator[>] identifier[HashBiMap] operator[<] identifier[K] , identifier[V] operator[>] identifier[create] operator[SEP] identifier[Map] operator[<] operator[?] Keyword[extends] identifier[K] , operator[?] Keyword[extends] identifier[V] operator[>] identifier[map] operator[SEP] { identifier[HashBiMap] operator[<] identifier[K] , identifier[V] operator[>] identifier[bimap] operator[=] identifier[create] operator[SEP] identifier[map] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[bimap] operator[SEP] identifier[putAll] operator[SEP] identifier[map] operator[SEP] operator[SEP] Keyword[return] identifier[bimap] operator[SEP] }
private String getKey(String key) throws IllegalArgumentException { String checkKey = JobHistoryKeys.HADOOP2_TO_HADOOP1_MAPPING.containsKey(key) ? JobHistoryKeys.HADOOP2_TO_HADOOP1_MAPPING .get(key) : key; return (JobHistoryKeys.valueOf(checkKey).toString()); }
class class_name[name] begin[{] method[getKey, return_type[type[String]], modifier[private], parameter[key]] begin[{] local_variable[type[String], checkKey] return[call[JobHistoryKeys.valueOf, parameter[member[.checkKey]]]] end[}] END[}]
Keyword[private] identifier[String] identifier[getKey] operator[SEP] identifier[String] identifier[key] operator[SEP] Keyword[throws] identifier[IllegalArgumentException] { identifier[String] identifier[checkKey] operator[=] identifier[JobHistoryKeys] operator[SEP] identifier[HADOOP2_TO_HADOOP1_MAPPING] operator[SEP] identifier[containsKey] operator[SEP] identifier[key] operator[SEP] operator[?] identifier[JobHistoryKeys] operator[SEP] identifier[HADOOP2_TO_HADOOP1_MAPPING] operator[SEP] identifier[get] operator[SEP] identifier[key] operator[SEP] operator[:] identifier[key] operator[SEP] Keyword[return] operator[SEP] identifier[JobHistoryKeys] operator[SEP] identifier[valueOf] operator[SEP] identifier[checkKey] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
public void marshall(DescribeScheduledAuditRequest describeScheduledAuditRequest, ProtocolMarshaller protocolMarshaller) { if (describeScheduledAuditRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(describeScheduledAuditRequest.getScheduledAuditName(), SCHEDULEDAUDITNAME_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[describeScheduledAuditRequest, protocolMarshaller]] begin[{] if[binary_operation[member[.describeScheduledAuditRequest], ==, 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=getScheduledAuditName, postfix_operators=[], prefix_operators=[], qualifier=describeScheduledAuditRequest, selectors=[], type_arguments=None), MemberReference(member=SCHEDULEDAUDITNAME_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[DescribeScheduledAuditRequest] identifier[describeScheduledAuditRequest] , identifier[ProtocolMarshaller] identifier[protocolMarshaller] operator[SEP] { Keyword[if] operator[SEP] identifier[describeScheduledAuditRequest] 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[describeScheduledAuditRequest] operator[SEP] identifier[getScheduledAuditName] operator[SEP] operator[SEP] , identifier[SCHEDULEDAUDITNAME_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 FacesConfigComponentType<WebFacesConfigDescriptor> getOrCreateComponent() { List<Node> nodeList = model.get("component"); if (nodeList != null && nodeList.size() > 0) { return new FacesConfigComponentTypeImpl<WebFacesConfigDescriptor>(this, "component", model, nodeList.get(0)); } return createComponent(); }
class class_name[name] begin[{] method[getOrCreateComponent, return_type[type[FacesConfigComponentType]], modifier[public], parameter[]] begin[{] local_variable[type[List], nodeList] if[binary_operation[binary_operation[member[.nodeList], !=, literal[null]], &&, binary_operation[call[nodeList.size, parameter[]], >, literal[0]]]] begin[{] return[ClassCreator(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="component"), MemberReference(member=model, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], member=get, postfix_operators=[], prefix_operators=[], qualifier=nodeList, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=WebFacesConfigDescriptor, sub_type=None))], dimensions=None, name=FacesConfigComponentTypeImpl, sub_type=None))] else begin[{] None end[}] return[call[.createComponent, parameter[]]] end[}] END[}]
Keyword[public] identifier[FacesConfigComponentType] operator[<] identifier[WebFacesConfigDescriptor] operator[>] identifier[getOrCreateComponent] operator[SEP] operator[SEP] { identifier[List] operator[<] identifier[Node] operator[>] identifier[nodeList] operator[=] identifier[model] operator[SEP] identifier[get] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[nodeList] operator[!=] Other[null] operator[&&] identifier[nodeList] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] { Keyword[return] Keyword[new] identifier[FacesConfigComponentTypeImpl] operator[<] identifier[WebFacesConfigDescriptor] operator[>] operator[SEP] Keyword[this] , literal[String] , identifier[model] , identifier[nodeList] operator[SEP] identifier[get] operator[SEP] Other[0] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[createComponent] operator[SEP] operator[SEP] operator[SEP] }
public Task<Void> sendResetPasswordEmail(@NonNull final String email) { return dispatcher.dispatchTask( new Callable<Void>() { @Override public Void call() { sendResetPasswordEmailInternal(email); return null; } }); }
class class_name[name] begin[{] method[sendResetPasswordEmail, return_type[type[Task]], modifier[public], parameter[email]] begin[{] return[call[dispatcher.dispatchTask, parameter[ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=email, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=sendResetPasswordEmailInternal, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), label=None)], documentation=None, modifiers={'public'}, name=call, parameters=[], return_type=ReferenceType(arguments=None, dimensions=[], name=Void, sub_type=None), throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Void, sub_type=None))], dimensions=None, name=Callable, sub_type=None))]]] end[}] END[}]
Keyword[public] identifier[Task] operator[<] identifier[Void] operator[>] identifier[sendResetPasswordEmail] operator[SEP] annotation[@] identifier[NonNull] Keyword[final] identifier[String] identifier[email] operator[SEP] { Keyword[return] identifier[dispatcher] operator[SEP] identifier[dispatchTask] operator[SEP] Keyword[new] identifier[Callable] operator[<] identifier[Void] operator[>] operator[SEP] operator[SEP] { annotation[@] identifier[Override] Keyword[public] identifier[Void] identifier[call] operator[SEP] operator[SEP] { identifier[sendResetPasswordEmailInternal] operator[SEP] identifier[email] operator[SEP] operator[SEP] Keyword[return] Other[null] operator[SEP] } } operator[SEP] operator[SEP] }
@RequirePOST public void doDowngrade(StaplerResponse rsp) throws IOException, ServletException { if(!isDowngradable()) { sendError("Jenkins downgrade is not possible, probably backup does not exist"); return; } HudsonDowngradeJob job = new HudsonDowngradeJob(getCoreSource(), Jenkins.getAuthentication()); LOGGER.info("Scheduling the core downgrade"); addJob(job); rsp.sendRedirect2("."); }
class class_name[name] begin[{] method[doDowngrade, return_type[void], modifier[public], parameter[rsp]] begin[{] if[call[.isDowngradable, parameter[]]] begin[{] call[.sendError, parameter[literal["Jenkins downgrade is not possible, probably backup does not exist"]]] return[None] else begin[{] None end[}] local_variable[type[HudsonDowngradeJob], job] call[LOGGER.info, parameter[literal["Scheduling the core downgrade"]]] call[.addJob, parameter[member[.job]]] call[rsp.sendRedirect2, parameter[literal["."]]] end[}] END[}]
annotation[@] identifier[RequirePOST] Keyword[public] Keyword[void] identifier[doDowngrade] operator[SEP] identifier[StaplerResponse] identifier[rsp] operator[SEP] Keyword[throws] identifier[IOException] , identifier[ServletException] { Keyword[if] operator[SEP] operator[!] identifier[isDowngradable] operator[SEP] operator[SEP] operator[SEP] { identifier[sendError] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[return] operator[SEP] } identifier[HudsonDowngradeJob] identifier[job] operator[=] Keyword[new] identifier[HudsonDowngradeJob] operator[SEP] identifier[getCoreSource] operator[SEP] operator[SEP] , identifier[Jenkins] operator[SEP] identifier[getAuthentication] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[LOGGER] operator[SEP] identifier[info] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[addJob] operator[SEP] identifier[job] operator[SEP] operator[SEP] identifier[rsp] operator[SEP] identifier[sendRedirect2] operator[SEP] literal[String] operator[SEP] operator[SEP] }
public synchronized boolean consolidate() throws IOException { if (isTainted()) { // proceed with consolidation XSequentialEventBuffer nBuffer = new XSequentialEventBuffer(buffer .getProvider(), this.attributeMapSerializer); int overflowIndex = 0; int fileBufferIndex = 0; for (int i = 0; i < size; i++) { if (overflowIndex < overflowSize && overflowIndices[overflowIndex] == i) { nBuffer.append(overflowEntries[overflowIndex]); overflowIndex++; } else { while (holeFlags.get(fileBufferIndex) == true) { fileBufferIndex++; } nBuffer.append(buffer.get(fileBufferIndex)); fileBufferIndex++; } } buffer.cleanup(); buffer = nBuffer; overflowSize = 0; holeFlags.clear(); return true; } else { return false; } }
class class_name[name] begin[{] method[consolidate, return_type[type[boolean]], modifier[synchronized public], parameter[]] begin[{] if[call[.isTainted, parameter[]]] begin[{] local_variable[type[XSequentialEventBuffer], nBuffer] local_variable[type[int], overflowIndex] local_variable[type[int], fileBufferIndex] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=overflowIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=overflowSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), operandr=BinaryOperation(operandl=MemberReference(member=overflowIndices, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=overflowIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operandr=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), operator=&&), else_statement=BlockStatement(label=None, statements=[WhileStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MemberReference(member=fileBufferIndex, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]), label=None)]), condition=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=fileBufferIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=holeFlags, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true), operator===), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=fileBufferIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=buffer, selectors=[], type_arguments=None)], member=append, postfix_operators=[], prefix_operators=[], qualifier=nBuffer, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MemberReference(member=fileBufferIndex, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=overflowEntries, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=overflowIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])], member=append, postfix_operators=[], prefix_operators=[], qualifier=nBuffer, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MemberReference(member=overflowIndex, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=size, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) call[buffer.cleanup, parameter[]] assign[member[.buffer], member[.nBuffer]] assign[member[.overflowSize], literal[0]] call[holeFlags.clear, parameter[]] return[literal[true]] else begin[{] return[literal[false]] end[}] end[}] END[}]
Keyword[public] Keyword[synchronized] Keyword[boolean] identifier[consolidate] operator[SEP] operator[SEP] Keyword[throws] identifier[IOException] { Keyword[if] operator[SEP] identifier[isTainted] operator[SEP] operator[SEP] operator[SEP] { identifier[XSequentialEventBuffer] identifier[nBuffer] operator[=] Keyword[new] identifier[XSequentialEventBuffer] operator[SEP] identifier[buffer] operator[SEP] identifier[getProvider] operator[SEP] operator[SEP] , Keyword[this] operator[SEP] identifier[attributeMapSerializer] operator[SEP] operator[SEP] Keyword[int] identifier[overflowIndex] operator[=] Other[0] operator[SEP] Keyword[int] identifier[fileBufferIndex] operator[=] Other[0] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[size] operator[SEP] identifier[i] operator[++] operator[SEP] { Keyword[if] operator[SEP] identifier[overflowIndex] operator[<] identifier[overflowSize] operator[&&] identifier[overflowIndices] operator[SEP] identifier[overflowIndex] operator[SEP] operator[==] identifier[i] operator[SEP] { identifier[nBuffer] operator[SEP] identifier[append] operator[SEP] identifier[overflowEntries] operator[SEP] identifier[overflowIndex] operator[SEP] operator[SEP] operator[SEP] identifier[overflowIndex] operator[++] operator[SEP] } Keyword[else] { Keyword[while] operator[SEP] identifier[holeFlags] operator[SEP] identifier[get] operator[SEP] identifier[fileBufferIndex] operator[SEP] operator[==] literal[boolean] operator[SEP] { identifier[fileBufferIndex] operator[++] operator[SEP] } identifier[nBuffer] operator[SEP] identifier[append] operator[SEP] identifier[buffer] operator[SEP] identifier[get] operator[SEP] identifier[fileBufferIndex] operator[SEP] operator[SEP] operator[SEP] identifier[fileBufferIndex] operator[++] operator[SEP] } } identifier[buffer] operator[SEP] identifier[cleanup] operator[SEP] operator[SEP] operator[SEP] identifier[buffer] operator[=] identifier[nBuffer] operator[SEP] identifier[overflowSize] operator[=] Other[0] operator[SEP] identifier[holeFlags] operator[SEP] identifier[clear] operator[SEP] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP] } Keyword[else] { Keyword[return] literal[boolean] operator[SEP] } }
public void validateOpts(Object instance) { final Set<ConstraintViolation<Object>> set = validator.validate(instance); final StringBuilder sb = new StringBuilder(); for (ConstraintViolation<Object> violation : set) { final Path path = violation.getPropertyPath(); final String msg = violation.getMessage(); sb.append(path.toString()).append(" ").append(msg).append(". "); } if (sb.length() > 0) { // is ConstraintViolationException more appropriate, // letting user choose their error message? throw new ValidationException(OPT_VIOLATION_MSG + ": " + sb.toString()); } }
class class_name[name] begin[{] method[validateOpts, return_type[void], modifier[public], parameter[instance]] begin[{] local_variable[type[Set], set] local_variable[type[StringBuilder], sb] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getPropertyPath, postfix_operators=[], prefix_operators=[], qualifier=violation, selectors=[], type_arguments=None), name=path)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=Path, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=violation, selectors=[], type_arguments=None), name=msg)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=path, selectors=[], type_arguments=None)], member=append, postfix_operators=[], prefix_operators=[], qualifier=sb, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" ")], member=append, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=msg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=append, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=". ")], member=append, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=set, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=violation)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))], dimensions=[], name=ConstraintViolation, sub_type=None))), label=None) if[binary_operation[call[sb.length, parameter[]], >, literal[0]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=OPT_VIOLATION_MSG, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=": "), operator=+), operandr=MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=sb, 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=ValidationException, sub_type=None)), label=None) else begin[{] None end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[validateOpts] operator[SEP] identifier[Object] identifier[instance] operator[SEP] { Keyword[final] identifier[Set] operator[<] identifier[ConstraintViolation] operator[<] identifier[Object] operator[>] operator[>] identifier[set] operator[=] identifier[validator] operator[SEP] identifier[validate] operator[SEP] identifier[instance] operator[SEP] operator[SEP] Keyword[final] identifier[StringBuilder] identifier[sb] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[ConstraintViolation] operator[<] identifier[Object] operator[>] identifier[violation] operator[:] identifier[set] operator[SEP] { Keyword[final] identifier[Path] identifier[path] operator[=] identifier[violation] operator[SEP] identifier[getPropertyPath] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[String] identifier[msg] operator[=] identifier[violation] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] operator[SEP] identifier[sb] operator[SEP] identifier[append] operator[SEP] identifier[path] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[msg] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[sb] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] { Keyword[throw] Keyword[new] identifier[ValidationException] operator[SEP] identifier[OPT_VIOLATION_MSG] operator[+] literal[String] operator[+] identifier[sb] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } }
private void activateFirstOnlyAliasOfKeyStore(int ksIndex) { if (ksIndex < 0 || ksIndex >= keyStoreList.getModel().getSize()) { return; } keyStoreList.setSelectedIndex(ksIndex); if (aliasTable.getRowCount() != 0) { aliasTable.setRowSelectionInterval(0, 0); if (aliasTable.getRowCount() == 1 && !isCertActive()) { setActiveAction(); } } }
class class_name[name] begin[{] method[activateFirstOnlyAliasOfKeyStore, return_type[void], modifier[private], parameter[ksIndex]] begin[{] if[binary_operation[binary_operation[member[.ksIndex], <, literal[0]], ||, binary_operation[member[.ksIndex], >=, call[keyStoreList.getModel, parameter[]]]]] begin[{] return[None] else begin[{] None end[}] call[keyStoreList.setSelectedIndex, parameter[member[.ksIndex]]] if[binary_operation[call[aliasTable.getRowCount, parameter[]], !=, literal[0]]] begin[{] call[aliasTable.setRowSelectionInterval, parameter[literal[0], literal[0]]] if[binary_operation[binary_operation[call[aliasTable.getRowCount, parameter[]], ==, literal[1]], &&, call[.isCertActive, parameter[]]]] begin[{] call[.setActiveAction, parameter[]] else begin[{] None end[}] else begin[{] None end[}] end[}] END[}]
Keyword[private] Keyword[void] identifier[activateFirstOnlyAliasOfKeyStore] operator[SEP] Keyword[int] identifier[ksIndex] operator[SEP] { Keyword[if] operator[SEP] identifier[ksIndex] operator[<] Other[0] operator[||] identifier[ksIndex] operator[>=] identifier[keyStoreList] operator[SEP] identifier[getModel] operator[SEP] operator[SEP] operator[SEP] identifier[getSize] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] operator[SEP] } identifier[keyStoreList] operator[SEP] identifier[setSelectedIndex] operator[SEP] identifier[ksIndex] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[aliasTable] operator[SEP] identifier[getRowCount] operator[SEP] operator[SEP] operator[!=] Other[0] operator[SEP] { identifier[aliasTable] operator[SEP] identifier[setRowSelectionInterval] operator[SEP] Other[0] , Other[0] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[aliasTable] operator[SEP] identifier[getRowCount] operator[SEP] operator[SEP] operator[==] Other[1] operator[&&] operator[!] identifier[isCertActive] operator[SEP] operator[SEP] operator[SEP] { identifier[setActiveAction] operator[SEP] operator[SEP] operator[SEP] } } }
public void marshall(ListGroupsRequest listGroupsRequest, ProtocolMarshaller protocolMarshaller) { if (listGroupsRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(listGroupsRequest.getAwsAccountId(), AWSACCOUNTID_BINDING); protocolMarshaller.marshall(listGroupsRequest.getNextToken(), NEXTTOKEN_BINDING); protocolMarshaller.marshall(listGroupsRequest.getMaxResults(), MAXRESULTS_BINDING); protocolMarshaller.marshall(listGroupsRequest.getNamespace(), NAMESPACE_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[listGroupsRequest, protocolMarshaller]] begin[{] if[binary_operation[member[.listGroupsRequest], ==, 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=getAwsAccountId, postfix_operators=[], prefix_operators=[], qualifier=listGroupsRequest, selectors=[], type_arguments=None), MemberReference(member=AWSACCOUNTID_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=listGroupsRequest, 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), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getMaxResults, postfix_operators=[], prefix_operators=[], qualifier=listGroupsRequest, 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=getNamespace, postfix_operators=[], prefix_operators=[], qualifier=listGroupsRequest, selectors=[], type_arguments=None), MemberReference(member=NAMESPACE_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[ListGroupsRequest] identifier[listGroupsRequest] , identifier[ProtocolMarshaller] identifier[protocolMarshaller] operator[SEP] { Keyword[if] operator[SEP] identifier[listGroupsRequest] 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[listGroupsRequest] operator[SEP] identifier[getAwsAccountId] operator[SEP] operator[SEP] , identifier[AWSACCOUNTID_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[listGroupsRequest] operator[SEP] identifier[getNextToken] operator[SEP] operator[SEP] , identifier[NEXTTOKEN_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[listGroupsRequest] operator[SEP] identifier[getMaxResults] operator[SEP] operator[SEP] , identifier[MAXRESULTS_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[listGroupsRequest] operator[SEP] identifier[getNamespace] operator[SEP] operator[SEP] , identifier[NAMESPACE_BINDING] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[SdkClientException] operator[SEP] literal[String] operator[+] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP] } }
public void marshall(BatchGetDevEndpointsRequest batchGetDevEndpointsRequest, ProtocolMarshaller protocolMarshaller) { if (batchGetDevEndpointsRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(batchGetDevEndpointsRequest.getDevEndpointNames(), DEVENDPOINTNAMES_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[batchGetDevEndpointsRequest, protocolMarshaller]] begin[{] if[binary_operation[member[.batchGetDevEndpointsRequest], ==, 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=getDevEndpointNames, postfix_operators=[], prefix_operators=[], qualifier=batchGetDevEndpointsRequest, selectors=[], type_arguments=None), MemberReference(member=DEVENDPOINTNAMES_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[BatchGetDevEndpointsRequest] identifier[batchGetDevEndpointsRequest] , identifier[ProtocolMarshaller] identifier[protocolMarshaller] operator[SEP] { Keyword[if] operator[SEP] identifier[batchGetDevEndpointsRequest] 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[batchGetDevEndpointsRequest] operator[SEP] identifier[getDevEndpointNames] operator[SEP] operator[SEP] , identifier[DEVENDPOINTNAMES_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] } }
static ByteBuf encodeString(String str) { ByteBuf out = Unpooled.buffer(2); byte[] raw; try { raw = str.getBytes("UTF-8"); //NB every Java platform has got UTF-8 encoding by default, so this //exception are never raised. } catch (UnsupportedEncodingException ex) { Log.error("", ex); return null; } //Utils.writeWord(out, raw.length); out.writeShort(raw.length); out.writeBytes(raw); return out; }
class class_name[name] begin[{] method[encodeString, return_type[type[ByteBuf]], modifier[static], parameter[str]] begin[{] local_variable[type[ByteBuf], out] local_variable[type[byte], raw] TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=raw, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="UTF-8")], member=getBytes, postfix_operators=[], prefix_operators=[], qualifier=str, selectors=[], type_arguments=None)), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=""), MemberReference(member=ex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=Log, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ex, types=['UnsupportedEncodingException']))], finally_block=None, label=None, resources=None) call[out.writeShort, parameter[member[raw.length]]] call[out.writeBytes, parameter[member[.raw]]] return[member[.out]] end[}] END[}]
Keyword[static] identifier[ByteBuf] identifier[encodeString] operator[SEP] identifier[String] identifier[str] operator[SEP] { identifier[ByteBuf] identifier[out] operator[=] identifier[Unpooled] operator[SEP] identifier[buffer] operator[SEP] Other[2] operator[SEP] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[raw] operator[SEP] Keyword[try] { identifier[raw] operator[=] identifier[str] operator[SEP] identifier[getBytes] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[UnsupportedEncodingException] identifier[ex] operator[SEP] { identifier[Log] operator[SEP] identifier[error] operator[SEP] literal[String] , identifier[ex] operator[SEP] operator[SEP] Keyword[return] Other[null] operator[SEP] } identifier[out] operator[SEP] identifier[writeShort] operator[SEP] identifier[raw] operator[SEP] identifier[length] operator[SEP] operator[SEP] identifier[out] operator[SEP] identifier[writeBytes] operator[SEP] identifier[raw] operator[SEP] operator[SEP] Keyword[return] identifier[out] operator[SEP] }
protected long buildNextSequence(PersistenceBroker broker, ClassDescriptor cld, String sequenceName) throws LookupException, SQLException, PlatformException { CallableStatement cs = null; try { Connection con = broker.serviceConnectionManager().getConnection(); cs = getPlatform().prepareNextValProcedureStatement(con, PROCEDURE_NAME, sequenceName); cs.executeUpdate(); return cs.getLong(1); } finally { try { if (cs != null) cs.close(); } catch (SQLException ignore) { // ignore it } } }
class class_name[name] begin[{] method[buildNextSequence, return_type[type[long]], modifier[protected], parameter[broker, cld, sequenceName]] begin[{] local_variable[type[CallableStatement], cs] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=serviceConnectionManager, postfix_operators=[], prefix_operators=[], qualifier=broker, selectors=[MethodInvocation(arguments=[], member=getConnection, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=con)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Connection, sub_type=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=cs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=getPlatform, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[MemberReference(member=con, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=PROCEDURE_NAME, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=sequenceName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=prepareNextValProcedureStatement, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=executeUpdate, postfix_operators=[], prefix_operators=[], qualifier=cs, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], member=getLong, postfix_operators=[], prefix_operators=[], qualifier=cs, selectors=[], type_arguments=None), label=None)], catches=None, finally_block=[TryStatement(block=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=cs, 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=StatementExpression(expression=MethodInvocation(arguments=[], member=close, postfix_operators=[], prefix_operators=[], qualifier=cs, selectors=[], type_arguments=None), label=None))], catches=[CatchClause(block=[], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ignore, types=['SQLException']))], finally_block=None, label=None, resources=None)], label=None, resources=None) end[}] END[}]
Keyword[protected] Keyword[long] identifier[buildNextSequence] operator[SEP] identifier[PersistenceBroker] identifier[broker] , identifier[ClassDescriptor] identifier[cld] , identifier[String] identifier[sequenceName] operator[SEP] Keyword[throws] identifier[LookupException] , identifier[SQLException] , identifier[PlatformException] { identifier[CallableStatement] identifier[cs] operator[=] Other[null] operator[SEP] Keyword[try] { identifier[Connection] identifier[con] operator[=] identifier[broker] operator[SEP] identifier[serviceConnectionManager] operator[SEP] operator[SEP] operator[SEP] identifier[getConnection] operator[SEP] operator[SEP] operator[SEP] identifier[cs] operator[=] identifier[getPlatform] operator[SEP] operator[SEP] operator[SEP] identifier[prepareNextValProcedureStatement] operator[SEP] identifier[con] , identifier[PROCEDURE_NAME] , identifier[sequenceName] operator[SEP] operator[SEP] identifier[cs] operator[SEP] identifier[executeUpdate] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[cs] operator[SEP] identifier[getLong] operator[SEP] Other[1] operator[SEP] operator[SEP] } Keyword[finally] { Keyword[try] { Keyword[if] operator[SEP] identifier[cs] operator[!=] Other[null] operator[SEP] identifier[cs] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[SQLException] identifier[ignore] operator[SEP] { } } }
private void moveSiblingExclusive(Node dest, Node start, Node end) { checkNotNull(start); checkNotNull(end); while (start.getNext() != end) { Node child = start.getNext().detach(); dest.addChildToBack(child); } }
class class_name[name] begin[{] method[moveSiblingExclusive, return_type[void], modifier[private], parameter[dest, start, end]] begin[{] call[.checkNotNull, parameter[member[.start]]] call[.checkNotNull, parameter[member[.end]]] while[binary_operation[call[start.getNext, parameter[]], !=, member[.end]]] begin[{] local_variable[type[Node], child] call[dest.addChildToBack, parameter[member[.child]]] end[}] end[}] END[}]
Keyword[private] Keyword[void] identifier[moveSiblingExclusive] operator[SEP] identifier[Node] identifier[dest] , identifier[Node] identifier[start] , identifier[Node] identifier[end] operator[SEP] { identifier[checkNotNull] operator[SEP] identifier[start] operator[SEP] operator[SEP] identifier[checkNotNull] operator[SEP] identifier[end] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[start] operator[SEP] identifier[getNext] operator[SEP] operator[SEP] operator[!=] identifier[end] operator[SEP] { identifier[Node] identifier[child] operator[=] identifier[start] operator[SEP] identifier[getNext] operator[SEP] operator[SEP] operator[SEP] identifier[detach] operator[SEP] operator[SEP] operator[SEP] identifier[dest] operator[SEP] identifier[addChildToBack] operator[SEP] identifier[child] operator[SEP] operator[SEP] } }
public static int compareUnsigned(int x, int y) { return Integer.compare(x + Integer.MIN_VALUE, y + Integer.MIN_VALUE); }
class class_name[name] begin[{] method[compareUnsigned, return_type[type[int]], modifier[public static], parameter[x, y]] begin[{] return[call[Integer.compare, parameter[binary_operation[member[.x], +, member[Integer.MIN_VALUE]], binary_operation[member[.y], +, member[Integer.MIN_VALUE]]]]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[int] identifier[compareUnsigned] operator[SEP] Keyword[int] identifier[x] , Keyword[int] identifier[y] operator[SEP] { Keyword[return] identifier[Integer] operator[SEP] identifier[compare] operator[SEP] identifier[x] operator[+] identifier[Integer] operator[SEP] identifier[MIN_VALUE] , identifier[y] operator[+] identifier[Integer] operator[SEP] identifier[MIN_VALUE] operator[SEP] operator[SEP] }
public static ConfigurationWatchList getConfigurationWatchList(Context context) { if (context == null) return null; return (ConfigurationWatchList) context.getObject(CoreConstants.CONFIGURATION_WATCH_LIST); }
class class_name[name] begin[{] method[getConfigurationWatchList, return_type[type[ConfigurationWatchList]], modifier[public static], parameter[context]] begin[{] if[binary_operation[member[.context], ==, literal[null]]] begin[{] return[literal[null]] else begin[{] None end[}] return[Cast(expression=MethodInvocation(arguments=[MemberReference(member=CONFIGURATION_WATCH_LIST, postfix_operators=[], prefix_operators=[], qualifier=CoreConstants, selectors=[])], member=getObject, postfix_operators=[], prefix_operators=[], qualifier=context, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=ConfigurationWatchList, sub_type=None))] end[}] END[}]
Keyword[public] Keyword[static] identifier[ConfigurationWatchList] identifier[getConfigurationWatchList] operator[SEP] identifier[Context] identifier[context] operator[SEP] { Keyword[if] operator[SEP] identifier[context] operator[==] Other[null] operator[SEP] Keyword[return] Other[null] operator[SEP] Keyword[return] operator[SEP] identifier[ConfigurationWatchList] operator[SEP] identifier[context] operator[SEP] identifier[getObject] operator[SEP] identifier[CoreConstants] operator[SEP] identifier[CONFIGURATION_WATCH_LIST] operator[SEP] operator[SEP] }
public PreparedStatementSetter getParameters() { if (list.size() == 0) { return null; } PreparedStatementSetter param = new PreparedStatementSetter() { @Override public void setValues(PreparedStatement pstmt) { try { StatementParameter.this.setValues(pstmt); } catch (SQLException e) { throw new InvalidParamDataAccessException(e); } } }; return param; }
class class_name[name] begin[{] method[getParameters, return_type[type[PreparedStatementSetter]], modifier[public], parameter[]] begin[{] if[binary_operation[call[list.size, parameter[]], ==, literal[0]]] begin[{] return[literal[null]] else begin[{] None end[}] local_variable[type[PreparedStatementSetter], param] return[member[.param]] end[}] END[}]
Keyword[public] identifier[PreparedStatementSetter] identifier[getParameters] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[list] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[==] Other[0] operator[SEP] { Keyword[return] Other[null] operator[SEP] } identifier[PreparedStatementSetter] identifier[param] operator[=] Keyword[new] identifier[PreparedStatementSetter] operator[SEP] operator[SEP] { annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[setValues] operator[SEP] identifier[PreparedStatement] identifier[pstmt] operator[SEP] { Keyword[try] { identifier[StatementParameter] operator[SEP] Keyword[this] operator[SEP] identifier[setValues] operator[SEP] identifier[pstmt] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[SQLException] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[InvalidParamDataAccessException] operator[SEP] identifier[e] operator[SEP] operator[SEP] } } } operator[SEP] Keyword[return] identifier[param] operator[SEP] }
public static <T1, T2, T3> TriFunction<T1, T2, T3, Boolean> function(TriPredicate<T1, T2, T3> adaptee) { dbc.precondition(adaptee != null, "cannot adapt a null predicate"); return adaptee::test; }
class class_name[name] begin[{] method[function, return_type[type[TriFunction]], modifier[public static], parameter[adaptee]] begin[{] call[dbc.precondition, parameter[binary_operation[member[.adaptee], !=, literal[null]], literal["cannot adapt a null predicate"]]] return[MethodReference(expression=MemberReference(member=adaptee, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), method=MemberReference(member=test, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type_arguments=[])] end[}] END[}]
Keyword[public] Keyword[static] operator[<] identifier[T1] , identifier[T2] , identifier[T3] operator[>] identifier[TriFunction] operator[<] identifier[T1] , identifier[T2] , identifier[T3] , identifier[Boolean] operator[>] identifier[function] operator[SEP] identifier[TriPredicate] operator[<] identifier[T1] , identifier[T2] , identifier[T3] operator[>] identifier[adaptee] operator[SEP] { identifier[dbc] operator[SEP] identifier[precondition] operator[SEP] identifier[adaptee] operator[!=] Other[null] , literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[adaptee] operator[::] identifier[test] operator[SEP] }
public synchronized final void setValue(final byte[] value) { this.edmType = EdmType.BINARY; this.type = byte[].class; this.value = value == null ? null : Base64.encode(value); }
class class_name[name] begin[{] method[setValue, return_type[void], modifier[synchronized final public], parameter[value]] begin[{] assign[THIS[member[None.edmType]], member[EdmType.BINARY]] assign[THIS[member[None.type]], ClassReference(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=[None], name=byte))] assign[THIS[member[None.value]], TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), if_false=MethodInvocation(arguments=[MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=encode, postfix_operators=[], prefix_operators=[], qualifier=Base64, selectors=[], type_arguments=None), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null))] end[}] END[}]
Keyword[public] Keyword[synchronized] Keyword[final] Keyword[void] identifier[setValue] operator[SEP] Keyword[final] Keyword[byte] operator[SEP] operator[SEP] identifier[value] operator[SEP] { Keyword[this] operator[SEP] identifier[edmType] operator[=] identifier[EdmType] operator[SEP] identifier[BINARY] operator[SEP] Keyword[this] operator[SEP] identifier[type] operator[=] Keyword[byte] operator[SEP] operator[SEP] operator[SEP] Keyword[class] operator[SEP] Keyword[this] operator[SEP] identifier[value] operator[=] identifier[value] operator[==] Other[null] operator[?] Other[null] operator[:] identifier[Base64] operator[SEP] identifier[encode] operator[SEP] identifier[value] operator[SEP] operator[SEP] }