code
stringlengths
63
466k
code_sememe
stringlengths
141
3.79M
token_type
stringlengths
274
1.23M
public void createLinks(ServiceReference<S> declarationBinderRef) { for (D declaration : linkerManagement.getMatchedDeclaration()) { if (linkerManagement.canBeLinked(declaration, declarationBinderRef)) { linkerManagement.link(declaration, declarationBinderRef); } } }
class class_name[name] begin[{] method[createLinks, return_type[void], modifier[public], parameter[declarationBinderRef]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=declaration, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=declarationBinderRef, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=canBeLinked, postfix_operators=[], prefix_operators=[], qualifier=linkerManagement, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=declaration, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=declarationBinderRef, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=link, postfix_operators=[], prefix_operators=[], qualifier=linkerManagement, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getMatchedDeclaration, postfix_operators=[], prefix_operators=[], qualifier=linkerManagement, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=declaration)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=D, sub_type=None))), label=None) end[}] END[}]
Keyword[public] Keyword[void] identifier[createLinks] operator[SEP] identifier[ServiceReference] operator[<] identifier[S] operator[>] identifier[declarationBinderRef] operator[SEP] { Keyword[for] operator[SEP] identifier[D] identifier[declaration] operator[:] identifier[linkerManagement] operator[SEP] identifier[getMatchedDeclaration] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[linkerManagement] operator[SEP] identifier[canBeLinked] operator[SEP] identifier[declaration] , identifier[declarationBinderRef] operator[SEP] operator[SEP] { identifier[linkerManagement] operator[SEP] identifier[link] operator[SEP] identifier[declaration] , identifier[declarationBinderRef] operator[SEP] operator[SEP] } } }
public List<Return> executeEvents(final EventType _eventType, final Object... _objectTuples) throws EFapsException { List<Return> ret = new ArrayList<>(); final AbstractCommand command; if (this.callingCmdUUID == null) { command = this.getCommand(); } else { command = getCallingCommand(); } if (command.hasEvents(_eventType)) { final Parameter param = new Parameter(); if (_objectTuples != null) { // add all parameters for (int i = 0; i < _objectTuples.length; i += 2) { if (i + 1 < _objectTuples.length && _objectTuples[i] instanceof ParameterValues) { param.put((ParameterValues) _objectTuples[i], _objectTuples[i + 1]); } } } param.put(ParameterValues.PARAMETERS, Context.getThreadContext().getParameters()); if (getInstance() != null) { final String[] contextoid = { getInstanceKey() }; Context.getThreadContext().getParameters().put("oid", contextoid); param.put(ParameterValues.CALL_INSTANCE, getInstance()); param.put(ParameterValues.INSTANCE, getInstance()); } ret = command.executeEvents(_eventType, param); } return ret; }
class class_name[name] begin[{] method[executeEvents, return_type[type[List]], modifier[public], parameter[_eventType, _objectTuples]] begin[{] local_variable[type[List], ret] local_variable[type[AbstractCommand], command] if[binary_operation[THIS[member[None.callingCmdUUID]], ==, literal[null]]] begin[{] assign[member[.command], THIS[call[None.getCommand, parameter[]]]] else begin[{] assign[member[.command], call[.getCallingCommand, parameter[]]] end[}] if[call[command.hasEvents, parameter[member[._eventType]]]] begin[{] local_variable[type[Parameter], param] if[binary_operation[member[._objectTuples], !=, literal[null]]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=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=length, postfix_operators=[], prefix_operators=[], qualifier=_objectTuples, selectors=[]), operator=<), operandr=BinaryOperation(operandl=MemberReference(member=_objectTuples, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operandr=ReferenceType(arguments=None, dimensions=[], name=ParameterValues, sub_type=None), operator=instanceof), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Cast(expression=MemberReference(member=_objectTuples, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type=ReferenceType(arguments=None, dimensions=[], name=ParameterValues, sub_type=None)), MemberReference(member=_objectTuples, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+))])], member=put, postfix_operators=[], prefix_operators=[], qualifier=param, selectors=[], type_arguments=None), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=_objectTuples, 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=[Assignment(expressionl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2))]), label=None) else begin[{] None end[}] call[param.put, parameter[member[ParameterValues.PARAMETERS], call[Context.getThreadContext, parameter[]]]] if[binary_operation[call[.getInstance, parameter[]], !=, literal[null]]] begin[{] local_variable[type[String], contextoid] call[Context.getThreadContext, parameter[]] call[param.put, parameter[member[ParameterValues.CALL_INSTANCE], call[.getInstance, parameter[]]]] call[param.put, parameter[member[ParameterValues.INSTANCE], call[.getInstance, parameter[]]]] else begin[{] None end[}] assign[member[.ret], call[command.executeEvents, parameter[member[._eventType], member[.param]]]] else begin[{] None end[}] return[member[.ret]] end[}] END[}]
Keyword[public] identifier[List] operator[<] identifier[Return] operator[>] identifier[executeEvents] operator[SEP] Keyword[final] identifier[EventType] identifier[_eventType] , Keyword[final] identifier[Object] operator[...] identifier[_objectTuples] operator[SEP] Keyword[throws] identifier[EFapsException] { identifier[List] operator[<] identifier[Return] operator[>] identifier[ret] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[AbstractCommand] identifier[command] operator[SEP] Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[callingCmdUUID] operator[==] Other[null] operator[SEP] { identifier[command] operator[=] Keyword[this] operator[SEP] identifier[getCommand] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[command] operator[=] identifier[getCallingCommand] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[command] operator[SEP] identifier[hasEvents] operator[SEP] identifier[_eventType] operator[SEP] operator[SEP] { Keyword[final] identifier[Parameter] identifier[param] operator[=] Keyword[new] identifier[Parameter] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[_objectTuples] operator[!=] Other[null] operator[SEP] { Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[_objectTuples] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[+=] Other[2] operator[SEP] { Keyword[if] operator[SEP] identifier[i] operator[+] Other[1] operator[<] identifier[_objectTuples] operator[SEP] identifier[length] operator[&&] identifier[_objectTuples] operator[SEP] identifier[i] operator[SEP] Keyword[instanceof] identifier[ParameterValues] operator[SEP] { identifier[param] operator[SEP] identifier[put] operator[SEP] operator[SEP] identifier[ParameterValues] operator[SEP] identifier[_objectTuples] operator[SEP] identifier[i] operator[SEP] , identifier[_objectTuples] operator[SEP] identifier[i] operator[+] Other[1] operator[SEP] operator[SEP] operator[SEP] } } } identifier[param] operator[SEP] identifier[put] operator[SEP] identifier[ParameterValues] operator[SEP] identifier[PARAMETERS] , identifier[Context] operator[SEP] identifier[getThreadContext] operator[SEP] operator[SEP] operator[SEP] identifier[getParameters] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[getInstance] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] { Keyword[final] identifier[String] operator[SEP] operator[SEP] identifier[contextoid] operator[=] { identifier[getInstanceKey] operator[SEP] operator[SEP] } operator[SEP] identifier[Context] operator[SEP] identifier[getThreadContext] operator[SEP] operator[SEP] operator[SEP] identifier[getParameters] operator[SEP] operator[SEP] operator[SEP] identifier[put] operator[SEP] literal[String] , identifier[contextoid] operator[SEP] operator[SEP] identifier[param] operator[SEP] identifier[put] operator[SEP] identifier[ParameterValues] operator[SEP] identifier[CALL_INSTANCE] , identifier[getInstance] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[param] operator[SEP] identifier[put] operator[SEP] identifier[ParameterValues] operator[SEP] identifier[INSTANCE] , identifier[getInstance] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[ret] operator[=] identifier[command] operator[SEP] identifier[executeEvents] operator[SEP] identifier[_eventType] , identifier[param] operator[SEP] operator[SEP] } Keyword[return] identifier[ret] operator[SEP] }
void heterogenousUnion(final HLL other) { /* * The logic here is divided into two sections: unions with an EMPTY * HLL, and unions between EXPLICIT/SPARSE/FULL * HLL. * * Between those two sections, all possible heterogeneous unions are * covered. Should another type be added to HLLType whose unions * are not easily reduced (say, as EMPTY's are below) this may be more * easily implemented as Strategies. However, that is unnecessary as it * stands. */ // .................................................................... // Union with an EMPTY if(HLLType.EMPTY.equals(type)) { // NOTE: The union of empty with non-empty HLL is just a // clone of the non-empty. switch(other.getType()) { case EXPLICIT: { // src: EXPLICIT // dest: EMPTY if(other.explicitStorage.size() <= explicitThreshold) { type = HLLType.EXPLICIT; explicitStorage = other.explicitStorage.clone(); } else { if(!sparseOff) { initializeStorage(HLLType.SPARSE); } else { initializeStorage(HLLType.FULL); } for(final long value : other.explicitStorage) { addRaw(value); } } return; } case SPARSE: { // src: SPARSE // dest: EMPTY if(!sparseOff) { type = HLLType.SPARSE; sparseProbabilisticStorage = other.sparseProbabilisticStorage.clone(); } else { initializeStorage(HLLType.FULL); for(final int registerIndex : other.sparseProbabilisticStorage.keySet()) { final byte registerValue = other.sparseProbabilisticStorage.get(registerIndex); probabilisticStorage.setMaxRegister(registerIndex, registerValue); } } return; } default/*case FULL*/: { // src: FULL // dest: EMPTY type = HLLType.FULL; probabilisticStorage = other.probabilisticStorage.clone(); return; } } } else if (HLLType.EMPTY.equals(other.getType())) { // source is empty, so just return destination since it is unchanged return; } /* else -- both of the sets are not empty */ // .................................................................... // NOTE: Since EMPTY is handled above, the HLLs are non-EMPTY below switch(type) { case EXPLICIT: { // src: FULL/SPARSE // dest: EXPLICIT // "Storing into destination" cannot be done (since destination // is by definition of smaller capacity than source), so a clone // of source is made and values from destination are inserted // into that. // Determine source and destination storage. // NOTE: destination storage may change through promotion if // source is SPARSE. if(HLLType.SPARSE.equals(other.getType())) { if(!sparseOff) { type = HLLType.SPARSE; sparseProbabilisticStorage = other.sparseProbabilisticStorage.clone(); } else { initializeStorage(HLLType.FULL); for(final int registerIndex : other.sparseProbabilisticStorage.keySet()) { final byte registerValue = other.sparseProbabilisticStorage.get(registerIndex); probabilisticStorage.setMaxRegister(registerIndex, registerValue); } } } else /*source is HLLType.FULL*/ { type = HLLType.FULL; probabilisticStorage = other.probabilisticStorage.clone(); } for(final long value : explicitStorage) { addRaw(value); } explicitStorage = null; return; } case SPARSE: { if(HLLType.EXPLICIT.equals(other.getType())) { // src: EXPLICIT // dest: SPARSE // Add the raw values from the source to the destination. for(final long value : other.explicitStorage) { addRaw(value); } // NOTE: addRaw will handle promotion cleanup } else /*source is HLLType.FULL*/ { // src: FULL // dest: SPARSE // "Storing into destination" cannot be done (since destination // is by definition of smaller capacity than source), so a // clone of source is made and registers from the destination // are merged into the clone. type = HLLType.FULL; probabilisticStorage = other.probabilisticStorage.clone(); for(final int registerIndex : sparseProbabilisticStorage.keySet()) { final byte registerValue = sparseProbabilisticStorage.get(registerIndex); probabilisticStorage.setMaxRegister(registerIndex, registerValue); } sparseProbabilisticStorage = null; } return; } default/*destination is HLLType.FULL*/: { if(HLLType.EXPLICIT.equals(other.getType())) { // src: EXPLICIT // dest: FULL // Add the raw values from the source to the destination. // Promotion is not possible, so don't bother checking. for(final long value : other.explicitStorage) { addRaw(value); } } else /*source is HLLType.SPARSE*/ { // src: SPARSE // dest: FULL // Merge the registers from the source into the destination. // Promotion is not possible, so don't bother checking. for(final int registerIndex : other.sparseProbabilisticStorage.keySet()) { final byte registerValue = other.sparseProbabilisticStorage.get(registerIndex); probabilisticStorage.setMaxRegister(registerIndex, registerValue); } } } } }
class class_name[name] begin[{] method[heterogenousUnion, return_type[void], modifier[default], parameter[other]] begin[{] if[call[HLLType.EMPTY.equals, parameter[member[.type]]]] begin[{] SwitchStatement(cases=[SwitchStatementCase(case=['EXPLICIT'], statements=[BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=other.explicitStorage, selectors=[], type_arguments=None), operandr=MemberReference(member=explicitThreshold, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<=), else_statement=BlockStatement(label=None, statements=[IfStatement(condition=MemberReference(member=sparseOff, postfix_operators=[], prefix_operators=['!'], qualifier=, selectors=[]), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=FULL, postfix_operators=[], prefix_operators=[], qualifier=HLLType, selectors=[])], member=initializeStorage, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=SPARSE, postfix_operators=[], prefix_operators=[], qualifier=HLLType, selectors=[])], member=initializeStorage, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)])), ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addRaw, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=explicitStorage, postfix_operators=[], prefix_operators=[], qualifier=other, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=value)], modifiers={'final'}, type=BasicType(dimensions=[], name=long))), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=EXPLICIT, postfix_operators=[], prefix_operators=[], qualifier=HLLType, selectors=[])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=explicitStorage, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=clone, postfix_operators=[], prefix_operators=[], qualifier=other.explicitStorage, selectors=[], type_arguments=None)), label=None)])), ReturnStatement(expression=None, label=None)])]), SwitchStatementCase(case=['SPARSE'], statements=[BlockStatement(label=None, statements=[IfStatement(condition=MemberReference(member=sparseOff, postfix_operators=[], prefix_operators=['!'], qualifier=, selectors=[]), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=FULL, postfix_operators=[], prefix_operators=[], qualifier=HLLType, selectors=[])], member=initializeStorage, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=registerIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=other.sparseProbabilisticStorage, selectors=[], type_arguments=None), name=registerValue)], modifiers={'final'}, type=BasicType(dimensions=[], name=byte)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=registerIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=registerValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setMaxRegister, postfix_operators=[], prefix_operators=[], qualifier=probabilisticStorage, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=keySet, postfix_operators=[], prefix_operators=[], qualifier=other.sparseProbabilisticStorage, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=registerIndex)], modifiers={'final'}, type=BasicType(dimensions=[], name=int))), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=SPARSE, postfix_operators=[], prefix_operators=[], qualifier=HLLType, selectors=[])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=sparseProbabilisticStorage, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=clone, postfix_operators=[], prefix_operators=[], qualifier=other.sparseProbabilisticStorage, selectors=[], type_arguments=None)), label=None)])), ReturnStatement(expression=None, label=None)])]), SwitchStatementCase(case=[], statements=[BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=FULL, postfix_operators=[], prefix_operators=[], qualifier=HLLType, selectors=[])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=probabilisticStorage, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=clone, postfix_operators=[], prefix_operators=[], qualifier=other.probabilisticStorage, selectors=[], type_arguments=None)), label=None), ReturnStatement(expression=None, label=None)])])], expression=MethodInvocation(arguments=[], member=getType, postfix_operators=[], prefix_operators=[], qualifier=other, selectors=[], type_arguments=None), label=None) else begin[{] if[call[HLLType.EMPTY.equals, parameter[call[other.getType, parameter[]]]]] begin[{] return[None] else begin[{] None end[}] end[}] SwitchStatement(cases=[SwitchStatementCase(case=['EXPLICIT'], statements=[BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getType, postfix_operators=[], prefix_operators=[], qualifier=other, selectors=[], type_arguments=None)], member=equals, postfix_operators=[], prefix_operators=[], qualifier=HLLType.SPARSE, selectors=[], type_arguments=None), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=FULL, postfix_operators=[], prefix_operators=[], qualifier=HLLType, selectors=[])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=probabilisticStorage, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=clone, postfix_operators=[], prefix_operators=[], qualifier=other.probabilisticStorage, selectors=[], type_arguments=None)), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=MemberReference(member=sparseOff, postfix_operators=[], prefix_operators=['!'], qualifier=, selectors=[]), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=FULL, postfix_operators=[], prefix_operators=[], qualifier=HLLType, selectors=[])], member=initializeStorage, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=registerIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=other.sparseProbabilisticStorage, selectors=[], type_arguments=None), name=registerValue)], modifiers={'final'}, type=BasicType(dimensions=[], name=byte)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=registerIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=registerValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setMaxRegister, postfix_operators=[], prefix_operators=[], qualifier=probabilisticStorage, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=keySet, postfix_operators=[], prefix_operators=[], qualifier=other.sparseProbabilisticStorage, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=registerIndex)], modifiers={'final'}, type=BasicType(dimensions=[], name=int))), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=SPARSE, postfix_operators=[], prefix_operators=[], qualifier=HLLType, selectors=[])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=sparseProbabilisticStorage, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=clone, postfix_operators=[], prefix_operators=[], qualifier=other.sparseProbabilisticStorage, selectors=[], type_arguments=None)), label=None)]))])), ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addRaw, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=explicitStorage, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=value)], modifiers={'final'}, type=BasicType(dimensions=[], name=long))), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=explicitStorage, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)), label=None), ReturnStatement(expression=None, label=None)])]), SwitchStatementCase(case=['SPARSE'], statements=[BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getType, postfix_operators=[], prefix_operators=[], qualifier=other, selectors=[], type_arguments=None)], member=equals, postfix_operators=[], prefix_operators=[], qualifier=HLLType.EXPLICIT, selectors=[], type_arguments=None), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=FULL, postfix_operators=[], prefix_operators=[], qualifier=HLLType, selectors=[])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=probabilisticStorage, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=clone, postfix_operators=[], prefix_operators=[], qualifier=other.probabilisticStorage, selectors=[], type_arguments=None)), label=None), ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=registerIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=sparseProbabilisticStorage, selectors=[], type_arguments=None), name=registerValue)], modifiers={'final'}, type=BasicType(dimensions=[], name=byte)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=registerIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=registerValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setMaxRegister, postfix_operators=[], prefix_operators=[], qualifier=probabilisticStorage, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=keySet, postfix_operators=[], prefix_operators=[], qualifier=sparseProbabilisticStorage, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=registerIndex)], modifiers={'final'}, type=BasicType(dimensions=[], name=int))), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=sparseProbabilisticStorage, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addRaw, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=explicitStorage, postfix_operators=[], prefix_operators=[], qualifier=other, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=value)], modifiers={'final'}, type=BasicType(dimensions=[], name=long))), label=None)])), ReturnStatement(expression=None, label=None)])]), SwitchStatementCase(case=[], statements=[BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getType, postfix_operators=[], prefix_operators=[], qualifier=other, selectors=[], type_arguments=None)], member=equals, postfix_operators=[], prefix_operators=[], qualifier=HLLType.EXPLICIT, selectors=[], type_arguments=None), else_statement=BlockStatement(label=None, statements=[ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=registerIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=other.sparseProbabilisticStorage, selectors=[], type_arguments=None), name=registerValue)], modifiers={'final'}, type=BasicType(dimensions=[], name=byte)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=registerIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=registerValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setMaxRegister, postfix_operators=[], prefix_operators=[], qualifier=probabilisticStorage, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=keySet, postfix_operators=[], prefix_operators=[], qualifier=other.sparseProbabilisticStorage, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=registerIndex)], modifiers={'final'}, type=BasicType(dimensions=[], name=int))), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addRaw, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=explicitStorage, postfix_operators=[], prefix_operators=[], qualifier=other, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=value)], modifiers={'final'}, type=BasicType(dimensions=[], name=long))), label=None)]))])])], expression=MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None) end[}] END[}]
Keyword[void] identifier[heterogenousUnion] operator[SEP] Keyword[final] identifier[HLL] identifier[other] operator[SEP] { Keyword[if] operator[SEP] identifier[HLLType] operator[SEP] identifier[EMPTY] operator[SEP] identifier[equals] operator[SEP] identifier[type] operator[SEP] operator[SEP] { Keyword[switch] operator[SEP] identifier[other] operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[SEP] { Keyword[case] identifier[EXPLICIT] operator[:] { Keyword[if] operator[SEP] identifier[other] operator[SEP] identifier[explicitStorage] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[<=] identifier[explicitThreshold] operator[SEP] { identifier[type] operator[=] identifier[HLLType] operator[SEP] identifier[EXPLICIT] operator[SEP] identifier[explicitStorage] operator[=] identifier[other] operator[SEP] identifier[explicitStorage] operator[SEP] identifier[clone] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { Keyword[if] operator[SEP] operator[!] identifier[sparseOff] operator[SEP] { identifier[initializeStorage] operator[SEP] identifier[HLLType] operator[SEP] identifier[SPARSE] operator[SEP] operator[SEP] } Keyword[else] { identifier[initializeStorage] operator[SEP] identifier[HLLType] operator[SEP] identifier[FULL] operator[SEP] operator[SEP] } Keyword[for] operator[SEP] Keyword[final] Keyword[long] identifier[value] operator[:] identifier[other] operator[SEP] identifier[explicitStorage] operator[SEP] { identifier[addRaw] operator[SEP] identifier[value] operator[SEP] operator[SEP] } } Keyword[return] operator[SEP] } Keyword[case] identifier[SPARSE] operator[:] { Keyword[if] operator[SEP] operator[!] identifier[sparseOff] operator[SEP] { identifier[type] operator[=] identifier[HLLType] operator[SEP] identifier[SPARSE] operator[SEP] identifier[sparseProbabilisticStorage] operator[=] identifier[other] operator[SEP] identifier[sparseProbabilisticStorage] operator[SEP] identifier[clone] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[initializeStorage] operator[SEP] identifier[HLLType] operator[SEP] identifier[FULL] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[final] Keyword[int] identifier[registerIndex] operator[:] identifier[other] operator[SEP] identifier[sparseProbabilisticStorage] operator[SEP] identifier[keySet] operator[SEP] operator[SEP] operator[SEP] { Keyword[final] Keyword[byte] identifier[registerValue] operator[=] identifier[other] operator[SEP] identifier[sparseProbabilisticStorage] operator[SEP] identifier[get] operator[SEP] identifier[registerIndex] operator[SEP] operator[SEP] identifier[probabilisticStorage] operator[SEP] identifier[setMaxRegister] operator[SEP] identifier[registerIndex] , identifier[registerValue] operator[SEP] operator[SEP] } } Keyword[return] operator[SEP] } Keyword[default] operator[:] { identifier[type] operator[=] identifier[HLLType] operator[SEP] identifier[FULL] operator[SEP] identifier[probabilisticStorage] operator[=] identifier[other] operator[SEP] identifier[probabilisticStorage] operator[SEP] identifier[clone] operator[SEP] operator[SEP] operator[SEP] Keyword[return] operator[SEP] } } } Keyword[else] Keyword[if] operator[SEP] identifier[HLLType] operator[SEP] identifier[EMPTY] operator[SEP] identifier[equals] operator[SEP] identifier[other] operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] operator[SEP] } Keyword[switch] operator[SEP] identifier[type] operator[SEP] { Keyword[case] identifier[EXPLICIT] operator[:] { Keyword[if] operator[SEP] identifier[HLLType] operator[SEP] identifier[SPARSE] operator[SEP] identifier[equals] operator[SEP] identifier[other] operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[sparseOff] operator[SEP] { identifier[type] operator[=] identifier[HLLType] operator[SEP] identifier[SPARSE] operator[SEP] identifier[sparseProbabilisticStorage] operator[=] identifier[other] operator[SEP] identifier[sparseProbabilisticStorage] operator[SEP] identifier[clone] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[initializeStorage] operator[SEP] identifier[HLLType] operator[SEP] identifier[FULL] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[final] Keyword[int] identifier[registerIndex] operator[:] identifier[other] operator[SEP] identifier[sparseProbabilisticStorage] operator[SEP] identifier[keySet] operator[SEP] operator[SEP] operator[SEP] { Keyword[final] Keyword[byte] identifier[registerValue] operator[=] identifier[other] operator[SEP] identifier[sparseProbabilisticStorage] operator[SEP] identifier[get] operator[SEP] identifier[registerIndex] operator[SEP] operator[SEP] identifier[probabilisticStorage] operator[SEP] identifier[setMaxRegister] operator[SEP] identifier[registerIndex] , identifier[registerValue] operator[SEP] operator[SEP] } } } Keyword[else] { identifier[type] operator[=] identifier[HLLType] operator[SEP] identifier[FULL] operator[SEP] identifier[probabilisticStorage] operator[=] identifier[other] operator[SEP] identifier[probabilisticStorage] operator[SEP] identifier[clone] operator[SEP] operator[SEP] operator[SEP] } Keyword[for] operator[SEP] Keyword[final] Keyword[long] identifier[value] operator[:] identifier[explicitStorage] operator[SEP] { identifier[addRaw] operator[SEP] identifier[value] operator[SEP] operator[SEP] } identifier[explicitStorage] operator[=] Other[null] operator[SEP] Keyword[return] operator[SEP] } Keyword[case] identifier[SPARSE] operator[:] { Keyword[if] operator[SEP] identifier[HLLType] operator[SEP] identifier[EXPLICIT] operator[SEP] identifier[equals] operator[SEP] identifier[other] operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { Keyword[for] operator[SEP] Keyword[final] Keyword[long] identifier[value] operator[:] identifier[other] operator[SEP] identifier[explicitStorage] operator[SEP] { identifier[addRaw] operator[SEP] identifier[value] operator[SEP] operator[SEP] } } Keyword[else] { identifier[type] operator[=] identifier[HLLType] operator[SEP] identifier[FULL] operator[SEP] identifier[probabilisticStorage] operator[=] identifier[other] operator[SEP] identifier[probabilisticStorage] operator[SEP] identifier[clone] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[final] Keyword[int] identifier[registerIndex] operator[:] identifier[sparseProbabilisticStorage] operator[SEP] identifier[keySet] operator[SEP] operator[SEP] operator[SEP] { Keyword[final] Keyword[byte] identifier[registerValue] operator[=] identifier[sparseProbabilisticStorage] operator[SEP] identifier[get] operator[SEP] identifier[registerIndex] operator[SEP] operator[SEP] identifier[probabilisticStorage] operator[SEP] identifier[setMaxRegister] operator[SEP] identifier[registerIndex] , identifier[registerValue] operator[SEP] operator[SEP] } identifier[sparseProbabilisticStorage] operator[=] Other[null] operator[SEP] } Keyword[return] operator[SEP] } Keyword[default] operator[:] { Keyword[if] operator[SEP] identifier[HLLType] operator[SEP] identifier[EXPLICIT] operator[SEP] identifier[equals] operator[SEP] identifier[other] operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { Keyword[for] operator[SEP] Keyword[final] Keyword[long] identifier[value] operator[:] identifier[other] operator[SEP] identifier[explicitStorage] operator[SEP] { identifier[addRaw] operator[SEP] identifier[value] operator[SEP] operator[SEP] } } Keyword[else] { Keyword[for] operator[SEP] Keyword[final] Keyword[int] identifier[registerIndex] operator[:] identifier[other] operator[SEP] identifier[sparseProbabilisticStorage] operator[SEP] identifier[keySet] operator[SEP] operator[SEP] operator[SEP] { Keyword[final] Keyword[byte] identifier[registerValue] operator[=] identifier[other] operator[SEP] identifier[sparseProbabilisticStorage] operator[SEP] identifier[get] operator[SEP] identifier[registerIndex] operator[SEP] operator[SEP] identifier[probabilisticStorage] operator[SEP] identifier[setMaxRegister] operator[SEP] identifier[registerIndex] , identifier[registerValue] operator[SEP] operator[SEP] } } } } }
@Override public boolean addData(IoBuffer data) { if (data.limit() == 0) { return true; } if (!this.canHandleData(data)) { return false; } byte first = data.get(); //log.trace("First byte: {}", HexDump.toHexString(first)); data.rewind(); // get frame type int frameType = (first & MASK_VIDEO_FRAMETYPE) >> 4; if (frameType != FLAG_FRAMETYPE_KEYFRAME) { // Not a keyframe try { int lastInterframe = numInterframes.getAndIncrement(); if (frameType != FLAG_FRAMETYPE_DISPOSABLE) { log.trace("Buffering interframe #{}", lastInterframe); if (lastInterframe < interframes.size()) { interframes.get(lastInterframe).setData(data); } else { interframes.add(new FrameData(data)); } } else { numInterframes.set(lastInterframe); } } catch (Throwable e) { log.error("Failed to buffer interframe", e); } data.rewind(); return true; } numInterframes.set(0); interframes.clear(); // Store last keyframe dataCount = data.limit(); if (blockSize < dataCount) { blockSize = dataCount; blockData = new byte[blockSize]; } data.get(blockData, 0, dataCount); data.rewind(); return true; }
class class_name[name] begin[{] method[addData, return_type[type[boolean]], modifier[public], parameter[data]] begin[{] if[binary_operation[call[data.limit, parameter[]], ==, literal[0]]] begin[{] return[literal[true]] else begin[{] None end[}] if[THIS[call[None.canHandleData, parameter[member[.data]]]]] begin[{] return[literal[false]] else begin[{] None end[}] local_variable[type[byte], first] call[data.rewind, parameter[]] local_variable[type[int], frameType] if[binary_operation[member[.frameType], !=, member[.FLAG_FRAMETYPE_KEYFRAME]]] begin[{] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getAndIncrement, postfix_operators=[], prefix_operators=[], qualifier=numInterframes, selectors=[], type_arguments=None), name=lastInterframe)], modifiers=set(), type=BasicType(dimensions=[], name=int)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=frameType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=FLAG_FRAMETYPE_DISPOSABLE, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=!=), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=lastInterframe, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=set, postfix_operators=[], prefix_operators=[], qualifier=numInterframes, selectors=[], 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="Buffering interframe #{}"), MemberReference(member=lastInterframe, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=trace, postfix_operators=[], prefix_operators=[], qualifier=log, selectors=[], type_arguments=None), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=lastInterframe, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=interframes, selectors=[], type_arguments=None), operator=<), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[ClassCreator(arguments=[MemberReference(member=data, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=FrameData, sub_type=None))], member=add, postfix_operators=[], prefix_operators=[], qualifier=interframes, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=lastInterframe, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=interframes, selectors=[MethodInvocation(arguments=[MemberReference(member=data, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setData, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)]))]))], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Failed to buffer interframe"), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=log, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Throwable']))], finally_block=None, label=None, resources=None) call[data.rewind, parameter[]] return[literal[true]] else begin[{] None end[}] call[numInterframes.set, parameter[literal[0]]] call[interframes.clear, parameter[]] assign[member[.dataCount], call[data.limit, parameter[]]] if[binary_operation[member[.blockSize], <, member[.dataCount]]] begin[{] assign[member[.blockSize], member[.dataCount]] assign[member[.blockData], ArrayCreator(dimensions=[MemberReference(member=blockSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=None, name=byte))] else begin[{] None end[}] call[data.get, parameter[member[.blockData], literal[0], member[.dataCount]]] call[data.rewind, parameter[]] return[literal[true]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[boolean] identifier[addData] operator[SEP] identifier[IoBuffer] identifier[data] operator[SEP] { Keyword[if] operator[SEP] identifier[data] operator[SEP] identifier[limit] operator[SEP] operator[SEP] operator[==] Other[0] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } Keyword[if] operator[SEP] operator[!] Keyword[this] operator[SEP] identifier[canHandleData] operator[SEP] identifier[data] operator[SEP] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } Keyword[byte] identifier[first] operator[=] identifier[data] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[data] operator[SEP] identifier[rewind] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[frameType] operator[=] operator[SEP] identifier[first] operator[&] identifier[MASK_VIDEO_FRAMETYPE] operator[SEP] operator[>] operator[>] Other[4] operator[SEP] Keyword[if] operator[SEP] identifier[frameType] operator[!=] identifier[FLAG_FRAMETYPE_KEYFRAME] operator[SEP] { Keyword[try] { Keyword[int] identifier[lastInterframe] operator[=] identifier[numInterframes] operator[SEP] identifier[getAndIncrement] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[frameType] operator[!=] identifier[FLAG_FRAMETYPE_DISPOSABLE] operator[SEP] { identifier[log] operator[SEP] identifier[trace] operator[SEP] literal[String] , identifier[lastInterframe] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[lastInterframe] operator[<] identifier[interframes] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] { identifier[interframes] operator[SEP] identifier[get] operator[SEP] identifier[lastInterframe] operator[SEP] operator[SEP] identifier[setData] operator[SEP] identifier[data] operator[SEP] operator[SEP] } Keyword[else] { identifier[interframes] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[FrameData] operator[SEP] identifier[data] operator[SEP] operator[SEP] operator[SEP] } } Keyword[else] { identifier[numInterframes] operator[SEP] identifier[set] operator[SEP] identifier[lastInterframe] operator[SEP] operator[SEP] } } Keyword[catch] operator[SEP] identifier[Throwable] identifier[e] operator[SEP] { identifier[log] operator[SEP] identifier[error] operator[SEP] literal[String] , identifier[e] operator[SEP] operator[SEP] } identifier[data] operator[SEP] identifier[rewind] operator[SEP] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP] } identifier[numInterframes] operator[SEP] identifier[set] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[interframes] operator[SEP] identifier[clear] operator[SEP] operator[SEP] operator[SEP] identifier[dataCount] operator[=] identifier[data] operator[SEP] identifier[limit] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[blockSize] operator[<] identifier[dataCount] operator[SEP] { identifier[blockSize] operator[=] identifier[dataCount] operator[SEP] identifier[blockData] operator[=] Keyword[new] Keyword[byte] operator[SEP] identifier[blockSize] operator[SEP] operator[SEP] } identifier[data] operator[SEP] identifier[get] operator[SEP] identifier[blockData] , Other[0] , identifier[dataCount] operator[SEP] operator[SEP] identifier[data] operator[SEP] identifier[rewind] operator[SEP] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP] }
public boolean isMatched(String value, Boolean defaultValue) { // @todo: there isn't a defaultValue for radio button, what should we do here? if (value == null) return false; if (_match != null) return value.equals(_match); if (_defaultRadio != null) return value.equals(_defaultRadio); return false; }
class class_name[name] begin[{] method[isMatched, return_type[type[boolean]], modifier[public], parameter[value, defaultValue]] begin[{] if[binary_operation[member[.value], ==, literal[null]]] begin[{] return[literal[false]] else begin[{] None end[}] if[binary_operation[member[._match], !=, literal[null]]] begin[{] return[call[value.equals, parameter[member[._match]]]] else begin[{] None end[}] if[binary_operation[member[._defaultRadio], !=, literal[null]]] begin[{] return[call[value.equals, parameter[member[._defaultRadio]]]] else begin[{] None end[}] return[literal[false]] end[}] END[}]
Keyword[public] Keyword[boolean] identifier[isMatched] operator[SEP] identifier[String] identifier[value] , identifier[Boolean] identifier[defaultValue] operator[SEP] { Keyword[if] operator[SEP] identifier[value] operator[==] Other[null] operator[SEP] Keyword[return] literal[boolean] operator[SEP] Keyword[if] operator[SEP] identifier[_match] operator[!=] Other[null] operator[SEP] Keyword[return] identifier[value] operator[SEP] identifier[equals] operator[SEP] identifier[_match] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[_defaultRadio] operator[!=] Other[null] operator[SEP] Keyword[return] identifier[value] operator[SEP] identifier[equals] operator[SEP] identifier[_defaultRadio] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP] }
private static <K,V> boolean colorOf(TreeMapEntry<K,V> p) { return (p == null ? BLACK : p.color); }
class class_name[name] begin[{] method[colorOf, return_type[type[boolean]], modifier[private static], parameter[p]] begin[{] return[TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=p, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), if_false=MemberReference(member=color, postfix_operators=[], prefix_operators=[], qualifier=p, selectors=[]), if_true=MemberReference(member=BLACK, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))] end[}] END[}]
Keyword[private] Keyword[static] operator[<] identifier[K] , identifier[V] operator[>] Keyword[boolean] identifier[colorOf] operator[SEP] identifier[TreeMapEntry] operator[<] identifier[K] , identifier[V] operator[>] identifier[p] operator[SEP] { Keyword[return] operator[SEP] identifier[p] operator[==] Other[null] operator[?] identifier[BLACK] operator[:] identifier[p] operator[SEP] identifier[color] operator[SEP] operator[SEP] }
@XmlElementDecl(namespace = "http://docs.oasis-open.org/ns/cmis/messaging/200908/", name = "depth", scope = GetTypeDescendants.class) public JAXBElement<BigInteger> createGetTypeDescendantsDepth( BigInteger value) { return new JAXBElement<BigInteger>(_GetDescendantsDepth_QNAME, BigInteger.class, GetTypeDescendants.class, value); }
class class_name[name] begin[{] method[createGetTypeDescendantsDepth, return_type[type[JAXBElement]], modifier[public], parameter[value]] begin[{] return[ClassCreator(arguments=[MemberReference(member=_GetDescendantsDepth_QNAME, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=BigInteger, sub_type=None)), ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=GetTypeDescendants, sub_type=None)), MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=BigInteger, sub_type=None))], dimensions=None, name=JAXBElement, sub_type=None))] end[}] END[}]
annotation[@] identifier[XmlElementDecl] operator[SEP] identifier[namespace] operator[=] literal[String] , identifier[name] operator[=] literal[String] , identifier[scope] operator[=] identifier[GetTypeDescendants] operator[SEP] Keyword[class] operator[SEP] Keyword[public] identifier[JAXBElement] operator[<] identifier[BigInteger] operator[>] identifier[createGetTypeDescendantsDepth] operator[SEP] identifier[BigInteger] identifier[value] operator[SEP] { Keyword[return] Keyword[new] identifier[JAXBElement] operator[<] identifier[BigInteger] operator[>] operator[SEP] identifier[_GetDescendantsDepth_QNAME] , identifier[BigInteger] operator[SEP] Keyword[class] , identifier[GetTypeDescendants] operator[SEP] Keyword[class] , identifier[value] operator[SEP] operator[SEP] }
private void debug(String message, Throwable t) { if (debugEnabled) { long currentTime = System.currentTimeMillis(); long timeSinceProcessingStart = currentTime - processingStartedAt; System.err.println(timeSinceProcessingStart + " [" + localClusterName + "] " + message); if (t != null) { t.printStackTrace(System.err); } } }
class class_name[name] begin[{] method[debug, return_type[void], modifier[private], parameter[message, t]] begin[{] if[member[.debugEnabled]] begin[{] local_variable[type[long], currentTime] local_variable[type[long], timeSinceProcessingStart] call[System.err.println, parameter[binary_operation[binary_operation[binary_operation[binary_operation[member[.timeSinceProcessingStart], +, literal[" ["]], +, member[.localClusterName]], +, literal["] "]], +, member[.message]]]] if[binary_operation[member[.t], !=, literal[null]]] begin[{] call[t.printStackTrace, parameter[member[System.err]]] else begin[{] None end[}] else begin[{] None end[}] end[}] END[}]
Keyword[private] Keyword[void] identifier[debug] operator[SEP] identifier[String] identifier[message] , identifier[Throwable] identifier[t] operator[SEP] { Keyword[if] operator[SEP] identifier[debugEnabled] operator[SEP] { Keyword[long] identifier[currentTime] operator[=] identifier[System] operator[SEP] identifier[currentTimeMillis] operator[SEP] operator[SEP] operator[SEP] Keyword[long] identifier[timeSinceProcessingStart] operator[=] identifier[currentTime] operator[-] identifier[processingStartedAt] operator[SEP] identifier[System] operator[SEP] identifier[err] operator[SEP] identifier[println] operator[SEP] identifier[timeSinceProcessingStart] operator[+] literal[String] operator[+] identifier[localClusterName] operator[+] literal[String] operator[+] identifier[message] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[t] operator[!=] Other[null] operator[SEP] { identifier[t] operator[SEP] identifier[printStackTrace] operator[SEP] identifier[System] operator[SEP] identifier[err] operator[SEP] operator[SEP] } } }
private String resolveServiceEntry(String serviceType, String domain, DirContext ctx) { String result = null; try { String query = new StringBuilder("_").append(serviceType).append("._tcp.") .append(domain).toString(); Attribute dnsRecord = lookup(query, ctx, "SRV"); // There are maybe more records defined, we will return the one // with the highest priority (lowest number) and the highest weight // (highest number) int highestPriority = -1; int highestWeight = -1; for (NamingEnumeration<?> recordEnum = dnsRecord.getAll(); recordEnum .hasMoreElements();) { String[] record = recordEnum.next().toString().split(" "); if (record.length != 4) { throw new DnsLookupException("Wrong service record for query " + query + ": [" + Arrays.toString(record) + "]"); } int priority = Integer.parseInt(record[0]); int weight = Integer.parseInt(record[1]); // we have a new highest Priority, so forget also the highest weight if (priority < highestPriority || highestPriority == -1) { highestPriority = priority; highestWeight = weight; result = record[3].trim(); } // same priority, but higher weight if (priority == highestPriority && weight > highestWeight) { highestWeight = weight; result = record[3].trim(); } } } catch (NamingException e) { throw new DnsLookupException( "DNS lookup failed for service " + serviceType + " at " + domain, e); } // remove the "." at the end if (result.endsWith(".")) { result = result.substring(0, result.length() - 1); } return result; }
class class_name[name] begin[{] method[resolveServiceEntry, return_type[type[String]], modifier[private], parameter[serviceType, domain, ctx]] begin[{] local_variable[type[String], result] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="_")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=serviceType, 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="._tcp.")], member=append, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=domain, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=append, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=toString, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=StringBuilder, sub_type=None)), name=query)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=query, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=ctx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="SRV")], member=lookup, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=dnsRecord)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Attribute, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=1), name=highestPriority)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=1), name=highestWeight)], modifiers=set(), type=BasicType(dimensions=[], name=int)), ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=next, postfix_operators=[], prefix_operators=[], qualifier=recordEnum, selectors=[MethodInvocation(arguments=[], member=toString, 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=split, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=record)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[None], name=String, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=record, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=4), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Wrong service record for query "), operandr=MemberReference(member=query, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=": ["), operator=+), operandr=MethodInvocation(arguments=[MemberReference(member=record, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=toString, postfix_operators=[], prefix_operators=[], qualifier=Arrays, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="]"), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=DnsLookupException, sub_type=None)), label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=record, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))])], member=parseInt, postfix_operators=[], prefix_operators=[], qualifier=Integer, selectors=[], type_arguments=None), name=priority)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=record, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1))])], member=parseInt, postfix_operators=[], prefix_operators=[], qualifier=Integer, selectors=[], type_arguments=None), name=weight)], modifiers=set(), type=BasicType(dimensions=[], name=int)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=priority, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=highestPriority, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), operandr=BinaryOperation(operandl=MemberReference(member=highestPriority, 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=Assignment(expressionl=MemberReference(member=highestPriority, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=priority, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=highestWeight, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=weight, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=record, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=3)), MethodInvocation(arguments=[], member=trim, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)])), label=None)])), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=priority, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=highestPriority, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), operandr=BinaryOperation(operandl=MemberReference(member=weight, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=highestWeight, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=>), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=highestWeight, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=weight, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=record, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=3)), MethodInvocation(arguments=[], member=trim, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)])), label=None)]))]), control=ForControl(condition=MethodInvocation(arguments=[], member=hasMoreElements, postfix_operators=[], prefix_operators=[], qualifier=recordEnum, selectors=[], type_arguments=None), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=MethodInvocation(arguments=[], member=getAll, postfix_operators=[], prefix_operators=[], qualifier=dnsRecord, selectors=[], type_arguments=None), name=recordEnum)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=?, type=None)], dimensions=[], name=NamingEnumeration, sub_type=None)), update=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="DNS lookup failed for service "), operandr=MemberReference(member=serviceType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" at "), operator=+), operandr=MemberReference(member=domain, 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=DnsLookupException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['NamingException']))], finally_block=None, label=None, resources=None) if[call[result.endsWith, parameter[literal["."]]]] begin[{] assign[member[.result], call[result.substring, parameter[literal[0], binary_operation[call[result.length, parameter[]], -, literal[1]]]]] else begin[{] None end[}] return[member[.result]] end[}] END[}]
Keyword[private] identifier[String] identifier[resolveServiceEntry] operator[SEP] identifier[String] identifier[serviceType] , identifier[String] identifier[domain] , identifier[DirContext] identifier[ctx] operator[SEP] { identifier[String] identifier[result] operator[=] Other[null] operator[SEP] Keyword[try] { identifier[String] identifier[query] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[serviceType] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[domain] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] identifier[Attribute] identifier[dnsRecord] operator[=] identifier[lookup] operator[SEP] identifier[query] , identifier[ctx] , literal[String] operator[SEP] operator[SEP] Keyword[int] identifier[highestPriority] operator[=] operator[-] Other[1] operator[SEP] Keyword[int] identifier[highestWeight] operator[=] operator[-] Other[1] operator[SEP] Keyword[for] operator[SEP] identifier[NamingEnumeration] operator[<] operator[?] operator[>] identifier[recordEnum] operator[=] identifier[dnsRecord] operator[SEP] identifier[getAll] operator[SEP] operator[SEP] operator[SEP] identifier[recordEnum] operator[SEP] identifier[hasMoreElements] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { identifier[String] operator[SEP] operator[SEP] identifier[record] operator[=] identifier[recordEnum] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] identifier[split] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[record] operator[SEP] identifier[length] operator[!=] Other[4] operator[SEP] { Keyword[throw] Keyword[new] identifier[DnsLookupException] operator[SEP] literal[String] operator[+] identifier[query] operator[+] literal[String] operator[+] identifier[Arrays] operator[SEP] identifier[toString] operator[SEP] identifier[record] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] } Keyword[int] identifier[priority] operator[=] identifier[Integer] operator[SEP] identifier[parseInt] operator[SEP] identifier[record] operator[SEP] Other[0] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[weight] operator[=] identifier[Integer] operator[SEP] identifier[parseInt] operator[SEP] identifier[record] operator[SEP] Other[1] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[priority] operator[<] identifier[highestPriority] operator[||] identifier[highestPriority] operator[==] operator[-] Other[1] operator[SEP] { identifier[highestPriority] operator[=] identifier[priority] operator[SEP] identifier[highestWeight] operator[=] identifier[weight] operator[SEP] identifier[result] operator[=] identifier[record] operator[SEP] Other[3] operator[SEP] operator[SEP] identifier[trim] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[priority] operator[==] identifier[highestPriority] operator[&&] identifier[weight] operator[>] identifier[highestWeight] operator[SEP] { identifier[highestWeight] operator[=] identifier[weight] operator[SEP] identifier[result] operator[=] identifier[record] operator[SEP] Other[3] operator[SEP] operator[SEP] identifier[trim] operator[SEP] operator[SEP] operator[SEP] } } } Keyword[catch] operator[SEP] identifier[NamingException] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[DnsLookupException] operator[SEP] literal[String] operator[+] identifier[serviceType] operator[+] literal[String] operator[+] identifier[domain] , identifier[e] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[result] operator[SEP] identifier[endsWith] operator[SEP] literal[String] operator[SEP] operator[SEP] { identifier[result] operator[=] identifier[result] operator[SEP] identifier[substring] operator[SEP] Other[0] , identifier[result] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[-] Other[1] operator[SEP] operator[SEP] } Keyword[return] identifier[result] operator[SEP] }
public boolean prescreen(Code code, Method method) { if (method.isSynthetic()) { return false; } CodeException[] ce = code.getExceptionTable(); if (CollectionUtils.isEmpty(ce)) { return false; } BitSet bytecodeSet = getClassContext().getBytecodeSet(method); return (bytecodeSet != null) && bytecodeSet.get(Const.ATHROW); }
class class_name[name] begin[{] method[prescreen, return_type[type[boolean]], modifier[public], parameter[code, method]] begin[{] if[call[method.isSynthetic, parameter[]]] begin[{] return[literal[false]] else begin[{] None end[}] local_variable[type[CodeException], ce] if[call[CollectionUtils.isEmpty, parameter[member[.ce]]]] begin[{] return[literal[false]] else begin[{] None end[}] local_variable[type[BitSet], bytecodeSet] return[binary_operation[binary_operation[member[.bytecodeSet], !=, literal[null]], &&, call[bytecodeSet.get, parameter[member[Const.ATHROW]]]]] end[}] END[}]
Keyword[public] Keyword[boolean] identifier[prescreen] operator[SEP] identifier[Code] identifier[code] , identifier[Method] identifier[method] operator[SEP] { Keyword[if] operator[SEP] identifier[method] operator[SEP] identifier[isSynthetic] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } identifier[CodeException] operator[SEP] operator[SEP] identifier[ce] operator[=] identifier[code] operator[SEP] identifier[getExceptionTable] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[CollectionUtils] operator[SEP] identifier[isEmpty] operator[SEP] identifier[ce] operator[SEP] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } identifier[BitSet] identifier[bytecodeSet] operator[=] identifier[getClassContext] operator[SEP] operator[SEP] operator[SEP] identifier[getBytecodeSet] operator[SEP] identifier[method] operator[SEP] operator[SEP] Keyword[return] operator[SEP] identifier[bytecodeSet] operator[!=] Other[null] operator[SEP] operator[&&] identifier[bytecodeSet] operator[SEP] identifier[get] operator[SEP] identifier[Const] operator[SEP] identifier[ATHROW] operator[SEP] operator[SEP] }
public static ArrayList<ConfigSource> getDefaultSources(ClassLoader classloader) { ArrayList<ConfigSource> sources = new ArrayList<>(); sources.add(new SystemConfigSource()); sources.add(new EnvConfig13Source()); sources.add(new AppPropertyConfigSource()); sources.add(new ServerXMLVariableConfigSource()); sources.addAll(getPropertiesFileConfigSources(classloader)); return sources; }
class class_name[name] begin[{] method[getDefaultSources, return_type[type[ArrayList]], modifier[public static], parameter[classloader]] begin[{] local_variable[type[ArrayList], sources] call[sources.add, parameter[ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SystemConfigSource, sub_type=None))]] call[sources.add, parameter[ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=EnvConfig13Source, sub_type=None))]] call[sources.add, parameter[ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=AppPropertyConfigSource, sub_type=None))]] call[sources.add, parameter[ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ServerXMLVariableConfigSource, sub_type=None))]] call[sources.addAll, parameter[call[.getPropertiesFileConfigSources, parameter[member[.classloader]]]]] return[member[.sources]] end[}] END[}]
Keyword[public] Keyword[static] identifier[ArrayList] operator[<] identifier[ConfigSource] operator[>] identifier[getDefaultSources] operator[SEP] identifier[ClassLoader] identifier[classloader] operator[SEP] { identifier[ArrayList] operator[<] identifier[ConfigSource] operator[>] identifier[sources] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[sources] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[SystemConfigSource] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[sources] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[EnvConfig13Source] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[sources] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[AppPropertyConfigSource] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[sources] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[ServerXMLVariableConfigSource] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[sources] operator[SEP] identifier[addAll] operator[SEP] identifier[getPropertiesFileConfigSources] operator[SEP] identifier[classloader] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[sources] operator[SEP] }
@Override public UpdateVirtualRouterResult updateVirtualRouter(UpdateVirtualRouterRequest request) { request = beforeClientExecution(request); return executeUpdateVirtualRouter(request); }
class class_name[name] begin[{] method[updateVirtualRouter, return_type[type[UpdateVirtualRouterResult]], modifier[public], parameter[request]] begin[{] assign[member[.request], call[.beforeClientExecution, parameter[member[.request]]]] return[call[.executeUpdateVirtualRouter, parameter[member[.request]]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[UpdateVirtualRouterResult] identifier[updateVirtualRouter] operator[SEP] identifier[UpdateVirtualRouterRequest] identifier[request] operator[SEP] { identifier[request] operator[=] identifier[beforeClientExecution] operator[SEP] identifier[request] operator[SEP] operator[SEP] Keyword[return] identifier[executeUpdateVirtualRouter] operator[SEP] identifier[request] operator[SEP] operator[SEP] }
public int getId(int index) { if (index >= mLayerState.mNum) { throw new IndexOutOfBoundsException(); } return mLayerState.mChildren[index].mId; }
class class_name[name] begin[{] method[getId, return_type[type[int]], modifier[public], parameter[index]] begin[{] if[binary_operation[member[.index], >=, member[mLayerState.mNum]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IndexOutOfBoundsException, sub_type=None)), label=None) else begin[{] None end[}] return[member[mLayerState.mChildren]] end[}] END[}]
Keyword[public] Keyword[int] identifier[getId] operator[SEP] Keyword[int] identifier[index] operator[SEP] { Keyword[if] operator[SEP] identifier[index] operator[>=] identifier[mLayerState] operator[SEP] identifier[mNum] operator[SEP] { Keyword[throw] Keyword[new] identifier[IndexOutOfBoundsException] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[mLayerState] operator[SEP] identifier[mChildren] operator[SEP] identifier[index] operator[SEP] operator[SEP] identifier[mId] operator[SEP] }
private void resubmit(long commandSequence, OperationAttempt<?, ?> attempt) { // If the client's response sequence number is greater than the given command sequence number, // the cluster likely has a new leader, and we need to reset the sequencing in the leader by // sending a keep-alive request. // Ensure that the client doesn't resubmit many concurrent KeepAliveRequests by tracking the last // keep-alive response sequence number and only resubmitting if the sequence number has changed. long responseSequence = state.getCommandResponse(); if (commandSequence < responseSequence && keepAliveIndex.get() != responseSequence) { keepAliveIndex.set(responseSequence); manager.resetIndexes(state.getSessionId()).whenCompleteAsync((result, error) -> { if (error == null) { resubmit(responseSequence, attempt); } else { keepAliveIndex.set(0); attempt.retry(Duration.ofSeconds(FIBONACCI[Math.min(attempt.attempt - 1, FIBONACCI.length - 1)])); } }, context); } else { for (Map.Entry<Long, OperationAttempt> entry : attempts.entrySet()) { OperationAttempt operation = entry.getValue(); if (operation instanceof CommandAttempt && operation.request.sequenceNumber() > commandSequence && operation.attempt <= attempt.attempt) { operation.retry(); } } } }
class class_name[name] begin[{] method[resubmit, return_type[void], modifier[private], parameter[commandSequence, attempt]] begin[{] local_variable[type[long], responseSequence] if[binary_operation[binary_operation[member[.commandSequence], <, member[.responseSequence]], &&, binary_operation[call[keepAliveIndex.get, parameter[]], !=, member[.responseSequence]]]] begin[{] call[keepAliveIndex.set, parameter[member[.responseSequence]]] call[manager.resetIndexes, parameter[call[state.getSessionId, parameter[]]]] else begin[{] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None), name=operation)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=OperationAttempt, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=operation, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=CommandAttempt, sub_type=None), operator=instanceof), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[], member=sequenceNumber, postfix_operators=[], prefix_operators=[], qualifier=operation.request, selectors=[], type_arguments=None), operandr=MemberReference(member=commandSequence, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=>), operator=&&), operandr=BinaryOperation(operandl=MemberReference(member=attempt, postfix_operators=[], prefix_operators=[], qualifier=operation, selectors=[]), operandr=MemberReference(member=attempt, postfix_operators=[], prefix_operators=[], qualifier=attempt, selectors=[]), operator=<=), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=retry, postfix_operators=[], prefix_operators=[], qualifier=operation, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=entrySet, postfix_operators=[], prefix_operators=[], qualifier=attempts, 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=Long, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=OperationAttempt, sub_type=None))], dimensions=None, name=Entry, sub_type=None)))), label=None) end[}] end[}] END[}]
Keyword[private] Keyword[void] identifier[resubmit] operator[SEP] Keyword[long] identifier[commandSequence] , identifier[OperationAttempt] operator[<] operator[?] , operator[?] operator[>] identifier[attempt] operator[SEP] { Keyword[long] identifier[responseSequence] operator[=] identifier[state] operator[SEP] identifier[getCommandResponse] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[commandSequence] operator[<] identifier[responseSequence] operator[&&] identifier[keepAliveIndex] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[!=] identifier[responseSequence] operator[SEP] { identifier[keepAliveIndex] operator[SEP] identifier[set] operator[SEP] identifier[responseSequence] operator[SEP] operator[SEP] identifier[manager] operator[SEP] identifier[resetIndexes] operator[SEP] identifier[state] operator[SEP] identifier[getSessionId] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[whenCompleteAsync] operator[SEP] operator[SEP] identifier[result] , identifier[error] operator[SEP] operator[->] { Keyword[if] operator[SEP] identifier[error] operator[==] Other[null] operator[SEP] { identifier[resubmit] operator[SEP] identifier[responseSequence] , identifier[attempt] operator[SEP] operator[SEP] } Keyword[else] { identifier[keepAliveIndex] operator[SEP] identifier[set] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[attempt] operator[SEP] identifier[retry] operator[SEP] identifier[Duration] operator[SEP] identifier[ofSeconds] operator[SEP] identifier[FIBONACCI] operator[SEP] identifier[Math] operator[SEP] identifier[min] operator[SEP] identifier[attempt] operator[SEP] identifier[attempt] operator[-] Other[1] , identifier[FIBONACCI] operator[SEP] identifier[length] operator[-] Other[1] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } , identifier[context] operator[SEP] operator[SEP] } Keyword[else] { Keyword[for] operator[SEP] identifier[Map] operator[SEP] identifier[Entry] operator[<] identifier[Long] , identifier[OperationAttempt] operator[>] identifier[entry] operator[:] identifier[attempts] operator[SEP] identifier[entrySet] operator[SEP] operator[SEP] operator[SEP] { identifier[OperationAttempt] identifier[operation] operator[=] identifier[entry] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[operation] Keyword[instanceof] identifier[CommandAttempt] operator[&&] identifier[operation] operator[SEP] identifier[request] operator[SEP] identifier[sequenceNumber] operator[SEP] operator[SEP] operator[>] identifier[commandSequence] operator[&&] identifier[operation] operator[SEP] identifier[attempt] operator[<=] identifier[attempt] operator[SEP] identifier[attempt] operator[SEP] { identifier[operation] operator[SEP] identifier[retry] operator[SEP] operator[SEP] operator[SEP] } } } }
public <T> AsyncIterator<Map.Entry<String, VersionedMetadata<T>>> getAllEntries(String tableName, Function<byte[], T> fromBytes) { return new ContinuationTokenAsyncIterator<>(token -> getEntriesPaginated(tableName, token, 1000, fromBytes) .thenApplyAsync(result -> { token.release(); return new AbstractMap.SimpleEntry<>(result.getKey(), result.getValue()); }, executor), IteratorState.EMPTY.toBytes()); }
class class_name[name] begin[{] method[getAllEntries, return_type[type[AsyncIterator]], modifier[public], parameter[tableName, fromBytes]] begin[{] return[ClassCreator(arguments=[LambdaExpression(body=MethodInvocation(arguments=[MemberReference(member=tableName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=token, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1000), MemberReference(member=fromBytes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getEntriesPaginated, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[LambdaExpression(body=[StatementExpression(expression=MethodInvocation(arguments=[], member=release, postfix_operators=[], prefix_operators=[], qualifier=token, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[], member=getKey, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=AbstractMap, sub_type=ReferenceType(arguments=[], dimensions=None, name=SimpleEntry, sub_type=None))), label=None)], parameters=[MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])]), MemberReference(member=executor, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=thenApplyAsync, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), parameters=[MemberReference(member=token, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])]), MethodInvocation(arguments=[], member=toBytes, postfix_operators=[], prefix_operators=[], qualifier=IteratorState.EMPTY, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=ContinuationTokenAsyncIterator, sub_type=None))] end[}] END[}]
Keyword[public] operator[<] identifier[T] operator[>] identifier[AsyncIterator] operator[<] identifier[Map] operator[SEP] identifier[Entry] operator[<] identifier[String] , identifier[VersionedMetadata] operator[<] identifier[T] operator[>] operator[>] operator[>] identifier[getAllEntries] operator[SEP] identifier[String] identifier[tableName] , identifier[Function] operator[<] Keyword[byte] operator[SEP] operator[SEP] , identifier[T] operator[>] identifier[fromBytes] operator[SEP] { Keyword[return] Keyword[new] identifier[ContinuationTokenAsyncIterator] operator[<] operator[>] operator[SEP] identifier[token] operator[->] identifier[getEntriesPaginated] operator[SEP] identifier[tableName] , identifier[token] , Other[1000] , identifier[fromBytes] operator[SEP] operator[SEP] identifier[thenApplyAsync] operator[SEP] identifier[result] operator[->] { identifier[token] operator[SEP] identifier[release] operator[SEP] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[AbstractMap] operator[SEP] identifier[SimpleEntry] operator[<] operator[>] operator[SEP] identifier[result] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] , identifier[result] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } , identifier[executor] operator[SEP] , identifier[IteratorState] operator[SEP] identifier[EMPTY] operator[SEP] identifier[toBytes] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
public byte[] serializeToBytes(final Serializable o) { byte[] bytes = null; try (final ByteArrayOutputStream baos = new ByteArrayOutputStream(); final ObjectOutputStream oos = new ObjectOutputStream(baos)) { oos.writeObject(o); oos.flush(); bytes = baos.toByteArray(); } catch (final IOException e) { logger.warn("cannot Java serialize object", e); } return bytes; }
class class_name[name] begin[{] method[serializeToBytes, return_type[type[byte]], modifier[public], parameter[o]] begin[{] local_variable[type[byte], bytes] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=o, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=writeObject, postfix_operators=[], prefix_operators=[], qualifier=oos, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=flush, postfix_operators=[], prefix_operators=[], qualifier=oos, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=bytes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=toByteArray, postfix_operators=[], prefix_operators=[], qualifier=baos, selectors=[], type_arguments=None)), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="cannot Java serialize object"), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=warn, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IOException']))], finally_block=None, label=None, resources=[TryResource(annotations=[], modifiers={'final'}, name=baos, type=ReferenceType(arguments=None, dimensions=[], name=ByteArrayOutputStream, sub_type=None), value=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ByteArrayOutputStream, sub_type=None))), TryResource(annotations=[], modifiers={'final'}, name=oos, type=ReferenceType(arguments=None, dimensions=[], name=ObjectOutputStream, sub_type=None), value=ClassCreator(arguments=[MemberReference(member=baos, 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=ObjectOutputStream, sub_type=None)))]) return[member[.bytes]] end[}] END[}]
Keyword[public] Keyword[byte] operator[SEP] operator[SEP] identifier[serializeToBytes] operator[SEP] Keyword[final] identifier[Serializable] identifier[o] operator[SEP] { Keyword[byte] operator[SEP] operator[SEP] identifier[bytes] operator[=] Other[null] operator[SEP] Keyword[try] operator[SEP] Keyword[final] identifier[ByteArrayOutputStream] identifier[baos] operator[=] Keyword[new] identifier[ByteArrayOutputStream] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[ObjectOutputStream] identifier[oos] operator[=] Keyword[new] identifier[ObjectOutputStream] operator[SEP] identifier[baos] operator[SEP] operator[SEP] { identifier[oos] operator[SEP] identifier[writeObject] operator[SEP] identifier[o] operator[SEP] operator[SEP] identifier[oos] operator[SEP] identifier[flush] operator[SEP] operator[SEP] operator[SEP] identifier[bytes] operator[=] identifier[baos] operator[SEP] identifier[toByteArray] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] Keyword[final] identifier[IOException] identifier[e] operator[SEP] { identifier[logger] operator[SEP] identifier[warn] operator[SEP] literal[String] , identifier[e] operator[SEP] operator[SEP] } Keyword[return] identifier[bytes] operator[SEP] }
public DateFuncSup add(def<DateSeperator> dateFunction) { date.setTime(date.getTime() + dateFunction.apply(new DateSeperator()).parse()); return this; }
class class_name[name] begin[{] method[add, return_type[type[DateFuncSup]], modifier[public], parameter[dateFunction]] begin[{] call[date.setTime, parameter[binary_operation[call[date.getTime, parameter[]], +, call[dateFunction.apply, parameter[ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=DateSeperator, sub_type=None))]]]]] return[THIS[]] end[}] END[}]
Keyword[public] identifier[DateFuncSup] identifier[add] operator[SEP] identifier[def] operator[<] identifier[DateSeperator] operator[>] identifier[dateFunction] operator[SEP] { identifier[date] operator[SEP] identifier[setTime] operator[SEP] identifier[date] operator[SEP] identifier[getTime] operator[SEP] operator[SEP] operator[+] identifier[dateFunction] operator[SEP] identifier[apply] operator[SEP] Keyword[new] identifier[DateSeperator] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[parse] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] Keyword[this] operator[SEP] }
@Override public Page<AvailablePhoneNumberCountry> nextPage(final Page<AvailablePhoneNumberCountry> page, final TwilioRestClient client) { Request request = new Request( HttpMethod.GET, page.getNextPageUrl( Domains.API.toString(), client.getRegion() ) ); return pageForRequest(client, request); }
class class_name[name] begin[{] method[nextPage, return_type[type[Page]], modifier[public], parameter[page, client]] begin[{] local_variable[type[Request], request] return[call[.pageForRequest, parameter[member[.client], member[.request]]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[Page] operator[<] identifier[AvailablePhoneNumberCountry] operator[>] identifier[nextPage] operator[SEP] Keyword[final] identifier[Page] operator[<] identifier[AvailablePhoneNumberCountry] operator[>] identifier[page] , Keyword[final] identifier[TwilioRestClient] identifier[client] operator[SEP] { identifier[Request] identifier[request] operator[=] Keyword[new] identifier[Request] operator[SEP] identifier[HttpMethod] operator[SEP] identifier[GET] , identifier[page] operator[SEP] identifier[getNextPageUrl] operator[SEP] identifier[Domains] operator[SEP] identifier[API] operator[SEP] identifier[toString] operator[SEP] operator[SEP] , identifier[client] operator[SEP] identifier[getRegion] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[pageForRequest] operator[SEP] identifier[client] , identifier[request] operator[SEP] operator[SEP] }
public Observable<ServiceResponseWithHeaders<Page<JobPreparationAndReleaseTaskExecutionInformation>, JobListPreparationAndReleaseTaskStatusHeaders>> listPreparationAndReleaseTaskStatusNextSinglePageAsync(final String nextPageLink, final JobListPreparationAndReleaseTaskStatusNextOptions jobListPreparationAndReleaseTaskStatusNextOptions) { if (nextPageLink == null) { throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); } Validator.validate(jobListPreparationAndReleaseTaskStatusNextOptions); UUID clientRequestId = null; if (jobListPreparationAndReleaseTaskStatusNextOptions != null) { clientRequestId = jobListPreparationAndReleaseTaskStatusNextOptions.clientRequestId(); } Boolean returnClientRequestId = null; if (jobListPreparationAndReleaseTaskStatusNextOptions != null) { returnClientRequestId = jobListPreparationAndReleaseTaskStatusNextOptions.returnClientRequestId(); } DateTime ocpDate = null; if (jobListPreparationAndReleaseTaskStatusNextOptions != null) { ocpDate = jobListPreparationAndReleaseTaskStatusNextOptions.ocpDate(); } DateTimeRfc1123 ocpDateConverted = null; if (ocpDate != null) { ocpDateConverted = new DateTimeRfc1123(ocpDate); } String nextUrl = String.format("%s", nextPageLink); return service.listPreparationAndReleaseTaskStatusNext(nextUrl, this.client.acceptLanguage(), clientRequestId, returnClientRequestId, ocpDateConverted, this.client.userAgent()) .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponseWithHeaders<Page<JobPreparationAndReleaseTaskExecutionInformation>, JobListPreparationAndReleaseTaskStatusHeaders>>>() { @Override public Observable<ServiceResponseWithHeaders<Page<JobPreparationAndReleaseTaskExecutionInformation>, JobListPreparationAndReleaseTaskStatusHeaders>> call(Response<ResponseBody> response) { try { ServiceResponseWithHeaders<PageImpl<JobPreparationAndReleaseTaskExecutionInformation>, JobListPreparationAndReleaseTaskStatusHeaders> result = listPreparationAndReleaseTaskStatusNextDelegate(response); return Observable.just(new ServiceResponseWithHeaders<Page<JobPreparationAndReleaseTaskExecutionInformation>, JobListPreparationAndReleaseTaskStatusHeaders>(result.body(), result.headers(), result.response())); } catch (Throwable t) { return Observable.error(t); } } }); }
class class_name[name] begin[{] method[listPreparationAndReleaseTaskStatusNextSinglePageAsync, return_type[type[Observable]], modifier[public], parameter[nextPageLink, jobListPreparationAndReleaseTaskStatusNextOptions]] begin[{] if[binary_operation[member[.nextPageLink], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Parameter nextPageLink 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[.jobListPreparationAndReleaseTaskStatusNextOptions]]] local_variable[type[UUID], clientRequestId] if[binary_operation[member[.jobListPreparationAndReleaseTaskStatusNextOptions], !=, literal[null]]] begin[{] assign[member[.clientRequestId], call[jobListPreparationAndReleaseTaskStatusNextOptions.clientRequestId, parameter[]]] else begin[{] None end[}] local_variable[type[Boolean], returnClientRequestId] if[binary_operation[member[.jobListPreparationAndReleaseTaskStatusNextOptions], !=, literal[null]]] begin[{] assign[member[.returnClientRequestId], call[jobListPreparationAndReleaseTaskStatusNextOptions.returnClientRequestId, parameter[]]] else begin[{] None end[}] local_variable[type[DateTime], ocpDate] if[binary_operation[member[.jobListPreparationAndReleaseTaskStatusNextOptions], !=, literal[null]]] begin[{] assign[member[.ocpDate], call[jobListPreparationAndReleaseTaskStatusNextOptions.ocpDate, parameter[]]] else begin[{] None end[}] local_variable[type[DateTimeRfc1123], ocpDateConverted] if[binary_operation[member[.ocpDate], !=, literal[null]]] begin[{] assign[member[.ocpDateConverted], ClassCreator(arguments=[MemberReference(member=ocpDate, 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=DateTimeRfc1123, sub_type=None))] else begin[{] None end[}] local_variable[type[String], nextUrl] return[call[service.listPreparationAndReleaseTaskStatusNext, parameter[member[.nextUrl], THIS[member[None.client]call[None.acceptLanguage, parameter[]]], member[.clientRequestId], member[.returnClientRequestId], member[.ocpDateConverted], THIS[member[None.client]call[None.userAgent, parameter[]]]]]] end[}] END[}]
Keyword[public] identifier[Observable] operator[<] identifier[ServiceResponseWithHeaders] operator[<] identifier[Page] operator[<] identifier[JobPreparationAndReleaseTaskExecutionInformation] operator[>] , identifier[JobListPreparationAndReleaseTaskStatusHeaders] operator[>] operator[>] identifier[listPreparationAndReleaseTaskStatusNextSinglePageAsync] operator[SEP] Keyword[final] identifier[String] identifier[nextPageLink] , Keyword[final] identifier[JobListPreparationAndReleaseTaskStatusNextOptions] identifier[jobListPreparationAndReleaseTaskStatusNextOptions] operator[SEP] { Keyword[if] operator[SEP] identifier[nextPageLink] 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[jobListPreparationAndReleaseTaskStatusNextOptions] operator[SEP] operator[SEP] identifier[UUID] identifier[clientRequestId] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[jobListPreparationAndReleaseTaskStatusNextOptions] operator[!=] Other[null] operator[SEP] { identifier[clientRequestId] operator[=] identifier[jobListPreparationAndReleaseTaskStatusNextOptions] operator[SEP] identifier[clientRequestId] operator[SEP] operator[SEP] operator[SEP] } identifier[Boolean] identifier[returnClientRequestId] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[jobListPreparationAndReleaseTaskStatusNextOptions] operator[!=] Other[null] operator[SEP] { identifier[returnClientRequestId] operator[=] identifier[jobListPreparationAndReleaseTaskStatusNextOptions] operator[SEP] identifier[returnClientRequestId] operator[SEP] operator[SEP] operator[SEP] } identifier[DateTime] identifier[ocpDate] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[jobListPreparationAndReleaseTaskStatusNextOptions] operator[!=] Other[null] operator[SEP] { identifier[ocpDate] operator[=] identifier[jobListPreparationAndReleaseTaskStatusNextOptions] operator[SEP] identifier[ocpDate] operator[SEP] operator[SEP] operator[SEP] } identifier[DateTimeRfc1123] identifier[ocpDateConverted] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[ocpDate] operator[!=] Other[null] operator[SEP] { identifier[ocpDateConverted] operator[=] Keyword[new] identifier[DateTimeRfc1123] operator[SEP] identifier[ocpDate] operator[SEP] operator[SEP] } identifier[String] identifier[nextUrl] operator[=] identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[nextPageLink] operator[SEP] operator[SEP] Keyword[return] identifier[service] operator[SEP] identifier[listPreparationAndReleaseTaskStatusNext] operator[SEP] identifier[nextUrl] , Keyword[this] operator[SEP] identifier[client] operator[SEP] identifier[acceptLanguage] operator[SEP] operator[SEP] , identifier[clientRequestId] , identifier[returnClientRequestId] , identifier[ocpDateConverted] , 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[ServiceResponseWithHeaders] operator[<] identifier[Page] operator[<] identifier[JobPreparationAndReleaseTaskExecutionInformation] operator[>] , identifier[JobListPreparationAndReleaseTaskStatusHeaders] operator[>] operator[>] operator[>] operator[SEP] operator[SEP] { annotation[@] identifier[Override] Keyword[public] identifier[Observable] operator[<] identifier[ServiceResponseWithHeaders] operator[<] identifier[Page] operator[<] identifier[JobPreparationAndReleaseTaskExecutionInformation] operator[>] , identifier[JobListPreparationAndReleaseTaskStatusHeaders] operator[>] operator[>] identifier[call] operator[SEP] identifier[Response] operator[<] identifier[ResponseBody] operator[>] identifier[response] operator[SEP] { Keyword[try] { identifier[ServiceResponseWithHeaders] operator[<] identifier[PageImpl] operator[<] identifier[JobPreparationAndReleaseTaskExecutionInformation] operator[>] , identifier[JobListPreparationAndReleaseTaskStatusHeaders] operator[>] identifier[result] operator[=] identifier[listPreparationAndReleaseTaskStatusNextDelegate] operator[SEP] identifier[response] operator[SEP] operator[SEP] Keyword[return] identifier[Observable] operator[SEP] identifier[just] operator[SEP] Keyword[new] identifier[ServiceResponseWithHeaders] operator[<] identifier[Page] operator[<] identifier[JobPreparationAndReleaseTaskExecutionInformation] operator[>] , identifier[JobListPreparationAndReleaseTaskStatusHeaders] operator[>] operator[SEP] identifier[result] operator[SEP] identifier[body] operator[SEP] operator[SEP] , identifier[result] operator[SEP] identifier[headers] operator[SEP] operator[SEP] , identifier[result] operator[SEP] identifier[response] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Throwable] identifier[t] operator[SEP] { Keyword[return] identifier[Observable] operator[SEP] identifier[error] operator[SEP] identifier[t] operator[SEP] operator[SEP] } } } operator[SEP] operator[SEP] }
public static Object asType(Object object, Class type) throws Throwable { if (object == null) object = NullObject.getNullObject(); return invokeMethodN(object.getClass(), object, "asType", new Object[]{type}); }
class class_name[name] begin[{] method[asType, return_type[type[Object]], modifier[public static], parameter[object, type]] begin[{] if[binary_operation[member[.object], ==, literal[null]]] begin[{] assign[member[.object], call[NullObject.getNullObject, parameter[]]] else begin[{] None end[}] return[call[.invokeMethodN, parameter[call[object.getClass, parameter[]], member[.object], literal["asType"], ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Object, sub_type=None))]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[Object] identifier[asType] operator[SEP] identifier[Object] identifier[object] , identifier[Class] identifier[type] operator[SEP] Keyword[throws] identifier[Throwable] { Keyword[if] operator[SEP] identifier[object] operator[==] Other[null] operator[SEP] identifier[object] operator[=] identifier[NullObject] operator[SEP] identifier[getNullObject] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[invokeMethodN] operator[SEP] identifier[object] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] , identifier[object] , literal[String] , Keyword[new] identifier[Object] operator[SEP] operator[SEP] { identifier[type] } operator[SEP] operator[SEP] }
public OvhOrder cdn_dedicated_serviceName_quota_duration_POST(String serviceName, String duration, OvhOrderQuotaEnum quota) throws IOException { String qPath = "/order/cdn/dedicated/{serviceName}/quota/{duration}"; StringBuilder sb = path(qPath, serviceName, duration); HashMap<String, Object>o = new HashMap<String, Object>(); addBody(o, "quota", quota); String resp = exec(qPath, "POST", sb.toString(), o); return convertTo(resp, OvhOrder.class); }
class class_name[name] begin[{] method[cdn_dedicated_serviceName_quota_duration_POST, return_type[type[OvhOrder]], modifier[public], parameter[serviceName, duration, quota]] begin[{] local_variable[type[String], qPath] local_variable[type[StringBuilder], sb] local_variable[type[HashMap], o] call[.addBody, parameter[member[.o], literal["quota"], member[.quota]]] local_variable[type[String], resp] return[call[.convertTo, parameter[member[.resp], ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=OvhOrder, sub_type=None))]]] end[}] END[}]
Keyword[public] identifier[OvhOrder] identifier[cdn_dedicated_serviceName_quota_duration_POST] operator[SEP] identifier[String] identifier[serviceName] , identifier[String] identifier[duration] , identifier[OvhOrderQuotaEnum] identifier[quota] operator[SEP] Keyword[throws] identifier[IOException] { identifier[String] identifier[qPath] operator[=] literal[String] operator[SEP] identifier[StringBuilder] identifier[sb] operator[=] identifier[path] operator[SEP] identifier[qPath] , identifier[serviceName] , identifier[duration] operator[SEP] operator[SEP] identifier[HashMap] operator[<] identifier[String] , identifier[Object] operator[>] identifier[o] operator[=] Keyword[new] identifier[HashMap] operator[<] identifier[String] , identifier[Object] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[addBody] operator[SEP] identifier[o] , literal[String] , identifier[quota] operator[SEP] operator[SEP] identifier[String] identifier[resp] operator[=] identifier[exec] operator[SEP] identifier[qPath] , literal[String] , identifier[sb] operator[SEP] identifier[toString] operator[SEP] operator[SEP] , identifier[o] operator[SEP] operator[SEP] Keyword[return] identifier[convertTo] operator[SEP] identifier[resp] , identifier[OvhOrder] operator[SEP] Keyword[class] operator[SEP] operator[SEP] }
public void copyFileFrom(InputStream src, boolean append) throws CopyFileFromException { ChannelSftp sftp; try { sftp = alloc(); try { sftp.put(src, escape(slashPath), append ? ChannelSftp.APPEND : ChannelSftp.OVERWRITE); } finally { free(sftp); } } catch (SftpException | JSchException e) { throw new CopyFileFromException(this, e); } }
class class_name[name] begin[{] method[copyFileFrom, return_type[void], modifier[public], parameter[src, append]] begin[{] local_variable[type[ChannelSftp], sftp] TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=sftp, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=alloc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=src, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[MemberReference(member=slashPath, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=escape, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), TernaryExpression(condition=MemberReference(member=append, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_false=MemberReference(member=OVERWRITE, postfix_operators=[], prefix_operators=[], qualifier=ChannelSftp, selectors=[]), if_true=MemberReference(member=APPEND, postfix_operators=[], prefix_operators=[], qualifier=ChannelSftp, selectors=[]))], member=put, postfix_operators=[], prefix_operators=[], qualifier=sftp, selectors=[], type_arguments=None), label=None)], catches=None, finally_block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=sftp, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=free, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], label=None, resources=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=CopyFileFromException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['SftpException', 'JSchException']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[public] Keyword[void] identifier[copyFileFrom] operator[SEP] identifier[InputStream] identifier[src] , Keyword[boolean] identifier[append] operator[SEP] Keyword[throws] identifier[CopyFileFromException] { identifier[ChannelSftp] identifier[sftp] operator[SEP] Keyword[try] { identifier[sftp] operator[=] identifier[alloc] operator[SEP] operator[SEP] operator[SEP] Keyword[try] { identifier[sftp] operator[SEP] identifier[put] operator[SEP] identifier[src] , identifier[escape] operator[SEP] identifier[slashPath] operator[SEP] , identifier[append] operator[?] identifier[ChannelSftp] operator[SEP] identifier[APPEND] operator[:] identifier[ChannelSftp] operator[SEP] identifier[OVERWRITE] operator[SEP] operator[SEP] } Keyword[finally] { identifier[free] operator[SEP] identifier[sftp] operator[SEP] operator[SEP] } } Keyword[catch] operator[SEP] identifier[SftpException] operator[|] identifier[JSchException] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[CopyFileFromException] operator[SEP] Keyword[this] , identifier[e] operator[SEP] operator[SEP] } }
void findMavenArtifacts(Enumeration<URL> mavenDirs) throws IOException, SAXException, XPathExpressionException, ParserConfigurationException { XPath xpath = XPathFactory.newInstance().newXPath(); DocumentBuilderFactory builderFactory = DocumentBuilderFactory.newInstance(); // don't allow external entity refs in the poms. builderFactory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true); builderFactory.setFeature("http://xml.org/sax/features/external-general-entities", false); builderFactory.setFeature("http://xml.org/sax/features/external-parameter-entities", false); DocumentBuilder builder = builderFactory.newDocumentBuilder(); while (mavenDirs.hasMoreElements()) { URL u = mavenDirs.nextElement(); // jar:file:/home/username/.m2/repository/org/slf4j/slf4j-jdk14/1.5.0/slf4j-jdk14-1.5.0.jar!/META-INF/MANIFEST.MF // we're not interested if it's not a jar, although how you'd have a MANIFEST.MF which wasn't in a jar? if (u.getProtocol().equals("jar")) { // file:/home/username/.m2/repository/com/betfair/tornjak/kpi/3.0-SNAPSHOT/kpi-3.0-SNAPSHOT.jar!/META-INF/MANIFEST.MF String file = u.getFile(); // file:/home/username/.m2/repository/com/betfair/tornjak/kpi/3.0-SNAPSHOT/kpi-3.0-SNAPSHOT.jar file = file.substring(0, file.indexOf("!")); // /home/username/.m2/repository/com/betfair/tornjak/kpi/3.0-SNAPSHOT/kpi-3.0-SNAPSHOT.jar file = file.substring(5); // remove %20 etc file = URLDecoder.decode(file, "UTF-8"); try (JarFile jarFile = new JarFile(file)) { Enumeration<JarEntry> entries = jarFile.entries(); while (entries.hasMoreElements()) { JarEntry entry = entries.nextElement(); try { if (entry.getName().endsWith("pom.xml")) { try (InputStream is = jarFile.getInputStream(entry)) { Document doc = builder.parse(is); String groupId = xpath.evaluate("/project/groupId", doc); if (groupId == null || "".equals(groupId)) { groupId = xpath.evaluate("/project/parent/groupId", doc); if (groupId == null || "".equals(groupId)) { logger.warn("Can't work out groupId for pom: "+file+"!"+entry); break; } } String artifactId = xpath.evaluate("/project/artifactId", doc); if (artifactId == null || "".equals(artifactId)) { artifactId = xpath.evaluate("/project/parent/artifactId", doc); if (artifactId == null || "".equals(artifactId)) { logger.warn("Can't work out artifactId for pom: "+file+"!"+entry); break; } } String version = xpath.evaluate("/project/version", doc); if (version == null || "".equals(version)) { version = xpath.evaluate("/project/parent/version", doc); if (version == null || "".equals(version)) { logger.warn("Can't work out version for pom: "+file+"!"+entry); break; } } artifacts.put(groupId + ":" + artifactId, version); } } } catch (IOException e) { logger.error("Can't resolve "+entry.getName()); throw e; } } } } else { logger.info("Can't examine maven artifact in non jar location: "+u); } } }
class class_name[name] begin[{] method[findMavenArtifacts, return_type[void], modifier[default], parameter[mavenDirs]] begin[{] local_variable[type[XPath], xpath] local_variable[type[DocumentBuilderFactory], builderFactory] call[builderFactory.setFeature, parameter[member[XMLConstants.FEATURE_SECURE_PROCESSING], literal[true]]] call[builderFactory.setFeature, parameter[literal["http://xml.org/sax/features/external-general-entities"], literal[false]]] call[builderFactory.setFeature, parameter[literal["http://xml.org/sax/features/external-parameter-entities"], literal[false]]] local_variable[type[DocumentBuilder], builder] while[call[mavenDirs.hasMoreElements, parameter[]]] begin[{] local_variable[type[URL], u] if[call[u.getProtocol, parameter[]]] begin[{] local_variable[type[String], file] assign[member[.file], call[file.substring, parameter[literal[0], call[file.indexOf, parameter[literal["!"]]]]]] assign[member[.file], call[file.substring, parameter[literal[5]]]] assign[member[.file], call[URLDecoder.decode, parameter[member[.file], literal["UTF-8"]]]] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=entries, postfix_operators=[], prefix_operators=[], qualifier=jarFile, selectors=[], type_arguments=None), name=entries)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=JarEntry, sub_type=None))], dimensions=[], name=Enumeration, sub_type=None)), WhileStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=nextElement, postfix_operators=[], prefix_operators=[], qualifier=entries, selectors=[], type_arguments=None), name=entry)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=JarEntry, sub_type=None)), TryStatement(block=[IfStatement(condition=MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="pom.xml")], member=endsWith, 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=[TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=is, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=parse, postfix_operators=[], prefix_operators=[], qualifier=builder, selectors=[], type_arguments=None), name=doc)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Document, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="/project/groupId"), MemberReference(member=doc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=evaluate, postfix_operators=[], prefix_operators=[], qualifier=xpath, selectors=[], type_arguments=None), name=groupId)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=groupId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=groupId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], value=""), operator=||), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=groupId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="/project/parent/groupId"), MemberReference(member=doc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=evaluate, postfix_operators=[], prefix_operators=[], qualifier=xpath, selectors=[], type_arguments=None)), label=None), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=groupId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=groupId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], value=""), operator=||), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Can't work out groupId for pom: "), operandr=MemberReference(member=file, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="!"), operator=+), operandr=MemberReference(member=entry, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=warn, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)]))])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="/project/artifactId"), MemberReference(member=doc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=evaluate, postfix_operators=[], prefix_operators=[], qualifier=xpath, selectors=[], type_arguments=None), name=artifactId)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=artifactId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=artifactId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], value=""), operator=||), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=artifactId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="/project/parent/artifactId"), MemberReference(member=doc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=evaluate, postfix_operators=[], prefix_operators=[], qualifier=xpath, selectors=[], type_arguments=None)), label=None), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=artifactId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=artifactId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], value=""), operator=||), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Can't work out artifactId for pom: "), operandr=MemberReference(member=file, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="!"), operator=+), operandr=MemberReference(member=entry, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=warn, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)]))])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="/project/version"), MemberReference(member=doc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=evaluate, postfix_operators=[], prefix_operators=[], qualifier=xpath, selectors=[], type_arguments=None), name=version)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=version, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=version, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], value=""), operator=||), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=version, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="/project/parent/version"), MemberReference(member=doc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=evaluate, postfix_operators=[], prefix_operators=[], qualifier=xpath, selectors=[], type_arguments=None)), label=None), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=version, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=version, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], value=""), operator=||), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Can't work out version for pom: "), operandr=MemberReference(member=file, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="!"), operator=+), operandr=MemberReference(member=entry, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=warn, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)]))])), StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=groupId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=":"), operator=+), operandr=MemberReference(member=artifactId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), MemberReference(member=version, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=put, postfix_operators=[], prefix_operators=[], qualifier=artifacts, selectors=[], type_arguments=None), label=None)], catches=None, finally_block=None, label=None, resources=[TryResource(annotations=[], modifiers=set(), name=is, type=ReferenceType(arguments=None, dimensions=[], name=InputStream, sub_type=None), value=MethodInvocation(arguments=[MemberReference(member=entry, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getInputStream, postfix_operators=[], prefix_operators=[], qualifier=jarFile, selectors=[], type_arguments=None))])]))], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Can't resolve "), operandr=MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None), operator=+)], member=error, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), label=None), ThrowStatement(expression=MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IOException']))], finally_block=None, label=None, resources=None)]), condition=MethodInvocation(arguments=[], member=hasMoreElements, postfix_operators=[], prefix_operators=[], qualifier=entries, selectors=[], type_arguments=None), label=None)], catches=None, finally_block=None, label=None, resources=[TryResource(annotations=[], modifiers=set(), name=jarFile, type=ReferenceType(arguments=None, dimensions=[], name=JarFile, sub_type=None), value=ClassCreator(arguments=[MemberReference(member=file, 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=JarFile, sub_type=None)))]) else begin[{] call[logger.info, parameter[binary_operation[literal["Can't examine maven artifact in non jar location: "], +, member[.u]]]] end[}] end[}] end[}] END[}]
Keyword[void] identifier[findMavenArtifacts] operator[SEP] identifier[Enumeration] operator[<] identifier[URL] operator[>] identifier[mavenDirs] operator[SEP] Keyword[throws] identifier[IOException] , identifier[SAXException] , identifier[XPathExpressionException] , identifier[ParserConfigurationException] { identifier[XPath] identifier[xpath] operator[=] identifier[XPathFactory] operator[SEP] identifier[newInstance] operator[SEP] operator[SEP] operator[SEP] identifier[newXPath] operator[SEP] operator[SEP] operator[SEP] identifier[DocumentBuilderFactory] identifier[builderFactory] operator[=] identifier[DocumentBuilderFactory] operator[SEP] identifier[newInstance] operator[SEP] operator[SEP] operator[SEP] identifier[builderFactory] operator[SEP] identifier[setFeature] operator[SEP] identifier[XMLConstants] operator[SEP] identifier[FEATURE_SECURE_PROCESSING] , literal[boolean] operator[SEP] operator[SEP] identifier[builderFactory] operator[SEP] identifier[setFeature] operator[SEP] literal[String] , literal[boolean] operator[SEP] operator[SEP] identifier[builderFactory] operator[SEP] identifier[setFeature] operator[SEP] literal[String] , literal[boolean] operator[SEP] operator[SEP] identifier[DocumentBuilder] identifier[builder] operator[=] identifier[builderFactory] operator[SEP] identifier[newDocumentBuilder] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[mavenDirs] operator[SEP] identifier[hasMoreElements] operator[SEP] operator[SEP] operator[SEP] { identifier[URL] identifier[u] operator[=] identifier[mavenDirs] operator[SEP] identifier[nextElement] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[u] operator[SEP] identifier[getProtocol] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] { identifier[String] identifier[file] operator[=] identifier[u] operator[SEP] identifier[getFile] operator[SEP] operator[SEP] operator[SEP] identifier[file] operator[=] identifier[file] operator[SEP] identifier[substring] operator[SEP] Other[0] , identifier[file] operator[SEP] identifier[indexOf] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[file] operator[=] identifier[file] operator[SEP] identifier[substring] operator[SEP] Other[5] operator[SEP] operator[SEP] identifier[file] operator[=] identifier[URLDecoder] operator[SEP] identifier[decode] operator[SEP] identifier[file] , literal[String] operator[SEP] operator[SEP] Keyword[try] operator[SEP] identifier[JarFile] identifier[jarFile] operator[=] Keyword[new] identifier[JarFile] operator[SEP] identifier[file] operator[SEP] operator[SEP] { identifier[Enumeration] operator[<] identifier[JarEntry] operator[>] identifier[entries] operator[=] identifier[jarFile] operator[SEP] identifier[entries] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[entries] operator[SEP] identifier[hasMoreElements] operator[SEP] operator[SEP] operator[SEP] { identifier[JarEntry] identifier[entry] operator[=] identifier[entries] operator[SEP] identifier[nextElement] operator[SEP] operator[SEP] operator[SEP] Keyword[try] { Keyword[if] operator[SEP] identifier[entry] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] identifier[endsWith] operator[SEP] literal[String] operator[SEP] operator[SEP] { Keyword[try] operator[SEP] identifier[InputStream] identifier[is] operator[=] identifier[jarFile] operator[SEP] identifier[getInputStream] operator[SEP] identifier[entry] operator[SEP] operator[SEP] { identifier[Document] identifier[doc] operator[=] identifier[builder] operator[SEP] identifier[parse] operator[SEP] identifier[is] operator[SEP] operator[SEP] identifier[String] identifier[groupId] operator[=] identifier[xpath] operator[SEP] identifier[evaluate] operator[SEP] literal[String] , identifier[doc] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[groupId] operator[==] Other[null] operator[||] literal[String] operator[SEP] identifier[equals] operator[SEP] identifier[groupId] operator[SEP] operator[SEP] { identifier[groupId] operator[=] identifier[xpath] operator[SEP] identifier[evaluate] operator[SEP] literal[String] , identifier[doc] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[groupId] operator[==] Other[null] operator[||] literal[String] operator[SEP] identifier[equals] operator[SEP] identifier[groupId] operator[SEP] operator[SEP] { identifier[logger] operator[SEP] identifier[warn] operator[SEP] literal[String] operator[+] identifier[file] operator[+] literal[String] operator[+] identifier[entry] operator[SEP] operator[SEP] Keyword[break] operator[SEP] } } identifier[String] identifier[artifactId] operator[=] identifier[xpath] operator[SEP] identifier[evaluate] operator[SEP] literal[String] , identifier[doc] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[artifactId] operator[==] Other[null] operator[||] literal[String] operator[SEP] identifier[equals] operator[SEP] identifier[artifactId] operator[SEP] operator[SEP] { identifier[artifactId] operator[=] identifier[xpath] operator[SEP] identifier[evaluate] operator[SEP] literal[String] , identifier[doc] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[artifactId] operator[==] Other[null] operator[||] literal[String] operator[SEP] identifier[equals] operator[SEP] identifier[artifactId] operator[SEP] operator[SEP] { identifier[logger] operator[SEP] identifier[warn] operator[SEP] literal[String] operator[+] identifier[file] operator[+] literal[String] operator[+] identifier[entry] operator[SEP] operator[SEP] Keyword[break] operator[SEP] } } identifier[String] identifier[version] operator[=] identifier[xpath] operator[SEP] identifier[evaluate] operator[SEP] literal[String] , identifier[doc] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[version] operator[==] Other[null] operator[||] literal[String] operator[SEP] identifier[equals] operator[SEP] identifier[version] operator[SEP] operator[SEP] { identifier[version] operator[=] identifier[xpath] operator[SEP] identifier[evaluate] operator[SEP] literal[String] , identifier[doc] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[version] operator[==] Other[null] operator[||] literal[String] operator[SEP] identifier[equals] operator[SEP] identifier[version] operator[SEP] operator[SEP] { identifier[logger] operator[SEP] identifier[warn] operator[SEP] literal[String] operator[+] identifier[file] operator[+] literal[String] operator[+] identifier[entry] operator[SEP] operator[SEP] Keyword[break] operator[SEP] } } identifier[artifacts] operator[SEP] identifier[put] operator[SEP] identifier[groupId] operator[+] literal[String] operator[+] identifier[artifactId] , identifier[version] operator[SEP] operator[SEP] } } } Keyword[catch] operator[SEP] identifier[IOException] identifier[e] operator[SEP] { identifier[logger] operator[SEP] identifier[error] operator[SEP] literal[String] operator[+] identifier[entry] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[throw] identifier[e] operator[SEP] } } } } Keyword[else] { identifier[logger] operator[SEP] identifier[info] operator[SEP] literal[String] operator[+] identifier[u] operator[SEP] operator[SEP] } } }
double qobs(int dummy, double[] xt) { int x = (int) (xt[0]); double p = Math.random(); double[] distr = accumP[x]; int i, left = 0, right = distr.length - 1; // Find and return least i s.t. p <= distr[i] while (left <= right) { // Here distr[left-1] <= p <= distr[right+1] i = (left + right) / 2; if (p < distr[i]) { right = i - 1; } else if (distr[i] < p) { left = i + 1; } else { return i; } } // Now p <= distr[left] return left; }
class class_name[name] begin[{] method[qobs, return_type[type[double]], modifier[default], parameter[dummy, xt]] begin[{] local_variable[type[int], x] local_variable[type[double], p] local_variable[type[double], distr] local_variable[type[int], i] while[binary_operation[member[.left], <=, member[.right]]] begin[{] assign[member[.i], binary_operation[binary_operation[member[.left], +, member[.right]], /, literal[2]]] if[binary_operation[member[.p], <, member[.distr]]] begin[{] assign[member[.right], binary_operation[member[.i], -, literal[1]]] else begin[{] if[binary_operation[member[.distr], <, member[.p]]] begin[{] assign[member[.left], binary_operation[member[.i], +, literal[1]]] else begin[{] return[member[.i]] end[}] end[}] end[}] return[member[.left]] end[}] END[}]
Keyword[double] identifier[qobs] operator[SEP] Keyword[int] identifier[dummy] , Keyword[double] operator[SEP] operator[SEP] identifier[xt] operator[SEP] { Keyword[int] identifier[x] operator[=] operator[SEP] Keyword[int] operator[SEP] operator[SEP] identifier[xt] operator[SEP] Other[0] operator[SEP] operator[SEP] operator[SEP] Keyword[double] identifier[p] operator[=] identifier[Math] operator[SEP] identifier[random] operator[SEP] operator[SEP] operator[SEP] Keyword[double] operator[SEP] operator[SEP] identifier[distr] operator[=] identifier[accumP] operator[SEP] identifier[x] operator[SEP] operator[SEP] Keyword[int] identifier[i] , identifier[left] operator[=] Other[0] , identifier[right] operator[=] identifier[distr] operator[SEP] identifier[length] operator[-] Other[1] operator[SEP] Keyword[while] operator[SEP] identifier[left] operator[<=] identifier[right] operator[SEP] { identifier[i] operator[=] operator[SEP] identifier[left] operator[+] identifier[right] operator[SEP] operator[/] Other[2] operator[SEP] Keyword[if] operator[SEP] identifier[p] operator[<] identifier[distr] operator[SEP] identifier[i] operator[SEP] operator[SEP] { identifier[right] operator[=] identifier[i] operator[-] Other[1] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[distr] operator[SEP] identifier[i] operator[SEP] operator[<] identifier[p] operator[SEP] { identifier[left] operator[=] identifier[i] operator[+] Other[1] operator[SEP] } Keyword[else] { Keyword[return] identifier[i] operator[SEP] } } Keyword[return] identifier[left] operator[SEP] }
public static void printOnce(Object msg) { if (messagesCache.get(msg.hashCode()) == null) { JK.printBlock(msg); messagesCache.put(msg.hashCode(), msg); } }
class class_name[name] begin[{] method[printOnce, return_type[void], modifier[public static], parameter[msg]] begin[{] if[binary_operation[call[messagesCache.get, parameter[call[msg.hashCode, parameter[]]]], ==, literal[null]]] begin[{] call[JK.printBlock, parameter[member[.msg]]] call[messagesCache.put, parameter[call[msg.hashCode, parameter[]], member[.msg]]] else begin[{] None end[}] end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[printOnce] operator[SEP] identifier[Object] identifier[msg] operator[SEP] { Keyword[if] operator[SEP] identifier[messagesCache] operator[SEP] identifier[get] operator[SEP] identifier[msg] operator[SEP] identifier[hashCode] operator[SEP] operator[SEP] operator[SEP] operator[==] Other[null] operator[SEP] { identifier[JK] operator[SEP] identifier[printBlock] operator[SEP] identifier[msg] operator[SEP] operator[SEP] identifier[messagesCache] operator[SEP] identifier[put] operator[SEP] identifier[msg] operator[SEP] identifier[hashCode] operator[SEP] operator[SEP] , identifier[msg] operator[SEP] operator[SEP] } }
@Override public Route getRouteFor(HttpMethod method, String uri, Request request) { // Compute the list of matching routes - only the path is check in this first stage List<Route> list = new ArrayList<>(1); //TODO This can be faster by using an immutable list. list.addAll(copy().stream() .filter(route -> route.matches(method, uri)) .sorted((r1, r2) -> { // Exact match first. if (r1.getUrl().equalsIgnoreCase(uri)) { return -1; } else if (r2.getUrl().equalsIgnoreCase(uri)) { return 1; } // Not comparable return 0; }) .collect(Collectors.toList())); if (list.isEmpty()) { // Creates an unbound route - 404 return new RouteDelegate(this, new Route(method, uri, Status.NOT_FOUND)); } // Find the route that accept the request List<Route> fullMatch = new ArrayList<>(); List<Route> partialMatch = new ArrayList<>(); for (Route route : list) { final int acceptation = route.isCompliantWithRequestContentType(request); switch (acceptation) { case 2: // It's a full match fullMatch.add(route); break; case 1: // It's a wildcard match, we have to see if we don't have a full match later. partialMatch.add(route); break; default: // Not accepted. } } if (fullMatch.isEmpty() && partialMatch.isEmpty()) { // Not Acceptable Content return new RouteDelegate(this, new Route(method, uri, Status.UNSUPPORTED_MEDIA_TYPE)); } // Check against the produce type fullMatch.addAll(partialMatch); for (Route route : fullMatch) { if (route.isCompliantWithRequestAccept(request)) { return route; } } return new RouteDelegate(this, new Route(method, uri, Status.NOT_ACCEPTABLE)); }
class class_name[name] begin[{] method[getRouteFor, return_type[type[Route]], modifier[public], parameter[method, uri, request]] begin[{] local_variable[type[List], list] call[list.addAll, parameter[call[.copy, parameter[]]]] if[call[list.isEmpty, parameter[]]] begin[{] return[ClassCreator(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), ClassCreator(arguments=[MemberReference(member=method, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=uri, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=NOT_FOUND, postfix_operators=[], prefix_operators=[], qualifier=Status, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Route, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=RouteDelegate, sub_type=None))] else begin[{] None end[}] local_variable[type[List], fullMatch] local_variable[type[List], partialMatch] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=request, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isCompliantWithRequestContentType, postfix_operators=[], prefix_operators=[], qualifier=route, selectors=[], type_arguments=None), name=acceptation)], modifiers={'final'}, type=BasicType(dimensions=[], name=int)), SwitchStatement(cases=[SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2)], statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=route, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=fullMatch, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=route, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=partialMatch, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[], statements=[])], expression=MemberReference(member=acceptation, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=list, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=route)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Route, sub_type=None))), label=None) if[binary_operation[call[fullMatch.isEmpty, parameter[]], &&, call[partialMatch.isEmpty, parameter[]]]] begin[{] return[ClassCreator(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), ClassCreator(arguments=[MemberReference(member=method, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=uri, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=UNSUPPORTED_MEDIA_TYPE, postfix_operators=[], prefix_operators=[], qualifier=Status, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Route, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=RouteDelegate, sub_type=None))] else begin[{] None end[}] call[fullMatch.addAll, parameter[member[.partialMatch]]] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=request, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isCompliantWithRequestAccept, postfix_operators=[], prefix_operators=[], qualifier=route, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=MemberReference(member=route, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=fullMatch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=route)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Route, sub_type=None))), label=None) return[ClassCreator(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), ClassCreator(arguments=[MemberReference(member=method, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=uri, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=NOT_ACCEPTABLE, postfix_operators=[], prefix_operators=[], qualifier=Status, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Route, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=RouteDelegate, sub_type=None))] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[Route] identifier[getRouteFor] operator[SEP] identifier[HttpMethod] identifier[method] , identifier[String] identifier[uri] , identifier[Request] identifier[request] operator[SEP] { identifier[List] operator[<] identifier[Route] operator[>] identifier[list] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] Other[1] operator[SEP] operator[SEP] identifier[list] operator[SEP] identifier[addAll] operator[SEP] identifier[copy] operator[SEP] operator[SEP] operator[SEP] identifier[stream] operator[SEP] operator[SEP] operator[SEP] identifier[filter] operator[SEP] identifier[route] operator[->] identifier[route] operator[SEP] identifier[matches] operator[SEP] identifier[method] , identifier[uri] operator[SEP] operator[SEP] operator[SEP] identifier[sorted] operator[SEP] operator[SEP] identifier[r1] , identifier[r2] operator[SEP] operator[->] { Keyword[if] operator[SEP] identifier[r1] operator[SEP] identifier[getUrl] operator[SEP] operator[SEP] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] identifier[uri] operator[SEP] operator[SEP] { Keyword[return] operator[-] Other[1] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[r2] operator[SEP] identifier[getUrl] operator[SEP] operator[SEP] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] identifier[uri] operator[SEP] operator[SEP] { Keyword[return] Other[1] operator[SEP] } Keyword[return] Other[0] operator[SEP] } operator[SEP] operator[SEP] identifier[collect] operator[SEP] identifier[Collectors] operator[SEP] identifier[toList] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[list] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] Keyword[new] identifier[RouteDelegate] operator[SEP] Keyword[this] , Keyword[new] identifier[Route] operator[SEP] identifier[method] , identifier[uri] , identifier[Status] operator[SEP] identifier[NOT_FOUND] operator[SEP] operator[SEP] operator[SEP] } identifier[List] operator[<] identifier[Route] operator[>] identifier[fullMatch] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[Route] operator[>] identifier[partialMatch] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Route] identifier[route] operator[:] identifier[list] operator[SEP] { Keyword[final] Keyword[int] identifier[acceptation] operator[=] identifier[route] operator[SEP] identifier[isCompliantWithRequestContentType] operator[SEP] identifier[request] operator[SEP] operator[SEP] Keyword[switch] operator[SEP] identifier[acceptation] operator[SEP] { Keyword[case] Other[2] operator[:] identifier[fullMatch] operator[SEP] identifier[add] operator[SEP] identifier[route] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] Other[1] operator[:] identifier[partialMatch] operator[SEP] identifier[add] operator[SEP] identifier[route] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[default] operator[:] } } Keyword[if] operator[SEP] identifier[fullMatch] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[&&] identifier[partialMatch] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] Keyword[new] identifier[RouteDelegate] operator[SEP] Keyword[this] , Keyword[new] identifier[Route] operator[SEP] identifier[method] , identifier[uri] , identifier[Status] operator[SEP] identifier[UNSUPPORTED_MEDIA_TYPE] operator[SEP] operator[SEP] operator[SEP] } identifier[fullMatch] operator[SEP] identifier[addAll] operator[SEP] identifier[partialMatch] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Route] identifier[route] operator[:] identifier[fullMatch] operator[SEP] { Keyword[if] operator[SEP] identifier[route] operator[SEP] identifier[isCompliantWithRequestAccept] operator[SEP] identifier[request] operator[SEP] operator[SEP] { Keyword[return] identifier[route] operator[SEP] } } Keyword[return] Keyword[new] identifier[RouteDelegate] operator[SEP] Keyword[this] , Keyword[new] identifier[Route] operator[SEP] identifier[method] , identifier[uri] , identifier[Status] operator[SEP] identifier[NOT_ACCEPTABLE] operator[SEP] operator[SEP] operator[SEP] }
private User addUser(String userName) { User user = new User(); PersonalDetail personalDetail = new PersonalDetail(userName, userName + "Password", "Single"); user.setUserId(userName); user.setEmailId(userName + "@" + userName + ".com"); user.setFirstName(userName); user.setLastName(userName); user.setTweets(new HashSet<Tweets>()); user.setPersonalDetail(personalDetail); return user; }
class class_name[name] begin[{] method[addUser, return_type[type[User]], modifier[private], parameter[userName]] begin[{] local_variable[type[User], user] local_variable[type[PersonalDetail], personalDetail] call[user.setUserId, parameter[member[.userName]]] call[user.setEmailId, parameter[binary_operation[binary_operation[binary_operation[member[.userName], +, literal["@"]], +, member[.userName]], +, literal[".com"]]]] call[user.setFirstName, parameter[member[.userName]]] call[user.setLastName, parameter[member[.userName]]] call[user.setTweets, parameter[ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Tweets, sub_type=None))], dimensions=None, name=HashSet, sub_type=None))]] call[user.setPersonalDetail, parameter[member[.personalDetail]]] return[member[.user]] end[}] END[}]
Keyword[private] identifier[User] identifier[addUser] operator[SEP] identifier[String] identifier[userName] operator[SEP] { identifier[User] identifier[user] operator[=] Keyword[new] identifier[User] operator[SEP] operator[SEP] operator[SEP] identifier[PersonalDetail] identifier[personalDetail] operator[=] Keyword[new] identifier[PersonalDetail] operator[SEP] identifier[userName] , identifier[userName] operator[+] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[user] operator[SEP] identifier[setUserId] operator[SEP] identifier[userName] operator[SEP] operator[SEP] identifier[user] operator[SEP] identifier[setEmailId] operator[SEP] identifier[userName] operator[+] literal[String] operator[+] identifier[userName] operator[+] literal[String] operator[SEP] operator[SEP] identifier[user] operator[SEP] identifier[setFirstName] operator[SEP] identifier[userName] operator[SEP] operator[SEP] identifier[user] operator[SEP] identifier[setLastName] operator[SEP] identifier[userName] operator[SEP] operator[SEP] identifier[user] operator[SEP] identifier[setTweets] operator[SEP] Keyword[new] identifier[HashSet] operator[<] identifier[Tweets] operator[>] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[user] operator[SEP] identifier[setPersonalDetail] operator[SEP] identifier[personalDetail] operator[SEP] operator[SEP] Keyword[return] identifier[user] operator[SEP] }
public static Option create(String opt) throws IllegalArgumentException { Option option = null; try { // create the option option = new Option(opt, description); // set the option properties option.setLongOpt(longopt); option.setRequired(required); option.setOptionalArg(optionalArg); option.setArgs(numberOfArgs); option.setType(type); option.setValueSeparator(valuesep); option.setArgName(argName); } finally { // reset the OptionBuilder properties OptionBuilder.reset(); } // return the Option instance return option; }
class class_name[name] begin[{] method[create, return_type[type[Option]], modifier[public static], parameter[opt]] begin[{] local_variable[type[Option], option] TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=option, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[MemberReference(member=opt, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=description, 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=Option, sub_type=None))), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=longopt, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setLongOpt, postfix_operators=[], prefix_operators=[], qualifier=option, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=required, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setRequired, postfix_operators=[], prefix_operators=[], qualifier=option, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=optionalArg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setOptionalArg, postfix_operators=[], prefix_operators=[], qualifier=option, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=numberOfArgs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setArgs, postfix_operators=[], prefix_operators=[], qualifier=option, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setType, postfix_operators=[], prefix_operators=[], qualifier=option, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=valuesep, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setValueSeparator, postfix_operators=[], prefix_operators=[], qualifier=option, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=argName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setArgName, postfix_operators=[], prefix_operators=[], qualifier=option, selectors=[], type_arguments=None), label=None)], catches=None, finally_block=[StatementExpression(expression=MethodInvocation(arguments=[], member=reset, postfix_operators=[], prefix_operators=[], qualifier=OptionBuilder, selectors=[], type_arguments=None), label=None)], label=None, resources=None) return[member[.option]] end[}] END[}]
Keyword[public] Keyword[static] identifier[Option] identifier[create] operator[SEP] identifier[String] identifier[opt] operator[SEP] Keyword[throws] identifier[IllegalArgumentException] { identifier[Option] identifier[option] operator[=] Other[null] operator[SEP] Keyword[try] { identifier[option] operator[=] Keyword[new] identifier[Option] operator[SEP] identifier[opt] , identifier[description] operator[SEP] operator[SEP] identifier[option] operator[SEP] identifier[setLongOpt] operator[SEP] identifier[longopt] operator[SEP] operator[SEP] identifier[option] operator[SEP] identifier[setRequired] operator[SEP] identifier[required] operator[SEP] operator[SEP] identifier[option] operator[SEP] identifier[setOptionalArg] operator[SEP] identifier[optionalArg] operator[SEP] operator[SEP] identifier[option] operator[SEP] identifier[setArgs] operator[SEP] identifier[numberOfArgs] operator[SEP] operator[SEP] identifier[option] operator[SEP] identifier[setType] operator[SEP] identifier[type] operator[SEP] operator[SEP] identifier[option] operator[SEP] identifier[setValueSeparator] operator[SEP] identifier[valuesep] operator[SEP] operator[SEP] identifier[option] operator[SEP] identifier[setArgName] operator[SEP] identifier[argName] operator[SEP] operator[SEP] } Keyword[finally] { identifier[OptionBuilder] operator[SEP] identifier[reset] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[option] operator[SEP] }
private static List<BuiltInQProfile.Builder> toQualityProfileBuilders(Map.Entry<String, Map<String, BuiltInQualityProfile>> rulesProfilesByLanguageAndName, Map<RuleKey, RuleDefinitionDto> rulesByRuleKey) { String language = rulesProfilesByLanguageAndName.getKey(); // use a LinkedHashMap to keep order of insertion of RulesProfiles Map<String, BuiltInQProfile.Builder> qualityProfileBuildersByName = new LinkedHashMap<>(); for (BuiltInQualityProfile builtInProfile : rulesProfilesByLanguageAndName.getValue().values()) { qualityProfileBuildersByName.compute( builtInProfile.name(), (name, existingBuilder) -> updateOrCreateBuilder(language, existingBuilder, builtInProfile, rulesByRuleKey)); } return ImmutableList.copyOf(qualityProfileBuildersByName.values()); }
class class_name[name] begin[{] method[toQualityProfileBuilders, return_type[type[List]], modifier[private static], parameter[rulesProfilesByLanguageAndName, rulesByRuleKey]] begin[{] local_variable[type[String], language] local_variable[type[Map], qualityProfileBuildersByName] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=name, postfix_operators=[], prefix_operators=[], qualifier=builtInProfile, selectors=[], type_arguments=None), LambdaExpression(body=MethodInvocation(arguments=[MemberReference(member=language, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=existingBuilder, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=builtInProfile, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=rulesByRuleKey, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=updateOrCreateBuilder, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), parameters=[InferredFormalParameter(name=name), InferredFormalParameter(name=existingBuilder)])], member=compute, postfix_operators=[], prefix_operators=[], qualifier=qualityProfileBuildersByName, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=rulesProfilesByLanguageAndName, selectors=[MethodInvocation(arguments=[], member=values, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=builtInProfile)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=BuiltInQualityProfile, sub_type=None))), label=None) return[call[ImmutableList.copyOf, parameter[call[qualityProfileBuildersByName.values, parameter[]]]]] end[}] END[}]
Keyword[private] Keyword[static] identifier[List] operator[<] identifier[BuiltInQProfile] operator[SEP] identifier[Builder] operator[>] identifier[toQualityProfileBuilders] operator[SEP] identifier[Map] operator[SEP] identifier[Entry] operator[<] identifier[String] , identifier[Map] operator[<] identifier[String] , identifier[BuiltInQualityProfile] operator[>] operator[>] identifier[rulesProfilesByLanguageAndName] , identifier[Map] operator[<] identifier[RuleKey] , identifier[RuleDefinitionDto] operator[>] identifier[rulesByRuleKey] operator[SEP] { identifier[String] identifier[language] operator[=] identifier[rulesProfilesByLanguageAndName] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[BuiltInQProfile] operator[SEP] identifier[Builder] operator[>] identifier[qualityProfileBuildersByName] operator[=] Keyword[new] identifier[LinkedHashMap] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[BuiltInQualityProfile] identifier[builtInProfile] operator[:] identifier[rulesProfilesByLanguageAndName] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] identifier[values] operator[SEP] operator[SEP] operator[SEP] { identifier[qualityProfileBuildersByName] operator[SEP] identifier[compute] operator[SEP] identifier[builtInProfile] operator[SEP] identifier[name] operator[SEP] operator[SEP] , operator[SEP] identifier[name] , identifier[existingBuilder] operator[SEP] operator[->] identifier[updateOrCreateBuilder] operator[SEP] identifier[language] , identifier[existingBuilder] , identifier[builtInProfile] , identifier[rulesByRuleKey] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[ImmutableList] operator[SEP] identifier[copyOf] operator[SEP] identifier[qualityProfileBuildersByName] operator[SEP] identifier[values] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
protected final CreateApplicationEventRequest createBaseApplicationEventRequest() { final CreateApplicationEventRequest eventRequest = new CreateApplicationEventRequest(); final UserAccount userAccount = getUserAccountFromSecurityContext(); if (userAccount != null) { eventRequest.setUserId(userAccount.getUserId()); } return eventRequest; }
class class_name[name] begin[{] method[createBaseApplicationEventRequest, return_type[type[CreateApplicationEventRequest]], modifier[final protected], parameter[]] begin[{] local_variable[type[CreateApplicationEventRequest], eventRequest] local_variable[type[UserAccount], userAccount] if[binary_operation[member[.userAccount], !=, literal[null]]] begin[{] call[eventRequest.setUserId, parameter[call[userAccount.getUserId, parameter[]]]] else begin[{] None end[}] return[member[.eventRequest]] end[}] END[}]
Keyword[protected] Keyword[final] identifier[CreateApplicationEventRequest] identifier[createBaseApplicationEventRequest] operator[SEP] operator[SEP] { Keyword[final] identifier[CreateApplicationEventRequest] identifier[eventRequest] operator[=] Keyword[new] identifier[CreateApplicationEventRequest] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[UserAccount] identifier[userAccount] operator[=] identifier[getUserAccountFromSecurityContext] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[userAccount] operator[!=] Other[null] operator[SEP] { identifier[eventRequest] operator[SEP] identifier[setUserId] operator[SEP] identifier[userAccount] operator[SEP] identifier[getUserId] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[eventRequest] operator[SEP] }
@Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { case AfplibPackage.FNC__RETIRED: return getRetired(); case AfplibPackage.FNC__PAT_TECH: return getPatTech(); case AfplibPackage.FNC__RESERVED1: return getReserved1(); case AfplibPackage.FNC__FNT_FLAGS: return getFntFlags(); case AfplibPackage.FNC__XUNIT_BASE: return getXUnitBase(); case AfplibPackage.FNC__YUNIT_BASE: return getYUnitBase(); case AfplibPackage.FNC__XFT_UNITS: return getXftUnits(); case AfplibPackage.FNC__YFT_UNITS: return getYftUnits(); case AfplibPackage.FNC__MAX_BOX_WD: return getMaxBoxWd(); case AfplibPackage.FNC__MAX_BOX_HT: return getMaxBoxHt(); case AfplibPackage.FNC__FNORG_LEN: return getFNORGLen(); case AfplibPackage.FNC__FNIRG_LEN: return getFNIRGLen(); case AfplibPackage.FNC__PAT_ALIGN: return getPatAlign(); case AfplibPackage.FNC__RPAT_DCNT: return getRPatDCnt(); case AfplibPackage.FNC__FNPRG_LEN: return getFNPRGLen(); case AfplibPackage.FNC__FNMRG_LEN: return getFNMRGLen(); case AfplibPackage.FNC__RES_XU_BASE: return getResXUBase(); case AfplibPackage.FNC__RES_YU_BASE: return getResYUBase(); case AfplibPackage.FNC__XFR_UNITS: return getXfrUnits(); case AfplibPackage.FNC__YFR_UNITS: return getYfrUnits(); case AfplibPackage.FNC__OPAT_DCNT: return getOPatDCnt(); case AfplibPackage.FNC__RESERVED2: return getReserved2(); case AfplibPackage.FNC__FNNRG_LEN: return getFNNRGLen(); case AfplibPackage.FNC__FNND_CNT: return getFNNDCnt(); case AfplibPackage.FNC__FNN_MAP_CNT: return getFNNMapCnt(); case AfplibPackage.FNC__TRIPLETS: return getTriplets(); } return super.eGet(featureID, resolve, coreType); }
class class_name[name] begin[{] method[eGet, return_type[type[Object]], modifier[public], parameter[featureID, resolve, coreType]] begin[{] SwitchStatement(cases=[SwitchStatementCase(case=[MemberReference(member=FNC__RETIRED, postfix_operators=[], prefix_operators=[], qualifier=AfplibPackage, selectors=[])], statements=[ReturnStatement(expression=MethodInvocation(arguments=[], member=getRetired, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), SwitchStatementCase(case=[MemberReference(member=FNC__PAT_TECH, postfix_operators=[], prefix_operators=[], qualifier=AfplibPackage, selectors=[])], statements=[ReturnStatement(expression=MethodInvocation(arguments=[], member=getPatTech, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), SwitchStatementCase(case=[MemberReference(member=FNC__RESERVED1, postfix_operators=[], prefix_operators=[], qualifier=AfplibPackage, selectors=[])], statements=[ReturnStatement(expression=MethodInvocation(arguments=[], member=getReserved1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), SwitchStatementCase(case=[MemberReference(member=FNC__FNT_FLAGS, postfix_operators=[], prefix_operators=[], qualifier=AfplibPackage, selectors=[])], statements=[ReturnStatement(expression=MethodInvocation(arguments=[], member=getFntFlags, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), SwitchStatementCase(case=[MemberReference(member=FNC__XUNIT_BASE, postfix_operators=[], prefix_operators=[], qualifier=AfplibPackage, selectors=[])], statements=[ReturnStatement(expression=MethodInvocation(arguments=[], member=getXUnitBase, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), SwitchStatementCase(case=[MemberReference(member=FNC__YUNIT_BASE, postfix_operators=[], prefix_operators=[], qualifier=AfplibPackage, selectors=[])], statements=[ReturnStatement(expression=MethodInvocation(arguments=[], member=getYUnitBase, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), SwitchStatementCase(case=[MemberReference(member=FNC__XFT_UNITS, postfix_operators=[], prefix_operators=[], qualifier=AfplibPackage, selectors=[])], statements=[ReturnStatement(expression=MethodInvocation(arguments=[], member=getXftUnits, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), SwitchStatementCase(case=[MemberReference(member=FNC__YFT_UNITS, postfix_operators=[], prefix_operators=[], qualifier=AfplibPackage, selectors=[])], statements=[ReturnStatement(expression=MethodInvocation(arguments=[], member=getYftUnits, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), SwitchStatementCase(case=[MemberReference(member=FNC__MAX_BOX_WD, postfix_operators=[], prefix_operators=[], qualifier=AfplibPackage, selectors=[])], statements=[ReturnStatement(expression=MethodInvocation(arguments=[], member=getMaxBoxWd, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), SwitchStatementCase(case=[MemberReference(member=FNC__MAX_BOX_HT, postfix_operators=[], prefix_operators=[], qualifier=AfplibPackage, selectors=[])], statements=[ReturnStatement(expression=MethodInvocation(arguments=[], member=getMaxBoxHt, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), SwitchStatementCase(case=[MemberReference(member=FNC__FNORG_LEN, postfix_operators=[], prefix_operators=[], qualifier=AfplibPackage, selectors=[])], statements=[ReturnStatement(expression=MethodInvocation(arguments=[], member=getFNORGLen, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), SwitchStatementCase(case=[MemberReference(member=FNC__FNIRG_LEN, postfix_operators=[], prefix_operators=[], qualifier=AfplibPackage, selectors=[])], statements=[ReturnStatement(expression=MethodInvocation(arguments=[], member=getFNIRGLen, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), SwitchStatementCase(case=[MemberReference(member=FNC__PAT_ALIGN, postfix_operators=[], prefix_operators=[], qualifier=AfplibPackage, selectors=[])], statements=[ReturnStatement(expression=MethodInvocation(arguments=[], member=getPatAlign, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), SwitchStatementCase(case=[MemberReference(member=FNC__RPAT_DCNT, postfix_operators=[], prefix_operators=[], qualifier=AfplibPackage, selectors=[])], statements=[ReturnStatement(expression=MethodInvocation(arguments=[], member=getRPatDCnt, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), SwitchStatementCase(case=[MemberReference(member=FNC__FNPRG_LEN, postfix_operators=[], prefix_operators=[], qualifier=AfplibPackage, selectors=[])], statements=[ReturnStatement(expression=MethodInvocation(arguments=[], member=getFNPRGLen, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), SwitchStatementCase(case=[MemberReference(member=FNC__FNMRG_LEN, postfix_operators=[], prefix_operators=[], qualifier=AfplibPackage, selectors=[])], statements=[ReturnStatement(expression=MethodInvocation(arguments=[], member=getFNMRGLen, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), SwitchStatementCase(case=[MemberReference(member=FNC__RES_XU_BASE, postfix_operators=[], prefix_operators=[], qualifier=AfplibPackage, selectors=[])], statements=[ReturnStatement(expression=MethodInvocation(arguments=[], member=getResXUBase, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), SwitchStatementCase(case=[MemberReference(member=FNC__RES_YU_BASE, postfix_operators=[], prefix_operators=[], qualifier=AfplibPackage, selectors=[])], statements=[ReturnStatement(expression=MethodInvocation(arguments=[], member=getResYUBase, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), SwitchStatementCase(case=[MemberReference(member=FNC__XFR_UNITS, postfix_operators=[], prefix_operators=[], qualifier=AfplibPackage, selectors=[])], statements=[ReturnStatement(expression=MethodInvocation(arguments=[], member=getXfrUnits, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), SwitchStatementCase(case=[MemberReference(member=FNC__YFR_UNITS, postfix_operators=[], prefix_operators=[], qualifier=AfplibPackage, selectors=[])], statements=[ReturnStatement(expression=MethodInvocation(arguments=[], member=getYfrUnits, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), SwitchStatementCase(case=[MemberReference(member=FNC__OPAT_DCNT, postfix_operators=[], prefix_operators=[], qualifier=AfplibPackage, selectors=[])], statements=[ReturnStatement(expression=MethodInvocation(arguments=[], member=getOPatDCnt, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), SwitchStatementCase(case=[MemberReference(member=FNC__RESERVED2, postfix_operators=[], prefix_operators=[], qualifier=AfplibPackage, selectors=[])], statements=[ReturnStatement(expression=MethodInvocation(arguments=[], member=getReserved2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), SwitchStatementCase(case=[MemberReference(member=FNC__FNNRG_LEN, postfix_operators=[], prefix_operators=[], qualifier=AfplibPackage, selectors=[])], statements=[ReturnStatement(expression=MethodInvocation(arguments=[], member=getFNNRGLen, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), SwitchStatementCase(case=[MemberReference(member=FNC__FNND_CNT, postfix_operators=[], prefix_operators=[], qualifier=AfplibPackage, selectors=[])], statements=[ReturnStatement(expression=MethodInvocation(arguments=[], member=getFNNDCnt, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), SwitchStatementCase(case=[MemberReference(member=FNC__FNN_MAP_CNT, postfix_operators=[], prefix_operators=[], qualifier=AfplibPackage, selectors=[])], statements=[ReturnStatement(expression=MethodInvocation(arguments=[], member=getFNNMapCnt, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), SwitchStatementCase(case=[MemberReference(member=FNC__TRIPLETS, postfix_operators=[], prefix_operators=[], qualifier=AfplibPackage, selectors=[])], statements=[ReturnStatement(expression=MethodInvocation(arguments=[], member=getTriplets, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)])], expression=MemberReference(member=featureID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None) return[SuperMethodInvocation(arguments=[MemberReference(member=featureID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=resolve, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=coreType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=eGet, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None)] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[Object] identifier[eGet] operator[SEP] Keyword[int] identifier[featureID] , Keyword[boolean] identifier[resolve] , Keyword[boolean] identifier[coreType] operator[SEP] { Keyword[switch] operator[SEP] identifier[featureID] operator[SEP] { Keyword[case] identifier[AfplibPackage] operator[SEP] identifier[FNC__RETIRED] operator[:] Keyword[return] identifier[getRetired] operator[SEP] operator[SEP] operator[SEP] Keyword[case] identifier[AfplibPackage] operator[SEP] identifier[FNC__PAT_TECH] operator[:] Keyword[return] identifier[getPatTech] operator[SEP] operator[SEP] operator[SEP] Keyword[case] identifier[AfplibPackage] operator[SEP] identifier[FNC__RESERVED1] operator[:] Keyword[return] identifier[getReserved1] operator[SEP] operator[SEP] operator[SEP] Keyword[case] identifier[AfplibPackage] operator[SEP] identifier[FNC__FNT_FLAGS] operator[:] Keyword[return] identifier[getFntFlags] operator[SEP] operator[SEP] operator[SEP] Keyword[case] identifier[AfplibPackage] operator[SEP] identifier[FNC__XUNIT_BASE] operator[:] Keyword[return] identifier[getXUnitBase] operator[SEP] operator[SEP] operator[SEP] Keyword[case] identifier[AfplibPackage] operator[SEP] identifier[FNC__YUNIT_BASE] operator[:] Keyword[return] identifier[getYUnitBase] operator[SEP] operator[SEP] operator[SEP] Keyword[case] identifier[AfplibPackage] operator[SEP] identifier[FNC__XFT_UNITS] operator[:] Keyword[return] identifier[getXftUnits] operator[SEP] operator[SEP] operator[SEP] Keyword[case] identifier[AfplibPackage] operator[SEP] identifier[FNC__YFT_UNITS] operator[:] Keyword[return] identifier[getYftUnits] operator[SEP] operator[SEP] operator[SEP] Keyword[case] identifier[AfplibPackage] operator[SEP] identifier[FNC__MAX_BOX_WD] operator[:] Keyword[return] identifier[getMaxBoxWd] operator[SEP] operator[SEP] operator[SEP] Keyword[case] identifier[AfplibPackage] operator[SEP] identifier[FNC__MAX_BOX_HT] operator[:] Keyword[return] identifier[getMaxBoxHt] operator[SEP] operator[SEP] operator[SEP] Keyword[case] identifier[AfplibPackage] operator[SEP] identifier[FNC__FNORG_LEN] operator[:] Keyword[return] identifier[getFNORGLen] operator[SEP] operator[SEP] operator[SEP] Keyword[case] identifier[AfplibPackage] operator[SEP] identifier[FNC__FNIRG_LEN] operator[:] Keyword[return] identifier[getFNIRGLen] operator[SEP] operator[SEP] operator[SEP] Keyword[case] identifier[AfplibPackage] operator[SEP] identifier[FNC__PAT_ALIGN] operator[:] Keyword[return] identifier[getPatAlign] operator[SEP] operator[SEP] operator[SEP] Keyword[case] identifier[AfplibPackage] operator[SEP] identifier[FNC__RPAT_DCNT] operator[:] Keyword[return] identifier[getRPatDCnt] operator[SEP] operator[SEP] operator[SEP] Keyword[case] identifier[AfplibPackage] operator[SEP] identifier[FNC__FNPRG_LEN] operator[:] Keyword[return] identifier[getFNPRGLen] operator[SEP] operator[SEP] operator[SEP] Keyword[case] identifier[AfplibPackage] operator[SEP] identifier[FNC__FNMRG_LEN] operator[:] Keyword[return] identifier[getFNMRGLen] operator[SEP] operator[SEP] operator[SEP] Keyword[case] identifier[AfplibPackage] operator[SEP] identifier[FNC__RES_XU_BASE] operator[:] Keyword[return] identifier[getResXUBase] operator[SEP] operator[SEP] operator[SEP] Keyword[case] identifier[AfplibPackage] operator[SEP] identifier[FNC__RES_YU_BASE] operator[:] Keyword[return] identifier[getResYUBase] operator[SEP] operator[SEP] operator[SEP] Keyword[case] identifier[AfplibPackage] operator[SEP] identifier[FNC__XFR_UNITS] operator[:] Keyword[return] identifier[getXfrUnits] operator[SEP] operator[SEP] operator[SEP] Keyword[case] identifier[AfplibPackage] operator[SEP] identifier[FNC__YFR_UNITS] operator[:] Keyword[return] identifier[getYfrUnits] operator[SEP] operator[SEP] operator[SEP] Keyword[case] identifier[AfplibPackage] operator[SEP] identifier[FNC__OPAT_DCNT] operator[:] Keyword[return] identifier[getOPatDCnt] operator[SEP] operator[SEP] operator[SEP] Keyword[case] identifier[AfplibPackage] operator[SEP] identifier[FNC__RESERVED2] operator[:] Keyword[return] identifier[getReserved2] operator[SEP] operator[SEP] operator[SEP] Keyword[case] identifier[AfplibPackage] operator[SEP] identifier[FNC__FNNRG_LEN] operator[:] Keyword[return] identifier[getFNNRGLen] operator[SEP] operator[SEP] operator[SEP] Keyword[case] identifier[AfplibPackage] operator[SEP] identifier[FNC__FNND_CNT] operator[:] Keyword[return] identifier[getFNNDCnt] operator[SEP] operator[SEP] operator[SEP] Keyword[case] identifier[AfplibPackage] operator[SEP] identifier[FNC__FNN_MAP_CNT] operator[:] Keyword[return] identifier[getFNNMapCnt] operator[SEP] operator[SEP] operator[SEP] Keyword[case] identifier[AfplibPackage] operator[SEP] identifier[FNC__TRIPLETS] operator[:] Keyword[return] identifier[getTriplets] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] Keyword[super] operator[SEP] identifier[eGet] operator[SEP] identifier[featureID] , identifier[resolve] , identifier[coreType] operator[SEP] operator[SEP] }
public static List<MasterState> triggerMasterHooks( Collection<MasterTriggerRestoreHook<?>> hooks, long checkpointId, long timestamp, Executor executor, Time timeout) throws FlinkException { final ArrayList<MasterState> states = new ArrayList<>(hooks.size()); for (MasterTriggerRestoreHook<?> hook : hooks) { MasterState state = triggerHook(hook, checkpointId, timestamp, executor, timeout); if (state != null) { states.add(state); } } states.trimToSize(); return states; }
class class_name[name] begin[{] method[triggerMasterHooks, return_type[type[List]], modifier[public static], parameter[hooks, checkpointId, timestamp, executor, timeout]] begin[{] local_variable[type[ArrayList], states] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=hook, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=checkpointId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=timestamp, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=executor, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=timeout, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=triggerHook, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=state)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=MasterState, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=state, 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=[MemberReference(member=state, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=states, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=hooks, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=hook)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=?, type=None)], dimensions=[], name=MasterTriggerRestoreHook, sub_type=None))), label=None) call[states.trimToSize, parameter[]] return[member[.states]] end[}] END[}]
Keyword[public] Keyword[static] identifier[List] operator[<] identifier[MasterState] operator[>] identifier[triggerMasterHooks] operator[SEP] identifier[Collection] operator[<] identifier[MasterTriggerRestoreHook] operator[<] operator[?] operator[>] operator[>] identifier[hooks] , Keyword[long] identifier[checkpointId] , Keyword[long] identifier[timestamp] , identifier[Executor] identifier[executor] , identifier[Time] identifier[timeout] operator[SEP] Keyword[throws] identifier[FlinkException] { Keyword[final] identifier[ArrayList] operator[<] identifier[MasterState] operator[>] identifier[states] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] identifier[hooks] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[MasterTriggerRestoreHook] operator[<] operator[?] operator[>] identifier[hook] operator[:] identifier[hooks] operator[SEP] { identifier[MasterState] identifier[state] operator[=] identifier[triggerHook] operator[SEP] identifier[hook] , identifier[checkpointId] , identifier[timestamp] , identifier[executor] , identifier[timeout] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[state] operator[!=] Other[null] operator[SEP] { identifier[states] operator[SEP] identifier[add] operator[SEP] identifier[state] operator[SEP] operator[SEP] } } identifier[states] operator[SEP] identifier[trimToSize] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[states] operator[SEP] }
public ConsoleLog getConsoleOutputText(int bufferOffset, boolean crumbFlag) throws IOException { List<NameValuePair> formData = new ArrayList<>(); formData.add(new BasicNameValuePair("start", Integer.toString(bufferOffset))); String path = getUrl() + "logText/progressiveText"; HttpResponse httpResponse = client.post_form_with_result(path, formData, crumbFlag); Header moreDataHeader = httpResponse.getFirstHeader(MORE_DATA_HEADER); Header textSizeHeader = httpResponse.getFirstHeader(TEXT_SIZE_HEADER); String response = EntityUtils.toString(httpResponse.getEntity()); boolean hasMoreData = false; if (moreDataHeader != null) { hasMoreData = Boolean.TRUE.toString().equals(moreDataHeader.getValue()); } Integer currentBufferSize = bufferOffset; if (textSizeHeader != null) { try { currentBufferSize = Integer.parseInt(textSizeHeader.getValue()); } catch (NumberFormatException e) { LOGGER.warn("Cannot parse buffer size for job {0} build {1}. Using current offset!", this.getDisplayName(), this.getNumber()); } } return new ConsoleLog(response, hasMoreData, currentBufferSize); }
class class_name[name] begin[{] method[getConsoleOutputText, return_type[type[ConsoleLog]], modifier[public], parameter[bufferOffset, crumbFlag]] begin[{] local_variable[type[List], formData] call[formData.add, parameter[ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="start"), MethodInvocation(arguments=[MemberReference(member=bufferOffset, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=toString, postfix_operators=[], prefix_operators=[], qualifier=Integer, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=BasicNameValuePair, sub_type=None))]] local_variable[type[String], path] local_variable[type[HttpResponse], httpResponse] local_variable[type[Header], moreDataHeader] local_variable[type[Header], textSizeHeader] local_variable[type[String], response] local_variable[type[boolean], hasMoreData] if[binary_operation[member[.moreDataHeader], !=, literal[null]]] begin[{] assign[member[.hasMoreData], call[Boolean.TRUE.toString, parameter[]]] else begin[{] None end[}] local_variable[type[Integer], currentBufferSize] if[binary_operation[member[.textSizeHeader], !=, literal[null]]] begin[{] TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=currentBufferSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=textSizeHeader, selectors=[], type_arguments=None)], member=parseInt, postfix_operators=[], prefix_operators=[], qualifier=Integer, selectors=[], type_arguments=None)), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Cannot parse buffer size for job {0} build {1}. Using current offset!"), This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[], member=getDisplayName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[], member=getNumber, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)])], member=warn, postfix_operators=[], prefix_operators=[], qualifier=LOGGER, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['NumberFormatException']))], finally_block=None, label=None, resources=None) else begin[{] None end[}] return[ClassCreator(arguments=[MemberReference(member=response, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=hasMoreData, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=currentBufferSize, 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=ConsoleLog, sub_type=None))] end[}] END[}]
Keyword[public] identifier[ConsoleLog] identifier[getConsoleOutputText] operator[SEP] Keyword[int] identifier[bufferOffset] , Keyword[boolean] identifier[crumbFlag] operator[SEP] Keyword[throws] identifier[IOException] { identifier[List] operator[<] identifier[NameValuePair] operator[>] identifier[formData] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[formData] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[BasicNameValuePair] operator[SEP] literal[String] , identifier[Integer] operator[SEP] identifier[toString] operator[SEP] identifier[bufferOffset] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[path] operator[=] identifier[getUrl] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] identifier[HttpResponse] identifier[httpResponse] operator[=] identifier[client] operator[SEP] identifier[post_form_with_result] operator[SEP] identifier[path] , identifier[formData] , identifier[crumbFlag] operator[SEP] operator[SEP] identifier[Header] identifier[moreDataHeader] operator[=] identifier[httpResponse] operator[SEP] identifier[getFirstHeader] operator[SEP] identifier[MORE_DATA_HEADER] operator[SEP] operator[SEP] identifier[Header] identifier[textSizeHeader] operator[=] identifier[httpResponse] operator[SEP] identifier[getFirstHeader] operator[SEP] identifier[TEXT_SIZE_HEADER] operator[SEP] operator[SEP] identifier[String] identifier[response] operator[=] identifier[EntityUtils] operator[SEP] identifier[toString] operator[SEP] identifier[httpResponse] operator[SEP] identifier[getEntity] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[boolean] identifier[hasMoreData] operator[=] literal[boolean] operator[SEP] Keyword[if] operator[SEP] identifier[moreDataHeader] operator[!=] Other[null] operator[SEP] { identifier[hasMoreData] operator[=] identifier[Boolean] operator[SEP] identifier[TRUE] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[moreDataHeader] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[Integer] identifier[currentBufferSize] operator[=] identifier[bufferOffset] operator[SEP] Keyword[if] operator[SEP] identifier[textSizeHeader] operator[!=] Other[null] operator[SEP] { Keyword[try] { identifier[currentBufferSize] operator[=] identifier[Integer] operator[SEP] identifier[parseInt] operator[SEP] identifier[textSizeHeader] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[NumberFormatException] identifier[e] operator[SEP] { identifier[LOGGER] operator[SEP] identifier[warn] operator[SEP] literal[String] , Keyword[this] operator[SEP] identifier[getDisplayName] operator[SEP] operator[SEP] , Keyword[this] operator[SEP] identifier[getNumber] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } Keyword[return] Keyword[new] identifier[ConsoleLog] operator[SEP] identifier[response] , identifier[hasMoreData] , identifier[currentBufferSize] operator[SEP] operator[SEP] }
final ConnectionPoolConnection open() { ConnectionPoolConnection conn = availableQueue.poll(); if(conn != null) { if(!testOnLogicalOpen) { conn.logicalOpen(); conn.state.set(ConnectionPoolConnection.STATE_OPEN); } else { try { conn.logicalOpenWithTest(); conn.state.set(ConnectionPoolConnection.STATE_OPEN); } catch(SQLException se) { conn.state.set(ConnectionPoolConnection.STATE_REOPENING); stats.connectionErrors.mark(); reopen(conn); return open(); //Attempt to open another connection } } } return conn; }
class class_name[name] begin[{] method[open, return_type[type[ConnectionPoolConnection]], modifier[final], parameter[]] begin[{] local_variable[type[ConnectionPoolConnection], conn] if[binary_operation[member[.conn], !=, literal[null]]] begin[{] if[member[.testOnLogicalOpen]] begin[{] call[conn.logicalOpen, parameter[]] call[conn.state.set, parameter[member[ConnectionPoolConnection.STATE_OPEN]]] else begin[{] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=logicalOpenWithTest, postfix_operators=[], prefix_operators=[], qualifier=conn, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=STATE_OPEN, postfix_operators=[], prefix_operators=[], qualifier=ConnectionPoolConnection, selectors=[])], member=set, postfix_operators=[], prefix_operators=[], qualifier=conn.state, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=STATE_REOPENING, postfix_operators=[], prefix_operators=[], qualifier=ConnectionPoolConnection, selectors=[])], member=set, postfix_operators=[], prefix_operators=[], qualifier=conn.state, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=mark, postfix_operators=[], prefix_operators=[], qualifier=stats.connectionErrors, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=conn, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=reopen, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=MethodInvocation(arguments=[], member=open, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=se, types=['SQLException']))], finally_block=None, label=None, resources=None) end[}] else begin[{] None end[}] return[member[.conn]] end[}] END[}]
Keyword[final] identifier[ConnectionPoolConnection] identifier[open] operator[SEP] operator[SEP] { identifier[ConnectionPoolConnection] identifier[conn] operator[=] identifier[availableQueue] operator[SEP] identifier[poll] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[conn] operator[!=] Other[null] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[testOnLogicalOpen] operator[SEP] { identifier[conn] operator[SEP] identifier[logicalOpen] operator[SEP] operator[SEP] operator[SEP] identifier[conn] operator[SEP] identifier[state] operator[SEP] identifier[set] operator[SEP] identifier[ConnectionPoolConnection] operator[SEP] identifier[STATE_OPEN] operator[SEP] operator[SEP] } Keyword[else] { Keyword[try] { identifier[conn] operator[SEP] identifier[logicalOpenWithTest] operator[SEP] operator[SEP] operator[SEP] identifier[conn] operator[SEP] identifier[state] operator[SEP] identifier[set] operator[SEP] identifier[ConnectionPoolConnection] operator[SEP] identifier[STATE_OPEN] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[SQLException] identifier[se] operator[SEP] { identifier[conn] operator[SEP] identifier[state] operator[SEP] identifier[set] operator[SEP] identifier[ConnectionPoolConnection] operator[SEP] identifier[STATE_REOPENING] operator[SEP] operator[SEP] identifier[stats] operator[SEP] identifier[connectionErrors] operator[SEP] identifier[mark] operator[SEP] operator[SEP] operator[SEP] identifier[reopen] operator[SEP] identifier[conn] operator[SEP] operator[SEP] Keyword[return] identifier[open] operator[SEP] operator[SEP] operator[SEP] } } } Keyword[return] identifier[conn] operator[SEP] }
private void extractQuaternionFromQ( SimpleMatrix q ) { SimpleEVD<SimpleMatrix> evd = q.eig(); int indexMax = evd.getIndexMax(); SimpleMatrix v_max = evd.getEigenVector( indexMax ); quat.w = (double) v_max.get( 0 ); quat.x = (double) v_max.get( 1 ); quat.y = (double) v_max.get( 2 ); quat.z = (double) v_max.get( 3 ); quat.normalize(); ConvertRotation3D_F64.quaternionToMatrix( quat, motion.getR() ); }
class class_name[name] begin[{] method[extractQuaternionFromQ, return_type[void], modifier[private], parameter[q]] begin[{] local_variable[type[SimpleEVD], evd] local_variable[type[int], indexMax] local_variable[type[SimpleMatrix], v_max] assign[member[quat.w], Cast(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], member=get, postfix_operators=[], prefix_operators=[], qualifier=v_max, selectors=[], type_arguments=None), type=BasicType(dimensions=[], name=double))] assign[member[quat.x], Cast(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], member=get, postfix_operators=[], prefix_operators=[], qualifier=v_max, selectors=[], type_arguments=None), type=BasicType(dimensions=[], name=double))] assign[member[quat.y], Cast(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2)], member=get, postfix_operators=[], prefix_operators=[], qualifier=v_max, selectors=[], type_arguments=None), type=BasicType(dimensions=[], name=double))] assign[member[quat.z], Cast(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=3)], member=get, postfix_operators=[], prefix_operators=[], qualifier=v_max, selectors=[], type_arguments=None), type=BasicType(dimensions=[], name=double))] call[quat.normalize, parameter[]] call[ConvertRotation3D_F64.quaternionToMatrix, parameter[member[.quat], call[motion.getR, parameter[]]]] end[}] END[}]
Keyword[private] Keyword[void] identifier[extractQuaternionFromQ] operator[SEP] identifier[SimpleMatrix] identifier[q] operator[SEP] { identifier[SimpleEVD] operator[<] identifier[SimpleMatrix] operator[>] identifier[evd] operator[=] identifier[q] operator[SEP] identifier[eig] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[indexMax] operator[=] identifier[evd] operator[SEP] identifier[getIndexMax] operator[SEP] operator[SEP] operator[SEP] identifier[SimpleMatrix] identifier[v_max] operator[=] identifier[evd] operator[SEP] identifier[getEigenVector] operator[SEP] identifier[indexMax] operator[SEP] operator[SEP] identifier[quat] operator[SEP] identifier[w] operator[=] operator[SEP] Keyword[double] operator[SEP] identifier[v_max] operator[SEP] identifier[get] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[quat] operator[SEP] identifier[x] operator[=] operator[SEP] Keyword[double] operator[SEP] identifier[v_max] operator[SEP] identifier[get] operator[SEP] Other[1] operator[SEP] operator[SEP] identifier[quat] operator[SEP] identifier[y] operator[=] operator[SEP] Keyword[double] operator[SEP] identifier[v_max] operator[SEP] identifier[get] operator[SEP] Other[2] operator[SEP] operator[SEP] identifier[quat] operator[SEP] identifier[z] operator[=] operator[SEP] Keyword[double] operator[SEP] identifier[v_max] operator[SEP] identifier[get] operator[SEP] Other[3] operator[SEP] operator[SEP] identifier[quat] operator[SEP] identifier[normalize] operator[SEP] operator[SEP] operator[SEP] identifier[ConvertRotation3D_F64] operator[SEP] identifier[quaternionToMatrix] operator[SEP] identifier[quat] , identifier[motion] operator[SEP] identifier[getR] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
public ICollectionItemOptions getCollectionItemOptions(String key) { Object object = this.options.get(key); if (object instanceof ICollectionItemOptions) return (ICollectionItemOptions) object; return null; }
class class_name[name] begin[{] method[getCollectionItemOptions, return_type[type[ICollectionItemOptions]], modifier[public], parameter[key]] begin[{] local_variable[type[Object], object] if[binary_operation[member[.object], instanceof, type[ICollectionItemOptions]]] begin[{] return[Cast(expression=MemberReference(member=object, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=ICollectionItemOptions, sub_type=None))] else begin[{] None end[}] return[literal[null]] end[}] END[}]
Keyword[public] identifier[ICollectionItemOptions] identifier[getCollectionItemOptions] operator[SEP] identifier[String] identifier[key] operator[SEP] { identifier[Object] identifier[object] operator[=] Keyword[this] operator[SEP] identifier[options] operator[SEP] identifier[get] operator[SEP] identifier[key] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[object] Keyword[instanceof] identifier[ICollectionItemOptions] operator[SEP] Keyword[return] operator[SEP] identifier[ICollectionItemOptions] operator[SEP] identifier[object] operator[SEP] Keyword[return] Other[null] operator[SEP] }
private static Set<String> getNonIgnoredChildTypes(ImmutableManagementResourceRegistration mrr) { final Set<String> result = new LinkedHashSet<>(); for (PathElement pe : mrr.getChildAddresses(PathAddress.EMPTY_ADDRESS)) { ImmutableManagementResourceRegistration childMrr = mrr.getSubModel(PathAddress.pathAddress(pe)); if (childMrr != null && !childMrr.isRemote() && !childMrr.isRuntimeOnly()) { result.add(pe.getKey()); } } return result; }
class class_name[name] begin[{] method[getNonIgnoredChildTypes, return_type[type[Set]], modifier[private static], parameter[mrr]] begin[{] local_variable[type[Set], result] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=pe, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=pathAddress, postfix_operators=[], prefix_operators=[], qualifier=PathAddress, selectors=[], type_arguments=None)], member=getSubModel, postfix_operators=[], prefix_operators=[], qualifier=mrr, selectors=[], type_arguments=None), name=childMrr)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ImmutableManagementResourceRegistration, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=childMrr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operandr=MethodInvocation(arguments=[], member=isRemote, postfix_operators=[], prefix_operators=['!'], qualifier=childMrr, selectors=[], type_arguments=None), operator=&&), operandr=MethodInvocation(arguments=[], member=isRuntimeOnly, postfix_operators=[], prefix_operators=['!'], qualifier=childMrr, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getKey, postfix_operators=[], prefix_operators=[], qualifier=pe, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[MemberReference(member=EMPTY_ADDRESS, postfix_operators=[], prefix_operators=[], qualifier=PathAddress, selectors=[])], member=getChildAddresses, postfix_operators=[], prefix_operators=[], qualifier=mrr, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=pe)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=PathElement, sub_type=None))), label=None) return[member[.result]] end[}] END[}]
Keyword[private] Keyword[static] identifier[Set] operator[<] identifier[String] operator[>] identifier[getNonIgnoredChildTypes] operator[SEP] identifier[ImmutableManagementResourceRegistration] identifier[mrr] operator[SEP] { Keyword[final] identifier[Set] operator[<] identifier[String] operator[>] identifier[result] operator[=] Keyword[new] identifier[LinkedHashSet] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[PathElement] identifier[pe] operator[:] identifier[mrr] operator[SEP] identifier[getChildAddresses] operator[SEP] identifier[PathAddress] operator[SEP] identifier[EMPTY_ADDRESS] operator[SEP] operator[SEP] { identifier[ImmutableManagementResourceRegistration] identifier[childMrr] operator[=] identifier[mrr] operator[SEP] identifier[getSubModel] operator[SEP] identifier[PathAddress] operator[SEP] identifier[pathAddress] operator[SEP] identifier[pe] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[childMrr] operator[!=] Other[null] operator[&&] operator[!] identifier[childMrr] operator[SEP] identifier[isRemote] operator[SEP] operator[SEP] operator[&&] operator[!] identifier[childMrr] operator[SEP] identifier[isRuntimeOnly] operator[SEP] operator[SEP] operator[SEP] { identifier[result] operator[SEP] identifier[add] operator[SEP] identifier[pe] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } Keyword[return] identifier[result] operator[SEP] }
public String getIllegalValueAsString() { String value = iStringValue; if (value == null) { value = String.valueOf(iNumberValue); } return value; }
class class_name[name] begin[{] method[getIllegalValueAsString, return_type[type[String]], modifier[public], parameter[]] begin[{] local_variable[type[String], value] if[binary_operation[member[.value], ==, literal[null]]] begin[{] assign[member[.value], call[String.valueOf, parameter[member[.iNumberValue]]]] else begin[{] None end[}] return[member[.value]] end[}] END[}]
Keyword[public] identifier[String] identifier[getIllegalValueAsString] operator[SEP] operator[SEP] { identifier[String] identifier[value] operator[=] identifier[iStringValue] operator[SEP] Keyword[if] operator[SEP] identifier[value] operator[==] Other[null] operator[SEP] { identifier[value] operator[=] identifier[String] operator[SEP] identifier[valueOf] operator[SEP] identifier[iNumberValue] operator[SEP] operator[SEP] } Keyword[return] identifier[value] operator[SEP] }
@CanIgnoreReturnValue public boolean removeExactly(@Nullable Object element, int occurrences) { if (occurrences == 0) { return true; } CollectPreconditions.checkPositive(occurrences, "occurences"); AtomicInteger existingCounter = Maps.safeGet(countMap, element); if (existingCounter == null) { return false; } while (true) { int oldValue = existingCounter.get(); if (oldValue < occurrences) { return false; } int newValue = oldValue - occurrences; if (existingCounter.compareAndSet(oldValue, newValue)) { if (newValue == 0) { // Just CASed to 0; remove the entry to clean up the map. If the removal fails, // another thread has already replaced it with a new counter, which is fine. countMap.remove(element, existingCounter); } return true; } } }
class class_name[name] begin[{] method[removeExactly, return_type[type[boolean]], modifier[public], parameter[element, occurrences]] begin[{] if[binary_operation[member[.occurrences], ==, literal[0]]] begin[{] return[literal[true]] else begin[{] None end[}] call[CollectPreconditions.checkPositive, parameter[member[.occurrences], literal["occurences"]]] local_variable[type[AtomicInteger], existingCounter] if[binary_operation[member[.existingCounter], ==, literal[null]]] begin[{] return[literal[false]] else begin[{] None end[}] while[literal[true]] begin[{] local_variable[type[int], oldValue] if[binary_operation[member[.oldValue], <, member[.occurrences]]] begin[{] return[literal[false]] else begin[{] None end[}] local_variable[type[int], newValue] if[call[existingCounter.compareAndSet, parameter[member[.oldValue], member[.newValue]]]] begin[{] if[binary_operation[member[.newValue], ==, literal[0]]] begin[{] call[countMap.remove, parameter[member[.element], member[.existingCounter]]] else begin[{] None end[}] return[literal[true]] else begin[{] None end[}] end[}] end[}] END[}]
annotation[@] identifier[CanIgnoreReturnValue] Keyword[public] Keyword[boolean] identifier[removeExactly] operator[SEP] annotation[@] identifier[Nullable] identifier[Object] identifier[element] , Keyword[int] identifier[occurrences] operator[SEP] { Keyword[if] operator[SEP] identifier[occurrences] operator[==] Other[0] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } identifier[CollectPreconditions] operator[SEP] identifier[checkPositive] operator[SEP] identifier[occurrences] , literal[String] operator[SEP] operator[SEP] identifier[AtomicInteger] identifier[existingCounter] operator[=] identifier[Maps] operator[SEP] identifier[safeGet] operator[SEP] identifier[countMap] , identifier[element] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[existingCounter] operator[==] Other[null] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } Keyword[while] operator[SEP] literal[boolean] operator[SEP] { Keyword[int] identifier[oldValue] operator[=] identifier[existingCounter] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[oldValue] operator[<] identifier[occurrences] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } Keyword[int] identifier[newValue] operator[=] identifier[oldValue] operator[-] identifier[occurrences] operator[SEP] Keyword[if] operator[SEP] identifier[existingCounter] operator[SEP] identifier[compareAndSet] operator[SEP] identifier[oldValue] , identifier[newValue] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[newValue] operator[==] Other[0] operator[SEP] { identifier[countMap] operator[SEP] identifier[remove] operator[SEP] identifier[element] , identifier[existingCounter] operator[SEP] operator[SEP] } Keyword[return] literal[boolean] operator[SEP] } } }
public Object getNext(KCall call) { if (map.get(call.getProcedure().getId()) == null) { Object context = call.getProcess().getContext(); // getting data by reflection Method readMethod = null; try { readMethod = new PropertyDescriptor(pipelineDataName, context.getClass()).getReadMethod(); } catch (IntrospectionException e) { MessageKind.W0003.format(e); } Object invoke = null; try { invoke = readMethod.invoke(context); } catch (IllegalArgumentException e) { MessageKind.W0003.format(e); } catch (IllegalAccessException e) { MessageKind.W0003.format(e); } catch (InvocationTargetException e) { MessageKind.W0003.format(e); } // putting new Iterator into map if (invoke instanceof Iterable<?>) { Iterator newIterator = ((Iterable) invoke).iterator(); this.add(call.getProcedure().getId(), newIterator); } } Iterator iterator = map.get(call.getProcedure().getId()); return iterator.next(); }
class class_name[name] begin[{] method[getNext, return_type[type[Object]], modifier[public], parameter[call]] begin[{] if[binary_operation[call[map.get, parameter[call[call.getProcedure, parameter[]]]], ==, literal[null]]] begin[{] local_variable[type[Object], context] local_variable[type[Method], readMethod] TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=readMethod, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[MemberReference(member=pipelineDataName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getClass, postfix_operators=[], prefix_operators=[], qualifier=context, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[], member=getReadMethod, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=PropertyDescriptor, sub_type=None))), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=format, postfix_operators=[], prefix_operators=[], qualifier=MessageKind.W0003, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IntrospectionException']))], finally_block=None, label=None, resources=None) local_variable[type[Object], invoke] TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=invoke, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=context, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=invoke, postfix_operators=[], prefix_operators=[], qualifier=readMethod, selectors=[], type_arguments=None)), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=format, postfix_operators=[], prefix_operators=[], qualifier=MessageKind.W0003, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IllegalArgumentException'])), CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=format, postfix_operators=[], prefix_operators=[], qualifier=MessageKind.W0003, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IllegalAccessException'])), CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=format, postfix_operators=[], prefix_operators=[], qualifier=MessageKind.W0003, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['InvocationTargetException']))], finally_block=None, label=None, resources=None) if[binary_operation[member[.invoke], instanceof, type[Iterable]]] begin[{] local_variable[type[Iterator], newIterator] THIS[call[None.add, parameter[call[call.getProcedure, parameter[]], member[.newIterator]]]] else begin[{] None end[}] else begin[{] None end[}] local_variable[type[Iterator], iterator] return[call[iterator.next, parameter[]]] end[}] END[}]
Keyword[public] identifier[Object] identifier[getNext] operator[SEP] identifier[KCall] identifier[call] operator[SEP] { Keyword[if] operator[SEP] identifier[map] operator[SEP] identifier[get] operator[SEP] identifier[call] operator[SEP] identifier[getProcedure] operator[SEP] operator[SEP] operator[SEP] identifier[getId] operator[SEP] operator[SEP] operator[SEP] operator[==] Other[null] operator[SEP] { identifier[Object] identifier[context] operator[=] identifier[call] operator[SEP] identifier[getProcess] operator[SEP] operator[SEP] operator[SEP] identifier[getContext] operator[SEP] operator[SEP] operator[SEP] identifier[Method] identifier[readMethod] operator[=] Other[null] operator[SEP] Keyword[try] { identifier[readMethod] operator[=] Keyword[new] identifier[PropertyDescriptor] operator[SEP] identifier[pipelineDataName] , identifier[context] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[getReadMethod] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[IntrospectionException] identifier[e] operator[SEP] { identifier[MessageKind] operator[SEP] identifier[W0003] operator[SEP] identifier[format] operator[SEP] identifier[e] operator[SEP] operator[SEP] } identifier[Object] identifier[invoke] operator[=] Other[null] operator[SEP] Keyword[try] { identifier[invoke] operator[=] identifier[readMethod] operator[SEP] identifier[invoke] operator[SEP] identifier[context] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[IllegalArgumentException] identifier[e] operator[SEP] { identifier[MessageKind] operator[SEP] identifier[W0003] operator[SEP] identifier[format] operator[SEP] identifier[e] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[IllegalAccessException] identifier[e] operator[SEP] { identifier[MessageKind] operator[SEP] identifier[W0003] operator[SEP] identifier[format] operator[SEP] identifier[e] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[InvocationTargetException] identifier[e] operator[SEP] { identifier[MessageKind] operator[SEP] identifier[W0003] operator[SEP] identifier[format] operator[SEP] identifier[e] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[invoke] Keyword[instanceof] identifier[Iterable] operator[<] operator[?] operator[>] operator[SEP] { identifier[Iterator] identifier[newIterator] operator[=] operator[SEP] operator[SEP] identifier[Iterable] operator[SEP] identifier[invoke] operator[SEP] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[add] operator[SEP] identifier[call] operator[SEP] identifier[getProcedure] operator[SEP] operator[SEP] operator[SEP] identifier[getId] operator[SEP] operator[SEP] , identifier[newIterator] operator[SEP] operator[SEP] } } identifier[Iterator] identifier[iterator] operator[=] identifier[map] operator[SEP] identifier[get] operator[SEP] identifier[call] operator[SEP] identifier[getProcedure] operator[SEP] operator[SEP] operator[SEP] identifier[getId] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[iterator] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] }
public Nfs3ReadRequest makeReadRequest(byte[] fileHandle, long offset, int size) throws FileNotFoundException { return new Nfs3ReadRequest(fileHandle, offset, size, _credential); }
class class_name[name] begin[{] method[makeReadRequest, return_type[type[Nfs3ReadRequest]], modifier[public], parameter[fileHandle, offset, size]] begin[{] return[ClassCreator(arguments=[MemberReference(member=fileHandle, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=offset, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=size, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=_credential, 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=Nfs3ReadRequest, sub_type=None))] end[}] END[}]
Keyword[public] identifier[Nfs3ReadRequest] identifier[makeReadRequest] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[fileHandle] , Keyword[long] identifier[offset] , Keyword[int] identifier[size] operator[SEP] Keyword[throws] identifier[FileNotFoundException] { Keyword[return] Keyword[new] identifier[Nfs3ReadRequest] operator[SEP] identifier[fileHandle] , identifier[offset] , identifier[size] , identifier[_credential] operator[SEP] operator[SEP] }
public void marshall(EnvironmentMember environmentMember, ProtocolMarshaller protocolMarshaller) { if (environmentMember == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(environmentMember.getPermissions(), PERMISSIONS_BINDING); protocolMarshaller.marshall(environmentMember.getUserId(), USERID_BINDING); protocolMarshaller.marshall(environmentMember.getUserArn(), USERARN_BINDING); protocolMarshaller.marshall(environmentMember.getEnvironmentId(), ENVIRONMENTID_BINDING); protocolMarshaller.marshall(environmentMember.getLastAccess(), LASTACCESS_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[environmentMember, protocolMarshaller]] begin[{] if[binary_operation[member[.environmentMember], ==, 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=getPermissions, postfix_operators=[], prefix_operators=[], qualifier=environmentMember, selectors=[], type_arguments=None), MemberReference(member=PERMISSIONS_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=getUserId, postfix_operators=[], prefix_operators=[], qualifier=environmentMember, selectors=[], type_arguments=None), MemberReference(member=USERID_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=getUserArn, postfix_operators=[], prefix_operators=[], qualifier=environmentMember, selectors=[], type_arguments=None), MemberReference(member=USERARN_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=getEnvironmentId, postfix_operators=[], prefix_operators=[], qualifier=environmentMember, selectors=[], type_arguments=None), MemberReference(member=ENVIRONMENTID_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=getLastAccess, postfix_operators=[], prefix_operators=[], qualifier=environmentMember, selectors=[], type_arguments=None), MemberReference(member=LASTACCESS_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[EnvironmentMember] identifier[environmentMember] , identifier[ProtocolMarshaller] identifier[protocolMarshaller] operator[SEP] { Keyword[if] operator[SEP] identifier[environmentMember] 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[environmentMember] operator[SEP] identifier[getPermissions] operator[SEP] operator[SEP] , identifier[PERMISSIONS_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[environmentMember] operator[SEP] identifier[getUserId] operator[SEP] operator[SEP] , identifier[USERID_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[environmentMember] operator[SEP] identifier[getUserArn] operator[SEP] operator[SEP] , identifier[USERARN_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[environmentMember] operator[SEP] identifier[getEnvironmentId] operator[SEP] operator[SEP] , identifier[ENVIRONMENTID_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[environmentMember] operator[SEP] identifier[getLastAccess] operator[SEP] operator[SEP] , identifier[LASTACCESS_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 TrialContext makeContext(UUID trialId, int trialNumber, Experiment experiment) { return new TrialContext(trialId, trialNumber, experiment); }
class class_name[name] begin[{] method[makeContext, return_type[type[TrialContext]], modifier[static], parameter[trialId, trialNumber, experiment]] begin[{] return[ClassCreator(arguments=[MemberReference(member=trialId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=trialNumber, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=experiment, 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=TrialContext, sub_type=None))] end[}] END[}]
Keyword[static] identifier[TrialContext] identifier[makeContext] operator[SEP] identifier[UUID] identifier[trialId] , Keyword[int] identifier[trialNumber] , identifier[Experiment] identifier[experiment] operator[SEP] { Keyword[return] Keyword[new] identifier[TrialContext] operator[SEP] identifier[trialId] , identifier[trialNumber] , identifier[experiment] operator[SEP] operator[SEP] }
public static <T> Mono<T> fromFuture(Supplier<? extends CompletableFuture<? extends T>> futureSupplier) { return defer(() -> onAssembly(new MonoCompletionStage<>(futureSupplier.get()))); }
class class_name[name] begin[{] method[fromFuture, return_type[type[Mono]], modifier[public static], parameter[futureSupplier]] begin[{] return[call[.defer, parameter[LambdaExpression(body=MethodInvocation(arguments=[ClassCreator(arguments=[MethodInvocation(arguments=[], member=get, postfix_operators=[], prefix_operators=[], qualifier=futureSupplier, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=MonoCompletionStage, sub_type=None))], member=onAssembly, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), parameters=[])]]] end[}] END[}]
Keyword[public] Keyword[static] operator[<] identifier[T] operator[>] identifier[Mono] operator[<] identifier[T] operator[>] identifier[fromFuture] operator[SEP] identifier[Supplier] operator[<] operator[?] Keyword[extends] identifier[CompletableFuture] operator[<] operator[?] Keyword[extends] identifier[T] operator[>] operator[>] identifier[futureSupplier] operator[SEP] { Keyword[return] identifier[defer] operator[SEP] operator[SEP] operator[SEP] operator[->] identifier[onAssembly] operator[SEP] Keyword[new] identifier[MonoCompletionStage] operator[<] operator[>] operator[SEP] identifier[futureSupplier] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
public void loadFrom(String modelfile) throws IOException, ClassNotFoundException { ObjectInputStream in = new ObjectInputStream(new BufferedInputStream( new GZIPInputStream(new FileInputStream(modelfile)))); templets = (TempletGroup) in.readObject(); cl = (Linear) in.readObject(); in.close(); }
class class_name[name] begin[{] method[loadFrom, return_type[void], modifier[public], parameter[modelfile]] begin[{] local_variable[type[ObjectInputStream], in] assign[member[.templets], Cast(expression=MethodInvocation(arguments=[], member=readObject, postfix_operators=[], prefix_operators=[], qualifier=in, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=TempletGroup, sub_type=None))] assign[member[.cl], Cast(expression=MethodInvocation(arguments=[], member=readObject, postfix_operators=[], prefix_operators=[], qualifier=in, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=Linear, sub_type=None))] call[in.close, parameter[]] end[}] END[}]
Keyword[public] Keyword[void] identifier[loadFrom] operator[SEP] identifier[String] identifier[modelfile] operator[SEP] Keyword[throws] identifier[IOException] , identifier[ClassNotFoundException] { identifier[ObjectInputStream] identifier[in] operator[=] Keyword[new] identifier[ObjectInputStream] operator[SEP] Keyword[new] identifier[BufferedInputStream] operator[SEP] Keyword[new] identifier[GZIPInputStream] operator[SEP] Keyword[new] identifier[FileInputStream] operator[SEP] identifier[modelfile] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[templets] operator[=] operator[SEP] identifier[TempletGroup] operator[SEP] identifier[in] operator[SEP] identifier[readObject] operator[SEP] operator[SEP] operator[SEP] identifier[cl] operator[=] operator[SEP] identifier[Linear] operator[SEP] identifier[in] operator[SEP] identifier[readObject] operator[SEP] operator[SEP] operator[SEP] identifier[in] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP] }
public void setLongAttribute(String name, Long value) { Attribute attribute = getAttributes().get(name); if (!(attribute instanceof LongAttribute)) { throw new IllegalStateException("Cannot set boolean value on attribute with different type, " + attribute.getClass().getName() + " setting value " + value); } ((LongAttribute) attribute).setValue(value); }
class class_name[name] begin[{] method[setLongAttribute, return_type[void], modifier[public], parameter[name, value]] begin[{] local_variable[type[Attribute], attribute] if[binary_operation[member[.attribute], instanceof, type[LongAttribute]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Cannot set boolean value on attribute with different type, "), operandr=MethodInvocation(arguments=[], member=getClass, postfix_operators=[], prefix_operators=[], qualifier=attribute, selectors=[MethodInvocation(arguments=[], member=getName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" setting value "), operator=+), operandr=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalStateException, sub_type=None)), label=None) else begin[{] None end[}] Cast(expression=MemberReference(member=attribute, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=LongAttribute, sub_type=None)) end[}] END[}]
Keyword[public] Keyword[void] identifier[setLongAttribute] operator[SEP] identifier[String] identifier[name] , identifier[Long] identifier[value] operator[SEP] { identifier[Attribute] identifier[attribute] operator[=] identifier[getAttributes] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] identifier[name] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] operator[SEP] identifier[attribute] Keyword[instanceof] identifier[LongAttribute] operator[SEP] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] literal[String] operator[+] identifier[attribute] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[value] operator[SEP] operator[SEP] } operator[SEP] operator[SEP] identifier[LongAttribute] operator[SEP] identifier[attribute] operator[SEP] operator[SEP] identifier[setValue] operator[SEP] identifier[value] operator[SEP] operator[SEP] }
private void checkAccess(List<Operation> operations, QueryContext queryContext) { for (Operation operation : operations) { checkAccess(operation, queryContext); } }
class class_name[name] begin[{] method[checkAccess, return_type[void], modifier[private], parameter[operations, queryContext]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=operation, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=queryContext, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=checkAccess, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=operations, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=operation)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Operation, sub_type=None))), label=None) end[}] END[}]
Keyword[private] Keyword[void] identifier[checkAccess] operator[SEP] identifier[List] operator[<] identifier[Operation] operator[>] identifier[operations] , identifier[QueryContext] identifier[queryContext] operator[SEP] { Keyword[for] operator[SEP] identifier[Operation] identifier[operation] operator[:] identifier[operations] operator[SEP] { identifier[checkAccess] operator[SEP] identifier[operation] , identifier[queryContext] operator[SEP] operator[SEP] } }
public void callback(final Callback callback) { Runnable runnable = new Runnable() { @Override public void run() { try { callback.result(queryId, awaitResult()); } catch (Exception e) { callback.error(queryId, e); } } }; EXECUTOR_SERVICE.submit(runnable); }
class class_name[name] begin[{] method[callback, return_type[void], modifier[public], parameter[callback]] begin[{] local_variable[type[Runnable], runnable] call[EXECUTOR_SERVICE.submit, parameter[member[.runnable]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[callback] operator[SEP] Keyword[final] identifier[Callback] identifier[callback] operator[SEP] { identifier[Runnable] identifier[runnable] operator[=] Keyword[new] identifier[Runnable] operator[SEP] operator[SEP] { annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[run] operator[SEP] operator[SEP] { Keyword[try] { identifier[callback] operator[SEP] identifier[result] operator[SEP] identifier[queryId] , identifier[awaitResult] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { identifier[callback] operator[SEP] identifier[error] operator[SEP] identifier[queryId] , identifier[e] operator[SEP] operator[SEP] } } } operator[SEP] identifier[EXECUTOR_SERVICE] operator[SEP] identifier[submit] operator[SEP] identifier[runnable] operator[SEP] operator[SEP] }
private void updateChunksInProjectVersions(final DatabaseTransOperator transOperator, final int projectId, final int version, final int chunk) throws ProjectManagerException { final String UPDATE_PROJECT_NUM_CHUNKS = "UPDATE project_versions SET num_chunks=? WHERE project_id=? AND version=?"; try { transOperator.update(UPDATE_PROJECT_NUM_CHUNKS, chunk, projectId, version); transOperator.getConnection().commit(); } catch (final SQLException e) { logger.error("Error updating project " + projectId + " : chunk_num " + chunk, e); throw new ProjectManagerException( "Error updating project " + projectId + " : chunk_num " + chunk, e); } }
class class_name[name] begin[{] method[updateChunksInProjectVersions, return_type[void], modifier[private], parameter[transOperator, projectId, version, chunk]] begin[{] local_variable[type[String], UPDATE_PROJECT_NUM_CHUNKS] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=UPDATE_PROJECT_NUM_CHUNKS, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=chunk, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=projectId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=version, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=update, postfix_operators=[], prefix_operators=[], qualifier=transOperator, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=getConnection, postfix_operators=[], prefix_operators=[], qualifier=transOperator, selectors=[MethodInvocation(arguments=[], member=commit, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Error updating project "), operandr=MemberReference(member=projectId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" : chunk_num "), operator=+), operandr=MemberReference(member=chunk, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), label=None), ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Error updating project "), operandr=MemberReference(member=projectId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" : chunk_num "), operator=+), operandr=MemberReference(member=chunk, 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=ProjectManagerException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['SQLException']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[private] Keyword[void] identifier[updateChunksInProjectVersions] operator[SEP] Keyword[final] identifier[DatabaseTransOperator] identifier[transOperator] , Keyword[final] Keyword[int] identifier[projectId] , Keyword[final] Keyword[int] identifier[version] , Keyword[final] Keyword[int] identifier[chunk] operator[SEP] Keyword[throws] identifier[ProjectManagerException] { Keyword[final] identifier[String] identifier[UPDATE_PROJECT_NUM_CHUNKS] operator[=] literal[String] operator[SEP] Keyword[try] { identifier[transOperator] operator[SEP] identifier[update] operator[SEP] identifier[UPDATE_PROJECT_NUM_CHUNKS] , identifier[chunk] , identifier[projectId] , identifier[version] operator[SEP] operator[SEP] identifier[transOperator] operator[SEP] identifier[getConnection] operator[SEP] operator[SEP] operator[SEP] identifier[commit] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] Keyword[final] identifier[SQLException] identifier[e] operator[SEP] { identifier[logger] operator[SEP] identifier[error] operator[SEP] literal[String] operator[+] identifier[projectId] operator[+] literal[String] operator[+] identifier[chunk] , identifier[e] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[ProjectManagerException] operator[SEP] literal[String] operator[+] identifier[projectId] operator[+] literal[String] operator[+] identifier[chunk] , identifier[e] operator[SEP] operator[SEP] } }
private void loadLastSavedPreferences() { fLastSelectedTemplateName = ""; //$NON-NLS-1$ boolean setSelection = false; String templateName = GlassmakerUIPlugin.getDefault().getPreferenceStore().getString(HTMLUIPreferenceNames.NEW_FILE_TEMPLATE_NAME); if (templateName == null || templateName.length() == 0) { templateName = GlassmakerUIPlugin.getDefault().getPreferenceStore().getString(HTMLUIPreferenceNames.NEW_FILE_TEMPLATE_ID); if (templateName != null && templateName.length() > 0) { Template template = fTemplateStore.findTemplateById(templateName); if (template != null) { fLastSelectedTemplateName = template.getName(); setSelection = true; } } } else { fLastSelectedTemplateName = templateName; setSelection = true; } fUseTemplateButton.setSelection(setSelection); enableTemplates(); }
class class_name[name] begin[{] method[loadLastSavedPreferences, return_type[void], modifier[private], parameter[]] begin[{] assign[member[.fLastSelectedTemplateName], literal[""]] local_variable[type[boolean], setSelection] local_variable[type[String], templateName] if[binary_operation[binary_operation[member[.templateName], ==, literal[null]], ||, binary_operation[call[templateName.length, parameter[]], ==, literal[0]]]] begin[{] assign[member[.templateName], call[GlassmakerUIPlugin.getDefault, parameter[]]] if[binary_operation[binary_operation[member[.templateName], !=, literal[null]], &&, binary_operation[call[templateName.length, parameter[]], >, literal[0]]]] begin[{] local_variable[type[Template], template] if[binary_operation[member[.template], !=, literal[null]]] begin[{] assign[member[.fLastSelectedTemplateName], call[template.getName, parameter[]]] assign[member[.setSelection], literal[true]] else begin[{] None end[}] else begin[{] None end[}] else begin[{] assign[member[.fLastSelectedTemplateName], member[.templateName]] assign[member[.setSelection], literal[true]] end[}] call[fUseTemplateButton.setSelection, parameter[member[.setSelection]]] call[.enableTemplates, parameter[]] end[}] END[}]
Keyword[private] Keyword[void] identifier[loadLastSavedPreferences] operator[SEP] operator[SEP] { identifier[fLastSelectedTemplateName] operator[=] literal[String] operator[SEP] Keyword[boolean] identifier[setSelection] operator[=] literal[boolean] operator[SEP] identifier[String] identifier[templateName] operator[=] identifier[GlassmakerUIPlugin] operator[SEP] identifier[getDefault] operator[SEP] operator[SEP] operator[SEP] identifier[getPreferenceStore] operator[SEP] operator[SEP] operator[SEP] identifier[getString] operator[SEP] identifier[HTMLUIPreferenceNames] operator[SEP] identifier[NEW_FILE_TEMPLATE_NAME] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[templateName] operator[==] Other[null] operator[||] identifier[templateName] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[==] Other[0] operator[SEP] { identifier[templateName] operator[=] identifier[GlassmakerUIPlugin] operator[SEP] identifier[getDefault] operator[SEP] operator[SEP] operator[SEP] identifier[getPreferenceStore] operator[SEP] operator[SEP] operator[SEP] identifier[getString] operator[SEP] identifier[HTMLUIPreferenceNames] operator[SEP] identifier[NEW_FILE_TEMPLATE_ID] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[templateName] operator[!=] Other[null] operator[&&] identifier[templateName] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] { identifier[Template] identifier[template] operator[=] identifier[fTemplateStore] operator[SEP] identifier[findTemplateById] operator[SEP] identifier[templateName] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[template] operator[!=] Other[null] operator[SEP] { identifier[fLastSelectedTemplateName] operator[=] identifier[template] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] identifier[setSelection] operator[=] literal[boolean] operator[SEP] } } } Keyword[else] { identifier[fLastSelectedTemplateName] operator[=] identifier[templateName] operator[SEP] identifier[setSelection] operator[=] literal[boolean] operator[SEP] } identifier[fUseTemplateButton] operator[SEP] identifier[setSelection] operator[SEP] identifier[setSelection] operator[SEP] operator[SEP] identifier[enableTemplates] operator[SEP] operator[SEP] operator[SEP] }
private static void performVersionChecks(String minSpringVersion) { if (minSpringVersion == null) { return; } // Check Spring Compatibility String springVersion = SpringVersion.getVersion(); String version = getVersion(); if (disableChecks(springVersion, version)) { return; } logger.info("You are running with Spring Security Core " + version); if (new ComparableVersion(springVersion) .compareTo(new ComparableVersion(minSpringVersion)) < 0) { logger.warn("**** You are advised to use Spring " + minSpringVersion + " or later with this version. You are running: " + springVersion); } }
class class_name[name] begin[{] method[performVersionChecks, return_type[void], modifier[private static], parameter[minSpringVersion]] begin[{] if[binary_operation[member[.minSpringVersion], ==, literal[null]]] begin[{] return[None] else begin[{] None end[}] local_variable[type[String], springVersion] local_variable[type[String], version] if[call[.disableChecks, parameter[member[.springVersion], member[.version]]]] begin[{] return[None] else begin[{] None end[}] call[logger.info, parameter[binary_operation[literal["You are running with Spring Security Core "], +, member[.version]]]] if[binary_operation[ClassCreator(arguments=[MemberReference(member=springVersion, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[ClassCreator(arguments=[MemberReference(member=minSpringVersion, 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=ComparableVersion, sub_type=None))], member=compareTo, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=ComparableVersion, sub_type=None)), <, literal[0]]] begin[{] call[logger.warn, parameter[binary_operation[binary_operation[binary_operation[literal["**** You are advised to use Spring "], +, member[.minSpringVersion]], +, literal[" or later with this version. You are running: "]], +, member[.springVersion]]]] else begin[{] None end[}] end[}] END[}]
Keyword[private] Keyword[static] Keyword[void] identifier[performVersionChecks] operator[SEP] identifier[String] identifier[minSpringVersion] operator[SEP] { Keyword[if] operator[SEP] identifier[minSpringVersion] operator[==] Other[null] operator[SEP] { Keyword[return] operator[SEP] } identifier[String] identifier[springVersion] operator[=] identifier[SpringVersion] operator[SEP] identifier[getVersion] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[version] operator[=] identifier[getVersion] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[disableChecks] operator[SEP] identifier[springVersion] , identifier[version] operator[SEP] operator[SEP] { Keyword[return] operator[SEP] } identifier[logger] operator[SEP] identifier[info] operator[SEP] literal[String] operator[+] identifier[version] operator[SEP] operator[SEP] Keyword[if] operator[SEP] Keyword[new] identifier[ComparableVersion] operator[SEP] identifier[springVersion] operator[SEP] operator[SEP] identifier[compareTo] operator[SEP] Keyword[new] identifier[ComparableVersion] operator[SEP] identifier[minSpringVersion] operator[SEP] operator[SEP] operator[<] Other[0] operator[SEP] { identifier[logger] operator[SEP] identifier[warn] operator[SEP] literal[String] operator[+] identifier[minSpringVersion] operator[+] literal[String] operator[+] identifier[springVersion] operator[SEP] operator[SEP] } }
public IndexFacesRequest withDetectionAttributes(String... detectionAttributes) { if (this.detectionAttributes == null) { setDetectionAttributes(new java.util.ArrayList<String>(detectionAttributes.length)); } for (String ele : detectionAttributes) { this.detectionAttributes.add(ele); } return this; }
class class_name[name] begin[{] method[withDetectionAttributes, return_type[type[IndexFacesRequest]], modifier[public], parameter[detectionAttributes]] begin[{] if[binary_operation[THIS[member[None.detectionAttributes]], ==, literal[null]]] begin[{] call[.setDetectionAttributes, parameter[ClassCreator(arguments=[MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=detectionAttributes, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=java, sub_type=ReferenceType(arguments=None, dimensions=None, name=util, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=None, name=ArrayList, sub_type=None))))]] else begin[{] None end[}] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=detectionAttributes, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[MemberReference(member=ele, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=detectionAttributes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=ele)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None) return[THIS[]] end[}] END[}]
Keyword[public] identifier[IndexFacesRequest] identifier[withDetectionAttributes] operator[SEP] identifier[String] operator[...] identifier[detectionAttributes] operator[SEP] { Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[detectionAttributes] operator[==] Other[null] operator[SEP] { identifier[setDetectionAttributes] operator[SEP] Keyword[new] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[ArrayList] operator[<] identifier[String] operator[>] operator[SEP] identifier[detectionAttributes] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] } Keyword[for] operator[SEP] identifier[String] identifier[ele] operator[:] identifier[detectionAttributes] operator[SEP] { Keyword[this] operator[SEP] identifier[detectionAttributes] operator[SEP] identifier[add] operator[SEP] identifier[ele] operator[SEP] operator[SEP] } Keyword[return] Keyword[this] operator[SEP] }
protected static void showKillDialog(Set<String> ids, String caption, final CmsSessionsTable table) { final Window window = CmsBasicDialog.prepareWindow(); window.setCaption(caption); window.setContent(new CmsKillSessionDialog(ids, getCloseRunnable(window, table))); A_CmsUI.get().addWindow(window); }
class class_name[name] begin[{] method[showKillDialog, return_type[void], modifier[static protected], parameter[ids, caption, table]] begin[{] local_variable[type[Window], window] call[window.setCaption, parameter[member[.caption]]] call[window.setContent, parameter[ClassCreator(arguments=[MemberReference(member=ids, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[MemberReference(member=window, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=table, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getCloseRunnable, 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=CmsKillSessionDialog, sub_type=None))]] call[A_CmsUI.get, parameter[]] end[}] END[}]
Keyword[protected] Keyword[static] Keyword[void] identifier[showKillDialog] operator[SEP] identifier[Set] operator[<] identifier[String] operator[>] identifier[ids] , identifier[String] identifier[caption] , Keyword[final] identifier[CmsSessionsTable] identifier[table] operator[SEP] { Keyword[final] identifier[Window] identifier[window] operator[=] identifier[CmsBasicDialog] operator[SEP] identifier[prepareWindow] operator[SEP] operator[SEP] operator[SEP] identifier[window] operator[SEP] identifier[setCaption] operator[SEP] identifier[caption] operator[SEP] operator[SEP] identifier[window] operator[SEP] identifier[setContent] operator[SEP] Keyword[new] identifier[CmsKillSessionDialog] operator[SEP] identifier[ids] , identifier[getCloseRunnable] operator[SEP] identifier[window] , identifier[table] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[A_CmsUI] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[addWindow] operator[SEP] identifier[window] operator[SEP] operator[SEP] }
public MembershipType saveMembershipType(MembershipType mt, boolean broadcast) throws Exception { Session session = service.getStorageSession(); try { return saveMembershipType(session, (MembershipTypeImpl)mt, broadcast); } finally { session.logout(); } }
class class_name[name] begin[{] method[saveMembershipType, return_type[type[MembershipType]], modifier[public], parameter[mt, broadcast]] begin[{] local_variable[type[Session], session] TryStatement(block=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=session, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Cast(expression=MemberReference(member=mt, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=MembershipTypeImpl, sub_type=None)), MemberReference(member=broadcast, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=saveMembershipType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], catches=None, finally_block=[StatementExpression(expression=MethodInvocation(arguments=[], member=logout, postfix_operators=[], prefix_operators=[], qualifier=session, selectors=[], type_arguments=None), label=None)], label=None, resources=None) end[}] END[}]
Keyword[public] identifier[MembershipType] identifier[saveMembershipType] operator[SEP] identifier[MembershipType] identifier[mt] , Keyword[boolean] identifier[broadcast] operator[SEP] Keyword[throws] identifier[Exception] { identifier[Session] identifier[session] operator[=] identifier[service] operator[SEP] identifier[getStorageSession] operator[SEP] operator[SEP] operator[SEP] Keyword[try] { Keyword[return] identifier[saveMembershipType] operator[SEP] identifier[session] , operator[SEP] identifier[MembershipTypeImpl] operator[SEP] identifier[mt] , identifier[broadcast] operator[SEP] operator[SEP] } Keyword[finally] { identifier[session] operator[SEP] identifier[logout] operator[SEP] operator[SEP] operator[SEP] } }
public static <T extends Proposition> Map<String, List<T>> createPropositionMap( List<T> propositions) { Map<String, List<T>> result = new HashMap<>(); if (propositions != null) { for (T prop : propositions) { String propId = prop.getId(); List<T> ts = null; if (result.containsKey(propId)) { ts = result.get(propId); } else { ts = new ArrayList<>(); result.put(propId, ts); } ts.add(prop); } } return result; }
class class_name[name] begin[{] method[createPropositionMap, return_type[type[Map]], modifier[public static], parameter[propositions]] begin[{] local_variable[type[Map], result] if[binary_operation[member[.propositions], !=, literal[null]]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getId, postfix_operators=[], prefix_operators=[], qualifier=prop, selectors=[], type_arguments=None), name=propId)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), name=ts)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None))], dimensions=[], name=List, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=propId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=containsKey, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[], type_arguments=None), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=ts, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=ArrayList, sub_type=None))), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=propId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=ts, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=put, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=ts, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=propId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[], type_arguments=None)), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=prop, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=ts, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=propositions, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=prop)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None))), label=None) else begin[{] None end[}] return[member[.result]] end[}] END[}]
Keyword[public] Keyword[static] operator[<] identifier[T] Keyword[extends] identifier[Proposition] operator[>] identifier[Map] operator[<] identifier[String] , identifier[List] operator[<] identifier[T] operator[>] operator[>] identifier[createPropositionMap] operator[SEP] identifier[List] operator[<] identifier[T] operator[>] identifier[propositions] operator[SEP] { identifier[Map] operator[<] identifier[String] , identifier[List] operator[<] identifier[T] operator[>] operator[>] identifier[result] operator[=] Keyword[new] identifier[HashMap] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[propositions] operator[!=] Other[null] operator[SEP] { Keyword[for] operator[SEP] identifier[T] identifier[prop] operator[:] identifier[propositions] operator[SEP] { identifier[String] identifier[propId] operator[=] identifier[prop] operator[SEP] identifier[getId] operator[SEP] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[T] operator[>] identifier[ts] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[result] operator[SEP] identifier[containsKey] operator[SEP] identifier[propId] operator[SEP] operator[SEP] { identifier[ts] operator[=] identifier[result] operator[SEP] identifier[get] operator[SEP] identifier[propId] operator[SEP] operator[SEP] } Keyword[else] { identifier[ts] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[put] operator[SEP] identifier[propId] , identifier[ts] operator[SEP] operator[SEP] } identifier[ts] operator[SEP] identifier[add] operator[SEP] identifier[prop] operator[SEP] operator[SEP] } } Keyword[return] identifier[result] operator[SEP] }
@XmlElementDecl(namespace = "", name = "dreizeiler") public JAXBElement<String> createDreizeiler(String value) { return new JAXBElement<String>(_Dreizeiler_QNAME, String.class, null, value); }
class class_name[name] begin[{] method[createDreizeiler, return_type[type[JAXBElement]], modifier[public], parameter[value]] begin[{] return[ClassCreator(arguments=[MemberReference(member=_Dreizeiler_QNAME, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=String, sub_type=None)), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=None, name=JAXBElement, sub_type=None))] end[}] END[}]
annotation[@] identifier[XmlElementDecl] operator[SEP] identifier[namespace] operator[=] literal[String] , identifier[name] operator[=] literal[String] operator[SEP] Keyword[public] identifier[JAXBElement] operator[<] identifier[String] operator[>] identifier[createDreizeiler] operator[SEP] identifier[String] identifier[value] operator[SEP] { Keyword[return] Keyword[new] identifier[JAXBElement] operator[<] identifier[String] operator[>] operator[SEP] identifier[_Dreizeiler_QNAME] , identifier[String] operator[SEP] Keyword[class] , Other[null] , identifier[value] operator[SEP] operator[SEP] }
private static String initializeBaseDir() { LOGGER.entering(); String repoFolderName = System.getProperty(ARTIFACT_BASE_CONFIG_PROPERTY, ConfigParser.parse().getString(ARTIFACT_BASE_CONFIG_PROPERTY, "repository")); repoFolderName = StringUtils.defaultIfEmpty(repoFolderName, "repository"); LOGGER.exiting(repoFolderName); return repoFolderName; }
class class_name[name] begin[{] method[initializeBaseDir, return_type[type[String]], modifier[private static], parameter[]] begin[{] call[LOGGER.entering, parameter[]] local_variable[type[String], repoFolderName] assign[member[.repoFolderName], call[StringUtils.defaultIfEmpty, parameter[member[.repoFolderName], literal["repository"]]]] call[LOGGER.exiting, parameter[member[.repoFolderName]]] return[member[.repoFolderName]] end[}] END[}]
Keyword[private] Keyword[static] identifier[String] identifier[initializeBaseDir] operator[SEP] operator[SEP] { identifier[LOGGER] operator[SEP] identifier[entering] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[repoFolderName] operator[=] identifier[System] operator[SEP] identifier[getProperty] operator[SEP] identifier[ARTIFACT_BASE_CONFIG_PROPERTY] , identifier[ConfigParser] operator[SEP] identifier[parse] operator[SEP] operator[SEP] operator[SEP] identifier[getString] operator[SEP] identifier[ARTIFACT_BASE_CONFIG_PROPERTY] , literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[repoFolderName] operator[=] identifier[StringUtils] operator[SEP] identifier[defaultIfEmpty] operator[SEP] identifier[repoFolderName] , literal[String] operator[SEP] operator[SEP] identifier[LOGGER] operator[SEP] identifier[exiting] operator[SEP] identifier[repoFolderName] operator[SEP] operator[SEP] Keyword[return] identifier[repoFolderName] operator[SEP] }
public void assignExclusiveSegments(NetworkBufferPool networkBufferPool, int networkBuffersPerChannel) throws IOException { checkState(this.isCreditBased, "Bug in input gate setup logic: exclusive buffers only exist with credit-based flow control."); checkState(this.networkBufferPool == null, "Bug in input gate setup logic: global buffer pool has" + "already been set for this input gate."); this.networkBufferPool = checkNotNull(networkBufferPool); this.networkBuffersPerChannel = networkBuffersPerChannel; synchronized (requestLock) { for (InputChannel inputChannel : inputChannels.values()) { if (inputChannel instanceof RemoteInputChannel) { ((RemoteInputChannel) inputChannel).assignExclusiveSegments( networkBufferPool.requestMemorySegments(networkBuffersPerChannel)); } } } }
class class_name[name] begin[{] method[assignExclusiveSegments, return_type[void], modifier[public], parameter[networkBufferPool, networkBuffersPerChannel]] begin[{] call[.checkState, parameter[THIS[member[None.isCreditBased]], literal["Bug in input gate setup logic: exclusive buffers only exist with credit-based flow control."]]] call[.checkState, parameter[binary_operation[THIS[member[None.networkBufferPool]], ==, literal[null]], binary_operation[literal["Bug in input gate setup logic: global buffer pool has"], +, literal["already been set for this input gate."]]]] assign[THIS[member[None.networkBufferPool]], call[.checkNotNull, parameter[member[.networkBufferPool]]]] assign[THIS[member[None.networkBuffersPerChannel]], member[.networkBuffersPerChannel]] SYNCHRONIZED[member[.requestLock]] BEGIN[{] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=inputChannel, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=RemoteInputChannel, sub_type=None), operator=instanceof), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Cast(expression=MemberReference(member=inputChannel, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=RemoteInputChannel, sub_type=None)), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=values, postfix_operators=[], prefix_operators=[], qualifier=inputChannels, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=inputChannel)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=InputChannel, sub_type=None))), label=None) END[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[assignExclusiveSegments] operator[SEP] identifier[NetworkBufferPool] identifier[networkBufferPool] , Keyword[int] identifier[networkBuffersPerChannel] operator[SEP] Keyword[throws] identifier[IOException] { identifier[checkState] operator[SEP] Keyword[this] operator[SEP] identifier[isCreditBased] , literal[String] operator[SEP] operator[SEP] identifier[checkState] operator[SEP] Keyword[this] operator[SEP] identifier[networkBufferPool] operator[==] Other[null] , literal[String] operator[+] literal[String] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[networkBufferPool] operator[=] identifier[checkNotNull] operator[SEP] identifier[networkBufferPool] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[networkBuffersPerChannel] operator[=] identifier[networkBuffersPerChannel] operator[SEP] Keyword[synchronized] operator[SEP] identifier[requestLock] operator[SEP] { Keyword[for] operator[SEP] identifier[InputChannel] identifier[inputChannel] operator[:] identifier[inputChannels] operator[SEP] identifier[values] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[inputChannel] Keyword[instanceof] identifier[RemoteInputChannel] operator[SEP] { operator[SEP] operator[SEP] identifier[RemoteInputChannel] operator[SEP] identifier[inputChannel] operator[SEP] operator[SEP] identifier[assignExclusiveSegments] operator[SEP] identifier[networkBufferPool] operator[SEP] identifier[requestMemorySegments] operator[SEP] identifier[networkBuffersPerChannel] operator[SEP] operator[SEP] operator[SEP] } } } }
private void flatten(List<DataDescriptor> result, List<DataDescriptor> tree) { for (DataDescriptor key : tree) { if (key.bad) { root.isBad = true; result.add(key); // add it anyway so we can see it in debug continue; } if ((key.f == 3) && (key.subKeys != null)) { flatten(result, key.subKeys); } else if (key.f == 1) { // flatten the subtrees List<DataDescriptor> subTree = new ArrayList<DataDescriptor>(); flatten(subTree, key.subKeys); key.subKeys = subTree; result.add(key); } else { result.add(key); } } }
class class_name[name] begin[{] method[flatten, return_type[void], modifier[private], parameter[result, tree]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MemberReference(member=bad, postfix_operators=[], prefix_operators=[], qualifier=key, selectors=[]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=isBad, postfix_operators=[], prefix_operators=[], qualifier=root, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[], type_arguments=None), label=None), ContinueStatement(goto=None, label=None)])), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=f, postfix_operators=[], prefix_operators=[], qualifier=key, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=3), operator===), operandr=BinaryOperation(operandl=MemberReference(member=subKeys, postfix_operators=[], prefix_operators=[], qualifier=key, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operator=&&), else_statement=IfStatement(condition=BinaryOperation(operandl=MemberReference(member=f, postfix_operators=[], prefix_operators=[], qualifier=key, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator===), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=DataDescriptor, sub_type=None))], dimensions=None, name=ArrayList, sub_type=None)), name=subTree)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=DataDescriptor, sub_type=None))], dimensions=[], name=List, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=subTree, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=subKeys, postfix_operators=[], prefix_operators=[], qualifier=key, selectors=[])], member=flatten, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=subKeys, postfix_operators=[], prefix_operators=[], qualifier=key, selectors=[]), type==, value=MemberReference(member=subTree, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[], type_arguments=None), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=subKeys, postfix_operators=[], prefix_operators=[], qualifier=key, selectors=[])], member=flatten, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=tree, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=key)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=DataDescriptor, sub_type=None))), label=None) end[}] END[}]
Keyword[private] Keyword[void] identifier[flatten] operator[SEP] identifier[List] operator[<] identifier[DataDescriptor] operator[>] identifier[result] , identifier[List] operator[<] identifier[DataDescriptor] operator[>] identifier[tree] operator[SEP] { Keyword[for] operator[SEP] identifier[DataDescriptor] identifier[key] operator[:] identifier[tree] operator[SEP] { Keyword[if] operator[SEP] identifier[key] operator[SEP] identifier[bad] operator[SEP] { identifier[root] operator[SEP] identifier[isBad] operator[=] literal[boolean] operator[SEP] identifier[result] operator[SEP] identifier[add] operator[SEP] identifier[key] operator[SEP] operator[SEP] Keyword[continue] operator[SEP] } Keyword[if] operator[SEP] operator[SEP] identifier[key] operator[SEP] identifier[f] operator[==] Other[3] operator[SEP] operator[&&] operator[SEP] identifier[key] operator[SEP] identifier[subKeys] operator[!=] Other[null] operator[SEP] operator[SEP] { identifier[flatten] operator[SEP] identifier[result] , identifier[key] operator[SEP] identifier[subKeys] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[key] operator[SEP] identifier[f] operator[==] Other[1] operator[SEP] { identifier[List] operator[<] identifier[DataDescriptor] operator[>] identifier[subTree] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[DataDescriptor] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[flatten] operator[SEP] identifier[subTree] , identifier[key] operator[SEP] identifier[subKeys] operator[SEP] operator[SEP] identifier[key] operator[SEP] identifier[subKeys] operator[=] identifier[subTree] operator[SEP] identifier[result] operator[SEP] identifier[add] operator[SEP] identifier[key] operator[SEP] operator[SEP] } Keyword[else] { identifier[result] operator[SEP] identifier[add] operator[SEP] identifier[key] operator[SEP] operator[SEP] } } }
protected boolean setResult(Object result) { for (; ; ) { Object currentState = this.state; if (isDoneState(currentState)) { return false; } if (STATE.compareAndSet(this, currentState, result)) { done(); notifyThreadsWaitingOnGet(); runAsynchronous((ExecutionCallbackNode) currentState, result); break; } } return true; }
class class_name[name] begin[{] method[setResult, return_type[type[boolean]], modifier[protected], parameter[result]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=state, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), name=currentState)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=currentState, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isDoneState, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), label=None)])), IfStatement(condition=MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), MemberReference(member=currentState, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=compareAndSet, postfix_operators=[], prefix_operators=[], qualifier=STATE, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=done, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=notifyThreadsWaitingOnGet, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Cast(expression=MemberReference(member=currentState, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=ExecutionCallbackNode, sub_type=None)), MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=runAsynchronous, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)]))]), control=ForControl(condition=None, init=None, update=None), label=None) return[literal[true]] end[}] END[}]
Keyword[protected] Keyword[boolean] identifier[setResult] operator[SEP] identifier[Object] identifier[result] operator[SEP] { Keyword[for] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { identifier[Object] identifier[currentState] operator[=] Keyword[this] operator[SEP] identifier[state] operator[SEP] Keyword[if] operator[SEP] identifier[isDoneState] operator[SEP] identifier[currentState] operator[SEP] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } Keyword[if] operator[SEP] identifier[STATE] operator[SEP] identifier[compareAndSet] operator[SEP] Keyword[this] , identifier[currentState] , identifier[result] operator[SEP] operator[SEP] { identifier[done] operator[SEP] operator[SEP] operator[SEP] identifier[notifyThreadsWaitingOnGet] operator[SEP] operator[SEP] operator[SEP] identifier[runAsynchronous] operator[SEP] operator[SEP] identifier[ExecutionCallbackNode] operator[SEP] identifier[currentState] , identifier[result] operator[SEP] operator[SEP] Keyword[break] operator[SEP] } } Keyword[return] literal[boolean] operator[SEP] }
public static <T> Collector<T, ?, ParetoFront<T>> toParetoFront(final Comparator<? super T> dominance) { return Collector.of( () -> new ParetoFront<>(dominance), ParetoFront::add, ParetoFront::merge ); }
class class_name[name] begin[{] method[toParetoFront, return_type[type[Collector]], modifier[public static], parameter[dominance]] begin[{] return[call[Collector.of, parameter[LambdaExpression(body=ClassCreator(arguments=[MemberReference(member=dominance, 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=ParetoFront, sub_type=None)), parameters=[]), MethodReference(expression=MemberReference(member=ParetoFront, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), method=MemberReference(member=add, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type_arguments=[]), MethodReference(expression=MemberReference(member=ParetoFront, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), method=MemberReference(member=merge, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type_arguments=[])]]] end[}] END[}]
Keyword[public] Keyword[static] operator[<] identifier[T] operator[>] identifier[Collector] operator[<] identifier[T] , operator[?] , identifier[ParetoFront] operator[<] identifier[T] operator[>] operator[>] identifier[toParetoFront] operator[SEP] Keyword[final] identifier[Comparator] operator[<] operator[?] Keyword[super] identifier[T] operator[>] identifier[dominance] operator[SEP] { Keyword[return] identifier[Collector] operator[SEP] identifier[of] operator[SEP] operator[SEP] operator[SEP] operator[->] Keyword[new] identifier[ParetoFront] operator[<] operator[>] operator[SEP] identifier[dominance] operator[SEP] , identifier[ParetoFront] operator[::] identifier[add] , identifier[ParetoFront] operator[::] identifier[merge] operator[SEP] operator[SEP] }
private boolean createMQLinkMPResources( MQLinkHandler mqLinkHandler, MQLinkDefinition mqld, LocalizationDefinition linkLocalizationDefinition, VirtualLinkDefinition virtualLinkDefinition, Set<String> linkLocalizingMEs, LocalTransaction transaction, boolean linkCreated) throws SIResourceException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry( tc, "createMQLinkMPResources", new Object[] { mqLinkHandler, mqld, linkLocalizationDefinition, virtualLinkDefinition, linkLocalizingMEs, transaction, new Boolean(linkCreated) }); boolean engineResourcesRequired = false; //For MQLinks, we want the QueueHigh messages to be the same as for //transmit queues. linkLocalizationDefinition.setDestinationHighMsgs(messageProcessor.getHighMessageThreshold()); linkLocalizationDefinition.setDestinationLowMsgs((messageProcessor.getHighMessageThreshold() * 8) / 10); //If we didnt just create the linkHandler and the one that already //existed is for a different UUID, or there is already a localisation for //the linkHandler on this ME, then this could be a problem and further //tests are required. if (!linkCreated) { /* * 182456.6 * For the move to WCCM, createDestination can be called for * destinations in WCCM that the message processor already * holds state about. This is ok as long as the destination has * not already been reconciled. */ // if (mqLinkHandler.isReconciled()) // { // if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) // SibTr.exit( // tc, // "createMQLinkMPResources", // "Link already exists"); // // throw new SIMPDestinationAlreadyExistsException( // nls.getFormattedMessage( // "LINK_ALREADY_EXISTS_ERROR_CWSIP0043", // new Object[] { virtualLinkDefinition.getName(), // messageProcessor.getMessagingEngineName()}, // null)); // } // Handle uuid changes if (!(mqld.getUuid().equals(mqLinkHandler.getMqLinkUuid()))) { // Need to set the toBeDeleted flag in the "old" handler // and set up a new handler deleteRecreateMQLinkHandler( mqld, mqLinkHandler, virtualLinkDefinition, linkLocalizationDefinition, transaction); } else { /* * Link already exists. In the new WCCM world, the * create should complete succesfully, with the new link * definition replacing the existing one. */ mqLinkHandler.updateLinkDefinition(virtualLinkDefinition, transaction); // Flag that we need to tell the MQLink component to create its MQLink infrastructure. engineResourcesRequired = true; if (linkLocalizingMEs == null) { linkLocalizingMEs = new HashSet<String>(); linkLocalizingMEs.add(messageProcessor.getMessagingEngineUuid().toString()); } // Alert the lookups object to handle the re-definition linkIndex.setLocalizationFlags(mqLinkHandler, true, false); //MQLinks have a real localisation associated with them, so it can //be updated here mqLinkHandler.updateLocalizationDefinition(linkLocalizationDefinition, transaction); // Alert the lookups object to handle the re-definition linkIndex.create(mqLinkHandler); } } else // we did just create the linkHandler. { //First add the localization for the MQlink mqLinkHandler.addNewMQLinkLocalisation( transaction, messageProcessor.getMessagingEngineUuid(), linkLocalizationDefinition); // Flag that we need to tell the MQLink component to create its MQLink infrastructure. engineResourcesRequired = true; } // eof we did just create the linkHandler if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "createMQLinkMPResources", new Boolean(engineResourcesRequired)); return engineResourcesRequired; }
class class_name[name] begin[{] method[createMQLinkMPResources, return_type[type[boolean]], modifier[private], parameter[mqLinkHandler, mqld, linkLocalizationDefinition, virtualLinkDefinition, linkLocalizingMEs, transaction, linkCreated]] begin[{] if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{] call[SibTr.entry, parameter[member[.tc], literal["createMQLinkMPResources"], ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MemberReference(member=mqLinkHandler, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=mqld, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=linkLocalizationDefinition, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=virtualLinkDefinition, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=linkLocalizingMEs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=transaction, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), ClassCreator(arguments=[MemberReference(member=linkCreated, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Boolean, sub_type=None))]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Object, sub_type=None))]] else begin[{] None end[}] local_variable[type[boolean], engineResourcesRequired] call[linkLocalizationDefinition.setDestinationHighMsgs, parameter[call[messageProcessor.getHighMessageThreshold, parameter[]]]] call[linkLocalizationDefinition.setDestinationLowMsgs, parameter[binary_operation[binary_operation[call[messageProcessor.getHighMessageThreshold, parameter[]], *, literal[8]], /, literal[10]]]] if[member[.linkCreated]] begin[{] if[call[mqld.getUuid, parameter[]]] begin[{] call[.deleteRecreateMQLinkHandler, parameter[member[.mqld], member[.mqLinkHandler], member[.virtualLinkDefinition], member[.linkLocalizationDefinition], member[.transaction]]] else begin[{] call[mqLinkHandler.updateLinkDefinition, parameter[member[.virtualLinkDefinition], member[.transaction]]] assign[member[.engineResourcesRequired], literal[true]] if[binary_operation[member[.linkLocalizingMEs], ==, literal[null]]] begin[{] assign[member[.linkLocalizingMEs], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=None, name=HashSet, sub_type=None))] call[linkLocalizingMEs.add, parameter[call[messageProcessor.getMessagingEngineUuid, parameter[]]]] else begin[{] None end[}] call[linkIndex.setLocalizationFlags, parameter[member[.mqLinkHandler], literal[true], literal[false]]] call[mqLinkHandler.updateLocalizationDefinition, parameter[member[.linkLocalizationDefinition], member[.transaction]]] call[linkIndex.create, parameter[member[.mqLinkHandler]]] end[}] else begin[{] call[mqLinkHandler.addNewMQLinkLocalisation, parameter[member[.transaction], call[messageProcessor.getMessagingEngineUuid, parameter[]], member[.linkLocalizationDefinition]]] assign[member[.engineResourcesRequired], literal[true]] end[}] if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{] call[SibTr.exit, parameter[member[.tc], literal["createMQLinkMPResources"], ClassCreator(arguments=[MemberReference(member=engineResourcesRequired, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Boolean, sub_type=None))]] else begin[{] None end[}] return[member[.engineResourcesRequired]] end[}] END[}]
Keyword[private] Keyword[boolean] identifier[createMQLinkMPResources] operator[SEP] identifier[MQLinkHandler] identifier[mqLinkHandler] , identifier[MQLinkDefinition] identifier[mqld] , identifier[LocalizationDefinition] identifier[linkLocalizationDefinition] , identifier[VirtualLinkDefinition] identifier[virtualLinkDefinition] , identifier[Set] operator[<] identifier[String] operator[>] identifier[linkLocalizingMEs] , identifier[LocalTransaction] identifier[transaction] , Keyword[boolean] identifier[linkCreated] operator[SEP] Keyword[throws] identifier[SIResourceException] { Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[entry] operator[SEP] identifier[tc] , literal[String] , Keyword[new] identifier[Object] operator[SEP] operator[SEP] { identifier[mqLinkHandler] , identifier[mqld] , identifier[linkLocalizationDefinition] , identifier[virtualLinkDefinition] , identifier[linkLocalizingMEs] , identifier[transaction] , Keyword[new] identifier[Boolean] operator[SEP] identifier[linkCreated] operator[SEP] } operator[SEP] operator[SEP] Keyword[boolean] identifier[engineResourcesRequired] operator[=] literal[boolean] operator[SEP] identifier[linkLocalizationDefinition] operator[SEP] identifier[setDestinationHighMsgs] operator[SEP] identifier[messageProcessor] operator[SEP] identifier[getHighMessageThreshold] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[linkLocalizationDefinition] operator[SEP] identifier[setDestinationLowMsgs] operator[SEP] operator[SEP] identifier[messageProcessor] operator[SEP] identifier[getHighMessageThreshold] operator[SEP] operator[SEP] operator[*] Other[8] operator[SEP] operator[/] Other[10] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[linkCreated] operator[SEP] { Keyword[if] operator[SEP] operator[!] operator[SEP] identifier[mqld] operator[SEP] identifier[getUuid] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[mqLinkHandler] operator[SEP] identifier[getMqLinkUuid] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { identifier[deleteRecreateMQLinkHandler] operator[SEP] identifier[mqld] , identifier[mqLinkHandler] , identifier[virtualLinkDefinition] , identifier[linkLocalizationDefinition] , identifier[transaction] operator[SEP] operator[SEP] } Keyword[else] { identifier[mqLinkHandler] operator[SEP] identifier[updateLinkDefinition] operator[SEP] identifier[virtualLinkDefinition] , identifier[transaction] operator[SEP] operator[SEP] identifier[engineResourcesRequired] operator[=] literal[boolean] operator[SEP] Keyword[if] operator[SEP] identifier[linkLocalizingMEs] operator[==] Other[null] operator[SEP] { identifier[linkLocalizingMEs] operator[=] Keyword[new] identifier[HashSet] operator[<] identifier[String] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[linkLocalizingMEs] operator[SEP] identifier[add] operator[SEP] identifier[messageProcessor] operator[SEP] identifier[getMessagingEngineUuid] operator[SEP] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[linkIndex] operator[SEP] identifier[setLocalizationFlags] operator[SEP] identifier[mqLinkHandler] , literal[boolean] , literal[boolean] operator[SEP] operator[SEP] identifier[mqLinkHandler] operator[SEP] identifier[updateLocalizationDefinition] operator[SEP] identifier[linkLocalizationDefinition] , identifier[transaction] operator[SEP] operator[SEP] identifier[linkIndex] operator[SEP] identifier[create] operator[SEP] identifier[mqLinkHandler] operator[SEP] operator[SEP] } } Keyword[else] { identifier[mqLinkHandler] operator[SEP] identifier[addNewMQLinkLocalisation] operator[SEP] identifier[transaction] , identifier[messageProcessor] operator[SEP] identifier[getMessagingEngineUuid] operator[SEP] operator[SEP] , identifier[linkLocalizationDefinition] operator[SEP] operator[SEP] identifier[engineResourcesRequired] operator[=] literal[boolean] operator[SEP] } Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[exit] operator[SEP] identifier[tc] , literal[String] , Keyword[new] identifier[Boolean] operator[SEP] identifier[engineResourcesRequired] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[engineResourcesRequired] operator[SEP] }
public String escapePath(final String text, final String encoding) { return UriEscape.escapeUriPath(text, encoding); }
class class_name[name] begin[{] method[escapePath, return_type[type[String]], modifier[public], parameter[text, encoding]] begin[{] return[call[UriEscape.escapeUriPath, parameter[member[.text], member[.encoding]]]] end[}] END[}]
Keyword[public] identifier[String] identifier[escapePath] operator[SEP] Keyword[final] identifier[String] identifier[text] , Keyword[final] identifier[String] identifier[encoding] operator[SEP] { Keyword[return] identifier[UriEscape] operator[SEP] identifier[escapeUriPath] operator[SEP] identifier[text] , identifier[encoding] operator[SEP] operator[SEP] }
public static boolean isFromOrSuppressedThrowable(Throwable throwable, Class<? extends Throwable> exceptionClass, boolean checkCause) { return convertFromOrSuppressedThrowable(throwable, exceptionClass, checkCause) != null; }
class class_name[name] begin[{] method[isFromOrSuppressedThrowable, return_type[type[boolean]], modifier[public static], parameter[throwable, exceptionClass, checkCause]] begin[{] return[binary_operation[call[.convertFromOrSuppressedThrowable, parameter[member[.throwable], member[.exceptionClass], member[.checkCause]]], !=, literal[null]]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[boolean] identifier[isFromOrSuppressedThrowable] operator[SEP] identifier[Throwable] identifier[throwable] , identifier[Class] operator[<] operator[?] Keyword[extends] identifier[Throwable] operator[>] identifier[exceptionClass] , Keyword[boolean] identifier[checkCause] operator[SEP] { Keyword[return] identifier[convertFromOrSuppressedThrowable] operator[SEP] identifier[throwable] , identifier[exceptionClass] , identifier[checkCause] operator[SEP] operator[!=] Other[null] operator[SEP] }
public void processTasks(List<Row> bars, List<Row> expandedTasks, List<Row> tasks, List<Row> milestones) { List<Row> parentBars = buildRowHierarchy(bars, expandedTasks, tasks, milestones); createTasks(m_project, "", parentBars); deriveProjectCalendar(); updateStructure(); }
class class_name[name] begin[{] method[processTasks, return_type[void], modifier[public], parameter[bars, expandedTasks, tasks, milestones]] begin[{] local_variable[type[List], parentBars] call[.createTasks, parameter[member[.m_project], literal[""], member[.parentBars]]] call[.deriveProjectCalendar, parameter[]] call[.updateStructure, parameter[]] end[}] END[}]
Keyword[public] Keyword[void] identifier[processTasks] operator[SEP] identifier[List] operator[<] identifier[Row] operator[>] identifier[bars] , identifier[List] operator[<] identifier[Row] operator[>] identifier[expandedTasks] , identifier[List] operator[<] identifier[Row] operator[>] identifier[tasks] , identifier[List] operator[<] identifier[Row] operator[>] identifier[milestones] operator[SEP] { identifier[List] operator[<] identifier[Row] operator[>] identifier[parentBars] operator[=] identifier[buildRowHierarchy] operator[SEP] identifier[bars] , identifier[expandedTasks] , identifier[tasks] , identifier[milestones] operator[SEP] operator[SEP] identifier[createTasks] operator[SEP] identifier[m_project] , literal[String] , identifier[parentBars] operator[SEP] operator[SEP] identifier[deriveProjectCalendar] operator[SEP] operator[SEP] operator[SEP] identifier[updateStructure] operator[SEP] operator[SEP] operator[SEP] }
static public Key[] exit(Key... keep) { List<Key> keylist = new ArrayList<>(); if( keep != null ) for( Key k : keep ) if (k != null) keylist.add(k); Object[] arrkeep = keylist.toArray(); Arrays.sort(arrkeep); Stack<HashSet<Key>> keys = _scope.get()._keys; if (keys.size() > 0) { Futures fs = new Futures(); for (Key key : keys.pop()) { int found = Arrays.binarySearch(arrkeep, key); if ((arrkeep.length == 0 || found < 0) && key != null) Keyed.remove(key, fs); } fs.blockForPending(); } return keep; }
class class_name[name] begin[{] method[exit, return_type[type[Key]], modifier[public static], parameter[keep]] begin[{] local_variable[type[List], keylist] if[binary_operation[member[.keep], !=, literal[null]]] begin[{] ForStatement(body=IfStatement(condition=BinaryOperation(operandl=MemberReference(member=k, 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=[MemberReference(member=k, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=keylist, selectors=[], type_arguments=None), label=None)), control=EnhancedForControl(iterable=MemberReference(member=keep, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=k)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Key, sub_type=None))), label=None) else begin[{] None end[}] local_variable[type[Object], arrkeep] call[Arrays.sort, parameter[member[.arrkeep]]] local_variable[type[Stack], keys] if[binary_operation[call[keys.size, parameter[]], >, literal[0]]] begin[{] local_variable[type[Futures], fs] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=arrkeep, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=binarySearch, postfix_operators=[], prefix_operators=[], qualifier=Arrays, selectors=[], type_arguments=None), name=found)], modifiers=set(), type=BasicType(dimensions=[], name=int)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=arrkeep, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator===), operandr=BinaryOperation(operandl=MemberReference(member=found, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=<), operator=||), operandr=BinaryOperation(operandl=MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operator=&&), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=fs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=remove, postfix_operators=[], prefix_operators=[], qualifier=Keyed, selectors=[], type_arguments=None), label=None))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=pop, postfix_operators=[], prefix_operators=[], qualifier=keys, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=key)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Key, sub_type=None))), label=None) call[fs.blockForPending, parameter[]] else begin[{] None end[}] return[member[.keep]] end[}] END[}]
Keyword[static] Keyword[public] identifier[Key] operator[SEP] operator[SEP] identifier[exit] operator[SEP] identifier[Key] operator[...] identifier[keep] operator[SEP] { identifier[List] operator[<] identifier[Key] operator[>] identifier[keylist] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[keep] operator[!=] Other[null] operator[SEP] Keyword[for] operator[SEP] identifier[Key] identifier[k] operator[:] identifier[keep] operator[SEP] Keyword[if] operator[SEP] identifier[k] operator[!=] Other[null] operator[SEP] identifier[keylist] operator[SEP] identifier[add] operator[SEP] identifier[k] operator[SEP] operator[SEP] identifier[Object] operator[SEP] operator[SEP] identifier[arrkeep] operator[=] identifier[keylist] operator[SEP] identifier[toArray] operator[SEP] operator[SEP] operator[SEP] identifier[Arrays] operator[SEP] identifier[sort] operator[SEP] identifier[arrkeep] operator[SEP] operator[SEP] identifier[Stack] operator[<] identifier[HashSet] operator[<] identifier[Key] operator[>] operator[>] identifier[keys] operator[=] identifier[_scope] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[_keys] operator[SEP] Keyword[if] operator[SEP] identifier[keys] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] { identifier[Futures] identifier[fs] operator[=] Keyword[new] identifier[Futures] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Key] identifier[key] operator[:] identifier[keys] operator[SEP] identifier[pop] operator[SEP] operator[SEP] operator[SEP] { Keyword[int] identifier[found] operator[=] identifier[Arrays] operator[SEP] identifier[binarySearch] operator[SEP] identifier[arrkeep] , identifier[key] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[SEP] identifier[arrkeep] operator[SEP] identifier[length] operator[==] Other[0] operator[||] identifier[found] operator[<] Other[0] operator[SEP] operator[&&] identifier[key] operator[!=] Other[null] operator[SEP] identifier[Keyed] operator[SEP] identifier[remove] operator[SEP] identifier[key] , identifier[fs] operator[SEP] operator[SEP] } identifier[fs] operator[SEP] identifier[blockForPending] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[keep] operator[SEP] }
protected String htmlComponent(CmsSetupComponent component) { StringBuffer html = new StringBuffer(256); html.append("\t<tr>\n"); html.append("\t\t<td>\n"); html.append("\t\t\t<input type='checkbox' name='availableComponents' value='"); html.append(component.getId()); html.append("'"); if (component.isChecked()) { html.append(" checked='checked'"); } html.append(" onClick=\"checkComponentDependencies('"); html.append(component.getId()); html.append("');\">\n"); html.append("\t\t</td>\n"); html.append("\t\t<td style='width: 100%; '>\n\t\t\t"); html.append(component.getName()); html.append("\n\t\t</td>\n"); html.append("\t</tr>\n"); html.append("\t<tr>\n"); html.append("\t\t<td>&nbsp;</td>\n"); html.append( "\t\t<td style='vertical-align: top; width: 100%; padding-bottom: 8px; font-style: italic;'>\n\t\t\t"); html.append(component.getDescription()); html.append("\n\t\t</td>\n"); html.append("\t</tr>\n"); return html.toString(); }
class class_name[name] begin[{] method[htmlComponent, return_type[type[String]], modifier[protected], parameter[component]] begin[{] local_variable[type[StringBuffer], html] call[html.append, parameter[literal["\t<tr>\n"]]] call[html.append, parameter[literal["\t\t<td>\n"]]] call[html.append, parameter[literal["\t\t\t<input type='checkbox' name='availableComponents' value='"]]] call[html.append, parameter[call[component.getId, parameter[]]]] call[html.append, parameter[literal["'"]]] if[call[component.isChecked, parameter[]]] begin[{] call[html.append, parameter[literal[" checked='checked'"]]] else begin[{] None end[}] call[html.append, parameter[literal[" onClick=\"checkComponentDependencies('"]]] call[html.append, parameter[call[component.getId, parameter[]]]] call[html.append, parameter[literal["');\">\n"]]] call[html.append, parameter[literal["\t\t</td>\n"]]] call[html.append, parameter[literal["\t\t<td style='width: 100%; '>\n\t\t\t"]]] call[html.append, parameter[call[component.getName, parameter[]]]] call[html.append, parameter[literal["\n\t\t</td>\n"]]] call[html.append, parameter[literal["\t</tr>\n"]]] call[html.append, parameter[literal["\t<tr>\n"]]] call[html.append, parameter[literal["\t\t<td>&nbsp;</td>\n"]]] call[html.append, parameter[literal["\t\t<td style='vertical-align: top; width: 100%; padding-bottom: 8px; font-style: italic;'>\n\t\t\t"]]] call[html.append, parameter[call[component.getDescription, parameter[]]]] call[html.append, parameter[literal["\n\t\t</td>\n"]]] call[html.append, parameter[literal["\t</tr>\n"]]] return[call[html.toString, parameter[]]] end[}] END[}]
Keyword[protected] identifier[String] identifier[htmlComponent] operator[SEP] identifier[CmsSetupComponent] identifier[component] operator[SEP] { identifier[StringBuffer] identifier[html] operator[=] Keyword[new] identifier[StringBuffer] operator[SEP] Other[256] operator[SEP] operator[SEP] identifier[html] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[html] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[html] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[html] operator[SEP] identifier[append] operator[SEP] identifier[component] operator[SEP] identifier[getId] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[html] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[component] operator[SEP] identifier[isChecked] operator[SEP] operator[SEP] operator[SEP] { identifier[html] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] } identifier[html] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[html] operator[SEP] identifier[append] operator[SEP] identifier[component] operator[SEP] identifier[getId] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[html] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[html] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[html] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[html] operator[SEP] identifier[append] operator[SEP] identifier[component] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[html] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[html] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[html] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[html] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[html] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[html] operator[SEP] identifier[append] operator[SEP] identifier[component] operator[SEP] identifier[getDescription] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[html] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[html] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[html] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] }
protected Class<?> findTagClass (String tag, ClassLoader classLoader) throws ClassNotFoundException { return Class.forName(tag, true, classLoader); }
class class_name[name] begin[{] method[findTagClass, return_type[type[Class]], modifier[protected], parameter[tag, classLoader]] begin[{] return[call[Class.forName, parameter[member[.tag], literal[true], member[.classLoader]]]] end[}] END[}]
Keyword[protected] identifier[Class] operator[<] operator[?] operator[>] identifier[findTagClass] operator[SEP] identifier[String] identifier[tag] , identifier[ClassLoader] identifier[classLoader] operator[SEP] Keyword[throws] identifier[ClassNotFoundException] { Keyword[return] identifier[Class] operator[SEP] identifier[forName] operator[SEP] identifier[tag] , literal[boolean] , identifier[classLoader] operator[SEP] operator[SEP] }
protected String getResourceBase() { if (useEmbeddedWebroot) { // option final String path = WEBROOT_RESOURCE_PATH; final URL webroot = getClass().getResource(path); if (webroot == null) { throw new IllegalStateException("Not found the webroot resource: path=" + path); } try { return webroot.toURI().toASCIIString(); } catch (URISyntaxException e) { throw new IllegalStateException("Illegal URL: " + webroot, e); } } else { // default is here return deriveWebappDir().getPath(); } }
class class_name[name] begin[{] method[getResourceBase, return_type[type[String]], modifier[protected], parameter[]] begin[{] if[member[.useEmbeddedWebroot]] begin[{] local_variable[type[String], path] local_variable[type[URL], webroot] if[binary_operation[member[.webroot], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Not found the webroot resource: path="), operandr=MemberReference(member=path, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalStateException, sub_type=None)), label=None) else begin[{] None end[}] TryStatement(block=[ReturnStatement(expression=MethodInvocation(arguments=[], member=toURI, postfix_operators=[], prefix_operators=[], qualifier=webroot, selectors=[MethodInvocation(arguments=[], member=toASCIIString, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Illegal URL: "), operandr=MemberReference(member=webroot, 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=IllegalStateException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['URISyntaxException']))], finally_block=None, label=None, resources=None) else begin[{] return[call[.deriveWebappDir, parameter[]]] end[}] end[}] END[}]
Keyword[protected] identifier[String] identifier[getResourceBase] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[useEmbeddedWebroot] operator[SEP] { Keyword[final] identifier[String] identifier[path] operator[=] identifier[WEBROOT_RESOURCE_PATH] operator[SEP] Keyword[final] identifier[URL] identifier[webroot] operator[=] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] identifier[getResource] operator[SEP] identifier[path] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[webroot] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] literal[String] operator[+] identifier[path] operator[SEP] operator[SEP] } Keyword[try] { Keyword[return] identifier[webroot] operator[SEP] identifier[toURI] operator[SEP] operator[SEP] operator[SEP] identifier[toASCIIString] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[URISyntaxException] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] literal[String] operator[+] identifier[webroot] , identifier[e] operator[SEP] operator[SEP] } } Keyword[else] { Keyword[return] identifier[deriveWebappDir] operator[SEP] operator[SEP] operator[SEP] identifier[getPath] operator[SEP] operator[SEP] operator[SEP] } }
private void setBar( final double VALUE ) { currentValueAngle = Helper.clamp(90.0, 270.0, ( VALUE - minValue ) * angleStep + 90.0); double smallHeight = 0.675 * height; double tinyHeight = 0.3 * height; double currentValueSin = Math.sin(-Math.toRadians(currentValueAngle)); double currentValueCos = Math.cos(-Math.toRadians(currentValueAngle)); dataBarOuterArc.setX(centerX + smallHeight * currentValueSin); dataBarOuterArc.setY(centerX + smallHeight * currentValueCos); dataBarLineToInnerArc.setX(centerX + tinyHeight * currentValueSin); dataBarLineToInnerArc.setY(centerX + tinyHeight * currentValueCos); if (gauge.isStartFromZero()) { double min = gauge.getMinValue(); double max = gauge.getMaxValue(); if ( ( VALUE > min || min < 0 ) && ( VALUE < max || max > 0 ) ) { if ( max < 0 ) { dataBarStart.setX(centerX + smallHeight); dataBarStart.setY(smallHeight); dataBarOuterArc.setSweepFlag(false); dataBarInnerArc.setX(centerX + tinyHeight); dataBarInnerArc.setY(smallHeight); dataBarInnerArc.setSweepFlag(true); } else if ( min > 0 ) { dataBarStart.setX(0); dataBarStart.setY(smallHeight); dataBarOuterArc.setSweepFlag(true); dataBarInnerArc.setX(0.27778 * width); dataBarInnerArc.setY(smallHeight); dataBarInnerArc.setSweepFlag(false); } else { double zeroAngle = Helper.clamp(90.0, 270.0, 90.0 - minValue * angleStep); double zeroSin = Math.sin(-Math.toRadians(zeroAngle)); double zeroCos = Math.cos(-Math.toRadians(zeroAngle)); dataBarStart.setX(centerX + smallHeight * zeroSin); dataBarStart.setY(centerX + smallHeight * zeroCos); dataBarInnerArc.setX(centerX + tinyHeight * zeroSin); dataBarInnerArc.setY(centerX + tinyHeight * zeroCos); if ( VALUE < 0 ) { dataBarOuterArc.setSweepFlag(false); dataBarInnerArc.setSweepFlag(true); } else { dataBarOuterArc.setSweepFlag(true); dataBarInnerArc.setSweepFlag(false); } } } } else { dataBarStart.setX(0); dataBarStart.setY(smallHeight); dataBarOuterArc.setSweepFlag(true); dataBarInnerArc.setX(0.27778 * width); dataBarInnerArc.setY(smallHeight); dataBarInnerArc.setSweepFlag(false); } setBarColor(VALUE); valueText.setText(formatNumber(gauge.getLocale(), gauge.getFormatString(), gauge.getDecimals(), VALUE)); if ( valueText.getLayoutBounds().getWidth() > 0.28 * width ) { Helper.adjustTextSize(valueText, 0.28 * width, size * 0.24); } valueText.relocate(( width - valueText.getLayoutBounds().getWidth() ) * 0.5, 0.615 * height + ( 0.3 * height - valueText.getLayoutBounds().getHeight() ) * 0.5); }
class class_name[name] begin[{] method[setBar, return_type[void], modifier[private], parameter[VALUE]] begin[{] assign[member[.currentValueAngle], call[Helper.clamp, parameter[literal[90.0], literal[270.0], binary_operation[binary_operation[binary_operation[member[.VALUE], -, member[.minValue]], *, member[.angleStep]], +, literal[90.0]]]]] local_variable[type[double], smallHeight] local_variable[type[double], tinyHeight] local_variable[type[double], currentValueSin] local_variable[type[double], currentValueCos] call[dataBarOuterArc.setX, parameter[binary_operation[member[.centerX], +, binary_operation[member[.smallHeight], *, member[.currentValueSin]]]]] call[dataBarOuterArc.setY, parameter[binary_operation[member[.centerX], +, binary_operation[member[.smallHeight], *, member[.currentValueCos]]]]] call[dataBarLineToInnerArc.setX, parameter[binary_operation[member[.centerX], +, binary_operation[member[.tinyHeight], *, member[.currentValueSin]]]]] call[dataBarLineToInnerArc.setY, parameter[binary_operation[member[.centerX], +, binary_operation[member[.tinyHeight], *, member[.currentValueCos]]]]] if[call[gauge.isStartFromZero, parameter[]]] begin[{] local_variable[type[double], min] local_variable[type[double], max] if[binary_operation[binary_operation[binary_operation[member[.VALUE], >, member[.min]], ||, binary_operation[member[.min], <, literal[0]]], &&, binary_operation[binary_operation[member[.VALUE], <, member[.max]], ||, binary_operation[member[.max], >, literal[0]]]]] begin[{] if[binary_operation[member[.max], <, literal[0]]] begin[{] call[dataBarStart.setX, parameter[binary_operation[member[.centerX], +, member[.smallHeight]]]] call[dataBarStart.setY, parameter[member[.smallHeight]]] call[dataBarOuterArc.setSweepFlag, parameter[literal[false]]] call[dataBarInnerArc.setX, parameter[binary_operation[member[.centerX], +, member[.tinyHeight]]]] call[dataBarInnerArc.setY, parameter[member[.smallHeight]]] call[dataBarInnerArc.setSweepFlag, parameter[literal[true]]] else begin[{] if[binary_operation[member[.min], >, literal[0]]] begin[{] call[dataBarStart.setX, parameter[literal[0]]] call[dataBarStart.setY, parameter[member[.smallHeight]]] call[dataBarOuterArc.setSweepFlag, parameter[literal[true]]] call[dataBarInnerArc.setX, parameter[binary_operation[literal[0.27778], *, member[.width]]]] call[dataBarInnerArc.setY, parameter[member[.smallHeight]]] call[dataBarInnerArc.setSweepFlag, parameter[literal[false]]] else begin[{] local_variable[type[double], zeroAngle] local_variable[type[double], zeroSin] local_variable[type[double], zeroCos] call[dataBarStart.setX, parameter[binary_operation[member[.centerX], +, binary_operation[member[.smallHeight], *, member[.zeroSin]]]]] call[dataBarStart.setY, parameter[binary_operation[member[.centerX], +, binary_operation[member[.smallHeight], *, member[.zeroCos]]]]] call[dataBarInnerArc.setX, parameter[binary_operation[member[.centerX], +, binary_operation[member[.tinyHeight], *, member[.zeroSin]]]]] call[dataBarInnerArc.setY, parameter[binary_operation[member[.centerX], +, binary_operation[member[.tinyHeight], *, member[.zeroCos]]]]] if[binary_operation[member[.VALUE], <, literal[0]]] begin[{] call[dataBarOuterArc.setSweepFlag, parameter[literal[false]]] call[dataBarInnerArc.setSweepFlag, parameter[literal[true]]] else begin[{] call[dataBarOuterArc.setSweepFlag, parameter[literal[true]]] call[dataBarInnerArc.setSweepFlag, parameter[literal[false]]] end[}] end[}] end[}] else begin[{] None end[}] else begin[{] call[dataBarStart.setX, parameter[literal[0]]] call[dataBarStart.setY, parameter[member[.smallHeight]]] call[dataBarOuterArc.setSweepFlag, parameter[literal[true]]] call[dataBarInnerArc.setX, parameter[binary_operation[literal[0.27778], *, member[.width]]]] call[dataBarInnerArc.setY, parameter[member[.smallHeight]]] call[dataBarInnerArc.setSweepFlag, parameter[literal[false]]] end[}] call[.setBarColor, parameter[member[.VALUE]]] call[valueText.setText, parameter[call[.formatNumber, parameter[call[gauge.getLocale, parameter[]], call[gauge.getFormatString, parameter[]], call[gauge.getDecimals, parameter[]], member[.VALUE]]]]] if[binary_operation[call[valueText.getLayoutBounds, parameter[]], >, binary_operation[literal[0.28], *, member[.width]]]] begin[{] call[Helper.adjustTextSize, parameter[member[.valueText], binary_operation[literal[0.28], *, member[.width]], binary_operation[member[.size], *, literal[0.24]]]] else begin[{] None end[}] call[valueText.relocate, parameter[binary_operation[binary_operation[member[.width], -, call[valueText.getLayoutBounds, parameter[]]], *, literal[0.5]], binary_operation[binary_operation[literal[0.615], *, member[.height]], +, binary_operation[binary_operation[binary_operation[literal[0.3], *, member[.height]], -, call[valueText.getLayoutBounds, parameter[]]], *, literal[0.5]]]]] end[}] END[}]
Keyword[private] Keyword[void] identifier[setBar] operator[SEP] Keyword[final] Keyword[double] identifier[VALUE] operator[SEP] { identifier[currentValueAngle] operator[=] identifier[Helper] operator[SEP] identifier[clamp] operator[SEP] literal[Float] , literal[Float] , operator[SEP] identifier[VALUE] operator[-] identifier[minValue] operator[SEP] operator[*] identifier[angleStep] operator[+] literal[Float] operator[SEP] operator[SEP] Keyword[double] identifier[smallHeight] operator[=] literal[Float] operator[*] identifier[height] operator[SEP] Keyword[double] identifier[tinyHeight] operator[=] literal[Float] operator[*] identifier[height] operator[SEP] Keyword[double] identifier[currentValueSin] operator[=] identifier[Math] operator[SEP] identifier[sin] operator[SEP] operator[-] identifier[Math] operator[SEP] identifier[toRadians] operator[SEP] identifier[currentValueAngle] operator[SEP] operator[SEP] operator[SEP] Keyword[double] identifier[currentValueCos] operator[=] identifier[Math] operator[SEP] identifier[cos] operator[SEP] operator[-] identifier[Math] operator[SEP] identifier[toRadians] operator[SEP] identifier[currentValueAngle] operator[SEP] operator[SEP] operator[SEP] identifier[dataBarOuterArc] operator[SEP] identifier[setX] operator[SEP] identifier[centerX] operator[+] identifier[smallHeight] operator[*] identifier[currentValueSin] operator[SEP] operator[SEP] identifier[dataBarOuterArc] operator[SEP] identifier[setY] operator[SEP] identifier[centerX] operator[+] identifier[smallHeight] operator[*] identifier[currentValueCos] operator[SEP] operator[SEP] identifier[dataBarLineToInnerArc] operator[SEP] identifier[setX] operator[SEP] identifier[centerX] operator[+] identifier[tinyHeight] operator[*] identifier[currentValueSin] operator[SEP] operator[SEP] identifier[dataBarLineToInnerArc] operator[SEP] identifier[setY] operator[SEP] identifier[centerX] operator[+] identifier[tinyHeight] operator[*] identifier[currentValueCos] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[gauge] operator[SEP] identifier[isStartFromZero] operator[SEP] operator[SEP] operator[SEP] { Keyword[double] identifier[min] operator[=] identifier[gauge] operator[SEP] identifier[getMinValue] operator[SEP] operator[SEP] operator[SEP] Keyword[double] identifier[max] operator[=] identifier[gauge] operator[SEP] identifier[getMaxValue] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[SEP] identifier[VALUE] operator[>] identifier[min] operator[||] identifier[min] operator[<] Other[0] operator[SEP] operator[&&] operator[SEP] identifier[VALUE] operator[<] identifier[max] operator[||] identifier[max] operator[>] Other[0] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[max] operator[<] Other[0] operator[SEP] { identifier[dataBarStart] operator[SEP] identifier[setX] operator[SEP] identifier[centerX] operator[+] identifier[smallHeight] operator[SEP] operator[SEP] identifier[dataBarStart] operator[SEP] identifier[setY] operator[SEP] identifier[smallHeight] operator[SEP] operator[SEP] identifier[dataBarOuterArc] operator[SEP] identifier[setSweepFlag] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[dataBarInnerArc] operator[SEP] identifier[setX] operator[SEP] identifier[centerX] operator[+] identifier[tinyHeight] operator[SEP] operator[SEP] identifier[dataBarInnerArc] operator[SEP] identifier[setY] operator[SEP] identifier[smallHeight] operator[SEP] operator[SEP] identifier[dataBarInnerArc] operator[SEP] identifier[setSweepFlag] operator[SEP] literal[boolean] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[min] operator[>] Other[0] operator[SEP] { identifier[dataBarStart] operator[SEP] identifier[setX] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[dataBarStart] operator[SEP] identifier[setY] operator[SEP] identifier[smallHeight] operator[SEP] operator[SEP] identifier[dataBarOuterArc] operator[SEP] identifier[setSweepFlag] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[dataBarInnerArc] operator[SEP] identifier[setX] operator[SEP] literal[Float] operator[*] identifier[width] operator[SEP] operator[SEP] identifier[dataBarInnerArc] operator[SEP] identifier[setY] operator[SEP] identifier[smallHeight] operator[SEP] operator[SEP] identifier[dataBarInnerArc] operator[SEP] identifier[setSweepFlag] operator[SEP] literal[boolean] operator[SEP] operator[SEP] } Keyword[else] { Keyword[double] identifier[zeroAngle] operator[=] identifier[Helper] operator[SEP] identifier[clamp] operator[SEP] literal[Float] , literal[Float] , literal[Float] operator[-] identifier[minValue] operator[*] identifier[angleStep] operator[SEP] operator[SEP] Keyword[double] identifier[zeroSin] operator[=] identifier[Math] operator[SEP] identifier[sin] operator[SEP] operator[-] identifier[Math] operator[SEP] identifier[toRadians] operator[SEP] identifier[zeroAngle] operator[SEP] operator[SEP] operator[SEP] Keyword[double] identifier[zeroCos] operator[=] identifier[Math] operator[SEP] identifier[cos] operator[SEP] operator[-] identifier[Math] operator[SEP] identifier[toRadians] operator[SEP] identifier[zeroAngle] operator[SEP] operator[SEP] operator[SEP] identifier[dataBarStart] operator[SEP] identifier[setX] operator[SEP] identifier[centerX] operator[+] identifier[smallHeight] operator[*] identifier[zeroSin] operator[SEP] operator[SEP] identifier[dataBarStart] operator[SEP] identifier[setY] operator[SEP] identifier[centerX] operator[+] identifier[smallHeight] operator[*] identifier[zeroCos] operator[SEP] operator[SEP] identifier[dataBarInnerArc] operator[SEP] identifier[setX] operator[SEP] identifier[centerX] operator[+] identifier[tinyHeight] operator[*] identifier[zeroSin] operator[SEP] operator[SEP] identifier[dataBarInnerArc] operator[SEP] identifier[setY] operator[SEP] identifier[centerX] operator[+] identifier[tinyHeight] operator[*] identifier[zeroCos] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[VALUE] operator[<] Other[0] operator[SEP] { identifier[dataBarOuterArc] operator[SEP] identifier[setSweepFlag] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[dataBarInnerArc] operator[SEP] identifier[setSweepFlag] operator[SEP] literal[boolean] operator[SEP] operator[SEP] } Keyword[else] { identifier[dataBarOuterArc] operator[SEP] identifier[setSweepFlag] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[dataBarInnerArc] operator[SEP] identifier[setSweepFlag] operator[SEP] literal[boolean] operator[SEP] operator[SEP] } } } } Keyword[else] { identifier[dataBarStart] operator[SEP] identifier[setX] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[dataBarStart] operator[SEP] identifier[setY] operator[SEP] identifier[smallHeight] operator[SEP] operator[SEP] identifier[dataBarOuterArc] operator[SEP] identifier[setSweepFlag] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[dataBarInnerArc] operator[SEP] identifier[setX] operator[SEP] literal[Float] operator[*] identifier[width] operator[SEP] operator[SEP] identifier[dataBarInnerArc] operator[SEP] identifier[setY] operator[SEP] identifier[smallHeight] operator[SEP] operator[SEP] identifier[dataBarInnerArc] operator[SEP] identifier[setSweepFlag] operator[SEP] literal[boolean] operator[SEP] operator[SEP] } identifier[setBarColor] operator[SEP] identifier[VALUE] operator[SEP] operator[SEP] identifier[valueText] operator[SEP] identifier[setText] operator[SEP] identifier[formatNumber] operator[SEP] identifier[gauge] operator[SEP] identifier[getLocale] operator[SEP] operator[SEP] , identifier[gauge] operator[SEP] identifier[getFormatString] operator[SEP] operator[SEP] , identifier[gauge] operator[SEP] identifier[getDecimals] operator[SEP] operator[SEP] , identifier[VALUE] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[valueText] operator[SEP] identifier[getLayoutBounds] operator[SEP] operator[SEP] operator[SEP] identifier[getWidth] operator[SEP] operator[SEP] operator[>] literal[Float] operator[*] identifier[width] operator[SEP] { identifier[Helper] operator[SEP] identifier[adjustTextSize] operator[SEP] identifier[valueText] , literal[Float] operator[*] identifier[width] , identifier[size] operator[*] literal[Float] operator[SEP] operator[SEP] } identifier[valueText] operator[SEP] identifier[relocate] operator[SEP] operator[SEP] identifier[width] operator[-] identifier[valueText] operator[SEP] identifier[getLayoutBounds] operator[SEP] operator[SEP] operator[SEP] identifier[getWidth] operator[SEP] operator[SEP] operator[SEP] operator[*] literal[Float] , literal[Float] operator[*] identifier[height] operator[+] operator[SEP] literal[Float] operator[*] identifier[height] operator[-] identifier[valueText] operator[SEP] identifier[getLayoutBounds] operator[SEP] operator[SEP] operator[SEP] identifier[getHeight] operator[SEP] operator[SEP] operator[SEP] operator[*] literal[Float] operator[SEP] operator[SEP] }
public void debug(String message, Map<String, Object> custom) { debug(null, custom, message); }
class class_name[name] begin[{] method[debug, return_type[void], modifier[public], parameter[message, custom]] begin[{] call[.debug, parameter[literal[null], member[.custom], member[.message]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[debug] operator[SEP] identifier[String] identifier[message] , identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] identifier[custom] operator[SEP] { identifier[debug] operator[SEP] Other[null] , identifier[custom] , identifier[message] operator[SEP] operator[SEP] }
protected List<PropertyData> getCachedCleanChildPropertiesData(NodeData nodeData) { if (cache.isEnabled()) { List<PropertyData> childProperties = cache.getChildProperties(nodeData); if (childProperties != null) { boolean skip = false; for (PropertyData prop : childProperties) { if (prop != null && !(prop instanceof NullPropertyData) && forceLoad(prop)) { cache.remove(prop.getIdentifier(), prop); skip = true; } } if (!skip) { return childProperties; } } } return null; }
class class_name[name] begin[{] method[getCachedCleanChildPropertiesData, return_type[type[List]], modifier[protected], parameter[nodeData]] begin[{] if[call[cache.isEnabled, parameter[]]] begin[{] local_variable[type[List], childProperties] if[binary_operation[member[.childProperties], !=, literal[null]]] begin[{] local_variable[type[boolean], skip] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=prop, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operandr=BinaryOperation(operandl=MemberReference(member=prop, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=NullPropertyData, sub_type=None), operator=instanceof), operator=&&), operandr=MethodInvocation(arguments=[MemberReference(member=prop, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=forceLoad, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getIdentifier, postfix_operators=[], prefix_operators=[], qualifier=prop, selectors=[], type_arguments=None), MemberReference(member=prop, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=remove, postfix_operators=[], prefix_operators=[], qualifier=cache, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=skip, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=childProperties, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=prop)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=PropertyData, sub_type=None))), label=None) if[member[.skip]] begin[{] return[member[.childProperties]] else begin[{] None end[}] else begin[{] None end[}] else begin[{] None end[}] return[literal[null]] end[}] END[}]
Keyword[protected] identifier[List] operator[<] identifier[PropertyData] operator[>] identifier[getCachedCleanChildPropertiesData] operator[SEP] identifier[NodeData] identifier[nodeData] operator[SEP] { Keyword[if] operator[SEP] identifier[cache] operator[SEP] identifier[isEnabled] operator[SEP] operator[SEP] operator[SEP] { identifier[List] operator[<] identifier[PropertyData] operator[>] identifier[childProperties] operator[=] identifier[cache] operator[SEP] identifier[getChildProperties] operator[SEP] identifier[nodeData] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[childProperties] operator[!=] Other[null] operator[SEP] { Keyword[boolean] identifier[skip] operator[=] literal[boolean] operator[SEP] Keyword[for] operator[SEP] identifier[PropertyData] identifier[prop] operator[:] identifier[childProperties] operator[SEP] { Keyword[if] operator[SEP] identifier[prop] operator[!=] Other[null] operator[&&] operator[!] operator[SEP] identifier[prop] Keyword[instanceof] identifier[NullPropertyData] operator[SEP] operator[&&] identifier[forceLoad] operator[SEP] identifier[prop] operator[SEP] operator[SEP] { identifier[cache] operator[SEP] identifier[remove] operator[SEP] identifier[prop] operator[SEP] identifier[getIdentifier] operator[SEP] operator[SEP] , identifier[prop] operator[SEP] operator[SEP] identifier[skip] operator[=] literal[boolean] operator[SEP] } } Keyword[if] operator[SEP] operator[!] identifier[skip] operator[SEP] { Keyword[return] identifier[childProperties] operator[SEP] } } } Keyword[return] Other[null] operator[SEP] }
public static <T extends AVUser> AVQuery<T> getUserQuery(Class<T> clazz) { return new AVQuery<T>(CLASS_NAME, clazz); }
class class_name[name] begin[{] method[getUserQuery, return_type[type[AVQuery]], modifier[public static], parameter[clazz]] begin[{] return[ClassCreator(arguments=[MemberReference(member=CLASS_NAME, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=clazz, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None))], dimensions=None, name=AVQuery, sub_type=None))] end[}] END[}]
Keyword[public] Keyword[static] operator[<] identifier[T] Keyword[extends] identifier[AVUser] operator[>] identifier[AVQuery] operator[<] identifier[T] operator[>] identifier[getUserQuery] operator[SEP] identifier[Class] operator[<] identifier[T] operator[>] identifier[clazz] operator[SEP] { Keyword[return] Keyword[new] identifier[AVQuery] operator[<] identifier[T] operator[>] operator[SEP] identifier[CLASS_NAME] , identifier[clazz] operator[SEP] operator[SEP] }
@Override public double doubleValue() { @SuppressWarnings("cast") double dValue = (double) (value & UNSIGNED_MASK); if (value < 0) { dValue += 0x1.0p63; } return dValue; }
class class_name[name] begin[{] method[doubleValue, return_type[type[double]], modifier[public], parameter[]] begin[{] local_variable[type[double], dValue] if[binary_operation[member[.value], <, literal[0]]] begin[{] assign[member[.dValue], literal[0x1.0p63]] else begin[{] None end[}] return[member[.dValue]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[double] identifier[doubleValue] operator[SEP] operator[SEP] { annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] Keyword[double] identifier[dValue] operator[=] operator[SEP] Keyword[double] operator[SEP] operator[SEP] identifier[value] operator[&] identifier[UNSIGNED_MASK] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[value] operator[<] Other[0] operator[SEP] { identifier[dValue] operator[+=] literal[Float] operator[SEP] } Keyword[return] identifier[dValue] operator[SEP] }
@Override public DeleteVpnConnectionResult deleteVpnConnection(DeleteVpnConnectionRequest request) { request = beforeClientExecution(request); return executeDeleteVpnConnection(request); }
class class_name[name] begin[{] method[deleteVpnConnection, return_type[type[DeleteVpnConnectionResult]], modifier[public], parameter[request]] begin[{] assign[member[.request], call[.beforeClientExecution, parameter[member[.request]]]] return[call[.executeDeleteVpnConnection, parameter[member[.request]]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[DeleteVpnConnectionResult] identifier[deleteVpnConnection] operator[SEP] identifier[DeleteVpnConnectionRequest] identifier[request] operator[SEP] { identifier[request] operator[=] identifier[beforeClientExecution] operator[SEP] identifier[request] operator[SEP] operator[SEP] Keyword[return] identifier[executeDeleteVpnConnection] operator[SEP] identifier[request] operator[SEP] operator[SEP] }
public void beginDelete(String resourceGroupName, String topicName) { beginDeleteWithServiceResponseAsync(resourceGroupName, topicName).toBlocking().single().body(); }
class class_name[name] begin[{] method[beginDelete, return_type[void], modifier[public], parameter[resourceGroupName, topicName]] begin[{] call[.beginDeleteWithServiceResponseAsync, parameter[member[.resourceGroupName], member[.topicName]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[beginDelete] operator[SEP] identifier[String] identifier[resourceGroupName] , identifier[String] identifier[topicName] operator[SEP] { identifier[beginDeleteWithServiceResponseAsync] operator[SEP] identifier[resourceGroupName] , identifier[topicName] operator[SEP] operator[SEP] identifier[toBlocking] operator[SEP] operator[SEP] operator[SEP] identifier[single] operator[SEP] operator[SEP] operator[SEP] identifier[body] operator[SEP] operator[SEP] operator[SEP] }
public Request searchAsync(@Nullable Query query, @Nullable CompletionHandler completionHandler) { return searchAsync(query, /* requestOptions: */ null, completionHandler); }
class class_name[name] begin[{] method[searchAsync, return_type[type[Request]], modifier[public], parameter[query, completionHandler]] begin[{] return[call[.searchAsync, parameter[member[.query], literal[null], member[.completionHandler]]]] end[}] END[}]
Keyword[public] identifier[Request] identifier[searchAsync] operator[SEP] annotation[@] identifier[Nullable] identifier[Query] identifier[query] , annotation[@] identifier[Nullable] identifier[CompletionHandler] identifier[completionHandler] operator[SEP] { Keyword[return] identifier[searchAsync] operator[SEP] identifier[query] , Other[null] , identifier[completionHandler] operator[SEP] operator[SEP] }
public void preInitGraphs(Map<String, byte[]> newSmallGraphs, Map<String, byte[]> newSmallOtherGraphs, Map<String, byte[]> newLargeGraphs) { pdfCoreReport.preInitGraphs(newSmallGraphs, newSmallOtherGraphs, newLargeGraphs); }
class class_name[name] begin[{] method[preInitGraphs, return_type[void], modifier[public], parameter[newSmallGraphs, newSmallOtherGraphs, newLargeGraphs]] begin[{] call[pdfCoreReport.preInitGraphs, parameter[member[.newSmallGraphs], member[.newSmallOtherGraphs], member[.newLargeGraphs]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[preInitGraphs] operator[SEP] identifier[Map] operator[<] identifier[String] , Keyword[byte] operator[SEP] operator[SEP] operator[>] identifier[newSmallGraphs] , identifier[Map] operator[<] identifier[String] , Keyword[byte] operator[SEP] operator[SEP] operator[>] identifier[newSmallOtherGraphs] , identifier[Map] operator[<] identifier[String] , Keyword[byte] operator[SEP] operator[SEP] operator[>] identifier[newLargeGraphs] operator[SEP] { identifier[pdfCoreReport] operator[SEP] identifier[preInitGraphs] operator[SEP] identifier[newSmallGraphs] , identifier[newSmallOtherGraphs] , identifier[newLargeGraphs] operator[SEP] operator[SEP] }
public static void fireOnChange(Saveable o, XmlFile file) { for (SaveableListener l : all()) { try { l.onChange(o,file); } catch (ThreadDeath t) { throw t; } catch (Throwable t) { Logger.getLogger(SaveableListener.class.getName()).log(Level.WARNING, null, t); } } }
class class_name[name] begin[{] method[fireOnChange, return_type[void], modifier[public static], parameter[o, file]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=o, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=file, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=onChange, postfix_operators=[], prefix_operators=[], qualifier=l, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=MemberReference(member=t, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=t, types=['ThreadDeath'])), CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[], member=getName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=SaveableListener, sub_type=None))], member=getLogger, postfix_operators=[], prefix_operators=[], qualifier=Logger, selectors=[MethodInvocation(arguments=[MemberReference(member=WARNING, postfix_operators=[], prefix_operators=[], qualifier=Level, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), MemberReference(member=t, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=log, 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=t, types=['Throwable']))], finally_block=None, label=None, resources=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=all, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=l)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=SaveableListener, sub_type=None))), label=None) end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[fireOnChange] operator[SEP] identifier[Saveable] identifier[o] , identifier[XmlFile] identifier[file] operator[SEP] { Keyword[for] operator[SEP] identifier[SaveableListener] identifier[l] operator[:] identifier[all] operator[SEP] operator[SEP] operator[SEP] { Keyword[try] { identifier[l] operator[SEP] identifier[onChange] operator[SEP] identifier[o] , identifier[file] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[ThreadDeath] identifier[t] operator[SEP] { Keyword[throw] identifier[t] operator[SEP] } Keyword[catch] operator[SEP] identifier[Throwable] identifier[t] operator[SEP] { identifier[Logger] operator[SEP] identifier[getLogger] operator[SEP] identifier[SaveableListener] operator[SEP] Keyword[class] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[log] operator[SEP] identifier[Level] operator[SEP] identifier[WARNING] , Other[null] , identifier[t] operator[SEP] operator[SEP] } } }
private MembershipsByUserWrapper findMembershipsByUser(Session session, String userName) throws Exception { Node userNode; try { userNode = utils.getUserNode(session, userName); } catch (PathNotFoundException e) { return new MembershipsByUserWrapper(new ArrayList<Membership>(), new ArrayList<Node>()); } List<Membership> memberships = new ArrayList<Membership>(); List<Node> refUserNodes = new ArrayList<Node>(); PropertyIterator refUserProps = userNode.getReferences(); while (refUserProps.hasNext()) { Node refUserNode = refUserProps.nextProperty().getParent(); Node groupNode = refUserNode.getParent().getParent(); memberships.addAll(findMembershipsByUserAndGroup(session, refUserNode, groupNode)); refUserNodes.add(refUserNode); } return new MembershipsByUserWrapper(memberships, refUserNodes); }
class class_name[name] begin[{] method[findMembershipsByUser, return_type[type[MembershipsByUserWrapper]], modifier[private], parameter[session, userName]] begin[{] local_variable[type[Node], userNode] TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=userNode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=session, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=userName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getUserNode, postfix_operators=[], prefix_operators=[], qualifier=utils, selectors=[], type_arguments=None)), label=None)], catches=[CatchClause(block=[ReturnStatement(expression=ClassCreator(arguments=[ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Membership, sub_type=None))], dimensions=None, name=ArrayList, sub_type=None)), ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Node, sub_type=None))], dimensions=None, name=ArrayList, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=MembershipsByUserWrapper, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['PathNotFoundException']))], finally_block=None, label=None, resources=None) local_variable[type[List], memberships] local_variable[type[List], refUserNodes] local_variable[type[PropertyIterator], refUserProps] while[call[refUserProps.hasNext, parameter[]]] begin[{] local_variable[type[Node], refUserNode] local_variable[type[Node], groupNode] call[memberships.addAll, parameter[call[.findMembershipsByUserAndGroup, parameter[member[.session], member[.refUserNode], member[.groupNode]]]]] call[refUserNodes.add, parameter[member[.refUserNode]]] end[}] return[ClassCreator(arguments=[MemberReference(member=memberships, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=refUserNodes, 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=MembershipsByUserWrapper, sub_type=None))] end[}] END[}]
Keyword[private] identifier[MembershipsByUserWrapper] identifier[findMembershipsByUser] operator[SEP] identifier[Session] identifier[session] , identifier[String] identifier[userName] operator[SEP] Keyword[throws] identifier[Exception] { identifier[Node] identifier[userNode] operator[SEP] Keyword[try] { identifier[userNode] operator[=] identifier[utils] operator[SEP] identifier[getUserNode] operator[SEP] identifier[session] , identifier[userName] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[PathNotFoundException] identifier[e] operator[SEP] { Keyword[return] Keyword[new] identifier[MembershipsByUserWrapper] operator[SEP] Keyword[new] identifier[ArrayList] operator[<] identifier[Membership] operator[>] operator[SEP] operator[SEP] , Keyword[new] identifier[ArrayList] operator[<] identifier[Node] operator[>] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[List] operator[<] identifier[Membership] operator[>] identifier[memberships] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[Membership] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[Node] operator[>] identifier[refUserNodes] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[Node] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[PropertyIterator] identifier[refUserProps] operator[=] identifier[userNode] operator[SEP] identifier[getReferences] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[refUserProps] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] { identifier[Node] identifier[refUserNode] operator[=] identifier[refUserProps] operator[SEP] identifier[nextProperty] operator[SEP] operator[SEP] operator[SEP] identifier[getParent] operator[SEP] operator[SEP] operator[SEP] identifier[Node] identifier[groupNode] operator[=] identifier[refUserNode] operator[SEP] identifier[getParent] operator[SEP] operator[SEP] operator[SEP] identifier[getParent] operator[SEP] operator[SEP] operator[SEP] identifier[memberships] operator[SEP] identifier[addAll] operator[SEP] identifier[findMembershipsByUserAndGroup] operator[SEP] identifier[session] , identifier[refUserNode] , identifier[groupNode] operator[SEP] operator[SEP] operator[SEP] identifier[refUserNodes] operator[SEP] identifier[add] operator[SEP] identifier[refUserNode] operator[SEP] operator[SEP] } Keyword[return] Keyword[new] identifier[MembershipsByUserWrapper] operator[SEP] identifier[memberships] , identifier[refUserNodes] operator[SEP] operator[SEP] }
public static int getBackgroundColor(Context context, AttributeSet attrs) { int color = Color.TRANSPARENT; if (isHaveAttribute(attrs, "background")) { int styleId = attrs.getStyleAttribute(); int[] attributesArray = new int[]{android.R.attr.background}; try { TypedArray typedArray = context.obtainStyledAttributes(styleId, attributesArray); if (typedArray.length() > 0) color = typedArray.getColor(0, color); typedArray.recycle(); } catch (Resources.NotFoundException e) { e.printStackTrace(); } } return color; }
class class_name[name] begin[{] method[getBackgroundColor, return_type[type[int]], modifier[public static], parameter[context, attrs]] begin[{] local_variable[type[int], color] if[call[.isHaveAttribute, parameter[member[.attrs], literal["background"]]]] begin[{] local_variable[type[int], styleId] local_variable[type[int], attributesArray] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=styleId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=attributesArray, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=obtainStyledAttributes, postfix_operators=[], prefix_operators=[], qualifier=context, selectors=[], type_arguments=None), name=typedArray)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=TypedArray, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=typedArray, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>), else_statement=None, label=None, then_statement=StatementExpression(expression=Assignment(expressionl=MemberReference(member=color, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), MemberReference(member=color, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getColor, postfix_operators=[], prefix_operators=[], qualifier=typedArray, selectors=[], type_arguments=None)), label=None)), StatementExpression(expression=MethodInvocation(arguments=[], member=recycle, postfix_operators=[], prefix_operators=[], qualifier=typedArray, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=printStackTrace, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Resources.NotFoundException']))], finally_block=None, label=None, resources=None) else begin[{] None end[}] return[member[.color]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[int] identifier[getBackgroundColor] operator[SEP] identifier[Context] identifier[context] , identifier[AttributeSet] identifier[attrs] operator[SEP] { Keyword[int] identifier[color] operator[=] identifier[Color] operator[SEP] identifier[TRANSPARENT] operator[SEP] Keyword[if] operator[SEP] identifier[isHaveAttribute] operator[SEP] identifier[attrs] , literal[String] operator[SEP] operator[SEP] { Keyword[int] identifier[styleId] operator[=] identifier[attrs] operator[SEP] identifier[getStyleAttribute] operator[SEP] operator[SEP] operator[SEP] Keyword[int] operator[SEP] operator[SEP] identifier[attributesArray] operator[=] Keyword[new] Keyword[int] operator[SEP] operator[SEP] { identifier[android] operator[SEP] identifier[R] operator[SEP] identifier[attr] operator[SEP] identifier[background] } operator[SEP] Keyword[try] { identifier[TypedArray] identifier[typedArray] operator[=] identifier[context] operator[SEP] identifier[obtainStyledAttributes] operator[SEP] identifier[styleId] , identifier[attributesArray] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[typedArray] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] identifier[color] operator[=] identifier[typedArray] operator[SEP] identifier[getColor] operator[SEP] Other[0] , identifier[color] operator[SEP] operator[SEP] identifier[typedArray] operator[SEP] identifier[recycle] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Resources] operator[SEP] identifier[NotFoundException] identifier[e] operator[SEP] { identifier[e] operator[SEP] identifier[printStackTrace] operator[SEP] operator[SEP] operator[SEP] } } Keyword[return] identifier[color] operator[SEP] }
public void setShardAssigner(KinesisShardAssigner shardAssigner) { this.shardAssigner = checkNotNull(shardAssigner, "function can not be null"); ClosureCleaner.clean(shardAssigner, true); }
class class_name[name] begin[{] method[setShardAssigner, return_type[void], modifier[public], parameter[shardAssigner]] begin[{] assign[THIS[member[None.shardAssigner]], call[.checkNotNull, parameter[member[.shardAssigner], literal["function can not be null"]]]] call[ClosureCleaner.clean, parameter[member[.shardAssigner], literal[true]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[setShardAssigner] operator[SEP] identifier[KinesisShardAssigner] identifier[shardAssigner] operator[SEP] { Keyword[this] operator[SEP] identifier[shardAssigner] operator[=] identifier[checkNotNull] operator[SEP] identifier[shardAssigner] , literal[String] operator[SEP] operator[SEP] identifier[ClosureCleaner] operator[SEP] identifier[clean] operator[SEP] identifier[shardAssigner] , literal[boolean] operator[SEP] operator[SEP] }
public final void entryRuleIdOrSuper() throws RecognitionException { try { // InternalXbase.g:1234:1: ( ruleIdOrSuper EOF ) // InternalXbase.g:1235:1: ruleIdOrSuper EOF { if ( state.backtracking==0 ) { before(grammarAccess.getIdOrSuperRule()); } pushFollow(FOLLOW_1); ruleIdOrSuper(); state._fsp--; if (state.failed) return ; if ( state.backtracking==0 ) { after(grammarAccess.getIdOrSuperRule()); } match(input,EOF,FOLLOW_2); if (state.failed) return ; } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { } return ; }
class class_name[name] begin[{] method[entryRuleIdOrSuper, return_type[void], modifier[final public], parameter[]] begin[{] TryStatement(block=[BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=backtracking, postfix_operators=[], prefix_operators=[], qualifier=state, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getIdOrSuperRule, postfix_operators=[], prefix_operators=[], qualifier=grammarAccess, selectors=[], type_arguments=None)], member=before, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=FOLLOW_1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=pushFollow, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=ruleIdOrSuper, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MemberReference(member=_fsp, postfix_operators=['--'], prefix_operators=[], qualifier=state, selectors=[]), label=None), IfStatement(condition=MemberReference(member=failed, postfix_operators=[], prefix_operators=[], qualifier=state, selectors=[]), else_statement=None, label=None, then_statement=ReturnStatement(expression=None, label=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=backtracking, postfix_operators=[], prefix_operators=[], qualifier=state, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getIdOrSuperRule, postfix_operators=[], prefix_operators=[], qualifier=grammarAccess, selectors=[], type_arguments=None)], member=after, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=input, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=EOF, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=FOLLOW_2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=match, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), IfStatement(condition=MemberReference(member=failed, postfix_operators=[], prefix_operators=[], qualifier=state, selectors=[]), else_statement=None, label=None, then_statement=ReturnStatement(expression=None, label=None))])], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=re, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=reportError, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=input, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=re, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=recover, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=re, types=['RecognitionException']))], finally_block=[], label=None, resources=None) return[None] end[}] END[}]
Keyword[public] Keyword[final] Keyword[void] identifier[entryRuleIdOrSuper] operator[SEP] operator[SEP] Keyword[throws] identifier[RecognitionException] { Keyword[try] { { Keyword[if] operator[SEP] identifier[state] operator[SEP] identifier[backtracking] operator[==] Other[0] operator[SEP] { identifier[before] operator[SEP] identifier[grammarAccess] operator[SEP] identifier[getIdOrSuperRule] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[pushFollow] operator[SEP] identifier[FOLLOW_1] operator[SEP] operator[SEP] identifier[ruleIdOrSuper] operator[SEP] operator[SEP] operator[SEP] identifier[state] operator[SEP] identifier[_fsp] operator[--] operator[SEP] Keyword[if] operator[SEP] identifier[state] operator[SEP] identifier[failed] operator[SEP] Keyword[return] operator[SEP] Keyword[if] operator[SEP] identifier[state] operator[SEP] identifier[backtracking] operator[==] Other[0] operator[SEP] { identifier[after] operator[SEP] identifier[grammarAccess] operator[SEP] identifier[getIdOrSuperRule] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[match] operator[SEP] identifier[input] , identifier[EOF] , identifier[FOLLOW_2] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[state] operator[SEP] identifier[failed] operator[SEP] Keyword[return] operator[SEP] } } Keyword[catch] operator[SEP] identifier[RecognitionException] identifier[re] operator[SEP] { identifier[reportError] operator[SEP] identifier[re] operator[SEP] operator[SEP] identifier[recover] operator[SEP] identifier[input] , identifier[re] operator[SEP] operator[SEP] } Keyword[finally] { } Keyword[return] operator[SEP] }
public AnnotationInfo getAnnotationInfo(final String annotationClassName) { for(AnnotationInfo item : annotationInfos) { if(item.getClassName().equals(annotationClassName)) { return item; } } return null; }
class class_name[name] begin[{] method[getAnnotationInfo, return_type[type[AnnotationInfo]], modifier[public], parameter[annotationClassName]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[], member=getClassName, postfix_operators=[], prefix_operators=[], qualifier=item, selectors=[MethodInvocation(arguments=[MemberReference(member=annotationClassName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=MemberReference(member=item, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=annotationInfos, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=item)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=AnnotationInfo, sub_type=None))), label=None) return[literal[null]] end[}] END[}]
Keyword[public] identifier[AnnotationInfo] identifier[getAnnotationInfo] operator[SEP] Keyword[final] identifier[String] identifier[annotationClassName] operator[SEP] { Keyword[for] operator[SEP] identifier[AnnotationInfo] identifier[item] operator[:] identifier[annotationInfos] operator[SEP] { Keyword[if] operator[SEP] identifier[item] operator[SEP] identifier[getClassName] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[annotationClassName] operator[SEP] operator[SEP] { Keyword[return] identifier[item] operator[SEP] } } Keyword[return] Other[null] operator[SEP] }
public void marshall(MeterUsageRequest meterUsageRequest, ProtocolMarshaller protocolMarshaller) { if (meterUsageRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(meterUsageRequest.getProductCode(), PRODUCTCODE_BINDING); protocolMarshaller.marshall(meterUsageRequest.getTimestamp(), TIMESTAMP_BINDING); protocolMarshaller.marshall(meterUsageRequest.getUsageDimension(), USAGEDIMENSION_BINDING); protocolMarshaller.marshall(meterUsageRequest.getUsageQuantity(), USAGEQUANTITY_BINDING); protocolMarshaller.marshall(meterUsageRequest.getDryRun(), DRYRUN_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[meterUsageRequest, protocolMarshaller]] begin[{] if[binary_operation[member[.meterUsageRequest], ==, 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=getProductCode, postfix_operators=[], prefix_operators=[], qualifier=meterUsageRequest, selectors=[], type_arguments=None), MemberReference(member=PRODUCTCODE_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=getTimestamp, postfix_operators=[], prefix_operators=[], qualifier=meterUsageRequest, selectors=[], type_arguments=None), MemberReference(member=TIMESTAMP_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=getUsageDimension, postfix_operators=[], prefix_operators=[], qualifier=meterUsageRequest, selectors=[], type_arguments=None), MemberReference(member=USAGEDIMENSION_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=getUsageQuantity, postfix_operators=[], prefix_operators=[], qualifier=meterUsageRequest, selectors=[], type_arguments=None), MemberReference(member=USAGEQUANTITY_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=getDryRun, postfix_operators=[], prefix_operators=[], qualifier=meterUsageRequest, selectors=[], type_arguments=None), MemberReference(member=DRYRUN_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[MeterUsageRequest] identifier[meterUsageRequest] , identifier[ProtocolMarshaller] identifier[protocolMarshaller] operator[SEP] { Keyword[if] operator[SEP] identifier[meterUsageRequest] 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[meterUsageRequest] operator[SEP] identifier[getProductCode] operator[SEP] operator[SEP] , identifier[PRODUCTCODE_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[meterUsageRequest] operator[SEP] identifier[getTimestamp] operator[SEP] operator[SEP] , identifier[TIMESTAMP_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[meterUsageRequest] operator[SEP] identifier[getUsageDimension] operator[SEP] operator[SEP] , identifier[USAGEDIMENSION_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[meterUsageRequest] operator[SEP] identifier[getUsageQuantity] operator[SEP] operator[SEP] , identifier[USAGEQUANTITY_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[meterUsageRequest] operator[SEP] identifier[getDryRun] operator[SEP] operator[SEP] , identifier[DRYRUN_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 fork(K to, M msg) { if (maxParallelism == 0) { throw new IllegalArgumentException("maxParallelism == 0, fork() not allowed! Use switchTo."); } try { stopSemaphore.acquire(); parallelSet.add(getCurrentKey()); doFork(to, msg); } catch (InterruptedException ex) { throw new IllegalArgumentException(ex); } }
class class_name[name] begin[{] method[fork, return_type[void], modifier[public], parameter[to, msg]] begin[{] if[binary_operation[member[.maxParallelism], ==, literal[0]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="maxParallelism == 0, fork() not allowed! Use switchTo.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None) else begin[{] None end[}] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=acquire, postfix_operators=[], prefix_operators=[], qualifier=stopSemaphore, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getCurrentKey, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=parallelSet, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=to, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=msg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=doFork, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=ex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ex, types=['InterruptedException']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[public] Keyword[void] identifier[fork] operator[SEP] identifier[K] identifier[to] , identifier[M] identifier[msg] operator[SEP] { Keyword[if] operator[SEP] identifier[maxParallelism] operator[==] Other[0] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[try] { identifier[stopSemaphore] operator[SEP] identifier[acquire] operator[SEP] operator[SEP] operator[SEP] identifier[parallelSet] operator[SEP] identifier[add] operator[SEP] identifier[getCurrentKey] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[doFork] operator[SEP] identifier[to] , identifier[msg] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[InterruptedException] identifier[ex] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] identifier[ex] operator[SEP] operator[SEP] } }
public long timeout() { final long now = now(); for (Entry<Timer, Long> entry : entries()) { final Timer timer = entry.getKey(); final Long expiration = entry.getValue(); if (timer.alive) { // Live timer, lets return the timeout if (expiration - now > 0) { return expiration - now; } else { return 0; } } // Remove it from the list of active timers. timers.remove(expiration, timer); } // Wait forever as no timers are alive return -1; }
class class_name[name] begin[{] method[timeout, return_type[type[long]], modifier[public], parameter[]] begin[{] local_variable[type[long], now] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getKey, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None), name=timer)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=Timer, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None), name=expiration)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=Long, sub_type=None)), IfStatement(condition=MemberReference(member=alive, postfix_operators=[], prefix_operators=[], qualifier=timer, selectors=[]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=expiration, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=now, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=-), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>), else_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=BinaryOperation(operandl=MemberReference(member=expiration, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=now, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=-), label=None)]))])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=expiration, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=timer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=remove, postfix_operators=[], prefix_operators=[], qualifier=timers, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=entries, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=entry)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Timer, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Long, sub_type=None))], dimensions=[], name=Entry, sub_type=None))), label=None) return[literal[1]] end[}] END[}]
Keyword[public] Keyword[long] identifier[timeout] operator[SEP] operator[SEP] { Keyword[final] Keyword[long] identifier[now] operator[=] identifier[now] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Entry] operator[<] identifier[Timer] , identifier[Long] operator[>] identifier[entry] operator[:] identifier[entries] operator[SEP] operator[SEP] operator[SEP] { Keyword[final] identifier[Timer] identifier[timer] operator[=] identifier[entry] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[Long] identifier[expiration] operator[=] identifier[entry] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[timer] operator[SEP] identifier[alive] operator[SEP] { Keyword[if] operator[SEP] identifier[expiration] operator[-] identifier[now] operator[>] Other[0] operator[SEP] { Keyword[return] identifier[expiration] operator[-] identifier[now] operator[SEP] } Keyword[else] { Keyword[return] Other[0] operator[SEP] } } identifier[timers] operator[SEP] identifier[remove] operator[SEP] identifier[expiration] , identifier[timer] operator[SEP] operator[SEP] } Keyword[return] operator[-] Other[1] operator[SEP] }
public List<String> getOutPorts() { List<String> ports = new ArrayList<>(); JsonObject jsonPorts = config.getObject("ports"); if (jsonPorts == null) { return ports; } JsonArray jsonOutPorts = jsonPorts.getArray("out"); if (jsonOutPorts == null) { return ports; } for(Object jsonOutPort : jsonOutPorts) { ports.add((String) jsonOutPort); } return ports; }
class class_name[name] begin[{] method[getOutPorts, return_type[type[List]], modifier[public], parameter[]] begin[{] local_variable[type[List], ports] local_variable[type[JsonObject], jsonPorts] if[binary_operation[member[.jsonPorts], ==, literal[null]]] begin[{] return[member[.ports]] else begin[{] None end[}] local_variable[type[JsonArray], jsonOutPorts] if[binary_operation[member[.jsonOutPorts], ==, literal[null]]] begin[{] return[member[.ports]] else begin[{] None end[}] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Cast(expression=MemberReference(member=jsonOutPort, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], member=add, postfix_operators=[], prefix_operators=[], qualifier=ports, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=jsonOutPorts, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=jsonOutPort)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))), label=None) return[member[.ports]] end[}] END[}]
Keyword[public] identifier[List] operator[<] identifier[String] operator[>] identifier[getOutPorts] operator[SEP] operator[SEP] { identifier[List] operator[<] identifier[String] operator[>] identifier[ports] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[JsonObject] identifier[jsonPorts] operator[=] identifier[config] operator[SEP] identifier[getObject] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[jsonPorts] operator[==] Other[null] operator[SEP] { Keyword[return] identifier[ports] operator[SEP] } identifier[JsonArray] identifier[jsonOutPorts] operator[=] identifier[jsonPorts] operator[SEP] identifier[getArray] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[jsonOutPorts] operator[==] Other[null] operator[SEP] { Keyword[return] identifier[ports] operator[SEP] } Keyword[for] operator[SEP] identifier[Object] identifier[jsonOutPort] operator[:] identifier[jsonOutPorts] operator[SEP] { identifier[ports] operator[SEP] identifier[add] operator[SEP] operator[SEP] identifier[String] operator[SEP] identifier[jsonOutPort] operator[SEP] operator[SEP] } Keyword[return] identifier[ports] operator[SEP] }
public static String[] toStringArray(Enumeration<String> enumeration) { if (enumeration == null) { return null; } List<String> list = java.util.Collections.list(enumeration); return list.toArray(new String[list.size()]); }
class class_name[name] begin[{] method[toStringArray, return_type[type[String]], modifier[public static], parameter[enumeration]] begin[{] if[binary_operation[member[.enumeration], ==, literal[null]]] begin[{] return[literal[null]] else begin[{] None end[}] local_variable[type[List], list] return[call[list.toArray, parameter[ArrayCreator(dimensions=[MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=list, selectors=[], type_arguments=None)], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=String, sub_type=None))]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[String] operator[SEP] operator[SEP] identifier[toStringArray] operator[SEP] identifier[Enumeration] operator[<] identifier[String] operator[>] identifier[enumeration] operator[SEP] { Keyword[if] operator[SEP] identifier[enumeration] operator[==] Other[null] operator[SEP] { Keyword[return] Other[null] operator[SEP] } identifier[List] operator[<] identifier[String] operator[>] identifier[list] operator[=] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[Collections] operator[SEP] identifier[list] operator[SEP] identifier[enumeration] operator[SEP] operator[SEP] Keyword[return] identifier[list] operator[SEP] identifier[toArray] operator[SEP] Keyword[new] identifier[String] operator[SEP] identifier[list] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
public void log(String message, Map<String, Object> custom) { log(null, custom, message, null); }
class class_name[name] begin[{] method[log, return_type[void], modifier[public], parameter[message, custom]] begin[{] call[.log, parameter[literal[null], member[.custom], member[.message], literal[null]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[log] operator[SEP] identifier[String] identifier[message] , identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] identifier[custom] operator[SEP] { identifier[log] operator[SEP] Other[null] , identifier[custom] , identifier[message] , Other[null] operator[SEP] operator[SEP] }
public void startElement( StylesheetHandler handler, String uri, String localName, String rawName, Attributes attributes) throws org.xml.sax.SAXException { KeyDeclaration kd = new KeyDeclaration(handler.getStylesheet(), handler.nextUid()); kd.setDOMBackPointer(handler.getOriginatingNode()); kd.setLocaterInfo(handler.getLocator()); setPropertiesFromAttributes(handler, rawName, attributes, kd); handler.getStylesheet().setKey(kd); }
class class_name[name] begin[{] method[startElement, return_type[void], modifier[public], parameter[handler, uri, localName, rawName, attributes]] begin[{] local_variable[type[KeyDeclaration], kd] call[kd.setDOMBackPointer, parameter[call[handler.getOriginatingNode, parameter[]]]] call[kd.setLocaterInfo, parameter[call[handler.getLocator, parameter[]]]] call[.setPropertiesFromAttributes, parameter[member[.handler], member[.rawName], member[.attributes], member[.kd]]] call[handler.getStylesheet, parameter[]] end[}] END[}]
Keyword[public] Keyword[void] identifier[startElement] operator[SEP] identifier[StylesheetHandler] identifier[handler] , identifier[String] identifier[uri] , identifier[String] identifier[localName] , identifier[String] identifier[rawName] , identifier[Attributes] identifier[attributes] operator[SEP] Keyword[throws] identifier[org] operator[SEP] identifier[xml] operator[SEP] identifier[sax] operator[SEP] identifier[SAXException] { identifier[KeyDeclaration] identifier[kd] operator[=] Keyword[new] identifier[KeyDeclaration] operator[SEP] identifier[handler] operator[SEP] identifier[getStylesheet] operator[SEP] operator[SEP] , identifier[handler] operator[SEP] identifier[nextUid] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[kd] operator[SEP] identifier[setDOMBackPointer] operator[SEP] identifier[handler] operator[SEP] identifier[getOriginatingNode] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[kd] operator[SEP] identifier[setLocaterInfo] operator[SEP] identifier[handler] operator[SEP] identifier[getLocator] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[setPropertiesFromAttributes] operator[SEP] identifier[handler] , identifier[rawName] , identifier[attributes] , identifier[kd] operator[SEP] operator[SEP] identifier[handler] operator[SEP] identifier[getStylesheet] operator[SEP] operator[SEP] operator[SEP] identifier[setKey] operator[SEP] identifier[kd] operator[SEP] operator[SEP] }
private void findSentenceIntervals(JCas jcas){ HashSet<Timex3Interval> timexesToRemove = new HashSet<Timex3Interval>(); FSIterator iterSentence = jcas.getAnnotationIndex(Sentence.type).iterator(); while (iterSentence.hasNext()) { Sentence s=(Sentence)iterSentence.next(); String sString=s.getCoveredText(); FSIterator iterInter = jcas.getAnnotationIndex(Timex3Interval.type).subiterator(s); int count=0; List<Timex3Interval> txes=new ArrayList<Timex3Interval>(); List<Timex3Interval> sentenceTxes=new ArrayList<Timex3Interval>(); while(iterInter.hasNext()){ Timex3Interval t=(Timex3Interval)iterInter.next(); sString=sString.replace(t.getCoveredText(), "<TX3_"+count+">"); count++; txes.add(t); } if(count>0){ if (find_interval_candidates){ IntervalCandidateSentence sI=new IntervalCandidateSentence(jcas); sI.setBegin(s.getBegin()); sI.setEnd(s.getEnd()); sI.addToIndexes(); } for(Pattern p: hmIntervalPattern.keySet()){ String name=hmIntervalPattern.get(p); List<MatchResult>results=(List<MatchResult>)Toolbox.findMatches(p,sString); if(results.size()>0){ //Interval in Sentence s found by Pattern p! for(MatchResult r: results){ Pattern pNorm=Pattern.compile("group\\(([1-9]+)\\)-group\\(([1-9]+)\\)"); String norm=hmIntervalNormalization.get(name); Matcher mNorm=pNorm.matcher(norm); if(!mNorm.matches()){ System.err.println("Problem with the Norm in rule "+name); } Timex3Interval startTx=null,endTx=null; try{ int startId=Integer.parseInt(mNorm.group(1)); int endId=Integer.parseInt(mNorm.group(2)); startTx=txes.get(Integer.parseInt(r.group(startId))); endTx=txes.get(Integer.parseInt(r.group(endId))); }catch(Exception e){ e.printStackTrace(); return; } Timex3Interval annotation=new Timex3Interval(jcas); annotation.setBegin(startTx.getBegin()>endTx.getBegin()?endTx.getBegin():startTx.getBegin()); annotation.setEnd(startTx.getEnd()>endTx.getEnd()?startTx.getEnd():endTx.getEnd()); //Does the interval already exist, //found by another pattern? boolean duplicate=false; for(Timex3Interval tx:sentenceTxes){ if(tx.getBegin()==annotation.getBegin() && tx.getEnd()==annotation.getEnd()){ duplicate=true; break; } } if(!duplicate){ annotation.setTimexValueEB(startTx.getTimexValueEB()); annotation.setTimexValueLB(startTx.getTimexValueLE()); annotation.setTimexValueEE(endTx.getTimexValueEB()); annotation.setTimexValueLE(endTx.getTimexValueLE()); annotation.setTimexType(startTx.getTimexType()); annotation.setFoundByRule(name); // create emptyvalue value String emptyValue = createEmptyValue(startTx, endTx, jcas); annotation.setEmptyValue(emptyValue); annotation.setBeginTimex(startTx.getBeginTimex()); annotation.setEndTimex(endTx.getEndTimex()); try { sentenceTxes.add(annotation); } catch(NumberFormatException e) { Logger.printError(component, "Couldn't do emptyValue calculation on accont of a faulty normalization in " + annotation.getTimexValueEB() + " or " + annotation.getTimexValueEE()); } // prepare tx3intervals to remove timexesToRemove.add(startTx); timexesToRemove.add(endTx); annotation.addToIndexes(); // System.out.println(emptyValue); } } } } } } for(Timex3Interval txi : timexesToRemove) { txi.removeFromIndexes(); } }
class class_name[name] begin[{] method[findSentenceIntervals, return_type[void], modifier[private], parameter[jcas]] begin[{] local_variable[type[HashSet], timexesToRemove] local_variable[type[FSIterator], iterSentence] while[call[iterSentence.hasNext, parameter[]]] begin[{] local_variable[type[Sentence], s] local_variable[type[String], sString] local_variable[type[FSIterator], iterInter] local_variable[type[int], count] local_variable[type[List], txes] local_variable[type[List], sentenceTxes] while[call[iterInter.hasNext, parameter[]]] begin[{] local_variable[type[Timex3Interval], t] assign[member[.sString], call[sString.replace, parameter[call[t.getCoveredText, parameter[]], binary_operation[binary_operation[literal["<TX3_"], +, member[.count]], +, literal[">"]]]]] member[.count] call[txes.add, parameter[member[.t]]] end[}] if[binary_operation[member[.count], >, literal[0]]] begin[{] if[member[.find_interval_candidates]] begin[{] local_variable[type[IntervalCandidateSentence], sI] call[sI.setBegin, parameter[call[s.getBegin, parameter[]]]] call[sI.setEnd, parameter[call[s.getEnd, parameter[]]]] call[sI.addToIndexes, parameter[]] else begin[{] None end[}] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=p, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=hmIntervalPattern, selectors=[], type_arguments=None), name=name)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MethodInvocation(arguments=[MemberReference(member=p, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=sString, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=findMatches, postfix_operators=[], prefix_operators=[], qualifier=Toolbox, selectors=[], type_arguments=None), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=MatchResult, sub_type=None))], dimensions=[], name=List, sub_type=None)), name=results)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=MatchResult, sub_type=None))], dimensions=[], name=List, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=results, 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=[ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="group\\(([1-9]+)\\)-group\\(([1-9]+)\\)")], member=compile, postfix_operators=[], prefix_operators=[], qualifier=Pattern, selectors=[], type_arguments=None), name=pNorm)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Pattern, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=hmIntervalNormalization, selectors=[], type_arguments=None), name=norm)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=norm, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=matcher, postfix_operators=[], prefix_operators=[], qualifier=pNorm, selectors=[], type_arguments=None), name=mNorm)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Matcher, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[], member=matches, postfix_operators=[], prefix_operators=['!'], qualifier=mNorm, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Problem with the Norm in rule "), operandr=MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=println, postfix_operators=[], prefix_operators=[], qualifier=System.err, selectors=[], type_arguments=None), label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), name=startTx), VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), name=endTx)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Timex3Interval, sub_type=None)), TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], member=group, postfix_operators=[], prefix_operators=[], qualifier=mNorm, selectors=[], type_arguments=None)], member=parseInt, postfix_operators=[], prefix_operators=[], qualifier=Integer, selectors=[], type_arguments=None), name=startId)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2)], member=group, postfix_operators=[], prefix_operators=[], qualifier=mNorm, selectors=[], type_arguments=None)], member=parseInt, postfix_operators=[], prefix_operators=[], qualifier=Integer, selectors=[], type_arguments=None), name=endId)], modifiers=set(), type=BasicType(dimensions=[], name=int)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=startTx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=startId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=group, postfix_operators=[], prefix_operators=[], qualifier=r, selectors=[], type_arguments=None)], member=parseInt, postfix_operators=[], prefix_operators=[], qualifier=Integer, selectors=[], type_arguments=None)], member=get, postfix_operators=[], prefix_operators=[], qualifier=txes, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=endTx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=endId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=group, postfix_operators=[], prefix_operators=[], qualifier=r, selectors=[], type_arguments=None)], member=parseInt, postfix_operators=[], prefix_operators=[], qualifier=Integer, selectors=[], type_arguments=None)], member=get, postfix_operators=[], prefix_operators=[], qualifier=txes, selectors=[], type_arguments=None)), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=printStackTrace, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=None, label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MemberReference(member=jcas, 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=Timex3Interval, sub_type=None)), name=annotation)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Timex3Interval, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[TernaryExpression(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getBegin, postfix_operators=[], prefix_operators=[], qualifier=startTx, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[], member=getBegin, postfix_operators=[], prefix_operators=[], qualifier=endTx, selectors=[], type_arguments=None), operator=>), if_false=MethodInvocation(arguments=[], member=getBegin, postfix_operators=[], prefix_operators=[], qualifier=startTx, selectors=[], type_arguments=None), if_true=MethodInvocation(arguments=[], member=getBegin, postfix_operators=[], prefix_operators=[], qualifier=endTx, selectors=[], type_arguments=None))], member=setBegin, postfix_operators=[], prefix_operators=[], qualifier=annotation, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[TernaryExpression(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getEnd, postfix_operators=[], prefix_operators=[], qualifier=startTx, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[], member=getEnd, postfix_operators=[], prefix_operators=[], qualifier=endTx, selectors=[], type_arguments=None), operator=>), if_false=MethodInvocation(arguments=[], member=getEnd, postfix_operators=[], prefix_operators=[], qualifier=endTx, selectors=[], type_arguments=None), if_true=MethodInvocation(arguments=[], member=getEnd, postfix_operators=[], prefix_operators=[], qualifier=startTx, selectors=[], type_arguments=None))], member=setEnd, postfix_operators=[], prefix_operators=[], qualifier=annotation, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), name=duplicate)], modifiers=set(), type=BasicType(dimensions=[], name=boolean)), ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getBegin, postfix_operators=[], prefix_operators=[], qualifier=tx, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[], member=getBegin, postfix_operators=[], prefix_operators=[], qualifier=annotation, selectors=[], type_arguments=None), operator===), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getEnd, postfix_operators=[], prefix_operators=[], qualifier=tx, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[], member=getEnd, postfix_operators=[], prefix_operators=[], qualifier=annotation, selectors=[], type_arguments=None), operator===), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=duplicate, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)), label=None), BreakStatement(goto=None, label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=sentenceTxes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=tx)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Timex3Interval, sub_type=None))), label=None), IfStatement(condition=MemberReference(member=duplicate, postfix_operators=[], prefix_operators=['!'], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getTimexValueEB, postfix_operators=[], prefix_operators=[], qualifier=startTx, selectors=[], type_arguments=None)], member=setTimexValueEB, postfix_operators=[], prefix_operators=[], qualifier=annotation, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getTimexValueLE, postfix_operators=[], prefix_operators=[], qualifier=startTx, selectors=[], type_arguments=None)], member=setTimexValueLB, postfix_operators=[], prefix_operators=[], qualifier=annotation, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getTimexValueEB, postfix_operators=[], prefix_operators=[], qualifier=endTx, selectors=[], type_arguments=None)], member=setTimexValueEE, postfix_operators=[], prefix_operators=[], qualifier=annotation, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getTimexValueLE, postfix_operators=[], prefix_operators=[], qualifier=endTx, selectors=[], type_arguments=None)], member=setTimexValueLE, postfix_operators=[], prefix_operators=[], qualifier=annotation, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getTimexType, postfix_operators=[], prefix_operators=[], qualifier=startTx, selectors=[], type_arguments=None)], member=setTimexType, postfix_operators=[], prefix_operators=[], qualifier=annotation, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setFoundByRule, postfix_operators=[], prefix_operators=[], qualifier=annotation, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=startTx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=endTx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=jcas, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=createEmptyValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=emptyValue)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=emptyValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setEmptyValue, postfix_operators=[], prefix_operators=[], qualifier=annotation, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getBeginTimex, postfix_operators=[], prefix_operators=[], qualifier=startTx, selectors=[], type_arguments=None)], member=setBeginTimex, postfix_operators=[], prefix_operators=[], qualifier=annotation, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getEndTimex, postfix_operators=[], prefix_operators=[], qualifier=endTx, selectors=[], type_arguments=None)], member=setEndTimex, postfix_operators=[], prefix_operators=[], qualifier=annotation, selectors=[], type_arguments=None), label=None), TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=annotation, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=sentenceTxes, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=component, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Couldn't do emptyValue calculation on accont of a faulty normalization in "), operandr=MethodInvocation(arguments=[], member=getTimexValueEB, postfix_operators=[], prefix_operators=[], qualifier=annotation, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" or "), operator=+), operandr=MethodInvocation(arguments=[], member=getTimexValueEE, postfix_operators=[], prefix_operators=[], qualifier=annotation, selectors=[], type_arguments=None), operator=+)], member=printError, postfix_operators=[], prefix_operators=[], qualifier=Logger, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['NumberFormatException']))], finally_block=None, label=None, resources=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=startTx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=timexesToRemove, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=endTx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=timexesToRemove, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=addToIndexes, postfix_operators=[], prefix_operators=[], qualifier=annotation, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=results, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=r)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=MatchResult, sub_type=None))), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=keySet, postfix_operators=[], prefix_operators=[], qualifier=hmIntervalPattern, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=p)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Pattern, sub_type=None))), label=None) else begin[{] None end[}] end[}] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=removeFromIndexes, postfix_operators=[], prefix_operators=[], qualifier=txi, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=timexesToRemove, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=txi)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Timex3Interval, sub_type=None))), label=None) end[}] END[}]
Keyword[private] Keyword[void] identifier[findSentenceIntervals] operator[SEP] identifier[JCas] identifier[jcas] operator[SEP] { identifier[HashSet] operator[<] identifier[Timex3Interval] operator[>] identifier[timexesToRemove] operator[=] Keyword[new] identifier[HashSet] operator[<] identifier[Timex3Interval] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[FSIterator] identifier[iterSentence] operator[=] identifier[jcas] operator[SEP] identifier[getAnnotationIndex] operator[SEP] identifier[Sentence] operator[SEP] identifier[type] operator[SEP] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[iterSentence] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] { identifier[Sentence] identifier[s] operator[=] operator[SEP] identifier[Sentence] operator[SEP] identifier[iterSentence] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[sString] operator[=] identifier[s] operator[SEP] identifier[getCoveredText] operator[SEP] operator[SEP] operator[SEP] identifier[FSIterator] identifier[iterInter] operator[=] identifier[jcas] operator[SEP] identifier[getAnnotationIndex] operator[SEP] identifier[Timex3Interval] operator[SEP] identifier[type] operator[SEP] operator[SEP] identifier[subiterator] operator[SEP] identifier[s] operator[SEP] operator[SEP] Keyword[int] identifier[count] operator[=] Other[0] operator[SEP] identifier[List] operator[<] identifier[Timex3Interval] operator[>] identifier[txes] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[Timex3Interval] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[Timex3Interval] operator[>] identifier[sentenceTxes] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[Timex3Interval] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[iterInter] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] { identifier[Timex3Interval] identifier[t] operator[=] operator[SEP] identifier[Timex3Interval] operator[SEP] identifier[iterInter] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] identifier[sString] operator[=] identifier[sString] operator[SEP] identifier[replace] operator[SEP] identifier[t] operator[SEP] identifier[getCoveredText] operator[SEP] operator[SEP] , literal[String] operator[+] identifier[count] operator[+] literal[String] operator[SEP] operator[SEP] identifier[count] operator[++] operator[SEP] identifier[txes] operator[SEP] identifier[add] operator[SEP] identifier[t] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[count] operator[>] Other[0] operator[SEP] { Keyword[if] operator[SEP] identifier[find_interval_candidates] operator[SEP] { identifier[IntervalCandidateSentence] identifier[sI] operator[=] Keyword[new] identifier[IntervalCandidateSentence] operator[SEP] identifier[jcas] operator[SEP] operator[SEP] identifier[sI] operator[SEP] identifier[setBegin] operator[SEP] identifier[s] operator[SEP] identifier[getBegin] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[sI] operator[SEP] identifier[setEnd] operator[SEP] identifier[s] operator[SEP] identifier[getEnd] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[sI] operator[SEP] identifier[addToIndexes] operator[SEP] operator[SEP] operator[SEP] } Keyword[for] operator[SEP] identifier[Pattern] identifier[p] operator[:] identifier[hmIntervalPattern] operator[SEP] identifier[keySet] operator[SEP] operator[SEP] operator[SEP] { identifier[String] identifier[name] operator[=] identifier[hmIntervalPattern] operator[SEP] identifier[get] operator[SEP] identifier[p] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[MatchResult] operator[>] identifier[results] operator[=] operator[SEP] identifier[List] operator[<] identifier[MatchResult] operator[>] operator[SEP] identifier[Toolbox] operator[SEP] identifier[findMatches] operator[SEP] identifier[p] , identifier[sString] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[results] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] { Keyword[for] operator[SEP] identifier[MatchResult] identifier[r] operator[:] identifier[results] operator[SEP] { identifier[Pattern] identifier[pNorm] operator[=] identifier[Pattern] operator[SEP] identifier[compile] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[String] identifier[norm] operator[=] identifier[hmIntervalNormalization] operator[SEP] identifier[get] operator[SEP] identifier[name] operator[SEP] operator[SEP] identifier[Matcher] identifier[mNorm] operator[=] identifier[pNorm] operator[SEP] identifier[matcher] operator[SEP] identifier[norm] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[mNorm] operator[SEP] identifier[matches] operator[SEP] operator[SEP] operator[SEP] { identifier[System] operator[SEP] identifier[err] operator[SEP] identifier[println] operator[SEP] literal[String] operator[+] identifier[name] operator[SEP] operator[SEP] } identifier[Timex3Interval] identifier[startTx] operator[=] Other[null] , identifier[endTx] operator[=] Other[null] operator[SEP] Keyword[try] { Keyword[int] identifier[startId] operator[=] identifier[Integer] operator[SEP] identifier[parseInt] operator[SEP] identifier[mNorm] operator[SEP] identifier[group] operator[SEP] Other[1] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[endId] operator[=] identifier[Integer] operator[SEP] identifier[parseInt] operator[SEP] identifier[mNorm] operator[SEP] identifier[group] operator[SEP] Other[2] operator[SEP] operator[SEP] operator[SEP] identifier[startTx] operator[=] identifier[txes] operator[SEP] identifier[get] operator[SEP] identifier[Integer] operator[SEP] identifier[parseInt] operator[SEP] identifier[r] operator[SEP] identifier[group] operator[SEP] identifier[startId] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[endTx] operator[=] identifier[txes] operator[SEP] identifier[get] operator[SEP] identifier[Integer] operator[SEP] identifier[parseInt] operator[SEP] identifier[r] operator[SEP] identifier[group] operator[SEP] identifier[endId] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { identifier[e] operator[SEP] identifier[printStackTrace] operator[SEP] operator[SEP] operator[SEP] Keyword[return] operator[SEP] } identifier[Timex3Interval] identifier[annotation] operator[=] Keyword[new] identifier[Timex3Interval] operator[SEP] identifier[jcas] operator[SEP] operator[SEP] identifier[annotation] operator[SEP] identifier[setBegin] operator[SEP] identifier[startTx] operator[SEP] identifier[getBegin] operator[SEP] operator[SEP] operator[>] identifier[endTx] operator[SEP] identifier[getBegin] operator[SEP] operator[SEP] operator[?] identifier[endTx] operator[SEP] identifier[getBegin] operator[SEP] operator[SEP] operator[:] identifier[startTx] operator[SEP] identifier[getBegin] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[annotation] operator[SEP] identifier[setEnd] operator[SEP] identifier[startTx] operator[SEP] identifier[getEnd] operator[SEP] operator[SEP] operator[>] identifier[endTx] operator[SEP] identifier[getEnd] operator[SEP] operator[SEP] operator[?] identifier[startTx] operator[SEP] identifier[getEnd] operator[SEP] operator[SEP] operator[:] identifier[endTx] operator[SEP] identifier[getEnd] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[boolean] identifier[duplicate] operator[=] literal[boolean] operator[SEP] Keyword[for] operator[SEP] identifier[Timex3Interval] identifier[tx] operator[:] identifier[sentenceTxes] operator[SEP] { Keyword[if] operator[SEP] identifier[tx] operator[SEP] identifier[getBegin] operator[SEP] operator[SEP] operator[==] identifier[annotation] operator[SEP] identifier[getBegin] operator[SEP] operator[SEP] operator[&&] identifier[tx] operator[SEP] identifier[getEnd] operator[SEP] operator[SEP] operator[==] identifier[annotation] operator[SEP] identifier[getEnd] operator[SEP] operator[SEP] operator[SEP] { identifier[duplicate] operator[=] literal[boolean] operator[SEP] Keyword[break] operator[SEP] } } Keyword[if] operator[SEP] operator[!] identifier[duplicate] operator[SEP] { identifier[annotation] operator[SEP] identifier[setTimexValueEB] operator[SEP] identifier[startTx] operator[SEP] identifier[getTimexValueEB] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[annotation] operator[SEP] identifier[setTimexValueLB] operator[SEP] identifier[startTx] operator[SEP] identifier[getTimexValueLE] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[annotation] operator[SEP] identifier[setTimexValueEE] operator[SEP] identifier[endTx] operator[SEP] identifier[getTimexValueEB] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[annotation] operator[SEP] identifier[setTimexValueLE] operator[SEP] identifier[endTx] operator[SEP] identifier[getTimexValueLE] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[annotation] operator[SEP] identifier[setTimexType] operator[SEP] identifier[startTx] operator[SEP] identifier[getTimexType] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[annotation] operator[SEP] identifier[setFoundByRule] operator[SEP] identifier[name] operator[SEP] operator[SEP] identifier[String] identifier[emptyValue] operator[=] identifier[createEmptyValue] operator[SEP] identifier[startTx] , identifier[endTx] , identifier[jcas] operator[SEP] operator[SEP] identifier[annotation] operator[SEP] identifier[setEmptyValue] operator[SEP] identifier[emptyValue] operator[SEP] operator[SEP] identifier[annotation] operator[SEP] identifier[setBeginTimex] operator[SEP] identifier[startTx] operator[SEP] identifier[getBeginTimex] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[annotation] operator[SEP] identifier[setEndTimex] operator[SEP] identifier[endTx] operator[SEP] identifier[getEndTimex] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[try] { identifier[sentenceTxes] operator[SEP] identifier[add] operator[SEP] identifier[annotation] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[NumberFormatException] identifier[e] operator[SEP] { identifier[Logger] operator[SEP] identifier[printError] operator[SEP] identifier[component] , literal[String] operator[+] identifier[annotation] operator[SEP] identifier[getTimexValueEB] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[annotation] operator[SEP] identifier[getTimexValueEE] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[timexesToRemove] operator[SEP] identifier[add] operator[SEP] identifier[startTx] operator[SEP] operator[SEP] identifier[timexesToRemove] operator[SEP] identifier[add] operator[SEP] identifier[endTx] operator[SEP] operator[SEP] identifier[annotation] operator[SEP] identifier[addToIndexes] operator[SEP] operator[SEP] operator[SEP] } } } } } } Keyword[for] operator[SEP] identifier[Timex3Interval] identifier[txi] operator[:] identifier[timexesToRemove] operator[SEP] { identifier[txi] operator[SEP] identifier[removeFromIndexes] operator[SEP] operator[SEP] operator[SEP] } }
public void marshall(DescribeClustersRequest describeClustersRequest, ProtocolMarshaller protocolMarshaller) { if (describeClustersRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(describeClustersRequest.getClusters(), CLUSTERS_BINDING); protocolMarshaller.marshall(describeClustersRequest.getInclude(), INCLUDE_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[describeClustersRequest, protocolMarshaller]] begin[{] if[binary_operation[member[.describeClustersRequest], ==, 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=getClusters, postfix_operators=[], prefix_operators=[], qualifier=describeClustersRequest, selectors=[], type_arguments=None), MemberReference(member=CLUSTERS_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=getInclude, postfix_operators=[], prefix_operators=[], qualifier=describeClustersRequest, selectors=[], type_arguments=None), MemberReference(member=INCLUDE_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[DescribeClustersRequest] identifier[describeClustersRequest] , identifier[ProtocolMarshaller] identifier[protocolMarshaller] operator[SEP] { Keyword[if] operator[SEP] identifier[describeClustersRequest] 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[describeClustersRequest] operator[SEP] identifier[getClusters] operator[SEP] operator[SEP] , identifier[CLUSTERS_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[describeClustersRequest] operator[SEP] identifier[getInclude] operator[SEP] operator[SEP] , identifier[INCLUDE_BINDING] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[SdkClientException] operator[SEP] literal[String] operator[+] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP] } }
public static cmppolicylabel_cmppolicy_binding[] get(nitro_service service, String labelname) throws Exception{ cmppolicylabel_cmppolicy_binding obj = new cmppolicylabel_cmppolicy_binding(); obj.set_labelname(labelname); cmppolicylabel_cmppolicy_binding response[] = (cmppolicylabel_cmppolicy_binding[]) obj.get_resources(service); return response; }
class class_name[name] begin[{] method[get, return_type[type[cmppolicylabel_cmppolicy_binding]], modifier[public static], parameter[service, labelname]] begin[{] local_variable[type[cmppolicylabel_cmppolicy_binding], obj] call[obj.set_labelname, parameter[member[.labelname]]] local_variable[type[cmppolicylabel_cmppolicy_binding], response] return[member[.response]] end[}] END[}]
Keyword[public] Keyword[static] identifier[cmppolicylabel_cmppolicy_binding] operator[SEP] operator[SEP] identifier[get] operator[SEP] identifier[nitro_service] identifier[service] , identifier[String] identifier[labelname] operator[SEP] Keyword[throws] identifier[Exception] { identifier[cmppolicylabel_cmppolicy_binding] identifier[obj] operator[=] Keyword[new] identifier[cmppolicylabel_cmppolicy_binding] operator[SEP] operator[SEP] operator[SEP] identifier[obj] operator[SEP] identifier[set_labelname] operator[SEP] identifier[labelname] operator[SEP] operator[SEP] identifier[cmppolicylabel_cmppolicy_binding] identifier[response] operator[SEP] operator[SEP] operator[=] operator[SEP] identifier[cmppolicylabel_cmppolicy_binding] operator[SEP] operator[SEP] operator[SEP] identifier[obj] operator[SEP] identifier[get_resources] operator[SEP] identifier[service] operator[SEP] operator[SEP] Keyword[return] identifier[response] operator[SEP] }
private static Stream<Class<?>> getSuperclassesAsStream(Class<?> clazz, boolean includeArgument) { return Stream.concat(includeArgument ? Stream.of(clazz) : Stream.empty(), Optional.ofNullable(clazz.getSuperclass()) .map(Stream::of) .orElseGet(Stream::empty) .flatMap(superclass -> getSuperclassesAsStream(superclass, true))); }
class class_name[name] begin[{] method[getSuperclassesAsStream, return_type[type[Stream]], modifier[private static], parameter[clazz, includeArgument]] begin[{] return[call[Stream.concat, parameter[TernaryExpression(condition=MemberReference(member=includeArgument, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_false=MethodInvocation(arguments=[], member=empty, postfix_operators=[], prefix_operators=[], qualifier=Stream, selectors=[], type_arguments=None), if_true=MethodInvocation(arguments=[MemberReference(member=clazz, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=of, postfix_operators=[], prefix_operators=[], qualifier=Stream, selectors=[], type_arguments=None)), call[Optional.ofNullable, parameter[call[clazz.getSuperclass, parameter[]]]]]]] end[}] END[}]
Keyword[private] Keyword[static] identifier[Stream] operator[<] identifier[Class] operator[<] operator[?] operator[>] operator[>] identifier[getSuperclassesAsStream] operator[SEP] identifier[Class] operator[<] operator[?] operator[>] identifier[clazz] , Keyword[boolean] identifier[includeArgument] operator[SEP] { Keyword[return] identifier[Stream] operator[SEP] identifier[concat] operator[SEP] identifier[includeArgument] operator[?] identifier[Stream] operator[SEP] identifier[of] operator[SEP] identifier[clazz] operator[SEP] operator[:] identifier[Stream] operator[SEP] identifier[empty] operator[SEP] operator[SEP] , identifier[Optional] operator[SEP] identifier[ofNullable] operator[SEP] identifier[clazz] operator[SEP] identifier[getSuperclass] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[map] operator[SEP] identifier[Stream] operator[::] identifier[of] operator[SEP] operator[SEP] identifier[orElseGet] operator[SEP] identifier[Stream] operator[::] identifier[empty] operator[SEP] operator[SEP] identifier[flatMap] operator[SEP] identifier[superclass] operator[->] identifier[getSuperclassesAsStream] operator[SEP] identifier[superclass] , literal[boolean] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
public Cell getCellByName(String cellName) { Set<String> keys = cells.keySet(); for (String key : keys) { List<Cell> cellList = cells.get(key); for (Cell c : cellList) { if (c.getCellName().equals(cellName)) { return c; } } } return null; }
class class_name[name] begin[{] method[getCellByName, return_type[type[Cell]], modifier[public], parameter[cellName]] begin[{] local_variable[type[Set], keys] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=cells, selectors=[], type_arguments=None), name=cellList)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Cell, sub_type=None))], dimensions=[], name=List, sub_type=None)), ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[], member=getCellName, postfix_operators=[], prefix_operators=[], qualifier=c, selectors=[MethodInvocation(arguments=[MemberReference(member=cellName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=cellList, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=c)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Cell, sub_type=None))), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=keys, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=key)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None) return[literal[null]] end[}] END[}]
Keyword[public] identifier[Cell] identifier[getCellByName] operator[SEP] identifier[String] identifier[cellName] operator[SEP] { identifier[Set] operator[<] identifier[String] operator[>] identifier[keys] operator[=] identifier[cells] operator[SEP] identifier[keySet] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[String] identifier[key] operator[:] identifier[keys] operator[SEP] { identifier[List] operator[<] identifier[Cell] operator[>] identifier[cellList] operator[=] identifier[cells] operator[SEP] identifier[get] operator[SEP] identifier[key] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Cell] identifier[c] operator[:] identifier[cellList] operator[SEP] { Keyword[if] operator[SEP] identifier[c] operator[SEP] identifier[getCellName] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[cellName] operator[SEP] operator[SEP] { Keyword[return] identifier[c] operator[SEP] } } } Keyword[return] Other[null] operator[SEP] }
public final MetricDescriptor createMetricDescriptor( String name, MetricDescriptor metricDescriptor) { CreateMetricDescriptorRequest request = CreateMetricDescriptorRequest.newBuilder() .setName(name) .setMetricDescriptor(metricDescriptor) .build(); return createMetricDescriptor(request); }
class class_name[name] begin[{] method[createMetricDescriptor, return_type[type[MetricDescriptor]], modifier[final public], parameter[name, metricDescriptor]] begin[{] local_variable[type[CreateMetricDescriptorRequest], request] return[call[.createMetricDescriptor, parameter[member[.request]]]] end[}] END[}]
Keyword[public] Keyword[final] identifier[MetricDescriptor] identifier[createMetricDescriptor] operator[SEP] identifier[String] identifier[name] , identifier[MetricDescriptor] identifier[metricDescriptor] operator[SEP] { identifier[CreateMetricDescriptorRequest] identifier[request] operator[=] identifier[CreateMetricDescriptorRequest] operator[SEP] identifier[newBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[setName] operator[SEP] identifier[name] operator[SEP] operator[SEP] identifier[setMetricDescriptor] operator[SEP] identifier[metricDescriptor] operator[SEP] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[createMetricDescriptor] operator[SEP] identifier[request] operator[SEP] operator[SEP] }
public static double[] getCol(double[][] m1, int col) { double[] ret = new double[m1.length]; for(int i = 0; i < ret.length; i++) { ret[i] = m1[i][col]; } return ret; }
class class_name[name] begin[{] method[getCol, return_type[type[double]], modifier[public static], parameter[m1, col]] begin[{] local_variable[type[double], ret] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=ret, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MemberReference(member=m1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), ArraySelector(index=MemberReference(member=col, 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=length, postfix_operators=[], prefix_operators=[], qualifier=ret, 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[.ret]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[double] operator[SEP] operator[SEP] identifier[getCol] operator[SEP] Keyword[double] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[m1] , Keyword[int] identifier[col] operator[SEP] { Keyword[double] operator[SEP] operator[SEP] identifier[ret] operator[=] Keyword[new] Keyword[double] operator[SEP] identifier[m1] operator[SEP] identifier[length] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[ret] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[ret] operator[SEP] identifier[i] operator[SEP] operator[=] identifier[m1] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[col] operator[SEP] operator[SEP] } Keyword[return] identifier[ret] operator[SEP] }
public final void entryRuleXSynchronizedExpression() throws RecognitionException { try { // InternalXbase.g:1484:1: ( ruleXSynchronizedExpression EOF ) // InternalXbase.g:1485:1: ruleXSynchronizedExpression EOF { if ( state.backtracking==0 ) { before(grammarAccess.getXSynchronizedExpressionRule()); } pushFollow(FOLLOW_1); ruleXSynchronizedExpression(); state._fsp--; if (state.failed) return ; if ( state.backtracking==0 ) { after(grammarAccess.getXSynchronizedExpressionRule()); } match(input,EOF,FOLLOW_2); if (state.failed) return ; } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { } return ; }
class class_name[name] begin[{] method[entryRuleXSynchronizedExpression, return_type[void], modifier[final public], parameter[]] begin[{] TryStatement(block=[BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=backtracking, postfix_operators=[], prefix_operators=[], qualifier=state, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getXSynchronizedExpressionRule, postfix_operators=[], prefix_operators=[], qualifier=grammarAccess, selectors=[], type_arguments=None)], member=before, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=FOLLOW_1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=pushFollow, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=ruleXSynchronizedExpression, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MemberReference(member=_fsp, postfix_operators=['--'], prefix_operators=[], qualifier=state, selectors=[]), label=None), IfStatement(condition=MemberReference(member=failed, postfix_operators=[], prefix_operators=[], qualifier=state, selectors=[]), else_statement=None, label=None, then_statement=ReturnStatement(expression=None, label=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=backtracking, postfix_operators=[], prefix_operators=[], qualifier=state, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getXSynchronizedExpressionRule, postfix_operators=[], prefix_operators=[], qualifier=grammarAccess, selectors=[], type_arguments=None)], member=after, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=input, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=EOF, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=FOLLOW_2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=match, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), IfStatement(condition=MemberReference(member=failed, postfix_operators=[], prefix_operators=[], qualifier=state, selectors=[]), else_statement=None, label=None, then_statement=ReturnStatement(expression=None, label=None))])], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=re, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=reportError, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=input, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=re, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=recover, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=re, types=['RecognitionException']))], finally_block=[], label=None, resources=None) return[None] end[}] END[}]
Keyword[public] Keyword[final] Keyword[void] identifier[entryRuleXSynchronizedExpression] operator[SEP] operator[SEP] Keyword[throws] identifier[RecognitionException] { Keyword[try] { { Keyword[if] operator[SEP] identifier[state] operator[SEP] identifier[backtracking] operator[==] Other[0] operator[SEP] { identifier[before] operator[SEP] identifier[grammarAccess] operator[SEP] identifier[getXSynchronizedExpressionRule] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[pushFollow] operator[SEP] identifier[FOLLOW_1] operator[SEP] operator[SEP] identifier[ruleXSynchronizedExpression] operator[SEP] operator[SEP] operator[SEP] identifier[state] operator[SEP] identifier[_fsp] operator[--] operator[SEP] Keyword[if] operator[SEP] identifier[state] operator[SEP] identifier[failed] operator[SEP] Keyword[return] operator[SEP] Keyword[if] operator[SEP] identifier[state] operator[SEP] identifier[backtracking] operator[==] Other[0] operator[SEP] { identifier[after] operator[SEP] identifier[grammarAccess] operator[SEP] identifier[getXSynchronizedExpressionRule] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[match] operator[SEP] identifier[input] , identifier[EOF] , identifier[FOLLOW_2] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[state] operator[SEP] identifier[failed] operator[SEP] Keyword[return] operator[SEP] } } Keyword[catch] operator[SEP] identifier[RecognitionException] identifier[re] operator[SEP] { identifier[reportError] operator[SEP] identifier[re] operator[SEP] operator[SEP] identifier[recover] operator[SEP] identifier[input] , identifier[re] operator[SEP] operator[SEP] } Keyword[finally] { } Keyword[return] operator[SEP] }
public static byte[] intArrayToByteArray(int[] intArray) { byte[] byteArray = new byte[intArray.length]; for (int i = 0; i < intArray.length; i++) { byteArray[i] = intToByte(intArray[i]); } return byteArray; }
class class_name[name] begin[{] method[intArrayToByteArray, return_type[type[byte]], modifier[public static], parameter[intArray]] begin[{] local_variable[type[byte], byteArray] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=byteArray, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MethodInvocation(arguments=[MemberReference(member=intArray, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])], member=intToByte, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=intArray, 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[.byteArray]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[byte] operator[SEP] operator[SEP] identifier[intArrayToByteArray] operator[SEP] Keyword[int] operator[SEP] operator[SEP] identifier[intArray] operator[SEP] { Keyword[byte] operator[SEP] operator[SEP] identifier[byteArray] operator[=] Keyword[new] Keyword[byte] operator[SEP] identifier[intArray] operator[SEP] identifier[length] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[intArray] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[byteArray] operator[SEP] identifier[i] operator[SEP] operator[=] identifier[intToByte] operator[SEP] identifier[intArray] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[byteArray] operator[SEP] }