code stringlengths 63 466k | code_sememe stringlengths 141 3.79M | token_type stringlengths 274 1.23M |
|---|---|---|
@Override
public MongodbPubSubHub<ID, DATA> init() {
if (getMongoClient() == null) {
setMongoClient(buildMongoClient(), true);
}
super.init();
if (getMongoClient() == null) {
throw new IllegalStateException("MongoDB Client is null.");
}
return this;
} | class class_name[name] begin[{]
method[init, return_type[type[MongodbPubSubHub]], modifier[public], parameter[]] begin[{]
if[binary_operation[call[.getMongoClient, parameter[]], ==, literal[null]]] begin[{]
call[.setMongoClient, parameter[call[.buildMongoClient, parameter[]], literal[true]]]
else begin[{]
None
end[}]
SuperMethodInvocation(arguments=[], member=init, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None)
if[binary_operation[call[.getMongoClient, parameter[]], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="MongoDB Client is null.")], 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[}]
return[THIS[]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] identifier[MongodbPubSubHub] operator[<] identifier[ID] , identifier[DATA] operator[>] identifier[init] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[getMongoClient] operator[SEP] operator[SEP] operator[==] Other[null] operator[SEP] {
identifier[setMongoClient] operator[SEP] identifier[buildMongoClient] operator[SEP] operator[SEP] , literal[boolean] operator[SEP] operator[SEP]
}
Keyword[super] operator[SEP] identifier[init] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[getMongoClient] operator[SEP] operator[SEP] operator[==] Other[null] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[return] Keyword[this] operator[SEP]
}
|
public boolean isTrivial(Integer complexity) {
int len = payload.length;
if ((null == complexity) || (len < 2)) {
return true;
}
else if ((complexity.intValue() > 0) && (len > 2)) {
Set<Character> seen = new TreeSet<Character>();
for (int i = 0; i < len; i++) {
Character c = Character.valueOf(this.payload[i]);
if (seen.contains(c)) {
continue;
}
else {
seen.add(c);
}
}
if (complexity.intValue() <= seen.size()) {
return false;
}
}
return true;
} | class class_name[name] begin[{]
method[isTrivial, return_type[type[boolean]], modifier[public], parameter[complexity]] begin[{]
local_variable[type[int], len]
if[binary_operation[binary_operation[literal[null], ==, member[.complexity]], ||, binary_operation[member[.len], <, literal[2]]]] begin[{]
return[literal[true]]
else begin[{]
if[binary_operation[binary_operation[call[complexity.intValue, parameter[]], >, literal[0]], &&, binary_operation[member[.len], >, literal[2]]]] begin[{]
local_variable[type[Set], seen]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=payload, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])], member=valueOf, postfix_operators=[], prefix_operators=[], qualifier=Character, selectors=[], type_arguments=None), name=c)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Character, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=contains, postfix_operators=[], prefix_operators=[], qualifier=seen, selectors=[], type_arguments=None), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=seen, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[ContinueStatement(goto=None, label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=len, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
if[binary_operation[call[complexity.intValue, parameter[]], <=, call[seen.size, parameter[]]]] begin[{]
return[literal[false]]
else begin[{]
None
end[}]
else begin[{]
None
end[}]
end[}]
return[literal[true]]
end[}]
END[}] | Keyword[public] Keyword[boolean] identifier[isTrivial] operator[SEP] identifier[Integer] identifier[complexity] operator[SEP] {
Keyword[int] identifier[len] operator[=] identifier[payload] operator[SEP] identifier[length] operator[SEP] Keyword[if] operator[SEP] operator[SEP] Other[null] operator[==] identifier[complexity] operator[SEP] operator[||] operator[SEP] identifier[len] operator[<] Other[2] operator[SEP] operator[SEP] {
Keyword[return] literal[boolean] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] operator[SEP] identifier[complexity] operator[SEP] identifier[intValue] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] operator[&&] operator[SEP] identifier[len] operator[>] Other[2] operator[SEP] operator[SEP] {
identifier[Set] operator[<] identifier[Character] operator[>] identifier[seen] operator[=] Keyword[new] identifier[TreeSet] operator[<] identifier[Character] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[len] operator[SEP] identifier[i] operator[++] operator[SEP] {
identifier[Character] identifier[c] operator[=] identifier[Character] operator[SEP] identifier[valueOf] operator[SEP] Keyword[this] operator[SEP] identifier[payload] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[seen] operator[SEP] identifier[contains] operator[SEP] identifier[c] operator[SEP] operator[SEP] {
Keyword[continue] operator[SEP]
}
Keyword[else] {
identifier[seen] operator[SEP] identifier[add] operator[SEP] identifier[c] operator[SEP] operator[SEP]
}
}
Keyword[if] operator[SEP] identifier[complexity] operator[SEP] identifier[intValue] operator[SEP] operator[SEP] operator[<=] identifier[seen] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] {
Keyword[return] literal[boolean] operator[SEP]
}
}
Keyword[return] literal[boolean] operator[SEP]
}
|
public com.google.api.Control getControl() {
return control_ == null ? com.google.api.Control.getDefaultInstance() : control_;
} | class class_name[name] begin[{]
method[getControl, return_type[type[com]], modifier[public], parameter[]] begin[{]
return[TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=control_, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), if_false=MemberReference(member=control_, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_true=MethodInvocation(arguments=[], member=getDefaultInstance, postfix_operators=[], prefix_operators=[], qualifier=com.google.api.Control, selectors=[], type_arguments=None))]
end[}]
END[}] | Keyword[public] identifier[com] operator[SEP] identifier[google] operator[SEP] identifier[api] operator[SEP] identifier[Control] identifier[getControl] operator[SEP] operator[SEP] {
Keyword[return] identifier[control_] operator[==] Other[null] operator[?] identifier[com] operator[SEP] identifier[google] operator[SEP] identifier[api] operator[SEP] identifier[Control] operator[SEP] identifier[getDefaultInstance] operator[SEP] operator[SEP] operator[:] identifier[control_] operator[SEP]
}
|
public int readBits(final JBBPBitNumber numOfBitsToRead) throws IOException {
int result;
final int numOfBitsAsNumber = numOfBitsToRead.getBitNumber();
if (this.bitsInBuffer == 0 && numOfBitsAsNumber == 8) {
result = this.readByteFromStream();
if (result >= 0) {
this.byteCounter++;
}
return result;
} else {
result = 0;
if (numOfBitsAsNumber == this.bitsInBuffer) {
result = this.bitBuffer;
this.bitBuffer = 0;
this.bitsInBuffer = 0;
this.byteCounter++;
return result;
}
int i = numOfBitsAsNumber;
int theBitBuffer = this.bitBuffer;
int theBitBufferCounter = this.bitsInBuffer;
final boolean doIncCounter = theBitBufferCounter != 0;
while (i > 0) {
if (theBitBufferCounter == 0) {
if (doIncCounter) {
this.byteCounter++;
}
final int nextByte = this.readByteFromStream();
if (nextByte < 0) {
if (i == numOfBitsAsNumber) {
return nextByte;
} else {
break;
}
} else {
theBitBuffer = nextByte;
theBitBufferCounter = 8;
}
}
result = (result << 1) | (theBitBuffer & 1);
theBitBuffer >>= 1;
theBitBufferCounter--;
i--;
}
this.bitBuffer = theBitBuffer;
this.bitsInBuffer = theBitBufferCounter;
return JBBPUtils.reverseBitsInByte(JBBPBitNumber.decode(numOfBitsAsNumber - i), (byte) result) & 0xFF;
}
} | class class_name[name] begin[{]
method[readBits, return_type[type[int]], modifier[public], parameter[numOfBitsToRead]] begin[{]
local_variable[type[int], result]
local_variable[type[int], numOfBitsAsNumber]
if[binary_operation[binary_operation[THIS[member[None.bitsInBuffer]], ==, literal[0]], &&, binary_operation[member[.numOfBitsAsNumber], ==, literal[8]]]] begin[{]
assign[member[.result], THIS[call[None.readByteFromStream, parameter[]]]]
if[binary_operation[member[.result], >=, literal[0]]] begin[{]
THIS[member[None.byteCounter]]
else begin[{]
None
end[}]
return[member[.result]]
else begin[{]
assign[member[.result], literal[0]]
if[binary_operation[member[.numOfBitsAsNumber], ==, THIS[member[None.bitsInBuffer]]]] begin[{]
assign[member[.result], THIS[member[None.bitBuffer]]]
assign[THIS[member[None.bitBuffer]], literal[0]]
assign[THIS[member[None.bitsInBuffer]], literal[0]]
THIS[member[None.byteCounter]]
return[member[.result]]
else begin[{]
None
end[}]
local_variable[type[int], i]
local_variable[type[int], theBitBuffer]
local_variable[type[int], theBitBufferCounter]
local_variable[type[boolean], doIncCounter]
while[binary_operation[member[.i], >, literal[0]]] begin[{]
if[binary_operation[member[.theBitBufferCounter], ==, literal[0]]] begin[{]
if[member[.doIncCounter]] begin[{]
THIS[member[None.byteCounter]]
else begin[{]
None
end[}]
local_variable[type[int], nextByte]
if[binary_operation[member[.nextByte], <, literal[0]]] begin[{]
if[binary_operation[member[.i], ==, member[.numOfBitsAsNumber]]] begin[{]
return[member[.nextByte]]
else begin[{]
BreakStatement(goto=None, label=None)
end[}]
else begin[{]
assign[member[.theBitBuffer], member[.nextByte]]
assign[member[.theBitBufferCounter], literal[8]]
end[}]
else begin[{]
None
end[}]
assign[member[.result], binary_operation[binary_operation[member[.result], <<, literal[1]], |, binary_operation[member[.theBitBuffer], &, literal[1]]]]
assign[member[.theBitBuffer], literal[1]]
member[.theBitBufferCounter]
member[.i]
end[}]
assign[THIS[member[None.bitBuffer]], member[.theBitBuffer]]
assign[THIS[member[None.bitsInBuffer]], member[.theBitBufferCounter]]
return[binary_operation[call[JBBPUtils.reverseBitsInByte, parameter[call[JBBPBitNumber.decode, parameter[binary_operation[member[.numOfBitsAsNumber], -, member[.i]]]], Cast(expression=MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=BasicType(dimensions=[], name=byte))]], &, literal[0xFF]]]
end[}]
end[}]
END[}] | Keyword[public] Keyword[int] identifier[readBits] operator[SEP] Keyword[final] identifier[JBBPBitNumber] identifier[numOfBitsToRead] operator[SEP] Keyword[throws] identifier[IOException] {
Keyword[int] identifier[result] operator[SEP] Keyword[final] Keyword[int] identifier[numOfBitsAsNumber] operator[=] identifier[numOfBitsToRead] operator[SEP] identifier[getBitNumber] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[bitsInBuffer] operator[==] Other[0] operator[&&] identifier[numOfBitsAsNumber] operator[==] Other[8] operator[SEP] {
identifier[result] operator[=] Keyword[this] operator[SEP] identifier[readByteFromStream] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[result] operator[>=] Other[0] operator[SEP] {
Keyword[this] operator[SEP] identifier[byteCounter] operator[++] operator[SEP]
}
Keyword[return] identifier[result] operator[SEP]
}
Keyword[else] {
identifier[result] operator[=] Other[0] operator[SEP] Keyword[if] operator[SEP] identifier[numOfBitsAsNumber] operator[==] Keyword[this] operator[SEP] identifier[bitsInBuffer] operator[SEP] {
identifier[result] operator[=] Keyword[this] operator[SEP] identifier[bitBuffer] operator[SEP] Keyword[this] operator[SEP] identifier[bitBuffer] operator[=] Other[0] operator[SEP] Keyword[this] operator[SEP] identifier[bitsInBuffer] operator[=] Other[0] operator[SEP] Keyword[this] operator[SEP] identifier[byteCounter] operator[++] operator[SEP] Keyword[return] identifier[result] operator[SEP]
}
Keyword[int] identifier[i] operator[=] identifier[numOfBitsAsNumber] operator[SEP] Keyword[int] identifier[theBitBuffer] operator[=] Keyword[this] operator[SEP] identifier[bitBuffer] operator[SEP] Keyword[int] identifier[theBitBufferCounter] operator[=] Keyword[this] operator[SEP] identifier[bitsInBuffer] operator[SEP] Keyword[final] Keyword[boolean] identifier[doIncCounter] operator[=] identifier[theBitBufferCounter] operator[!=] Other[0] operator[SEP] Keyword[while] operator[SEP] identifier[i] operator[>] Other[0] operator[SEP] {
Keyword[if] operator[SEP] identifier[theBitBufferCounter] operator[==] Other[0] operator[SEP] {
Keyword[if] operator[SEP] identifier[doIncCounter] operator[SEP] {
Keyword[this] operator[SEP] identifier[byteCounter] operator[++] operator[SEP]
}
Keyword[final] Keyword[int] identifier[nextByte] operator[=] Keyword[this] operator[SEP] identifier[readByteFromStream] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[nextByte] operator[<] Other[0] operator[SEP] {
Keyword[if] operator[SEP] identifier[i] operator[==] identifier[numOfBitsAsNumber] operator[SEP] {
Keyword[return] identifier[nextByte] operator[SEP]
}
Keyword[else] {
Keyword[break] operator[SEP]
}
}
Keyword[else] {
identifier[theBitBuffer] operator[=] identifier[nextByte] operator[SEP] identifier[theBitBufferCounter] operator[=] Other[8] operator[SEP]
}
}
identifier[result] operator[=] operator[SEP] identifier[result] operator[<<] Other[1] operator[SEP] operator[|] operator[SEP] identifier[theBitBuffer] operator[&] Other[1] operator[SEP] operator[SEP] identifier[theBitBuffer] operator[>>=] Other[1] operator[SEP] identifier[theBitBufferCounter] operator[--] operator[SEP] identifier[i] operator[--] operator[SEP]
}
Keyword[this] operator[SEP] identifier[bitBuffer] operator[=] identifier[theBitBuffer] operator[SEP] Keyword[this] operator[SEP] identifier[bitsInBuffer] operator[=] identifier[theBitBufferCounter] operator[SEP] Keyword[return] identifier[JBBPUtils] operator[SEP] identifier[reverseBitsInByte] operator[SEP] identifier[JBBPBitNumber] operator[SEP] identifier[decode] operator[SEP] identifier[numOfBitsAsNumber] operator[-] identifier[i] operator[SEP] , operator[SEP] Keyword[byte] operator[SEP] identifier[result] operator[SEP] operator[&] literal[Integer] operator[SEP]
}
}
|
@Override
public FSDataOutputStream create(Path f, WriteMode overwriteMode) throws IOException {
return createOutputStream(() -> originalFs.create(f, overwriteMode));
} | class class_name[name] begin[{]
method[create, return_type[type[FSDataOutputStream]], modifier[public], parameter[f, overwriteMode]] begin[{]
return[call[.createOutputStream, parameter[LambdaExpression(body=MethodInvocation(arguments=[MemberReference(member=f, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=overwriteMode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=create, postfix_operators=[], prefix_operators=[], qualifier=originalFs, selectors=[], type_arguments=None), parameters=[])]]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] identifier[FSDataOutputStream] identifier[create] operator[SEP] identifier[Path] identifier[f] , identifier[WriteMode] identifier[overwriteMode] operator[SEP] Keyword[throws] identifier[IOException] {
Keyword[return] identifier[createOutputStream] operator[SEP] operator[SEP] operator[SEP] operator[->] identifier[originalFs] operator[SEP] identifier[create] operator[SEP] identifier[f] , identifier[overwriteMode] operator[SEP] operator[SEP] operator[SEP]
}
|
@Override
public void terminationComplete(RecoveryAgent recoveryAgent, FailureScope failureScope) throws InvalidFailureScopeException {
if (tc.isEntryEnabled())
Tr.entry(tc, "terminationComplete", new Object[] { recoveryAgent, failureScope, this });
final boolean removed = removeTerminationRecord(recoveryAgent, failureScope);
if (!removed) {
if (tc.isEventEnabled())
Tr.event(tc, "The supplied FailureScope was not recognized as an outstaning termination request for this RecoveryAgent");
if (tc.isEntryEnabled())
Tr.exit(tc, "terminationComplete", "InvalidFailureScopeException");
throw new InvalidFailureScopeException(null);
}
if (tc.isEntryEnabled())
Tr.exit(tc, "terminationComplete");
} | class class_name[name] begin[{]
method[terminationComplete, return_type[void], modifier[public], parameter[recoveryAgent, failureScope]] begin[{]
if[call[tc.isEntryEnabled, parameter[]]] begin[{]
call[Tr.entry, parameter[member[.tc], literal["terminationComplete"], ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MemberReference(member=recoveryAgent, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=failureScope, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[])]), 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], removed]
if[member[.removed]] begin[{]
if[call[tc.isEventEnabled, parameter[]]] begin[{]
call[Tr.event, parameter[member[.tc], literal["The supplied FailureScope was not recognized as an outstaning termination request for this RecoveryAgent"]]]
else begin[{]
None
end[}]
if[call[tc.isEntryEnabled, parameter[]]] begin[{]
call[Tr.exit, parameter[member[.tc], literal["terminationComplete"], literal["InvalidFailureScopeException"]]]
else begin[{]
None
end[}]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=InvalidFailureScopeException, sub_type=None)), label=None)
else begin[{]
None
end[}]
if[call[tc.isEntryEnabled, parameter[]]] begin[{]
call[Tr.exit, parameter[member[.tc], literal["terminationComplete"]]]
else begin[{]
None
end[}]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[terminationComplete] operator[SEP] identifier[RecoveryAgent] identifier[recoveryAgent] , identifier[FailureScope] identifier[failureScope] operator[SEP] Keyword[throws] identifier[InvalidFailureScopeException] {
Keyword[if] operator[SEP] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[Tr] operator[SEP] identifier[entry] operator[SEP] identifier[tc] , literal[String] , Keyword[new] identifier[Object] operator[SEP] operator[SEP] {
identifier[recoveryAgent] , identifier[failureScope] , Keyword[this]
} operator[SEP] operator[SEP] Keyword[final] Keyword[boolean] identifier[removed] operator[=] identifier[removeTerminationRecord] operator[SEP] identifier[recoveryAgent] , identifier[failureScope] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[removed] operator[SEP] {
Keyword[if] operator[SEP] identifier[tc] operator[SEP] identifier[isEventEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[Tr] operator[SEP] identifier[event] operator[SEP] identifier[tc] , literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[Tr] operator[SEP] identifier[exit] operator[SEP] identifier[tc] , literal[String] , literal[String] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[InvalidFailureScopeException] operator[SEP] Other[null] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[Tr] operator[SEP] identifier[exit] operator[SEP] identifier[tc] , literal[String] operator[SEP] operator[SEP]
}
|
private <I extends Message, O extends Message> void invoke(
ServerMethod<I, O> method, ByteString payload, long requestId, Channel channel) {
FutureCallback<O> callback = new ServerMethodCallback<>(method, requestId, channel);
try {
I request = method.inputParser().parseFrom(payload);
ListenableFuture<O> result = method.invoke(request);
pendingRequests.put(requestId, result);
Futures.addCallback(result, callback, responseCallbackExecutor);
} catch (InvalidProtocolBufferException ipbe) {
callback.onFailure(ipbe);
}
} | class class_name[name] begin[{]
method[invoke, return_type[void], modifier[private], parameter[method, payload, requestId, channel]] begin[{]
local_variable[type[FutureCallback], callback]
TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=inputParser, postfix_operators=[], prefix_operators=[], qualifier=method, selectors=[MethodInvocation(arguments=[MemberReference(member=payload, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=parseFrom, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=request)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=I, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=request, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=invoke, postfix_operators=[], prefix_operators=[], qualifier=method, selectors=[], type_arguments=None), name=result)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=O, sub_type=None))], dimensions=[], name=ListenableFuture, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=requestId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=put, postfix_operators=[], prefix_operators=[], qualifier=pendingRequests, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=callback, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=responseCallbackExecutor, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addCallback, postfix_operators=[], prefix_operators=[], qualifier=Futures, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=ipbe, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=onFailure, postfix_operators=[], prefix_operators=[], qualifier=callback, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ipbe, types=['InvalidProtocolBufferException']))], finally_block=None, label=None, resources=None)
end[}]
END[}] | Keyword[private] operator[<] identifier[I] Keyword[extends] identifier[Message] , identifier[O] Keyword[extends] identifier[Message] operator[>] Keyword[void] identifier[invoke] operator[SEP] identifier[ServerMethod] operator[<] identifier[I] , identifier[O] operator[>] identifier[method] , identifier[ByteString] identifier[payload] , Keyword[long] identifier[requestId] , identifier[Channel] identifier[channel] operator[SEP] {
identifier[FutureCallback] operator[<] identifier[O] operator[>] identifier[callback] operator[=] Keyword[new] identifier[ServerMethodCallback] operator[<] operator[>] operator[SEP] identifier[method] , identifier[requestId] , identifier[channel] operator[SEP] operator[SEP] Keyword[try] {
identifier[I] identifier[request] operator[=] identifier[method] operator[SEP] identifier[inputParser] operator[SEP] operator[SEP] operator[SEP] identifier[parseFrom] operator[SEP] identifier[payload] operator[SEP] operator[SEP] identifier[ListenableFuture] operator[<] identifier[O] operator[>] identifier[result] operator[=] identifier[method] operator[SEP] identifier[invoke] operator[SEP] identifier[request] operator[SEP] operator[SEP] identifier[pendingRequests] operator[SEP] identifier[put] operator[SEP] identifier[requestId] , identifier[result] operator[SEP] operator[SEP] identifier[Futures] operator[SEP] identifier[addCallback] operator[SEP] identifier[result] , identifier[callback] , identifier[responseCallbackExecutor] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[InvalidProtocolBufferException] identifier[ipbe] operator[SEP] {
identifier[callback] operator[SEP] identifier[onFailure] operator[SEP] identifier[ipbe] operator[SEP] operator[SEP]
}
}
|
public void setInputUpdates(java.util.Collection<InputUpdate> inputUpdates) {
if (inputUpdates == null) {
this.inputUpdates = null;
return;
}
this.inputUpdates = new java.util.ArrayList<InputUpdate>(inputUpdates);
} | class class_name[name] begin[{]
method[setInputUpdates, return_type[void], modifier[public], parameter[inputUpdates]] begin[{]
if[binary_operation[member[.inputUpdates], ==, literal[null]]] begin[{]
assign[THIS[member[None.inputUpdates]], literal[null]]
return[None]
else begin[{]
None
end[}]
assign[THIS[member[None.inputUpdates]], ClassCreator(arguments=[MemberReference(member=inputUpdates, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=java, sub_type=ReferenceType(arguments=None, dimensions=None, name=util, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=InputUpdate, sub_type=None))], dimensions=None, name=ArrayList, sub_type=None))))]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[setInputUpdates] operator[SEP] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[Collection] operator[<] identifier[InputUpdate] operator[>] identifier[inputUpdates] operator[SEP] {
Keyword[if] operator[SEP] identifier[inputUpdates] operator[==] Other[null] operator[SEP] {
Keyword[this] operator[SEP] identifier[inputUpdates] operator[=] Other[null] operator[SEP] Keyword[return] operator[SEP]
}
Keyword[this] operator[SEP] identifier[inputUpdates] operator[=] Keyword[new] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[ArrayList] operator[<] identifier[InputUpdate] operator[>] operator[SEP] identifier[inputUpdates] operator[SEP] operator[SEP]
}
|
public static Long getSeqMinValue(Properties prop)
{
String result = prop.getProperty(PROP_SEQ_MIN_VALUE, null);
if(result != null)
{
return new Long(Long.parseLong(result));
}
else
{
return null;
}
} | class class_name[name] begin[{]
method[getSeqMinValue, return_type[type[Long]], modifier[public static], parameter[prop]] begin[{]
local_variable[type[String], result]
if[binary_operation[member[.result], !=, literal[null]]] begin[{]
return[ClassCreator(arguments=[MethodInvocation(arguments=[MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=parseLong, postfix_operators=[], prefix_operators=[], qualifier=Long, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Long, sub_type=None))]
else begin[{]
return[literal[null]]
end[}]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[Long] identifier[getSeqMinValue] operator[SEP] identifier[Properties] identifier[prop] operator[SEP] {
identifier[String] identifier[result] operator[=] identifier[prop] operator[SEP] identifier[getProperty] operator[SEP] identifier[PROP_SEQ_MIN_VALUE] , Other[null] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[result] operator[!=] Other[null] operator[SEP] {
Keyword[return] Keyword[new] identifier[Long] operator[SEP] identifier[Long] operator[SEP] identifier[parseLong] operator[SEP] identifier[result] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] {
Keyword[return] Other[null] operator[SEP]
}
}
|
@Override
public void eUnset(int featureID) {
switch (featureID) {
case AfplibPackage.EII__IMO_NAME:
setImoName(IMO_NAME_EDEFAULT);
return;
}
super.eUnset(featureID);
} | class class_name[name] begin[{]
method[eUnset, return_type[void], modifier[public], parameter[featureID]] begin[{]
SwitchStatement(cases=[SwitchStatementCase(case=[MemberReference(member=EII__IMO_NAME, postfix_operators=[], prefix_operators=[], qualifier=AfplibPackage, selectors=[])], statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=IMO_NAME_EDEFAULT, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setImoName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=None, label=None)])], expression=MemberReference(member=featureID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)
SuperMethodInvocation(arguments=[MemberReference(member=featureID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=eUnset, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None)
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[eUnset] operator[SEP] Keyword[int] identifier[featureID] operator[SEP] {
Keyword[switch] operator[SEP] identifier[featureID] operator[SEP] {
Keyword[case] identifier[AfplibPackage] operator[SEP] identifier[EII__IMO_NAME] operator[:] identifier[setImoName] operator[SEP] identifier[IMO_NAME_EDEFAULT] operator[SEP] operator[SEP] Keyword[return] operator[SEP]
}
Keyword[super] operator[SEP] identifier[eUnset] operator[SEP] identifier[featureID] operator[SEP] operator[SEP]
}
|
@Override
public Map<String, String> getTelemetryProperties() {
final Map<String, String> map = super.getTelemetryProperties();
final WebAppConfiguration webAppConfiguration;
try {
webAppConfiguration = getWebAppConfiguration();
} catch (Exception e) {
map.put(INVALID_CONFIG_KEY, e.getMessage());
return map;
}
if (webAppConfiguration.getImage() != null) {
final String imageType = WebAppUtils.getDockerImageType(webAppConfiguration.getImage(),
webAppConfiguration.getServerId(), webAppConfiguration.getRegistryUrl()).toString();
map.put(DOCKER_IMAGE_TYPE_KEY, imageType);
} else {
map.put(DOCKER_IMAGE_TYPE_KEY, DockerImageType.NONE.toString());
}
map.put(SCHEMA_VERSION_KEY, schemaVersion);
map.put(OS_KEY, webAppConfiguration.getOs() == null ? "" : webAppConfiguration.getOs().toString());
map.put(JAVA_VERSION_KEY, webAppConfiguration.getJavaVersion() == null ? "" :
webAppConfiguration.getJavaVersion().toString());
map.put(JAVA_WEB_CONTAINER_KEY, webAppConfiguration.getWebContainer() == null ? "" :
webAppConfiguration.getJavaVersion().toString());
map.put(LINUX_RUNTIME_KEY, webAppConfiguration.getRuntimeStack() == null ? "" :
webAppConfiguration.getRuntimeStack().stack() + " " + webAppConfiguration.getRuntimeStack().version());
try {
map.put(DEPLOYMENT_TYPE_KEY, getDeploymentType().toString());
} catch (MojoExecutionException e) {
map.put(DEPLOYMENT_TYPE_KEY, "Unknown deployment type.");
}
return map;
} | class class_name[name] begin[{]
method[getTelemetryProperties, return_type[type[Map]], modifier[public], parameter[]] begin[{]
local_variable[type[Map], map]
local_variable[type[WebAppConfiguration], webAppConfiguration]
TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=webAppConfiguration, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=getWebAppConfiguration, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=INVALID_CONFIG_KEY, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None)], member=put, postfix_operators=[], prefix_operators=[], qualifier=map, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=MemberReference(member=map, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None)
if[binary_operation[call[webAppConfiguration.getImage, parameter[]], !=, literal[null]]] begin[{]
local_variable[type[String], imageType]
call[map.put, parameter[member[.DOCKER_IMAGE_TYPE_KEY], member[.imageType]]]
else begin[{]
call[map.put, parameter[member[.DOCKER_IMAGE_TYPE_KEY], call[DockerImageType.NONE.toString, parameter[]]]]
end[}]
call[map.put, parameter[member[.SCHEMA_VERSION_KEY], member[.schemaVersion]]]
call[map.put, parameter[member[.OS_KEY], TernaryExpression(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getOs, postfix_operators=[], prefix_operators=[], qualifier=webAppConfiguration, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), if_false=MethodInvocation(arguments=[], member=getOs, postfix_operators=[], prefix_operators=[], qualifier=webAppConfiguration, selectors=[MethodInvocation(arguments=[], member=toString, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=""))]]
call[map.put, parameter[member[.JAVA_VERSION_KEY], TernaryExpression(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getJavaVersion, postfix_operators=[], prefix_operators=[], qualifier=webAppConfiguration, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), if_false=MethodInvocation(arguments=[], member=getJavaVersion, postfix_operators=[], prefix_operators=[], qualifier=webAppConfiguration, selectors=[MethodInvocation(arguments=[], member=toString, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=""))]]
call[map.put, parameter[member[.JAVA_WEB_CONTAINER_KEY], TernaryExpression(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getWebContainer, postfix_operators=[], prefix_operators=[], qualifier=webAppConfiguration, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), if_false=MethodInvocation(arguments=[], member=getJavaVersion, postfix_operators=[], prefix_operators=[], qualifier=webAppConfiguration, selectors=[MethodInvocation(arguments=[], member=toString, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=""))]]
call[map.put, parameter[member[.LINUX_RUNTIME_KEY], TernaryExpression(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getRuntimeStack, postfix_operators=[], prefix_operators=[], qualifier=webAppConfiguration, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), if_false=BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getRuntimeStack, postfix_operators=[], prefix_operators=[], qualifier=webAppConfiguration, selectors=[MethodInvocation(arguments=[], member=stack, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" "), operator=+), operandr=MethodInvocation(arguments=[], member=getRuntimeStack, postfix_operators=[], prefix_operators=[], qualifier=webAppConfiguration, selectors=[MethodInvocation(arguments=[], member=version, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operator=+), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=""))]]
TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=DEPLOYMENT_TYPE_KEY, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getDeploymentType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[], member=toString, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=put, postfix_operators=[], prefix_operators=[], qualifier=map, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=DEPLOYMENT_TYPE_KEY, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unknown deployment type.")], member=put, postfix_operators=[], prefix_operators=[], qualifier=map, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['MojoExecutionException']))], finally_block=None, label=None, resources=None)
return[member[.map]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[getTelemetryProperties] operator[SEP] operator[SEP] {
Keyword[final] identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[map] operator[=] Keyword[super] operator[SEP] identifier[getTelemetryProperties] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[WebAppConfiguration] identifier[webAppConfiguration] operator[SEP] Keyword[try] {
identifier[webAppConfiguration] operator[=] identifier[getWebAppConfiguration] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] {
identifier[map] operator[SEP] identifier[put] operator[SEP] identifier[INVALID_CONFIG_KEY] , identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[map] operator[SEP]
}
Keyword[if] operator[SEP] identifier[webAppConfiguration] operator[SEP] identifier[getImage] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] {
Keyword[final] identifier[String] identifier[imageType] operator[=] identifier[WebAppUtils] operator[SEP] identifier[getDockerImageType] operator[SEP] identifier[webAppConfiguration] operator[SEP] identifier[getImage] operator[SEP] operator[SEP] , identifier[webAppConfiguration] operator[SEP] identifier[getServerId] operator[SEP] operator[SEP] , identifier[webAppConfiguration] operator[SEP] identifier[getRegistryUrl] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] identifier[map] operator[SEP] identifier[put] operator[SEP] identifier[DOCKER_IMAGE_TYPE_KEY] , identifier[imageType] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[map] operator[SEP] identifier[put] operator[SEP] identifier[DOCKER_IMAGE_TYPE_KEY] , identifier[DockerImageType] operator[SEP] identifier[NONE] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
identifier[map] operator[SEP] identifier[put] operator[SEP] identifier[SCHEMA_VERSION_KEY] , identifier[schemaVersion] operator[SEP] operator[SEP] identifier[map] operator[SEP] identifier[put] operator[SEP] identifier[OS_KEY] , identifier[webAppConfiguration] operator[SEP] identifier[getOs] operator[SEP] operator[SEP] operator[==] Other[null] operator[?] literal[String] operator[:] identifier[webAppConfiguration] operator[SEP] identifier[getOs] operator[SEP] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[map] operator[SEP] identifier[put] operator[SEP] identifier[JAVA_VERSION_KEY] , identifier[webAppConfiguration] operator[SEP] identifier[getJavaVersion] operator[SEP] operator[SEP] operator[==] Other[null] operator[?] literal[String] operator[:] identifier[webAppConfiguration] operator[SEP] identifier[getJavaVersion] operator[SEP] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[map] operator[SEP] identifier[put] operator[SEP] identifier[JAVA_WEB_CONTAINER_KEY] , identifier[webAppConfiguration] operator[SEP] identifier[getWebContainer] operator[SEP] operator[SEP] operator[==] Other[null] operator[?] literal[String] operator[:] identifier[webAppConfiguration] operator[SEP] identifier[getJavaVersion] operator[SEP] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[map] operator[SEP] identifier[put] operator[SEP] identifier[LINUX_RUNTIME_KEY] , identifier[webAppConfiguration] operator[SEP] identifier[getRuntimeStack] operator[SEP] operator[SEP] operator[==] Other[null] operator[?] literal[String] operator[:] identifier[webAppConfiguration] operator[SEP] identifier[getRuntimeStack] operator[SEP] operator[SEP] operator[SEP] identifier[stack] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[webAppConfiguration] operator[SEP] identifier[getRuntimeStack] operator[SEP] operator[SEP] operator[SEP] identifier[version] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[try] {
identifier[map] operator[SEP] identifier[put] operator[SEP] identifier[DEPLOYMENT_TYPE_KEY] , identifier[getDeploymentType] operator[SEP] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[MojoExecutionException] identifier[e] operator[SEP] {
identifier[map] operator[SEP] identifier[put] operator[SEP] identifier[DEPLOYMENT_TYPE_KEY] , literal[String] operator[SEP] operator[SEP]
}
Keyword[return] identifier[map] operator[SEP]
}
|
private boolean doSetScale(double scale) {
boolean res = Math.abs(viewState.getScale() - scale) > .0000001;
viewState = viewState.copyAndSetScale(scale);
return res;
} | class class_name[name] begin[{]
method[doSetScale, return_type[type[boolean]], modifier[private], parameter[scale]] begin[{]
local_variable[type[boolean], res]
assign[member[.viewState], call[viewState.copyAndSetScale, parameter[member[.scale]]]]
return[member[.res]]
end[}]
END[}] | Keyword[private] Keyword[boolean] identifier[doSetScale] operator[SEP] Keyword[double] identifier[scale] operator[SEP] {
Keyword[boolean] identifier[res] operator[=] identifier[Math] operator[SEP] identifier[abs] operator[SEP] identifier[viewState] operator[SEP] identifier[getScale] operator[SEP] operator[SEP] operator[-] identifier[scale] operator[SEP] operator[>] literal[Float] operator[SEP] identifier[viewState] operator[=] identifier[viewState] operator[SEP] identifier[copyAndSetScale] operator[SEP] identifier[scale] operator[SEP] operator[SEP] Keyword[return] identifier[res] operator[SEP]
}
|
public static void generateJavadocGeneratedBy(Builder builder) {
if (!BindDataSourceSubProcessor.JUNIT_TEST_MODE) {
builder.addJavadoc("<p><strong>This class is generated by Kripton Annotation Processor - v. $L</strong></p>\n", Version.getVersion());
builder.addJavadoc("<p><strong>Generation-time: $L</strong></p>\n\n", (new Date()).toString());
}
} | class class_name[name] begin[{]
method[generateJavadocGeneratedBy, return_type[void], modifier[public static], parameter[builder]] begin[{]
if[member[BindDataSourceSubProcessor.JUNIT_TEST_MODE]] begin[{]
call[builder.addJavadoc, parameter[literal["<p><strong>This class is generated by Kripton Annotation Processor - v. $L</strong></p>\n"], call[Version.getVersion, parameter[]]]]
call[builder.addJavadoc, parameter[literal["<p><strong>Generation-time: $L</strong></p>\n\n"], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[], member=toString, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=Date, sub_type=None))]]
else begin[{]
None
end[}]
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[void] identifier[generateJavadocGeneratedBy] operator[SEP] identifier[Builder] identifier[builder] operator[SEP] {
Keyword[if] operator[SEP] operator[!] identifier[BindDataSourceSubProcessor] operator[SEP] identifier[JUNIT_TEST_MODE] operator[SEP] {
identifier[builder] operator[SEP] identifier[addJavadoc] operator[SEP] literal[String] , identifier[Version] operator[SEP] identifier[getVersion] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[builder] operator[SEP] identifier[addJavadoc] operator[SEP] literal[String] , operator[SEP] Keyword[new] identifier[Date] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
}
|
public void revokeService(Class serviceClass, BeanContextServiceProvider serviceProvider, boolean revokeCurrentServicesNow)
{
if (serviceClass == null || serviceProvider == null)
{
throw new NullPointerException();
}
synchronized (globalHierarchyLock)
{
synchronized (services)
{
BCSSServiceProvider bcssProvider = (BCSSServiceProvider) services.get(serviceClass);
if (bcssProvider == null)
{ // non-exist service
return;
}
if (bcssProvider.getServiceProvider() != serviceProvider)
{
throw new IllegalArgumentException(Messages.getString("beans.66"));
}
services.remove(serviceClass);
if (serviceProvider instanceof Serializable)
{
serializable--;
}
}
}
// notify listeners
fireServiceRevoked(serviceClass, revokeCurrentServicesNow);
// notify service users
notifyServiceRevokedToServiceUsers(serviceClass, serviceProvider, revokeCurrentServicesNow);
} | class class_name[name] begin[{]
method[revokeService, return_type[void], modifier[public], parameter[serviceClass, serviceProvider, revokeCurrentServicesNow]] begin[{]
if[binary_operation[binary_operation[member[.serviceClass], ==, literal[null]], ||, binary_operation[member[.serviceProvider], ==, literal[null]]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=NullPointerException, sub_type=None)), label=None)
else begin[{]
None
end[}]
SYNCHRONIZED[member[.globalHierarchyLock]] BEGIN[{]
SYNCHRONIZED[member[.services]] BEGIN[{]
local_variable[type[BCSSServiceProvider], bcssProvider]
if[binary_operation[member[.bcssProvider], ==, literal[null]]] begin[{]
return[None]
else begin[{]
None
end[}]
if[binary_operation[call[bcssProvider.getServiceProvider, parameter[]], !=, member[.serviceProvider]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="beans.66")], member=getString, postfix_operators=[], prefix_operators=[], qualifier=Messages, selectors=[], type_arguments=None)], 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[services.remove, parameter[member[.serviceClass]]]
if[binary_operation[member[.serviceProvider], instanceof, type[Serializable]]] begin[{]
member[.serializable]
else begin[{]
None
end[}]
END[}]
END[}]
call[.fireServiceRevoked, parameter[member[.serviceClass], member[.revokeCurrentServicesNow]]]
call[.notifyServiceRevokedToServiceUsers, parameter[member[.serviceClass], member[.serviceProvider], member[.revokeCurrentServicesNow]]]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[revokeService] operator[SEP] identifier[Class] identifier[serviceClass] , identifier[BeanContextServiceProvider] identifier[serviceProvider] , Keyword[boolean] identifier[revokeCurrentServicesNow] operator[SEP] {
Keyword[if] operator[SEP] identifier[serviceClass] operator[==] Other[null] operator[||] identifier[serviceProvider] operator[==] Other[null] operator[SEP] {
Keyword[throw] Keyword[new] identifier[NullPointerException] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[synchronized] operator[SEP] identifier[globalHierarchyLock] operator[SEP] {
Keyword[synchronized] operator[SEP] identifier[services] operator[SEP] {
identifier[BCSSServiceProvider] identifier[bcssProvider] operator[=] operator[SEP] identifier[BCSSServiceProvider] operator[SEP] identifier[services] operator[SEP] identifier[get] operator[SEP] identifier[serviceClass] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[bcssProvider] operator[==] Other[null] operator[SEP] {
Keyword[return] operator[SEP]
}
Keyword[if] operator[SEP] identifier[bcssProvider] operator[SEP] identifier[getServiceProvider] operator[SEP] operator[SEP] operator[!=] identifier[serviceProvider] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] identifier[Messages] operator[SEP] identifier[getString] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP]
}
identifier[services] operator[SEP] identifier[remove] operator[SEP] identifier[serviceClass] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[serviceProvider] Keyword[instanceof] identifier[Serializable] operator[SEP] {
identifier[serializable] operator[--] operator[SEP]
}
}
}
identifier[fireServiceRevoked] operator[SEP] identifier[serviceClass] , identifier[revokeCurrentServicesNow] operator[SEP] operator[SEP] identifier[notifyServiceRevokedToServiceUsers] operator[SEP] identifier[serviceClass] , identifier[serviceProvider] , identifier[revokeCurrentServicesNow] operator[SEP] operator[SEP]
}
|
private List getResources(ZipFile file, String root)
{
List resourceNames = new ArrayList();
Enumeration e = file.entries();
while (e.hasMoreElements())
{
ZipEntry entry = (ZipEntry) e.nextElement();
String name = entry.getName();
if (name.startsWith(root)
&& !(name.indexOf('/') > root.length())
&& !entry.isDirectory())
{
// Calling File.getPath() cleans up the path so that it's using
// the proper path separators for the host OS
name = new File(name).getPath();
resourceNames.add(name);
}
}
return resourceNames;
} | class class_name[name] begin[{]
method[getResources, return_type[type[List]], modifier[private], parameter[file, root]] begin[{]
local_variable[type[List], resourceNames]
local_variable[type[Enumeration], e]
while[call[e.hasMoreElements, parameter[]]] begin[{]
local_variable[type[ZipEntry], entry]
local_variable[type[String], name]
if[binary_operation[binary_operation[call[name.startsWith, parameter[member[.root]]], &&, binary_operation[call[name.indexOf, parameter[literal['/']]], >, call[root.length, parameter[]]]], &&, call[entry.isDirectory, parameter[]]]] begin[{]
assign[member[.name], ClassCreator(arguments=[MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[], member=getPath, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=File, sub_type=None))]
call[resourceNames.add, parameter[member[.name]]]
else begin[{]
None
end[}]
end[}]
return[member[.resourceNames]]
end[}]
END[}] | Keyword[private] identifier[List] identifier[getResources] operator[SEP] identifier[ZipFile] identifier[file] , identifier[String] identifier[root] operator[SEP] {
identifier[List] identifier[resourceNames] operator[=] Keyword[new] identifier[ArrayList] operator[SEP] operator[SEP] operator[SEP] identifier[Enumeration] identifier[e] operator[=] identifier[file] operator[SEP] identifier[entries] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[e] operator[SEP] identifier[hasMoreElements] operator[SEP] operator[SEP] operator[SEP] {
identifier[ZipEntry] identifier[entry] operator[=] operator[SEP] identifier[ZipEntry] operator[SEP] identifier[e] operator[SEP] identifier[nextElement] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[name] operator[=] identifier[entry] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[name] operator[SEP] identifier[startsWith] operator[SEP] identifier[root] operator[SEP] operator[&&] operator[!] operator[SEP] identifier[name] operator[SEP] identifier[indexOf] operator[SEP] literal[String] operator[SEP] operator[>] identifier[root] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] operator[&&] operator[!] identifier[entry] operator[SEP] identifier[isDirectory] operator[SEP] operator[SEP] operator[SEP] {
identifier[name] operator[=] Keyword[new] identifier[File] operator[SEP] identifier[name] operator[SEP] operator[SEP] identifier[getPath] operator[SEP] operator[SEP] operator[SEP] identifier[resourceNames] operator[SEP] identifier[add] operator[SEP] identifier[name] operator[SEP] operator[SEP]
}
}
Keyword[return] identifier[resourceNames] operator[SEP]
}
|
public final EObject entryRuleXOtherOperatorExpression() throws RecognitionException {
EObject current = null;
EObject iv_ruleXOtherOperatorExpression = null;
try {
// InternalSARL.g:12803:65: (iv_ruleXOtherOperatorExpression= ruleXOtherOperatorExpression EOF )
// InternalSARL.g:12804:2: iv_ruleXOtherOperatorExpression= ruleXOtherOperatorExpression EOF
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getXOtherOperatorExpressionRule());
}
pushFollow(FOLLOW_1);
iv_ruleXOtherOperatorExpression=ruleXOtherOperatorExpression();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
current =iv_ruleXOtherOperatorExpression;
}
match(input,EOF,FOLLOW_2); if (state.failed) return current;
}
}
catch (RecognitionException re) {
recover(input,re);
appendSkippedTokens();
}
finally {
}
return current;
} | class class_name[name] begin[{]
method[entryRuleXOtherOperatorExpression, return_type[type[EObject]], modifier[final public], parameter[]] begin[{]
local_variable[type[EObject], current]
local_variable[type[EObject], iv_ruleXOtherOperatorExpression]
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=getXOtherOperatorExpressionRule, postfix_operators=[], prefix_operators=[], qualifier=grammarAccess, selectors=[], type_arguments=None)], member=newCompositeNode, 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=Assignment(expressionl=MemberReference(member=iv_ruleXOtherOperatorExpression, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=ruleXOtherOperatorExpression, 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=MemberReference(member=current, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), 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=Assignment(expressionl=MemberReference(member=current, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=iv_ruleXOtherOperatorExpression, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), 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=MemberReference(member=current, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None))])], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=input, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=re, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=recover, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=appendSkippedTokens, 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[member[.current]]
end[}]
END[}] | Keyword[public] Keyword[final] identifier[EObject] identifier[entryRuleXOtherOperatorExpression] operator[SEP] operator[SEP] Keyword[throws] identifier[RecognitionException] {
identifier[EObject] identifier[current] operator[=] Other[null] operator[SEP] identifier[EObject] identifier[iv_ruleXOtherOperatorExpression] operator[=] Other[null] operator[SEP] Keyword[try] {
{
Keyword[if] operator[SEP] identifier[state] operator[SEP] identifier[backtracking] operator[==] Other[0] operator[SEP] {
identifier[newCompositeNode] operator[SEP] identifier[grammarAccess] operator[SEP] identifier[getXOtherOperatorExpressionRule] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
identifier[pushFollow] operator[SEP] identifier[FOLLOW_1] operator[SEP] operator[SEP] identifier[iv_ruleXOtherOperatorExpression] operator[=] identifier[ruleXOtherOperatorExpression] 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] identifier[current] operator[SEP] Keyword[if] operator[SEP] identifier[state] operator[SEP] identifier[backtracking] operator[==] Other[0] operator[SEP] {
identifier[current] operator[=] identifier[iv_ruleXOtherOperatorExpression] 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] identifier[current] operator[SEP]
}
}
Keyword[catch] operator[SEP] identifier[RecognitionException] identifier[re] operator[SEP] {
identifier[recover] operator[SEP] identifier[input] , identifier[re] operator[SEP] operator[SEP] identifier[appendSkippedTokens] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[finally] {
}
Keyword[return] identifier[current] operator[SEP]
}
|
@Override
public Object readFrom(Class<Object> c, Type t, Annotation[] anns, MediaType mt,
MultivaluedMap<String, String> headers, InputStream is) throws IOException, WebApplicationException {
// TODO Auto-generated method stub
//if Type t contains IAttachment, IMutibody, convert to Attachment, Mutibody to adapt CXF MultipartProvider.readFrom
multipartProvider.setMessageContext(mc);
ParameterizedType origType = null;
Type[] actualType = null;
if (ParameterizedType.class.isAssignableFrom(t.getClass())) {
origType = (ParameterizedType) t;
actualType = origType.getActualTypeArguments();
for (int i = 0; i < actualType.length; i++) {
if (actualType[i].equals(IAttachment.class)) {
actualType[i] = Attachment.class;
} else if (actualType[i].equals(IMultipartBody.class)) {
actualType[i] = MultipartBody.class;
}
}
if (actualType != null && origType != null) {
t = IBMParameterizedTypeImpl.make(origType.getRawType().getClass(), actualType, origType.getOwnerType());
}
} else if (IMultipartBody.class.isAssignableFrom(getActualType(t, 0))) {
t = MultipartBody.class;
}
if (IAttachment.class.equals(c)) {
c = (Class<Object>) (Object) Attachment.class;
} else if (IMultipartBody.class.equals(c)) {
c = (Class<Object>) (Object) MultipartBody.class;
}
//add additional converting logic since the above converting doesn't work in personal build server.
if ("com.ibm.websphere.jaxrs20.multipart.IAttachment".equals(c.getName())) {
c = (Class<Object>) (Object) Attachment.class;
} else if ("com.ibm.websphere.jaxrs20.multipart.IMultipartBody".equals(c.getName())) {
c = (Class<Object>) (Object) MultipartBody.class;
}
Object object = multipartProvider.readFrom(c, t, anns, mt, headers, is);
//if object contains Attachment/MultiBoday for CXF, convert to AttachmentImpl, MultipartBodyImpl for IBM
//List Value type: DataHandler, DataSource, Attachment, only converty Attachment
if (object instanceof List<?>) {
List attList = (List) object;
List<AttachmentImpl> attImplList;
if (!attList.isEmpty()) {
attImplList = new LinkedList<AttachmentImpl>();
AttachmentImpl attImpl;
for (Object obj : attList) {
if (obj != null && obj instanceof Attachment) {
attImpl = new AttachmentImpl((Attachment) obj);
attImplList.add(attImpl);
}
}
return attImplList;
}
return object;
}
//convert Map if contains Attachment, e.g. LinkedHashMap <a.getContentType().toString(),fromAttachment>, fromAttachment== List<>: DataHandler, DataSource, Attachment
else if (object != null && Map.class.isAssignableFrom(object.getClass())) {
Map<Object, Object> attMap = (Map) object;
if (!attMap.isEmpty()) {
for (Iterator it = attMap.entrySet().iterator(); it.hasNext();) {
Entry entrySet = (Entry) it.next();
if (entrySet.getValue() != null && List.class.isAssignableFrom(entrySet.getValue().getClass())) {
List attList = (List) entrySet.getValue();
List<AttachmentImpl> attImplList;
if (!attList.isEmpty()) {
attImplList = new LinkedList<AttachmentImpl>();
AttachmentImpl attImpl;
for (Object obj : attList) {
if (obj != null && Attachment.class.isAssignableFrom(obj.getClass())) {
attImpl = new AttachmentImpl((Attachment) obj);
attImplList.add(attImpl);
}
}
entrySet.setValue(attImplList);
}
}
}
}
return attMap;
}
//if object is MultipartBody, convert to MultipartBodayImpl
else if (object instanceof MultipartBody) {
IMultipartBody imbody = new MultipartBodyImpl((MultipartBody) object);
return imbody;
}
return object;
} | class class_name[name] begin[{]
method[readFrom, return_type[type[Object]], modifier[public], parameter[c, t, anns, mt, headers, is]] begin[{]
call[multipartProvider.setMessageContext, parameter[member[.mc]]]
local_variable[type[ParameterizedType], origType]
local_variable[type[Type], actualType]
if[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getClass, postfix_operators=[], prefix_operators=[], qualifier=t, selectors=[], type_arguments=None)], member=isAssignableFrom, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=ParameterizedType, sub_type=None))] begin[{]
assign[member[.origType], Cast(expression=MemberReference(member=t, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=ParameterizedType, sub_type=None))]
assign[member[.actualType], call[origType.getActualTypeArguments, parameter[]]]
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MemberReference(member=actualType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MethodInvocation(arguments=[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IAttachment, sub_type=None))], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), else_statement=IfStatement(condition=MemberReference(member=actualType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MethodInvocation(arguments=[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IMultipartBody, sub_type=None))], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=actualType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=MultipartBody, sub_type=None))), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=actualType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Attachment, sub_type=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=actualType, 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)
if[binary_operation[binary_operation[member[.actualType], !=, literal[null]], &&, binary_operation[member[.origType], !=, literal[null]]]] begin[{]
assign[member[.t], call[IBMParameterizedTypeImpl.make, parameter[call[origType.getRawType, parameter[]], member[.actualType], call[origType.getOwnerType, parameter[]]]]]
else begin[{]
None
end[}]
else begin[{]
if[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=t, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], member=getActualType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=isAssignableFrom, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=IMultipartBody, sub_type=None))] begin[{]
assign[member[.t], ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=MultipartBody, sub_type=None))]
else begin[{]
None
end[}]
end[}]
if[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=IAttachment, sub_type=None))] begin[{]
assign[member[.c], Cast(expression=Cast(expression=ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Attachment, sub_type=None)), type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None)), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))], dimensions=[], name=Class, sub_type=None))]
else begin[{]
if[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=IMultipartBody, sub_type=None))] begin[{]
assign[member[.c], Cast(expression=Cast(expression=ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=MultipartBody, sub_type=None)), type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None)), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))], dimensions=[], name=Class, sub_type=None))]
else begin[{]
None
end[}]
end[}]
if[literal["com.ibm.websphere.jaxrs20.multipart.IAttachment"]] begin[{]
assign[member[.c], Cast(expression=Cast(expression=ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Attachment, sub_type=None)), type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None)), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))], dimensions=[], name=Class, sub_type=None))]
else begin[{]
if[literal["com.ibm.websphere.jaxrs20.multipart.IMultipartBody"]] begin[{]
assign[member[.c], Cast(expression=Cast(expression=ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=MultipartBody, sub_type=None)), type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None)), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))], dimensions=[], name=Class, sub_type=None))]
else begin[{]
None
end[}]
end[}]
local_variable[type[Object], object]
if[binary_operation[member[.object], instanceof, type[List]]] begin[{]
local_variable[type[List], attList]
local_variable[type[List], attImplList]
if[call[attList.isEmpty, parameter[]]] begin[{]
assign[member[.attImplList], 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=AttachmentImpl, sub_type=None))], dimensions=None, name=LinkedList, sub_type=None))]
local_variable[type[AttachmentImpl], attImpl]
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=obj, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operandr=BinaryOperation(operandl=MemberReference(member=obj, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=Attachment, sub_type=None), operator=instanceof), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=attImpl, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[Cast(expression=MemberReference(member=obj, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Attachment, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=AttachmentImpl, sub_type=None))), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=attImpl, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=attImplList, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=attList, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=obj)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))), label=None)
return[member[.attImplList]]
else begin[{]
None
end[}]
return[member[.object]]
else begin[{]
if[binary_operation[binary_operation[member[.object], !=, literal[null]], &&, ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getClass, postfix_operators=[], prefix_operators=[], qualifier=object, selectors=[], type_arguments=None)], member=isAssignableFrom, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=Map, sub_type=None))]] begin[{]
local_variable[type[Map], attMap]
if[call[attMap.isEmpty, parameter[]]] begin[{]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MethodInvocation(arguments=[], member=next, postfix_operators=[], prefix_operators=[], qualifier=it, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=Entry, sub_type=None)), name=entrySet)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Entry, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=entrySet, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operandr=ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=entrySet, selectors=[MethodInvocation(arguments=[], member=getClass, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=isAssignableFrom, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=List, sub_type=None)), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=entrySet, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=List, sub_type=None)), name=attList)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=List, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=None, name=attImplList)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=AttachmentImpl, sub_type=None))], dimensions=[], name=List, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[], member=isEmpty, postfix_operators=[], prefix_operators=['!'], qualifier=attList, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=attImplList, 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=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=AttachmentImpl, sub_type=None))], dimensions=None, name=LinkedList, sub_type=None))), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=None, name=attImpl)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=AttachmentImpl, sub_type=None)), ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=obj, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operandr=ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getClass, postfix_operators=[], prefix_operators=[], qualifier=obj, selectors=[], type_arguments=None)], member=isAssignableFrom, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=Attachment, sub_type=None)), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=attImpl, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[Cast(expression=MemberReference(member=obj, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Attachment, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=AttachmentImpl, sub_type=None))), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=attImpl, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=attImplList, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=attList, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=obj)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=attImplList, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setValue, postfix_operators=[], prefix_operators=[], qualifier=entrySet, selectors=[], type_arguments=None), label=None)]))]))]), control=ForControl(condition=MethodInvocation(arguments=[], member=hasNext, postfix_operators=[], prefix_operators=[], qualifier=it, selectors=[], type_arguments=None), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=MethodInvocation(arguments=[], member=entrySet, postfix_operators=[], prefix_operators=[], qualifier=attMap, selectors=[MethodInvocation(arguments=[], member=iterator, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=it)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Iterator, sub_type=None)), update=None), label=None)
else begin[{]
None
end[}]
return[member[.attMap]]
else begin[{]
if[binary_operation[member[.object], instanceof, type[MultipartBody]]] begin[{]
local_variable[type[IMultipartBody], imbody]
return[member[.imbody]]
else begin[{]
None
end[}]
end[}]
end[}]
return[member[.object]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] identifier[Object] identifier[readFrom] operator[SEP] identifier[Class] operator[<] identifier[Object] operator[>] identifier[c] , identifier[Type] identifier[t] , identifier[Annotation] operator[SEP] operator[SEP] identifier[anns] , identifier[MediaType] identifier[mt] , identifier[MultivaluedMap] operator[<] identifier[String] , identifier[String] operator[>] identifier[headers] , identifier[InputStream] identifier[is] operator[SEP] Keyword[throws] identifier[IOException] , identifier[WebApplicationException] {
identifier[multipartProvider] operator[SEP] identifier[setMessageContext] operator[SEP] identifier[mc] operator[SEP] operator[SEP] identifier[ParameterizedType] identifier[origType] operator[=] Other[null] operator[SEP] identifier[Type] operator[SEP] operator[SEP] identifier[actualType] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[ParameterizedType] operator[SEP] Keyword[class] operator[SEP] identifier[isAssignableFrom] operator[SEP] identifier[t] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
identifier[origType] operator[=] operator[SEP] identifier[ParameterizedType] operator[SEP] identifier[t] operator[SEP] identifier[actualType] operator[=] identifier[origType] operator[SEP] identifier[getActualTypeArguments] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[actualType] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] {
Keyword[if] operator[SEP] identifier[actualType] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[IAttachment] operator[SEP] Keyword[class] operator[SEP] operator[SEP] {
identifier[actualType] operator[SEP] identifier[i] operator[SEP] operator[=] identifier[Attachment] operator[SEP] Keyword[class] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[actualType] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[IMultipartBody] operator[SEP] Keyword[class] operator[SEP] operator[SEP] {
identifier[actualType] operator[SEP] identifier[i] operator[SEP] operator[=] identifier[MultipartBody] operator[SEP] Keyword[class] operator[SEP]
}
}
Keyword[if] operator[SEP] identifier[actualType] operator[!=] Other[null] operator[&&] identifier[origType] operator[!=] Other[null] operator[SEP] {
identifier[t] operator[=] identifier[IBMParameterizedTypeImpl] operator[SEP] identifier[make] operator[SEP] identifier[origType] operator[SEP] identifier[getRawType] operator[SEP] operator[SEP] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] , identifier[actualType] , identifier[origType] operator[SEP] identifier[getOwnerType] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[else] Keyword[if] operator[SEP] identifier[IMultipartBody] operator[SEP] Keyword[class] operator[SEP] identifier[isAssignableFrom] operator[SEP] identifier[getActualType] operator[SEP] identifier[t] , Other[0] operator[SEP] operator[SEP] operator[SEP] {
identifier[t] operator[=] identifier[MultipartBody] operator[SEP] Keyword[class] operator[SEP]
}
Keyword[if] operator[SEP] identifier[IAttachment] operator[SEP] Keyword[class] operator[SEP] identifier[equals] operator[SEP] identifier[c] operator[SEP] operator[SEP] {
identifier[c] operator[=] operator[SEP] identifier[Class] operator[<] identifier[Object] operator[>] operator[SEP] operator[SEP] identifier[Object] operator[SEP] identifier[Attachment] operator[SEP] Keyword[class] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[IMultipartBody] operator[SEP] Keyword[class] operator[SEP] identifier[equals] operator[SEP] identifier[c] operator[SEP] operator[SEP] {
identifier[c] operator[=] operator[SEP] identifier[Class] operator[<] identifier[Object] operator[>] operator[SEP] operator[SEP] identifier[Object] operator[SEP] identifier[MultipartBody] operator[SEP] Keyword[class] operator[SEP]
}
Keyword[if] operator[SEP] literal[String] operator[SEP] identifier[equals] operator[SEP] identifier[c] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
identifier[c] operator[=] operator[SEP] identifier[Class] operator[<] identifier[Object] operator[>] operator[SEP] operator[SEP] identifier[Object] operator[SEP] identifier[Attachment] operator[SEP] Keyword[class] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] literal[String] operator[SEP] identifier[equals] operator[SEP] identifier[c] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
identifier[c] operator[=] operator[SEP] identifier[Class] operator[<] identifier[Object] operator[>] operator[SEP] operator[SEP] identifier[Object] operator[SEP] identifier[MultipartBody] operator[SEP] Keyword[class] operator[SEP]
}
identifier[Object] identifier[object] operator[=] identifier[multipartProvider] operator[SEP] identifier[readFrom] operator[SEP] identifier[c] , identifier[t] , identifier[anns] , identifier[mt] , identifier[headers] , identifier[is] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[object] Keyword[instanceof] identifier[List] operator[<] operator[?] operator[>] operator[SEP] {
identifier[List] identifier[attList] operator[=] operator[SEP] identifier[List] operator[SEP] identifier[object] operator[SEP] identifier[List] operator[<] identifier[AttachmentImpl] operator[>] identifier[attImplList] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[attList] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] {
identifier[attImplList] operator[=] Keyword[new] identifier[LinkedList] operator[<] identifier[AttachmentImpl] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[AttachmentImpl] identifier[attImpl] operator[SEP] Keyword[for] operator[SEP] identifier[Object] identifier[obj] operator[:] identifier[attList] operator[SEP] {
Keyword[if] operator[SEP] identifier[obj] operator[!=] Other[null] operator[&&] identifier[obj] Keyword[instanceof] identifier[Attachment] operator[SEP] {
identifier[attImpl] operator[=] Keyword[new] identifier[AttachmentImpl] operator[SEP] operator[SEP] identifier[Attachment] operator[SEP] identifier[obj] operator[SEP] operator[SEP] identifier[attImplList] operator[SEP] identifier[add] operator[SEP] identifier[attImpl] operator[SEP] operator[SEP]
}
}
Keyword[return] identifier[attImplList] operator[SEP]
}
Keyword[return] identifier[object] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[object] operator[!=] Other[null] operator[&&] identifier[Map] operator[SEP] Keyword[class] operator[SEP] identifier[isAssignableFrom] operator[SEP] identifier[object] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
identifier[Map] operator[<] identifier[Object] , identifier[Object] operator[>] identifier[attMap] operator[=] operator[SEP] identifier[Map] operator[SEP] identifier[object] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[attMap] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] {
Keyword[for] operator[SEP] identifier[Iterator] identifier[it] operator[=] identifier[attMap] operator[SEP] identifier[entrySet] operator[SEP] operator[SEP] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] identifier[it] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
identifier[Entry] identifier[entrySet] operator[=] operator[SEP] identifier[Entry] operator[SEP] identifier[it] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[entrySet] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[!=] Other[null] operator[&&] identifier[List] operator[SEP] Keyword[class] operator[SEP] identifier[isAssignableFrom] operator[SEP] identifier[entrySet] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
identifier[List] identifier[attList] operator[=] operator[SEP] identifier[List] operator[SEP] identifier[entrySet] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[AttachmentImpl] operator[>] identifier[attImplList] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[attList] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] {
identifier[attImplList] operator[=] Keyword[new] identifier[LinkedList] operator[<] identifier[AttachmentImpl] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[AttachmentImpl] identifier[attImpl] operator[SEP] Keyword[for] operator[SEP] identifier[Object] identifier[obj] operator[:] identifier[attList] operator[SEP] {
Keyword[if] operator[SEP] identifier[obj] operator[!=] Other[null] operator[&&] identifier[Attachment] operator[SEP] Keyword[class] operator[SEP] identifier[isAssignableFrom] operator[SEP] identifier[obj] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
identifier[attImpl] operator[=] Keyword[new] identifier[AttachmentImpl] operator[SEP] operator[SEP] identifier[Attachment] operator[SEP] identifier[obj] operator[SEP] operator[SEP] identifier[attImplList] operator[SEP] identifier[add] operator[SEP] identifier[attImpl] operator[SEP] operator[SEP]
}
}
identifier[entrySet] operator[SEP] identifier[setValue] operator[SEP] identifier[attImplList] operator[SEP] operator[SEP]
}
}
}
}
Keyword[return] identifier[attMap] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[object] Keyword[instanceof] identifier[MultipartBody] operator[SEP] {
identifier[IMultipartBody] identifier[imbody] operator[=] Keyword[new] identifier[MultipartBodyImpl] operator[SEP] operator[SEP] identifier[MultipartBody] operator[SEP] identifier[object] operator[SEP] operator[SEP] Keyword[return] identifier[imbody] operator[SEP]
}
Keyword[return] identifier[object] operator[SEP]
}
|
Iterator<Path> dirIterator() {
if (dataset.getDescriptor().isPartitioned()) {
return Iterators.transform(partitionIterator(), new Function<StorageKey, Path>() {
@Override
@edu.umd.cs.findbugs.annotations.SuppressWarnings(
value="NP_PARAMETER_MUST_BE_NONNULL_BUT_MARKED_AS_NULLABLE",
justification="False positive, initialized above as non-null.")
public Path apply(@Nullable StorageKey key) {
return new Path(root, key.getPath());
}
});
} else {
return Iterators.singletonIterator(root);
}
} | class class_name[name] begin[{]
method[dirIterator, return_type[type[Iterator]], modifier[default], parameter[]] begin[{]
if[call[dataset.getDescriptor, parameter[]]] begin[{]
return[call[Iterators.transform, parameter[call[.partitionIterator, parameter[]], ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[Annotation(element=None, name=Override), Annotation(element=[ElementValuePair(name=value, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="NP_PARAMETER_MUST_BE_NONNULL_BUT_MARKED_AS_NULLABLE")), ElementValuePair(name=justification, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="False positive, initialized above as non-null."))], name=edu.umd.cs.findbugs.annotations.SuppressWarnings)], body=[ReturnStatement(expression=ClassCreator(arguments=[MemberReference(member=root, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getPath, postfix_operators=[], prefix_operators=[], qualifier=key, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Path, sub_type=None)), label=None)], documentation=None, modifiers={'public'}, name=apply, parameters=[FormalParameter(annotations=[Annotation(element=None, name=Nullable)], modifiers=set(), name=key, type=ReferenceType(arguments=None, dimensions=[], name=StorageKey, sub_type=None), varargs=False)], return_type=ReferenceType(arguments=None, dimensions=[], name=Path, sub_type=None), throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=StorageKey, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Path, sub_type=None))], dimensions=None, name=Function, sub_type=None))]]]
else begin[{]
return[call[Iterators.singletonIterator, parameter[member[.root]]]]
end[}]
end[}]
END[}] | identifier[Iterator] operator[<] identifier[Path] operator[>] identifier[dirIterator] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[dataset] operator[SEP] identifier[getDescriptor] operator[SEP] operator[SEP] operator[SEP] identifier[isPartitioned] operator[SEP] operator[SEP] operator[SEP] {
Keyword[return] identifier[Iterators] operator[SEP] identifier[transform] operator[SEP] identifier[partitionIterator] operator[SEP] operator[SEP] , Keyword[new] identifier[Function] operator[<] identifier[StorageKey] , identifier[Path] operator[>] operator[SEP] operator[SEP] {
annotation[@] identifier[Override] annotation[@] identifier[edu] operator[SEP] identifier[umd] operator[SEP] identifier[cs] operator[SEP] identifier[findbugs] operator[SEP] identifier[annotations] operator[SEP] identifier[SuppressWarnings] operator[SEP] identifier[value] operator[=] literal[String] , identifier[justification] operator[=] literal[String] operator[SEP] Keyword[public] identifier[Path] identifier[apply] operator[SEP] annotation[@] identifier[Nullable] identifier[StorageKey] identifier[key] operator[SEP] {
Keyword[return] Keyword[new] identifier[Path] operator[SEP] identifier[root] , identifier[key] operator[SEP] identifier[getPath] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
} operator[SEP] operator[SEP]
}
Keyword[else] {
Keyword[return] identifier[Iterators] operator[SEP] identifier[singletonIterator] operator[SEP] identifier[root] operator[SEP] operator[SEP]
}
}
|
public boolean isSet(_Fields field) {
if (field == null) {
throw new IllegalArgumentException();
}
switch (field) {
case KEYS:
return is_set_keys();
case SESSION:
return is_set_session();
}
throw new IllegalStateException();
} | class class_name[name] begin[{]
method[isSet, return_type[type[boolean]], modifier[public], parameter[field]] begin[{]
if[binary_operation[member[.field], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None)
else begin[{]
None
end[}]
SwitchStatement(cases=[SwitchStatementCase(case=['KEYS'], statements=[ReturnStatement(expression=MethodInvocation(arguments=[], member=is_set_keys, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), SwitchStatementCase(case=['SESSION'], statements=[ReturnStatement(expression=MethodInvocation(arguments=[], member=is_set_session, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)])], expression=MemberReference(member=field, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)
ThrowStatement(expression=ClassCreator(arguments=[], 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)
end[}]
END[}] | Keyword[public] Keyword[boolean] identifier[isSet] operator[SEP] identifier[_Fields] identifier[field] operator[SEP] {
Keyword[if] operator[SEP] identifier[field] operator[==] Other[null] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[switch] operator[SEP] identifier[field] operator[SEP] {
Keyword[case] identifier[KEYS] operator[:] Keyword[return] identifier[is_set_keys] operator[SEP] operator[SEP] operator[SEP] Keyword[case] identifier[SESSION] operator[:] Keyword[return] identifier[is_set_session] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] operator[SEP] operator[SEP]
}
|
public EClass getIID() {
if (iidEClass == null) {
iidEClass = (EClass)EPackage.Registry.INSTANCE.getEPackage(AfplibPackage.eNS_URI).getEClassifiers().get(275);
}
return iidEClass;
} | class class_name[name] begin[{]
method[getIID, return_type[type[EClass]], modifier[public], parameter[]] begin[{]
if[binary_operation[member[.iidEClass], ==, literal[null]]] begin[{]
assign[member[.iidEClass], Cast(expression=MethodInvocation(arguments=[MemberReference(member=eNS_URI, postfix_operators=[], prefix_operators=[], qualifier=AfplibPackage, selectors=[])], member=getEPackage, postfix_operators=[], prefix_operators=[], qualifier=EPackage.Registry.INSTANCE, selectors=[MethodInvocation(arguments=[], member=getEClassifiers, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=275)], member=get, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=EClass, sub_type=None))]
else begin[{]
None
end[}]
return[member[.iidEClass]]
end[}]
END[}] | Keyword[public] identifier[EClass] identifier[getIID] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[iidEClass] operator[==] Other[null] operator[SEP] {
identifier[iidEClass] operator[=] operator[SEP] identifier[EClass] operator[SEP] identifier[EPackage] operator[SEP] identifier[Registry] operator[SEP] identifier[INSTANCE] operator[SEP] identifier[getEPackage] operator[SEP] identifier[AfplibPackage] operator[SEP] identifier[eNS_URI] operator[SEP] operator[SEP] identifier[getEClassifiers] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] Other[275] operator[SEP] operator[SEP]
}
Keyword[return] identifier[iidEClass] operator[SEP]
}
|
public static final H2ONode intern( H2Okey key ) {
H2ONode h2o = INTERN.get(key);
if( h2o != null ) return h2o;
final int idx = UNIQUE.getAndIncrement();
h2o = new H2ONode(key,idx);
H2ONode old = INTERN.putIfAbsent(key,h2o);
if( old != null ) return old;
synchronized(H2O.class) {
while( idx >= IDX.length )
IDX = Arrays.copyOf(IDX,IDX.length<<1);
IDX[idx] = h2o;
}
return h2o;
} | class class_name[name] begin[{]
method[intern, return_type[type[H2ONode]], modifier[final public static], parameter[key]] begin[{]
local_variable[type[H2ONode], h2o]
if[binary_operation[member[.h2o], !=, literal[null]]] begin[{]
return[member[.h2o]]
else begin[{]
None
end[}]
local_variable[type[int], idx]
assign[member[.h2o], ClassCreator(arguments=[MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=idx, 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=H2ONode, sub_type=None))]
local_variable[type[H2ONode], old]
if[binary_operation[member[.old], !=, literal[null]]] begin[{]
return[member[.old]]
else begin[{]
None
end[}]
SYNCHRONIZED[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=H2O, sub_type=None))] BEGIN[{]
while[binary_operation[member[.idx], >=, member[IDX.length]]] begin[{]
assign[member[.IDX], call[Arrays.copyOf, parameter[member[.IDX], binary_operation[member[IDX.length], <<, literal[1]]]]]
end[}]
assign[member[.IDX], member[.h2o]]
END[}]
return[member[.h2o]]
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[final] identifier[H2ONode] identifier[intern] operator[SEP] identifier[H2Okey] identifier[key] operator[SEP] {
identifier[H2ONode] identifier[h2o] operator[=] identifier[INTERN] operator[SEP] identifier[get] operator[SEP] identifier[key] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[h2o] operator[!=] Other[null] operator[SEP] Keyword[return] identifier[h2o] operator[SEP] Keyword[final] Keyword[int] identifier[idx] operator[=] identifier[UNIQUE] operator[SEP] identifier[getAndIncrement] operator[SEP] operator[SEP] operator[SEP] identifier[h2o] operator[=] Keyword[new] identifier[H2ONode] operator[SEP] identifier[key] , identifier[idx] operator[SEP] operator[SEP] identifier[H2ONode] identifier[old] operator[=] identifier[INTERN] operator[SEP] identifier[putIfAbsent] operator[SEP] identifier[key] , identifier[h2o] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[old] operator[!=] Other[null] operator[SEP] Keyword[return] identifier[old] operator[SEP] Keyword[synchronized] operator[SEP] identifier[H2O] operator[SEP] Keyword[class] operator[SEP] {
Keyword[while] operator[SEP] identifier[idx] operator[>=] identifier[IDX] operator[SEP] identifier[length] operator[SEP] identifier[IDX] operator[=] identifier[Arrays] operator[SEP] identifier[copyOf] operator[SEP] identifier[IDX] , identifier[IDX] operator[SEP] identifier[length] operator[<<] Other[1] operator[SEP] operator[SEP] identifier[IDX] operator[SEP] identifier[idx] operator[SEP] operator[=] identifier[h2o] operator[SEP]
}
Keyword[return] identifier[h2o] operator[SEP]
}
|
private void loadPolicies(final IAsyncHandler<List<PolicyWithConfiguration>> handler) {
final Set<Integer> totalCounter = new HashSet<>();
final Set<Integer> errorCounter = new TreeSet<>();
final List<PolicyWithConfiguration> rval = new ArrayList<>(policies.size());
final List<Throwable> errors = new ArrayList<>(policies.size());
final int numPolicies = policies.size();
int index = 0;
// If there aren't any policies, then no need to asynchronously load them!
if (policies.isEmpty()) {
handler.handle(policyImpls);
return;
}
for (final Policy policy : policies) {
rval.add(null);
errors.add(null);
final int localIdx = index++;
policyFactory.loadPolicy(policy.getPolicyImpl(), (IAsyncResult<IPolicy> result) -> {
if (result.isSuccess()) {
IPolicy policyImpl = result.getResult();
// Test whether pipeline contains any data policies. Connectors can use this for Content-Length pass-through.
if (policyImpl instanceof IDataPolicy) {
hasDataPolicy = true;
}
try {
Object policyConfig = policyFactory.loadConfig(policyImpl, policy.getPolicyImpl(), policy.getPolicyJsonConfig());
PolicyWithConfiguration pwc = new PolicyWithConfiguration(policyImpl, policyConfig);
rval.set(localIdx, pwc);
} catch (Throwable t) {
errors.set(localIdx, t);
errorCounter.add(localIdx);
}
} else {
Throwable error = result.getError();
errors.set(localIdx, error);
errorCounter.add(localIdx);
}
totalCounter.add(localIdx);
// Have we done them all?
if (totalCounter.size() == numPolicies) {
// Did we get any errors? If yes, report the first one. If no, then send back
// the fully resolved list of policies.
if (!errorCounter.isEmpty()) {
int errorIdx = errorCounter.iterator().next();
Throwable error = errors.get(errorIdx);
// TODO add some logging here to indicate which policy error'd out
//Policy errorPolicy = policies.get(errorIdx);
policyErrorHandler.handle(error);
} else {
handler.handle(rval);
}
}
});
}
} | class class_name[name] begin[{]
method[loadPolicies, return_type[void], modifier[private], parameter[handler]] begin[{]
local_variable[type[Set], totalCounter]
local_variable[type[Set], errorCounter]
local_variable[type[List], rval]
local_variable[type[List], errors]
local_variable[type[int], numPolicies]
local_variable[type[int], index]
if[call[policies.isEmpty, parameter[]]] begin[{]
call[handler.handle, parameter[member[.policyImpls]]]
return[None]
else begin[{]
None
end[}]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], member=add, postfix_operators=[], prefix_operators=[], qualifier=rval, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], member=add, postfix_operators=[], prefix_operators=[], qualifier=errors, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=index, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]), name=localIdx)], modifiers={'final'}, type=BasicType(dimensions=[], name=int)), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getPolicyImpl, postfix_operators=[], prefix_operators=[], qualifier=policy, selectors=[], type_arguments=None), LambdaExpression(body=[IfStatement(condition=MethodInvocation(arguments=[], member=isSuccess, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[], type_arguments=None), else_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getError, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[], type_arguments=None), name=error)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Throwable, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=localIdx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=error, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=set, postfix_operators=[], prefix_operators=[], qualifier=errors, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=localIdx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=errorCounter, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getResult, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[], type_arguments=None), name=policyImpl)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=IPolicy, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=policyImpl, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=IDataPolicy, sub_type=None), operator=instanceof), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=hasDataPolicy, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)), label=None)])), TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=policyImpl, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getPolicyImpl, postfix_operators=[], prefix_operators=[], qualifier=policy, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getPolicyJsonConfig, postfix_operators=[], prefix_operators=[], qualifier=policy, selectors=[], type_arguments=None)], member=loadConfig, postfix_operators=[], prefix_operators=[], qualifier=policyFactory, selectors=[], type_arguments=None), name=policyConfig)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MemberReference(member=policyImpl, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=policyConfig, 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=PolicyWithConfiguration, sub_type=None)), name=pwc)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=PolicyWithConfiguration, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=localIdx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=pwc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=set, postfix_operators=[], prefix_operators=[], qualifier=rval, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=localIdx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=t, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=set, postfix_operators=[], prefix_operators=[], qualifier=errors, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=localIdx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=errorCounter, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=t, types=['Throwable']))], finally_block=None, label=None, resources=None)])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=localIdx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=totalCounter, selectors=[], type_arguments=None), label=None), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=totalCounter, selectors=[], type_arguments=None), operandr=MemberReference(member=numPolicies, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[], member=isEmpty, postfix_operators=[], prefix_operators=['!'], qualifier=errorCounter, selectors=[], type_arguments=None), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=rval, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=handle, postfix_operators=[], prefix_operators=[], qualifier=handler, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=iterator, postfix_operators=[], prefix_operators=[], qualifier=errorCounter, selectors=[MethodInvocation(arguments=[], member=next, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=errorIdx)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=errorIdx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=errors, selectors=[], type_arguments=None), name=error)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Throwable, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=error, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=handle, postfix_operators=[], prefix_operators=[], qualifier=policyErrorHandler, selectors=[], type_arguments=None), label=None)]))]))], parameters=[FormalParameter(annotations=[], modifiers=set(), name=result, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=IPolicy, sub_type=None))], dimensions=[], name=IAsyncResult, sub_type=None), varargs=False)])], member=loadPolicy, postfix_operators=[], prefix_operators=[], qualifier=policyFactory, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=policies, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=policy)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=Policy, sub_type=None))), label=None)
end[}]
END[}] | Keyword[private] Keyword[void] identifier[loadPolicies] operator[SEP] Keyword[final] identifier[IAsyncHandler] operator[<] identifier[List] operator[<] identifier[PolicyWithConfiguration] operator[>] operator[>] identifier[handler] operator[SEP] {
Keyword[final] identifier[Set] operator[<] identifier[Integer] operator[>] identifier[totalCounter] operator[=] Keyword[new] identifier[HashSet] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[Set] operator[<] identifier[Integer] operator[>] identifier[errorCounter] operator[=] Keyword[new] identifier[TreeSet] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[List] operator[<] identifier[PolicyWithConfiguration] operator[>] identifier[rval] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] identifier[policies] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[List] operator[<] identifier[Throwable] operator[>] identifier[errors] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] identifier[policies] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[final] Keyword[int] identifier[numPolicies] operator[=] identifier[policies] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[index] operator[=] Other[0] operator[SEP] Keyword[if] operator[SEP] identifier[policies] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] {
identifier[handler] operator[SEP] identifier[handle] operator[SEP] identifier[policyImpls] operator[SEP] operator[SEP] Keyword[return] operator[SEP]
}
Keyword[for] operator[SEP] Keyword[final] identifier[Policy] identifier[policy] operator[:] identifier[policies] operator[SEP] {
identifier[rval] operator[SEP] identifier[add] operator[SEP] Other[null] operator[SEP] operator[SEP] identifier[errors] operator[SEP] identifier[add] operator[SEP] Other[null] operator[SEP] operator[SEP] Keyword[final] Keyword[int] identifier[localIdx] operator[=] identifier[index] operator[++] operator[SEP] identifier[policyFactory] operator[SEP] identifier[loadPolicy] operator[SEP] identifier[policy] operator[SEP] identifier[getPolicyImpl] operator[SEP] operator[SEP] , operator[SEP] identifier[IAsyncResult] operator[<] identifier[IPolicy] operator[>] identifier[result] operator[SEP] operator[->] {
Keyword[if] operator[SEP] identifier[result] operator[SEP] identifier[isSuccess] operator[SEP] operator[SEP] operator[SEP] {
identifier[IPolicy] identifier[policyImpl] operator[=] identifier[result] operator[SEP] identifier[getResult] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[policyImpl] Keyword[instanceof] identifier[IDataPolicy] operator[SEP] {
identifier[hasDataPolicy] operator[=] literal[boolean] operator[SEP]
}
Keyword[try] {
identifier[Object] identifier[policyConfig] operator[=] identifier[policyFactory] operator[SEP] identifier[loadConfig] operator[SEP] identifier[policyImpl] , identifier[policy] operator[SEP] identifier[getPolicyImpl] operator[SEP] operator[SEP] , identifier[policy] operator[SEP] identifier[getPolicyJsonConfig] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[PolicyWithConfiguration] identifier[pwc] operator[=] Keyword[new] identifier[PolicyWithConfiguration] operator[SEP] identifier[policyImpl] , identifier[policyConfig] operator[SEP] operator[SEP] identifier[rval] operator[SEP] identifier[set] operator[SEP] identifier[localIdx] , identifier[pwc] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Throwable] identifier[t] operator[SEP] {
identifier[errors] operator[SEP] identifier[set] operator[SEP] identifier[localIdx] , identifier[t] operator[SEP] operator[SEP] identifier[errorCounter] operator[SEP] identifier[add] operator[SEP] identifier[localIdx] operator[SEP] operator[SEP]
}
}
Keyword[else] {
identifier[Throwable] identifier[error] operator[=] identifier[result] operator[SEP] identifier[getError] operator[SEP] operator[SEP] operator[SEP] identifier[errors] operator[SEP] identifier[set] operator[SEP] identifier[localIdx] , identifier[error] operator[SEP] operator[SEP] identifier[errorCounter] operator[SEP] identifier[add] operator[SEP] identifier[localIdx] operator[SEP] operator[SEP]
}
identifier[totalCounter] operator[SEP] identifier[add] operator[SEP] identifier[localIdx] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[totalCounter] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[==] identifier[numPolicies] operator[SEP] {
Keyword[if] operator[SEP] operator[!] identifier[errorCounter] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] {
Keyword[int] identifier[errorIdx] operator[=] identifier[errorCounter] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] identifier[Throwable] identifier[error] operator[=] identifier[errors] operator[SEP] identifier[get] operator[SEP] identifier[errorIdx] operator[SEP] operator[SEP] identifier[policyErrorHandler] operator[SEP] identifier[handle] operator[SEP] identifier[error] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[handler] operator[SEP] identifier[handle] operator[SEP] identifier[rval] operator[SEP] operator[SEP]
}
}
} operator[SEP] operator[SEP]
}
}
|
public XCalElement child(ICalDataType dataType) {
String localName = dataType.getName().toLowerCase();
for (Element child : children()) {
if (localName.equals(child.getLocalName()) && XCAL_NS.equals(child.getNamespaceURI())) {
return new XCalElement(child);
}
}
return null;
} | class class_name[name] begin[{]
method[child, return_type[type[XCalElement]], modifier[public], parameter[dataType]] begin[{]
local_variable[type[String], localName]
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getLocalName, postfix_operators=[], prefix_operators=[], qualifier=child, selectors=[], type_arguments=None)], member=equals, postfix_operators=[], prefix_operators=[], qualifier=localName, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getNamespaceURI, postfix_operators=[], prefix_operators=[], qualifier=child, selectors=[], type_arguments=None)], member=equals, postfix_operators=[], prefix_operators=[], qualifier=XCAL_NS, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=ClassCreator(arguments=[MemberReference(member=child, 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=XCalElement, sub_type=None)), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=children, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=child)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Element, sub_type=None))), label=None)
return[literal[null]]
end[}]
END[}] | Keyword[public] identifier[XCalElement] identifier[child] operator[SEP] identifier[ICalDataType] identifier[dataType] operator[SEP] {
identifier[String] identifier[localName] operator[=] identifier[dataType] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] identifier[toLowerCase] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Element] identifier[child] operator[:] identifier[children] operator[SEP] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[localName] operator[SEP] identifier[equals] operator[SEP] identifier[child] operator[SEP] identifier[getLocalName] operator[SEP] operator[SEP] operator[SEP] operator[&&] identifier[XCAL_NS] operator[SEP] identifier[equals] operator[SEP] identifier[child] operator[SEP] identifier[getNamespaceURI] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
Keyword[return] Keyword[new] identifier[XCalElement] operator[SEP] identifier[child] operator[SEP] operator[SEP]
}
}
Keyword[return] Other[null] operator[SEP]
}
|
private Collection<Membership> findMembershipsByUserAndGroup(Session session, Node refUserNode, Node groupNode) throws Exception
{
List<Membership> memberships = new ArrayList<Membership>();
NodeIterator refTypes = refUserNode.getNodes();
while (refTypes.hasNext())
{
Node refTypeNode = refTypes.nextNode();
String id = utils.composeMembershipId(groupNode, refUserNode, refTypeNode);
String groupId = utils.getGroupIds(groupNode).groupId;
MembershipImpl membership = new MembershipImpl();
membership.setUserName(refUserNode.getName());
membership.setMembershipType((refTypeNode.getName().equals(JCROrganizationServiceImpl.JOS_MEMBERSHIP_TYPE_ANY)
? MembershipTypeHandler.ANY_MEMBERSHIP_TYPE : refTypeNode.getName()));
membership.setGroupId(groupId);
membership.setId(id);
memberships.add(membership);
}
return memberships;
} | class class_name[name] begin[{]
method[findMembershipsByUserAndGroup, return_type[type[Collection]], modifier[private], parameter[session, refUserNode, groupNode]] begin[{]
local_variable[type[List], memberships]
local_variable[type[NodeIterator], refTypes]
while[call[refTypes.hasNext, parameter[]]] begin[{]
local_variable[type[Node], refTypeNode]
local_variable[type[String], id]
local_variable[type[String], groupId]
local_variable[type[MembershipImpl], membership]
call[membership.setUserName, parameter[call[refUserNode.getName, parameter[]]]]
call[membership.setMembershipType, parameter[TernaryExpression(condition=MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=refTypeNode, selectors=[MethodInvocation(arguments=[MemberReference(member=JOS_MEMBERSHIP_TYPE_ANY, postfix_operators=[], prefix_operators=[], qualifier=JCROrganizationServiceImpl, selectors=[])], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), if_false=MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=refTypeNode, selectors=[], type_arguments=None), if_true=MemberReference(member=ANY_MEMBERSHIP_TYPE, postfix_operators=[], prefix_operators=[], qualifier=MembershipTypeHandler, selectors=[]))]]
call[membership.setGroupId, parameter[member[.groupId]]]
call[membership.setId, parameter[member[.id]]]
call[memberships.add, parameter[member[.membership]]]
end[}]
return[member[.memberships]]
end[}]
END[}] | Keyword[private] identifier[Collection] operator[<] identifier[Membership] operator[>] identifier[findMembershipsByUserAndGroup] operator[SEP] identifier[Session] identifier[session] , identifier[Node] identifier[refUserNode] , identifier[Node] identifier[groupNode] operator[SEP] Keyword[throws] identifier[Exception] {
identifier[List] operator[<] identifier[Membership] operator[>] identifier[memberships] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[Membership] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[NodeIterator] identifier[refTypes] operator[=] identifier[refUserNode] operator[SEP] identifier[getNodes] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[refTypes] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] {
identifier[Node] identifier[refTypeNode] operator[=] identifier[refTypes] operator[SEP] identifier[nextNode] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[id] operator[=] identifier[utils] operator[SEP] identifier[composeMembershipId] operator[SEP] identifier[groupNode] , identifier[refUserNode] , identifier[refTypeNode] operator[SEP] operator[SEP] identifier[String] identifier[groupId] operator[=] identifier[utils] operator[SEP] identifier[getGroupIds] operator[SEP] identifier[groupNode] operator[SEP] operator[SEP] identifier[groupId] operator[SEP] identifier[MembershipImpl] identifier[membership] operator[=] Keyword[new] identifier[MembershipImpl] operator[SEP] operator[SEP] operator[SEP] identifier[membership] operator[SEP] identifier[setUserName] operator[SEP] identifier[refUserNode] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[membership] operator[SEP] identifier[setMembershipType] operator[SEP] operator[SEP] identifier[refTypeNode] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[JCROrganizationServiceImpl] operator[SEP] identifier[JOS_MEMBERSHIP_TYPE_ANY] operator[SEP] operator[?] identifier[MembershipTypeHandler] operator[SEP] identifier[ANY_MEMBERSHIP_TYPE] operator[:] identifier[refTypeNode] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[membership] operator[SEP] identifier[setGroupId] operator[SEP] identifier[groupId] operator[SEP] operator[SEP] identifier[membership] operator[SEP] identifier[setId] operator[SEP] identifier[id] operator[SEP] operator[SEP] identifier[memberships] operator[SEP] identifier[add] operator[SEP] identifier[membership] operator[SEP] operator[SEP]
}
Keyword[return] identifier[memberships] operator[SEP]
}
|
private static String unescapeLiteral(final String text) {
if (text == null) {
return null;
}
StringBuilder strBuilder = null;
final int max = text.length();
int readOffset = 0;
int referenceOffset = 0;
char c;
for (int i = 0; i < max; i++) {
c = text.charAt(i);
/*
* Check the need for an unescape operation at this point
*/
if (c != ESCAPE_PREFIX || (i + 1) >= max) {
continue;
}
if (c == ESCAPE_PREFIX) {
switch (text.charAt(i + 1)) {
case '\'': c = '\''; referenceOffset = i + 1; break;
case '\\': c = '\\'; referenceOffset = i + 1; break;
// We weren't able to consume any valid escape chars, just not consider it an escape operation
default: referenceOffset = i; break;
}
}
/*
* At this point we know for sure we will need some kind of unescape, so we
* can increase the offset and initialize the string builder if needed, along with
* copying to it all the contents pending up to this point.
*/
if (strBuilder == null) {
strBuilder = new StringBuilder(max + 5);
}
if (i - readOffset > 0) {
strBuilder.append(text, readOffset, i);
}
i = referenceOffset;
readOffset = i + 1;
/*
* Write the unescaped char
*/
strBuilder.append(c);
}
/*
* -----------------------------------------------------------------------------------------------
* Final cleaning: return the original String object if no unescape was actually needed. Otherwise
* append the remaining escaped text to the string builder and return.
* -----------------------------------------------------------------------------------------------
*/
if (strBuilder == null) {
return text;
}
if (max - readOffset > 0) {
strBuilder.append(text, readOffset, max);
}
return strBuilder.toString();
} | class class_name[name] begin[{]
method[unescapeLiteral, return_type[type[String]], modifier[private static], parameter[text]] begin[{]
if[binary_operation[member[.text], ==, literal[null]]] begin[{]
return[literal[null]]
else begin[{]
None
end[}]
local_variable[type[StringBuilder], strBuilder]
local_variable[type[int], max]
local_variable[type[int], readOffset]
local_variable[type[int], referenceOffset]
local_variable[type[char], c]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=charAt, postfix_operators=[], prefix_operators=[], qualifier=text, selectors=[], type_arguments=None)), label=None), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=ESCAPE_PREFIX, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=!=), operandr=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=max, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=>=), operator=||), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ContinueStatement(goto=None, label=None)])), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=ESCAPE_PREFIX, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[SwitchStatement(cases=[SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='\'')], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='\'')), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=referenceOffset, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+)), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='\\')], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='\\')), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=referenceOffset, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+)), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=referenceOffset, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), BreakStatement(goto=None, label=None)])], expression=MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+)], member=charAt, postfix_operators=[], prefix_operators=[], qualifier=text, selectors=[], type_arguments=None), label=None)])), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=strBuilder, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=strBuilder, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[BinaryOperation(operandl=MemberReference(member=max, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=5), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=StringBuilder, sub_type=None))), label=None)])), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=readOffset, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=-), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=text, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=readOffset, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=append, postfix_operators=[], prefix_operators=[], qualifier=strBuilder, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=referenceOffset, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=readOffset, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+)), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=append, postfix_operators=[], prefix_operators=[], qualifier=strBuilder, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=max, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
if[binary_operation[member[.strBuilder], ==, literal[null]]] begin[{]
return[member[.text]]
else begin[{]
None
end[}]
if[binary_operation[binary_operation[member[.max], -, member[.readOffset]], >, literal[0]]] begin[{]
call[strBuilder.append, parameter[member[.text], member[.readOffset], member[.max]]]
else begin[{]
None
end[}]
return[call[strBuilder.toString, parameter[]]]
end[}]
END[}] | Keyword[private] Keyword[static] identifier[String] identifier[unescapeLiteral] operator[SEP] Keyword[final] identifier[String] identifier[text] operator[SEP] {
Keyword[if] operator[SEP] identifier[text] operator[==] Other[null] operator[SEP] {
Keyword[return] Other[null] operator[SEP]
}
identifier[StringBuilder] identifier[strBuilder] operator[=] Other[null] operator[SEP] Keyword[final] Keyword[int] identifier[max] operator[=] identifier[text] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[readOffset] operator[=] Other[0] operator[SEP] Keyword[int] identifier[referenceOffset] operator[=] Other[0] operator[SEP] Keyword[char] identifier[c] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[max] operator[SEP] identifier[i] operator[++] operator[SEP] {
identifier[c] operator[=] identifier[text] operator[SEP] identifier[charAt] operator[SEP] identifier[i] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[c] operator[!=] identifier[ESCAPE_PREFIX] operator[||] operator[SEP] identifier[i] operator[+] Other[1] operator[SEP] operator[>=] identifier[max] operator[SEP] {
Keyword[continue] operator[SEP]
}
Keyword[if] operator[SEP] identifier[c] operator[==] identifier[ESCAPE_PREFIX] operator[SEP] {
Keyword[switch] operator[SEP] identifier[text] operator[SEP] identifier[charAt] operator[SEP] identifier[i] operator[+] Other[1] operator[SEP] operator[SEP] {
Keyword[case] literal[String] operator[:] identifier[c] operator[=] literal[String] operator[SEP] identifier[referenceOffset] operator[=] identifier[i] operator[+] Other[1] operator[SEP] Keyword[break] operator[SEP] Keyword[case] literal[String] operator[:] identifier[c] operator[=] literal[String] operator[SEP] identifier[referenceOffset] operator[=] identifier[i] operator[+] Other[1] operator[SEP] Keyword[break] operator[SEP] Keyword[default] operator[:] identifier[referenceOffset] operator[=] identifier[i] operator[SEP] Keyword[break] operator[SEP]
}
}
Keyword[if] operator[SEP] identifier[strBuilder] operator[==] Other[null] operator[SEP] {
identifier[strBuilder] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] identifier[max] operator[+] Other[5] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[i] operator[-] identifier[readOffset] operator[>] Other[0] operator[SEP] {
identifier[strBuilder] operator[SEP] identifier[append] operator[SEP] identifier[text] , identifier[readOffset] , identifier[i] operator[SEP] operator[SEP]
}
identifier[i] operator[=] identifier[referenceOffset] operator[SEP] identifier[readOffset] operator[=] identifier[i] operator[+] Other[1] operator[SEP] identifier[strBuilder] operator[SEP] identifier[append] operator[SEP] identifier[c] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[strBuilder] operator[==] Other[null] operator[SEP] {
Keyword[return] identifier[text] operator[SEP]
}
Keyword[if] operator[SEP] identifier[max] operator[-] identifier[readOffset] operator[>] Other[0] operator[SEP] {
identifier[strBuilder] operator[SEP] identifier[append] operator[SEP] identifier[text] , identifier[readOffset] , identifier[max] operator[SEP] operator[SEP]
}
Keyword[return] identifier[strBuilder] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP]
}
|
public BatchWriteItemResult batchWriteItem(BatchWriteItemRequest batchWriteItemRequest)
throws AmazonServiceException, AmazonClientException {
ExecutionContext executionContext = createExecutionContext(batchWriteItemRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
Request<BatchWriteItemRequest> request = marshall(
batchWriteItemRequest, new BatchWriteItemRequestMarshaller(),
executionContext.getAwsRequestMetrics());
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
Unmarshaller<BatchWriteItemResult, JsonUnmarshallerContext> unmarshaller = new BatchWriteItemResultJsonUnmarshaller();
JsonResponseHandler<BatchWriteItemResult> responseHandler = new JsonResponseHandler<BatchWriteItemResult>(unmarshaller);
return invoke(request, responseHandler, executionContext);
} | class class_name[name] begin[{]
method[batchWriteItem, return_type[type[BatchWriteItemResult]], modifier[public], parameter[batchWriteItemRequest]] begin[{]
local_variable[type[ExecutionContext], executionContext]
local_variable[type[AWSRequestMetrics], awsRequestMetrics]
local_variable[type[Request], request]
call[request.setAWSRequestMetrics, parameter[member[.awsRequestMetrics]]]
local_variable[type[Unmarshaller], unmarshaller]
local_variable[type[JsonResponseHandler], responseHandler]
return[call[.invoke, parameter[member[.request], member[.responseHandler], member[.executionContext]]]]
end[}]
END[}] | Keyword[public] identifier[BatchWriteItemResult] identifier[batchWriteItem] operator[SEP] identifier[BatchWriteItemRequest] identifier[batchWriteItemRequest] operator[SEP] Keyword[throws] identifier[AmazonServiceException] , identifier[AmazonClientException] {
identifier[ExecutionContext] identifier[executionContext] operator[=] identifier[createExecutionContext] operator[SEP] identifier[batchWriteItemRequest] operator[SEP] operator[SEP] identifier[AWSRequestMetrics] identifier[awsRequestMetrics] operator[=] identifier[executionContext] operator[SEP] identifier[getAwsRequestMetrics] operator[SEP] operator[SEP] operator[SEP] identifier[Request] operator[<] identifier[BatchWriteItemRequest] operator[>] identifier[request] operator[=] identifier[marshall] operator[SEP] identifier[batchWriteItemRequest] , Keyword[new] identifier[BatchWriteItemRequestMarshaller] operator[SEP] operator[SEP] , identifier[executionContext] operator[SEP] identifier[getAwsRequestMetrics] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[request] operator[SEP] identifier[setAWSRequestMetrics] operator[SEP] identifier[awsRequestMetrics] operator[SEP] operator[SEP] identifier[Unmarshaller] operator[<] identifier[BatchWriteItemResult] , identifier[JsonUnmarshallerContext] operator[>] identifier[unmarshaller] operator[=] Keyword[new] identifier[BatchWriteItemResultJsonUnmarshaller] operator[SEP] operator[SEP] operator[SEP] identifier[JsonResponseHandler] operator[<] identifier[BatchWriteItemResult] operator[>] identifier[responseHandler] operator[=] Keyword[new] identifier[JsonResponseHandler] operator[<] identifier[BatchWriteItemResult] operator[>] operator[SEP] identifier[unmarshaller] operator[SEP] operator[SEP] Keyword[return] identifier[invoke] operator[SEP] identifier[request] , identifier[responseHandler] , identifier[executionContext] operator[SEP] operator[SEP]
}
|
public static base_response unset(nitro_service client, responderparam resource, String[] args) throws Exception{
responderparam unsetresource = new responderparam();
return unsetresource.unset_resource(client,args);
} | class class_name[name] begin[{]
method[unset, return_type[type[base_response]], modifier[public static], parameter[client, resource, args]] begin[{]
local_variable[type[responderparam], unsetresource]
return[call[unsetresource.unset_resource, parameter[member[.client], member[.args]]]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[base_response] identifier[unset] operator[SEP] identifier[nitro_service] identifier[client] , identifier[responderparam] identifier[resource] , identifier[String] operator[SEP] operator[SEP] identifier[args] operator[SEP] Keyword[throws] identifier[Exception] {
identifier[responderparam] identifier[unsetresource] operator[=] Keyword[new] identifier[responderparam] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[unsetresource] operator[SEP] identifier[unset_resource] operator[SEP] identifier[client] , identifier[args] operator[SEP] operator[SEP]
}
|
int qua_gain( /* output: quantizer index */
float code[], /* input : fixed codebook vector */
float[] g_coeff, /* input : correlation factors */
int l_subfr, /* input : fcb vector length */
FloatPointer gain_pit, /* output: quantized acb gain */
FloatPointer gain_code, /* output: quantized fcb gain */
int tameflag /* input : flag set to 1 if taming is needed */
)
{
/*
* MA prediction is performed on the innovation energy (in dB with mean *
* removed). *
* An initial predicted gain, g_0, is first determined and the correction *
* factor alpha = gain / g_0 is quantized. *
* The pitch gain and the correction factor are vector quantized and the *
* mean-squared weighted error criterion is used in the quantizer search. *
* CS Codebook , fast pre-selection version *
*/
int i,j, index1=0, index2=0;
IntegerPointer cand1 = new IntegerPointer(0),cand2=new IntegerPointer(0) ;
FloatPointer gcode0 = new FloatPointer((float)0);
float dist = 0;
float dist_min = 0;
float g_pitch = 0;
float g_code = 0;
float best_gain[] = new float[2],tmp;
/*---------------------------------------------------*
*- energy due to innovation -*
*- predicted energy -*
*- predicted codebook gain => gcode0[exp_gcode0] -*
*---------------------------------------------------*/
GainPred.gain_predict( past_qua_en, code, l_subfr, gcode0);
/*-- pre-selection --*/
tmp = (float)-1./((float)4.*g_coeff[0]*g_coeff[2]-g_coeff[4]*g_coeff[4]) ;
best_gain[0] = ((float)2.*g_coeff[2]*g_coeff[1]-g_coeff[3]*g_coeff[4])*tmp ;
best_gain[1] = ((float)2.*g_coeff[0]*g_coeff[3]-g_coeff[1]*g_coeff[4])*tmp ;
if (tameflag == 1){
if(best_gain[0]> LD8KConstants.GPCLIP2) best_gain[0] = LD8KConstants.GPCLIP2;
}
/*----------------------------------------------*
* - presearch for gain codebook - *
*----------------------------------------------*/
gbk_presel(best_gain,cand1,cand2,gcode0.value) ;
/*-- selection --*/
dist_min = LD8KConstants.FLT_MAX_G729;
if(tameflag == 1) {
for (i=0;i<LD8KConstants.NCAN1;i++){
for(j=0;j<LD8KConstants.NCAN2;j++){
g_pitch=TabLD8k.gbk1[cand1.value+i][0]+TabLD8k.gbk2[cand2.value+j][0];
if(g_pitch < LD8KConstants.GP0999) {
g_code=gcode0.value*(TabLD8k.gbk1[cand1.value+i][1]+TabLD8k.gbk2[cand2.value+j][1]);
dist = g_pitch*g_pitch * g_coeff[0]
+ g_pitch * g_coeff[1]
+ g_code*g_code * g_coeff[2]
+ g_code * g_coeff[3]
+ g_pitch*g_code * g_coeff[4] ;
if (dist < dist_min){
dist_min = dist;
index1 = cand1.value+i ;
index2 = cand2.value+j ;
}
}
}
}
}
else {
for (i=0;i<LD8KConstants.NCAN1;i++){
for(j=0;j<LD8KConstants.NCAN2;j++){
g_pitch=TabLD8k.gbk1[cand1.value+i][0]+TabLD8k.gbk2[cand2.value+j][0];
g_code=gcode0.value*(TabLD8k.gbk1[cand1.value+i][1]+TabLD8k.gbk2[cand2.value+j][1]);
dist = g_pitch*g_pitch * g_coeff[0]
+ g_pitch * g_coeff[1]
+ g_code*g_code * g_coeff[2]
+ g_code * g_coeff[3]
+ g_pitch*g_code * g_coeff[4] ;
if (dist < dist_min){
dist_min = dist;
index1 = cand1.value+i ;
index2 = cand2.value+j ;
}
}
}
}
gain_pit.value = TabLD8k.gbk1[index1][0]+TabLD8k.gbk2[index2][0] ;
g_code = TabLD8k.gbk1[index1][1]+TabLD8k.gbk2[index2][1];
gain_code.value = g_code * gcode0.value;
/*----------------------------------------------*
* update table of past quantized energies *
*----------------------------------------------*/
GainPred.gain_update( past_qua_en, g_code);
return (TabLD8k.map1[index1]*LD8KConstants.NCODE2+TabLD8k.map2[index2]);
} | class class_name[name] begin[{]
method[qua_gain, return_type[type[int]], modifier[default], parameter[code, g_coeff, l_subfr, gain_pit, gain_code, tameflag]] begin[{]
local_variable[type[int], i]
local_variable[type[IntegerPointer], cand1]
local_variable[type[FloatPointer], gcode0]
local_variable[type[float], dist]
local_variable[type[float], dist_min]
local_variable[type[float], g_pitch]
local_variable[type[float], g_code]
local_variable[type[float], best_gain]
call[GainPred.gain_predict, parameter[member[.past_qua_en], member[.code], member[.l_subfr], member[.gcode0]]]
assign[member[.tmp], binary_operation[Cast(expression=Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=1.), type=BasicType(dimensions=[], name=float)), /, binary_operation[binary_operation[binary_operation[Cast(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=4.), type=BasicType(dimensions=[], name=float)), *, member[.g_coeff]], *, member[.g_coeff]], -, binary_operation[member[.g_coeff], *, member[.g_coeff]]]]]
assign[member[.best_gain], binary_operation[binary_operation[binary_operation[binary_operation[Cast(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2.), type=BasicType(dimensions=[], name=float)), *, member[.g_coeff]], *, member[.g_coeff]], -, binary_operation[member[.g_coeff], *, member[.g_coeff]]], *, member[.tmp]]]
assign[member[.best_gain], binary_operation[binary_operation[binary_operation[binary_operation[Cast(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2.), type=BasicType(dimensions=[], name=float)), *, member[.g_coeff]], *, member[.g_coeff]], -, binary_operation[member[.g_coeff], *, member[.g_coeff]]], *, member[.tmp]]]
if[binary_operation[member[.tameflag], ==, literal[1]]] begin[{]
if[binary_operation[member[.best_gain], >, member[LD8KConstants.GPCLIP2]]] begin[{]
assign[member[.best_gain], member[LD8KConstants.GPCLIP2]]
else begin[{]
None
end[}]
else begin[{]
None
end[}]
call[.gbk_presel, parameter[member[.best_gain], member[.cand1], member[.cand2], member[gcode0.value]]]
assign[member[.dist_min], member[LD8KConstants.FLT_MAX_G729]]
if[binary_operation[member[.tameflag], ==, literal[1]]] begin[{]
ForStatement(body=BlockStatement(label=None, statements=[ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=g_pitch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=BinaryOperation(operandl=MemberReference(member=gbk1, postfix_operators=[], prefix_operators=[], qualifier=TabLD8k, selectors=[ArraySelector(index=BinaryOperation(operandl=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=cand1, selectors=[]), operandr=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)), ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))]), operandr=MemberReference(member=gbk2, postfix_operators=[], prefix_operators=[], qualifier=TabLD8k, selectors=[ArraySelector(index=BinaryOperation(operandl=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=cand2, selectors=[]), operandr=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)), ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))]), operator=+)), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=g_pitch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=GP0999, postfix_operators=[], prefix_operators=[], qualifier=LD8KConstants, selectors=[]), operator=<), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=g_code, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=BinaryOperation(operandl=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=gcode0, selectors=[]), operandr=BinaryOperation(operandl=MemberReference(member=gbk1, postfix_operators=[], prefix_operators=[], qualifier=TabLD8k, selectors=[ArraySelector(index=BinaryOperation(operandl=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=cand1, selectors=[]), operandr=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)), ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1))]), operandr=MemberReference(member=gbk2, postfix_operators=[], prefix_operators=[], qualifier=TabLD8k, selectors=[ArraySelector(index=BinaryOperation(operandl=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=cand2, selectors=[]), operandr=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)), ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1))]), operator=+), operator=*)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=dist, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=g_pitch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=g_pitch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=*), operandr=MemberReference(member=g_coeff, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))]), operator=*), operandr=BinaryOperation(operandl=MemberReference(member=g_pitch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=g_coeff, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1))]), operator=*), operator=+), operandr=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=g_code, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=g_code, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=*), operandr=MemberReference(member=g_coeff, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2))]), operator=*), operator=+), operandr=BinaryOperation(operandl=MemberReference(member=g_code, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=g_coeff, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=3))]), operator=*), operator=+), operandr=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=g_pitch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=g_code, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=*), operandr=MemberReference(member=g_coeff, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=4))]), operator=*), operator=+)), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=dist, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=dist_min, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=dist_min, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=dist, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=index1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=BinaryOperation(operandl=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=cand1, selectors=[]), operandr=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=index2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=BinaryOperation(operandl=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=cand2, selectors=[]), operandr=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)), label=None)]))]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=NCAN2, postfix_operators=[], prefix_operators=[], qualifier=LD8KConstants, selectors=[]), operator=<), init=[Assignment(expressionl=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))], update=[MemberReference(member=j, 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=NCAN1, postfix_operators=[], prefix_operators=[], qualifier=LD8KConstants, selectors=[]), operator=<), init=[Assignment(expressionl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))], update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
else begin[{]
ForStatement(body=BlockStatement(label=None, statements=[ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=g_pitch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=BinaryOperation(operandl=MemberReference(member=gbk1, postfix_operators=[], prefix_operators=[], qualifier=TabLD8k, selectors=[ArraySelector(index=BinaryOperation(operandl=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=cand1, selectors=[]), operandr=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)), ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))]), operandr=MemberReference(member=gbk2, postfix_operators=[], prefix_operators=[], qualifier=TabLD8k, selectors=[ArraySelector(index=BinaryOperation(operandl=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=cand2, selectors=[]), operandr=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)), ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))]), operator=+)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=g_code, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=BinaryOperation(operandl=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=gcode0, selectors=[]), operandr=BinaryOperation(operandl=MemberReference(member=gbk1, postfix_operators=[], prefix_operators=[], qualifier=TabLD8k, selectors=[ArraySelector(index=BinaryOperation(operandl=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=cand1, selectors=[]), operandr=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)), ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1))]), operandr=MemberReference(member=gbk2, postfix_operators=[], prefix_operators=[], qualifier=TabLD8k, selectors=[ArraySelector(index=BinaryOperation(operandl=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=cand2, selectors=[]), operandr=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)), ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1))]), operator=+), operator=*)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=dist, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=g_pitch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=g_pitch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=*), operandr=MemberReference(member=g_coeff, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))]), operator=*), operandr=BinaryOperation(operandl=MemberReference(member=g_pitch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=g_coeff, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1))]), operator=*), operator=+), operandr=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=g_code, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=g_code, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=*), operandr=MemberReference(member=g_coeff, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2))]), operator=*), operator=+), operandr=BinaryOperation(operandl=MemberReference(member=g_code, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=g_coeff, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=3))]), operator=*), operator=+), operandr=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=g_pitch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=g_code, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=*), operandr=MemberReference(member=g_coeff, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=4))]), operator=*), operator=+)), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=dist, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=dist_min, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=dist_min, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=dist, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=index1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=BinaryOperation(operandl=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=cand1, selectors=[]), operandr=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=index2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=BinaryOperation(operandl=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=cand2, selectors=[]), operandr=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=NCAN2, postfix_operators=[], prefix_operators=[], qualifier=LD8KConstants, selectors=[]), operator=<), init=[Assignment(expressionl=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))], update=[MemberReference(member=j, 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=NCAN1, postfix_operators=[], prefix_operators=[], qualifier=LD8KConstants, selectors=[]), operator=<), init=[Assignment(expressionl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))], update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
end[}]
assign[member[gain_pit.value], binary_operation[member[TabLD8k.gbk1], +, member[TabLD8k.gbk2]]]
assign[member[.g_code], binary_operation[member[TabLD8k.gbk1], +, member[TabLD8k.gbk2]]]
assign[member[gain_code.value], binary_operation[member[.g_code], *, member[gcode0.value]]]
call[GainPred.gain_update, parameter[member[.past_qua_en], member[.g_code]]]
return[binary_operation[binary_operation[member[TabLD8k.map1], *, member[LD8KConstants.NCODE2]], +, member[TabLD8k.map2]]]
end[}]
END[}] | Keyword[int] identifier[qua_gain] operator[SEP] Keyword[float] identifier[code] operator[SEP] operator[SEP] , Keyword[float] operator[SEP] operator[SEP] identifier[g_coeff] , Keyword[int] identifier[l_subfr] , identifier[FloatPointer] identifier[gain_pit] , identifier[FloatPointer] identifier[gain_code] , Keyword[int] identifier[tameflag] operator[SEP] {
Keyword[int] identifier[i] , identifier[j] , identifier[index1] operator[=] Other[0] , identifier[index2] operator[=] Other[0] operator[SEP] identifier[IntegerPointer] identifier[cand1] operator[=] Keyword[new] identifier[IntegerPointer] operator[SEP] Other[0] operator[SEP] , identifier[cand2] operator[=] Keyword[new] identifier[IntegerPointer] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[FloatPointer] identifier[gcode0] operator[=] Keyword[new] identifier[FloatPointer] operator[SEP] operator[SEP] Keyword[float] operator[SEP] Other[0] operator[SEP] operator[SEP] Keyword[float] identifier[dist] operator[=] Other[0] operator[SEP] Keyword[float] identifier[dist_min] operator[=] Other[0] operator[SEP] Keyword[float] identifier[g_pitch] operator[=] Other[0] operator[SEP] Keyword[float] identifier[g_code] operator[=] Other[0] operator[SEP] Keyword[float] identifier[best_gain] operator[SEP] operator[SEP] operator[=] Keyword[new] Keyword[float] operator[SEP] Other[2] operator[SEP] , identifier[tmp] operator[SEP] identifier[GainPred] operator[SEP] identifier[gain_predict] operator[SEP] identifier[past_qua_en] , identifier[code] , identifier[l_subfr] , identifier[gcode0] operator[SEP] operator[SEP] identifier[tmp] operator[=] operator[SEP] Keyword[float] operator[SEP] operator[-] literal[Float] operator[/] operator[SEP] operator[SEP] Keyword[float] operator[SEP] literal[Float] operator[*] identifier[g_coeff] operator[SEP] Other[0] operator[SEP] operator[*] identifier[g_coeff] operator[SEP] Other[2] operator[SEP] operator[-] identifier[g_coeff] operator[SEP] Other[4] operator[SEP] operator[*] identifier[g_coeff] operator[SEP] Other[4] operator[SEP] operator[SEP] operator[SEP] identifier[best_gain] operator[SEP] Other[0] operator[SEP] operator[=] operator[SEP] operator[SEP] Keyword[float] operator[SEP] literal[Float] operator[*] identifier[g_coeff] operator[SEP] Other[2] operator[SEP] operator[*] identifier[g_coeff] operator[SEP] Other[1] operator[SEP] operator[-] identifier[g_coeff] operator[SEP] Other[3] operator[SEP] operator[*] identifier[g_coeff] operator[SEP] Other[4] operator[SEP] operator[SEP] operator[*] identifier[tmp] operator[SEP] identifier[best_gain] operator[SEP] Other[1] operator[SEP] operator[=] operator[SEP] operator[SEP] Keyword[float] operator[SEP] literal[Float] operator[*] identifier[g_coeff] operator[SEP] Other[0] operator[SEP] operator[*] identifier[g_coeff] operator[SEP] Other[3] operator[SEP] operator[-] identifier[g_coeff] operator[SEP] Other[1] operator[SEP] operator[*] identifier[g_coeff] operator[SEP] Other[4] operator[SEP] operator[SEP] operator[*] identifier[tmp] operator[SEP] Keyword[if] operator[SEP] identifier[tameflag] operator[==] Other[1] operator[SEP] {
Keyword[if] operator[SEP] identifier[best_gain] operator[SEP] Other[0] operator[SEP] operator[>] identifier[LD8KConstants] operator[SEP] identifier[GPCLIP2] operator[SEP] identifier[best_gain] operator[SEP] Other[0] operator[SEP] operator[=] identifier[LD8KConstants] operator[SEP] identifier[GPCLIP2] operator[SEP]
}
identifier[gbk_presel] operator[SEP] identifier[best_gain] , identifier[cand1] , identifier[cand2] , identifier[gcode0] operator[SEP] identifier[value] operator[SEP] operator[SEP] identifier[dist_min] operator[=] identifier[LD8KConstants] operator[SEP] identifier[FLT_MAX_G729] operator[SEP] Keyword[if] operator[SEP] identifier[tameflag] operator[==] Other[1] operator[SEP] {
Keyword[for] operator[SEP] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[LD8KConstants] operator[SEP] identifier[NCAN1] operator[SEP] identifier[i] operator[++] operator[SEP] {
Keyword[for] operator[SEP] identifier[j] operator[=] Other[0] operator[SEP] identifier[j] operator[<] identifier[LD8KConstants] operator[SEP] identifier[NCAN2] operator[SEP] identifier[j] operator[++] operator[SEP] {
identifier[g_pitch] operator[=] identifier[TabLD8k] operator[SEP] identifier[gbk1] operator[SEP] identifier[cand1] operator[SEP] identifier[value] operator[+] identifier[i] operator[SEP] operator[SEP] Other[0] operator[SEP] operator[+] identifier[TabLD8k] operator[SEP] identifier[gbk2] operator[SEP] identifier[cand2] operator[SEP] identifier[value] operator[+] identifier[j] operator[SEP] operator[SEP] Other[0] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[g_pitch] operator[<] identifier[LD8KConstants] operator[SEP] identifier[GP0999] operator[SEP] {
identifier[g_code] operator[=] identifier[gcode0] operator[SEP] identifier[value] operator[*] operator[SEP] identifier[TabLD8k] operator[SEP] identifier[gbk1] operator[SEP] identifier[cand1] operator[SEP] identifier[value] operator[+] identifier[i] operator[SEP] operator[SEP] Other[1] operator[SEP] operator[+] identifier[TabLD8k] operator[SEP] identifier[gbk2] operator[SEP] identifier[cand2] operator[SEP] identifier[value] operator[+] identifier[j] operator[SEP] operator[SEP] Other[1] operator[SEP] operator[SEP] operator[SEP] identifier[dist] operator[=] identifier[g_pitch] operator[*] identifier[g_pitch] operator[*] identifier[g_coeff] operator[SEP] Other[0] operator[SEP] operator[+] identifier[g_pitch] operator[*] identifier[g_coeff] operator[SEP] Other[1] operator[SEP] operator[+] identifier[g_code] operator[*] identifier[g_code] operator[*] identifier[g_coeff] operator[SEP] Other[2] operator[SEP] operator[+] identifier[g_code] operator[*] identifier[g_coeff] operator[SEP] Other[3] operator[SEP] operator[+] identifier[g_pitch] operator[*] identifier[g_code] operator[*] identifier[g_coeff] operator[SEP] Other[4] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[dist] operator[<] identifier[dist_min] operator[SEP] {
identifier[dist_min] operator[=] identifier[dist] operator[SEP] identifier[index1] operator[=] identifier[cand1] operator[SEP] identifier[value] operator[+] identifier[i] operator[SEP] identifier[index2] operator[=] identifier[cand2] operator[SEP] identifier[value] operator[+] identifier[j] operator[SEP]
}
}
}
}
}
Keyword[else] {
Keyword[for] operator[SEP] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[LD8KConstants] operator[SEP] identifier[NCAN1] operator[SEP] identifier[i] operator[++] operator[SEP] {
Keyword[for] operator[SEP] identifier[j] operator[=] Other[0] operator[SEP] identifier[j] operator[<] identifier[LD8KConstants] operator[SEP] identifier[NCAN2] operator[SEP] identifier[j] operator[++] operator[SEP] {
identifier[g_pitch] operator[=] identifier[TabLD8k] operator[SEP] identifier[gbk1] operator[SEP] identifier[cand1] operator[SEP] identifier[value] operator[+] identifier[i] operator[SEP] operator[SEP] Other[0] operator[SEP] operator[+] identifier[TabLD8k] operator[SEP] identifier[gbk2] operator[SEP] identifier[cand2] operator[SEP] identifier[value] operator[+] identifier[j] operator[SEP] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[g_code] operator[=] identifier[gcode0] operator[SEP] identifier[value] operator[*] operator[SEP] identifier[TabLD8k] operator[SEP] identifier[gbk1] operator[SEP] identifier[cand1] operator[SEP] identifier[value] operator[+] identifier[i] operator[SEP] operator[SEP] Other[1] operator[SEP] operator[+] identifier[TabLD8k] operator[SEP] identifier[gbk2] operator[SEP] identifier[cand2] operator[SEP] identifier[value] operator[+] identifier[j] operator[SEP] operator[SEP] Other[1] operator[SEP] operator[SEP] operator[SEP] identifier[dist] operator[=] identifier[g_pitch] operator[*] identifier[g_pitch] operator[*] identifier[g_coeff] operator[SEP] Other[0] operator[SEP] operator[+] identifier[g_pitch] operator[*] identifier[g_coeff] operator[SEP] Other[1] operator[SEP] operator[+] identifier[g_code] operator[*] identifier[g_code] operator[*] identifier[g_coeff] operator[SEP] Other[2] operator[SEP] operator[+] identifier[g_code] operator[*] identifier[g_coeff] operator[SEP] Other[3] operator[SEP] operator[+] identifier[g_pitch] operator[*] identifier[g_code] operator[*] identifier[g_coeff] operator[SEP] Other[4] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[dist] operator[<] identifier[dist_min] operator[SEP] {
identifier[dist_min] operator[=] identifier[dist] operator[SEP] identifier[index1] operator[=] identifier[cand1] operator[SEP] identifier[value] operator[+] identifier[i] operator[SEP] identifier[index2] operator[=] identifier[cand2] operator[SEP] identifier[value] operator[+] identifier[j] operator[SEP]
}
}
}
}
identifier[gain_pit] operator[SEP] identifier[value] operator[=] identifier[TabLD8k] operator[SEP] identifier[gbk1] operator[SEP] identifier[index1] operator[SEP] operator[SEP] Other[0] operator[SEP] operator[+] identifier[TabLD8k] operator[SEP] identifier[gbk2] operator[SEP] identifier[index2] operator[SEP] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[g_code] operator[=] identifier[TabLD8k] operator[SEP] identifier[gbk1] operator[SEP] identifier[index1] operator[SEP] operator[SEP] Other[1] operator[SEP] operator[+] identifier[TabLD8k] operator[SEP] identifier[gbk2] operator[SEP] identifier[index2] operator[SEP] operator[SEP] Other[1] operator[SEP] operator[SEP] identifier[gain_code] operator[SEP] identifier[value] operator[=] identifier[g_code] operator[*] identifier[gcode0] operator[SEP] identifier[value] operator[SEP] identifier[GainPred] operator[SEP] identifier[gain_update] operator[SEP] identifier[past_qua_en] , identifier[g_code] operator[SEP] operator[SEP] Keyword[return] operator[SEP] identifier[TabLD8k] operator[SEP] identifier[map1] operator[SEP] identifier[index1] operator[SEP] operator[*] identifier[LD8KConstants] operator[SEP] identifier[NCODE2] operator[+] identifier[TabLD8k] operator[SEP] identifier[map2] operator[SEP] identifier[index2] operator[SEP] operator[SEP] operator[SEP]
}
|
@Override
public void destroy() {
try {
this.isWork = false;
try {
if (this.thread != null) {
this.thread.join(2000);
if (this.thread.isAlive()) {
// FIXME: remove ASAP
this.thread.interrupt();
}
thread = null;
}
}
catch (InterruptedException e) {
logger.debug("Can not stop thread", e);
}
if (this.serverSocket != null) {
this.serverSocket.close();
this.serverSocket = null;
}
}
catch (IOException e) {
logger.error("", e);
}
} | class class_name[name] begin[{]
method[destroy, return_type[void], modifier[public], parameter[]] begin[{]
TryStatement(block=[StatementExpression(expression=Assignment(expressionl=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=isWork, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)), label=None), TryStatement(block=[IfStatement(condition=BinaryOperation(operandl=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=thread, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=thread, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2000)], member=join, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None), IfStatement(condition=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=thread, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[], member=isAlive, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=thread, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[], member=interrupt, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None)])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=thread, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)), label=None)]))], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Can not stop thread"), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=debug, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['InterruptedException']))], finally_block=None, label=None, resources=None), IfStatement(condition=BinaryOperation(operandl=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=serverSocket, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=serverSocket, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[], member=close, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None), StatementExpression(expression=Assignment(expressionl=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=serverSocket, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)), label=None)]))], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=""), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IOException']))], finally_block=None, label=None, resources=None)
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[destroy] operator[SEP] operator[SEP] {
Keyword[try] {
Keyword[this] operator[SEP] identifier[isWork] operator[=] literal[boolean] operator[SEP] Keyword[try] {
Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[thread] operator[!=] Other[null] operator[SEP] {
Keyword[this] operator[SEP] identifier[thread] operator[SEP] identifier[join] operator[SEP] Other[2000] operator[SEP] operator[SEP] Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[thread] operator[SEP] identifier[isAlive] operator[SEP] operator[SEP] operator[SEP] {
Keyword[this] operator[SEP] identifier[thread] operator[SEP] identifier[interrupt] operator[SEP] operator[SEP] operator[SEP]
}
identifier[thread] operator[=] Other[null] operator[SEP]
}
}
Keyword[catch] operator[SEP] identifier[InterruptedException] identifier[e] operator[SEP] {
identifier[logger] operator[SEP] identifier[debug] operator[SEP] literal[String] , identifier[e] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[serverSocket] operator[!=] Other[null] operator[SEP] {
Keyword[this] operator[SEP] identifier[serverSocket] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[serverSocket] operator[=] Other[null] operator[SEP]
}
}
Keyword[catch] operator[SEP] identifier[IOException] identifier[e] operator[SEP] {
identifier[logger] operator[SEP] identifier[error] operator[SEP] literal[String] , identifier[e] operator[SEP] operator[SEP]
}
}
|
@Deprecated
public void sendRow(long sheetId, long rowId, RowEmail email) throws SmartsheetException {
this.createResource("sheets/" + sheetId + "/rows/" + rowId + "/emails", RowEmail.class, email);
} | class class_name[name] begin[{]
method[sendRow, return_type[void], modifier[public], parameter[sheetId, rowId, email]] begin[{]
THIS[call[None.createResource, parameter[binary_operation[binary_operation[binary_operation[binary_operation[literal["sheets/"], +, member[.sheetId]], +, literal["/rows/"]], +, member[.rowId]], +, literal["/emails"]], ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=RowEmail, sub_type=None)), member[.email]]]]
end[}]
END[}] | annotation[@] identifier[Deprecated] Keyword[public] Keyword[void] identifier[sendRow] operator[SEP] Keyword[long] identifier[sheetId] , Keyword[long] identifier[rowId] , identifier[RowEmail] identifier[email] operator[SEP] Keyword[throws] identifier[SmartsheetException] {
Keyword[this] operator[SEP] identifier[createResource] operator[SEP] literal[String] operator[+] identifier[sheetId] operator[+] literal[String] operator[+] identifier[rowId] operator[+] literal[String] , identifier[RowEmail] operator[SEP] Keyword[class] , identifier[email] operator[SEP] operator[SEP]
}
|
@Override
public void deserializeInstance(SerializationStreamReader streamReader, OWLAnnotationPropertyDomainAxiomImpl instance) throws SerializationException {
deserialize(streamReader, instance);
} | class class_name[name] begin[{]
method[deserializeInstance, return_type[void], modifier[public], parameter[streamReader, instance]] begin[{]
call[.deserialize, parameter[member[.streamReader], member[.instance]]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[deserializeInstance] operator[SEP] identifier[SerializationStreamReader] identifier[streamReader] , identifier[OWLAnnotationPropertyDomainAxiomImpl] identifier[instance] operator[SEP] Keyword[throws] identifier[SerializationException] {
identifier[deserialize] operator[SEP] identifier[streamReader] , identifier[instance] operator[SEP] operator[SEP]
}
|
private void populateDistSetTypeNameCombo() {
distsetTypeNameComboBox.setContainerDataSource(getDistSetTypeLazyQueryContainer());
distsetTypeNameComboBox.setItemCaptionPropertyId(SPUILabelDefinitions.VAR_NAME);
distsetTypeNameComboBox.setValue(getDefaultDistributionSetType().getId());
} | class class_name[name] begin[{]
method[populateDistSetTypeNameCombo, return_type[void], modifier[private], parameter[]] begin[{]
call[distsetTypeNameComboBox.setContainerDataSource, parameter[call[.getDistSetTypeLazyQueryContainer, parameter[]]]]
call[distsetTypeNameComboBox.setItemCaptionPropertyId, parameter[member[SPUILabelDefinitions.VAR_NAME]]]
call[distsetTypeNameComboBox.setValue, parameter[call[.getDefaultDistributionSetType, parameter[]]]]
end[}]
END[}] | Keyword[private] Keyword[void] identifier[populateDistSetTypeNameCombo] operator[SEP] operator[SEP] {
identifier[distsetTypeNameComboBox] operator[SEP] identifier[setContainerDataSource] operator[SEP] identifier[getDistSetTypeLazyQueryContainer] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[distsetTypeNameComboBox] operator[SEP] identifier[setItemCaptionPropertyId] operator[SEP] identifier[SPUILabelDefinitions] operator[SEP] identifier[VAR_NAME] operator[SEP] operator[SEP] identifier[distsetTypeNameComboBox] operator[SEP] identifier[setValue] operator[SEP] identifier[getDefaultDistributionSetType] operator[SEP] operator[SEP] operator[SEP] identifier[getId] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
@Override
public int encode ( byte[] dst, int dstIndex ) {
int start = dstIndex;
SMBUtil.writeTime(this.createTime, dst, dstIndex);
dstIndex += 8;
SMBUtil.writeTime(this.lastAccessTime, dst, dstIndex);
dstIndex += 8;
SMBUtil.writeTime(this.lastWriteTime, dst, dstIndex);
dstIndex += 8;
SMBUtil.writeTime(this.changeTime, dst, dstIndex);
dstIndex += 8;
SMBUtil.writeInt4(this.attributes, dst, dstIndex);
dstIndex += 4;
dstIndex += 4;
return dstIndex - start;
} | class class_name[name] begin[{]
method[encode, return_type[type[int]], modifier[public], parameter[dst, dstIndex]] begin[{]
local_variable[type[int], start]
call[SMBUtil.writeTime, parameter[THIS[member[None.createTime]], member[.dst], member[.dstIndex]]]
assign[member[.dstIndex], literal[8]]
call[SMBUtil.writeTime, parameter[THIS[member[None.lastAccessTime]], member[.dst], member[.dstIndex]]]
assign[member[.dstIndex], literal[8]]
call[SMBUtil.writeTime, parameter[THIS[member[None.lastWriteTime]], member[.dst], member[.dstIndex]]]
assign[member[.dstIndex], literal[8]]
call[SMBUtil.writeTime, parameter[THIS[member[None.changeTime]], member[.dst], member[.dstIndex]]]
assign[member[.dstIndex], literal[8]]
call[SMBUtil.writeInt4, parameter[THIS[member[None.attributes]], member[.dst], member[.dstIndex]]]
assign[member[.dstIndex], literal[4]]
assign[member[.dstIndex], literal[4]]
return[binary_operation[member[.dstIndex], -, member[.start]]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] Keyword[int] identifier[encode] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[dst] , Keyword[int] identifier[dstIndex] operator[SEP] {
Keyword[int] identifier[start] operator[=] identifier[dstIndex] operator[SEP] identifier[SMBUtil] operator[SEP] identifier[writeTime] operator[SEP] Keyword[this] operator[SEP] identifier[createTime] , identifier[dst] , identifier[dstIndex] operator[SEP] operator[SEP] identifier[dstIndex] operator[+=] Other[8] operator[SEP] identifier[SMBUtil] operator[SEP] identifier[writeTime] operator[SEP] Keyword[this] operator[SEP] identifier[lastAccessTime] , identifier[dst] , identifier[dstIndex] operator[SEP] operator[SEP] identifier[dstIndex] operator[+=] Other[8] operator[SEP] identifier[SMBUtil] operator[SEP] identifier[writeTime] operator[SEP] Keyword[this] operator[SEP] identifier[lastWriteTime] , identifier[dst] , identifier[dstIndex] operator[SEP] operator[SEP] identifier[dstIndex] operator[+=] Other[8] operator[SEP] identifier[SMBUtil] operator[SEP] identifier[writeTime] operator[SEP] Keyword[this] operator[SEP] identifier[changeTime] , identifier[dst] , identifier[dstIndex] operator[SEP] operator[SEP] identifier[dstIndex] operator[+=] Other[8] operator[SEP] identifier[SMBUtil] operator[SEP] identifier[writeInt4] operator[SEP] Keyword[this] operator[SEP] identifier[attributes] , identifier[dst] , identifier[dstIndex] operator[SEP] operator[SEP] identifier[dstIndex] operator[+=] Other[4] operator[SEP] identifier[dstIndex] operator[+=] Other[4] operator[SEP] Keyword[return] identifier[dstIndex] operator[-] identifier[start] operator[SEP]
}
|
@Override
public boolean isRequestedSessionIDValid(String sessionID, int version) {
boolean isValid = false;
if (sessionID != null) {
ISession session = (ISession) getSession(sessionID, version, false, null);
if (session != null) {
isValid = session.isValid();
}
}
if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled() && LoggingUtil.SESSION_LOGGER_CORE.isLoggable(Level.FINE)) {
LoggingUtil.SESSION_LOGGER_CORE.logp(Level.FINE, methodClassName, "isRequestedSessionIDValid", "" + isValid);
}
return isValid;
} | class class_name[name] begin[{]
method[isRequestedSessionIDValid, return_type[type[boolean]], modifier[public], parameter[sessionID, version]] begin[{]
local_variable[type[boolean], isValid]
if[binary_operation[member[.sessionID], !=, literal[null]]] begin[{]
local_variable[type[ISession], session]
if[binary_operation[member[.session], !=, literal[null]]] begin[{]
assign[member[.isValid], call[session.isValid, parameter[]]]
else begin[{]
None
end[}]
else begin[{]
None
end[}]
if[binary_operation[call[com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[LoggingUtil.SESSION_LOGGER_CORE.isLoggable, parameter[member[Level.FINE]]]]] begin[{]
call[LoggingUtil.SESSION_LOGGER_CORE.logp, parameter[member[Level.FINE], member[.methodClassName], literal["isRequestedSessionIDValid"], binary_operation[literal[""], +, member[.isValid]]]]
else begin[{]
None
end[}]
return[member[.isValid]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] Keyword[boolean] identifier[isRequestedSessionIDValid] operator[SEP] identifier[String] identifier[sessionID] , Keyword[int] identifier[version] operator[SEP] {
Keyword[boolean] identifier[isValid] operator[=] literal[boolean] operator[SEP] Keyword[if] operator[SEP] identifier[sessionID] operator[!=] Other[null] operator[SEP] {
identifier[ISession] identifier[session] operator[=] operator[SEP] identifier[ISession] operator[SEP] identifier[getSession] operator[SEP] identifier[sessionID] , identifier[version] , literal[boolean] , Other[null] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[session] operator[!=] Other[null] operator[SEP] {
identifier[isValid] operator[=] identifier[session] operator[SEP] identifier[isValid] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[if] operator[SEP] identifier[com] operator[SEP] identifier[ibm] operator[SEP] identifier[ejs] operator[SEP] identifier[ras] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[LoggingUtil] operator[SEP] identifier[SESSION_LOGGER_CORE] operator[SEP] identifier[isLoggable] operator[SEP] identifier[Level] operator[SEP] identifier[FINE] operator[SEP] operator[SEP] {
identifier[LoggingUtil] operator[SEP] identifier[SESSION_LOGGER_CORE] operator[SEP] identifier[logp] operator[SEP] identifier[Level] operator[SEP] identifier[FINE] , identifier[methodClassName] , literal[String] , literal[String] operator[+] identifier[isValid] operator[SEP] operator[SEP]
}
Keyword[return] identifier[isValid] operator[SEP]
}
|
protected String createWidgetBlockEnd() {
StringBuffer result = new StringBuffer(8);
result.append(createWidgetTableEnd());
result.append(dialogBlockEnd());
return result.toString();
} | class class_name[name] begin[{]
method[createWidgetBlockEnd, return_type[type[String]], modifier[protected], parameter[]] begin[{]
local_variable[type[StringBuffer], result]
call[result.append, parameter[call[.createWidgetTableEnd, parameter[]]]]
call[result.append, parameter[call[.dialogBlockEnd, parameter[]]]]
return[call[result.toString, parameter[]]]
end[}]
END[}] | Keyword[protected] identifier[String] identifier[createWidgetBlockEnd] operator[SEP] operator[SEP] {
identifier[StringBuffer] identifier[result] operator[=] Keyword[new] identifier[StringBuffer] operator[SEP] Other[8] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[append] operator[SEP] identifier[createWidgetTableEnd] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[append] operator[SEP] identifier[dialogBlockEnd] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[result] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP]
}
|
private void createReportLink (final Sink sink, final File sourceDirectory, final File grammarFile, String linkPath)
{
sink.tableRow ();
sink.tableCell ();
if (linkPath.startsWith ("/"))
{
linkPath = linkPath.substring (1);
}
sink.link (linkPath);
String grammarFileRelativePath = sourceDirectory.toURI ().relativize (grammarFile.toURI ()).toString ();
if (grammarFileRelativePath.startsWith ("/"))
{
grammarFileRelativePath = grammarFileRelativePath.substring (1);
}
sink.text (grammarFileRelativePath);
sink.link_ ();
sink.tableCell_ ();
sink.tableRow_ ();
} | class class_name[name] begin[{]
method[createReportLink, return_type[void], modifier[private], parameter[sink, sourceDirectory, grammarFile, linkPath]] begin[{]
call[sink.tableRow, parameter[]]
call[sink.tableCell, parameter[]]
if[call[linkPath.startsWith, parameter[literal["/"]]]] begin[{]
assign[member[.linkPath], call[linkPath.substring, parameter[literal[1]]]]
else begin[{]
None
end[}]
call[sink.link, parameter[member[.linkPath]]]
local_variable[type[String], grammarFileRelativePath]
if[call[grammarFileRelativePath.startsWith, parameter[literal["/"]]]] begin[{]
assign[member[.grammarFileRelativePath], call[grammarFileRelativePath.substring, parameter[literal[1]]]]
else begin[{]
None
end[}]
call[sink.text, parameter[member[.grammarFileRelativePath]]]
call[sink.link_, parameter[]]
call[sink.tableCell_, parameter[]]
call[sink.tableRow_, parameter[]]
end[}]
END[}] | Keyword[private] Keyword[void] identifier[createReportLink] operator[SEP] Keyword[final] identifier[Sink] identifier[sink] , Keyword[final] identifier[File] identifier[sourceDirectory] , Keyword[final] identifier[File] identifier[grammarFile] , identifier[String] identifier[linkPath] operator[SEP] {
identifier[sink] operator[SEP] identifier[tableRow] operator[SEP] operator[SEP] operator[SEP] identifier[sink] operator[SEP] identifier[tableCell] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[linkPath] operator[SEP] identifier[startsWith] operator[SEP] literal[String] operator[SEP] operator[SEP] {
identifier[linkPath] operator[=] identifier[linkPath] operator[SEP] identifier[substring] operator[SEP] Other[1] operator[SEP] operator[SEP]
}
identifier[sink] operator[SEP] identifier[link] operator[SEP] identifier[linkPath] operator[SEP] operator[SEP] identifier[String] identifier[grammarFileRelativePath] operator[=] identifier[sourceDirectory] operator[SEP] identifier[toURI] operator[SEP] operator[SEP] operator[SEP] identifier[relativize] operator[SEP] identifier[grammarFile] operator[SEP] identifier[toURI] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[grammarFileRelativePath] operator[SEP] identifier[startsWith] operator[SEP] literal[String] operator[SEP] operator[SEP] {
identifier[grammarFileRelativePath] operator[=] identifier[grammarFileRelativePath] operator[SEP] identifier[substring] operator[SEP] Other[1] operator[SEP] operator[SEP]
}
identifier[sink] operator[SEP] identifier[text] operator[SEP] identifier[grammarFileRelativePath] operator[SEP] operator[SEP] identifier[sink] operator[SEP] identifier[link_] operator[SEP] operator[SEP] operator[SEP] identifier[sink] operator[SEP] identifier[tableCell_] operator[SEP] operator[SEP] operator[SEP] identifier[sink] operator[SEP] identifier[tableRow_] operator[SEP] operator[SEP] operator[SEP]
}
|
private void handleLongOption(String token) throws OptionParserException {
if (token.indexOf('=') == -1) {
handleLongOptionWithoutEqual(token);
} else {
handleLongOptionWithEqual(token);
}
} | class class_name[name] begin[{]
method[handleLongOption, return_type[void], modifier[private], parameter[token]] begin[{]
if[binary_operation[call[token.indexOf, parameter[literal['=']]], ==, literal[1]]] begin[{]
call[.handleLongOptionWithoutEqual, parameter[member[.token]]]
else begin[{]
call[.handleLongOptionWithEqual, parameter[member[.token]]]
end[}]
end[}]
END[}] | Keyword[private] Keyword[void] identifier[handleLongOption] operator[SEP] identifier[String] identifier[token] operator[SEP] Keyword[throws] identifier[OptionParserException] {
Keyword[if] operator[SEP] identifier[token] operator[SEP] identifier[indexOf] operator[SEP] literal[String] operator[SEP] operator[==] operator[-] Other[1] operator[SEP] {
identifier[handleLongOptionWithoutEqual] operator[SEP] identifier[token] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[handleLongOptionWithEqual] operator[SEP] identifier[token] operator[SEP] operator[SEP]
}
}
|
public NetworkSecurityGroupInner beginUpdateTags(String resourceGroupName, String networkSecurityGroupName, Map<String, String> tags) {
return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName, tags).toBlocking().single().body();
} | class class_name[name] begin[{]
method[beginUpdateTags, return_type[type[NetworkSecurityGroupInner]], modifier[public], parameter[resourceGroupName, networkSecurityGroupName, tags]] begin[{]
return[call[.beginUpdateTagsWithServiceResponseAsync, parameter[member[.resourceGroupName], member[.networkSecurityGroupName], member[.tags]]]]
end[}]
END[}] | Keyword[public] identifier[NetworkSecurityGroupInner] identifier[beginUpdateTags] operator[SEP] identifier[String] identifier[resourceGroupName] , identifier[String] identifier[networkSecurityGroupName] , identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[tags] operator[SEP] {
Keyword[return] identifier[beginUpdateTagsWithServiceResponseAsync] operator[SEP] identifier[resourceGroupName] , identifier[networkSecurityGroupName] , identifier[tags] 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 static void escapeJavaScript(final Reader reader, final Writer writer,
final JavaScriptEscapeType type, final JavaScriptEscapeLevel level)
throws IOException {
if (writer == null) {
throw new IllegalArgumentException("Argument 'writer' cannot be null");
}
if (type == null) {
throw new IllegalArgumentException("The 'type' argument cannot be null");
}
if (level == null) {
throw new IllegalArgumentException("The 'level' argument cannot be null");
}
JavaScriptEscapeUtil.escape(reader, writer, type, level);
} | class class_name[name] begin[{]
method[escapeJavaScript, return_type[void], modifier[public static], parameter[reader, writer, type, level]] begin[{]
if[binary_operation[member[.writer], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Argument 'writer' cannot be null")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None)
else begin[{]
None
end[}]
if[binary_operation[member[.type], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="The 'type' argument cannot be null")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None)
else begin[{]
None
end[}]
if[binary_operation[member[.level], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="The 'level' argument 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[JavaScriptEscapeUtil.escape, parameter[member[.reader], member[.writer], member[.type], member[.level]]]
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[void] identifier[escapeJavaScript] operator[SEP] Keyword[final] identifier[Reader] identifier[reader] , Keyword[final] identifier[Writer] identifier[writer] , Keyword[final] identifier[JavaScriptEscapeType] identifier[type] , Keyword[final] identifier[JavaScriptEscapeLevel] identifier[level] operator[SEP] Keyword[throws] identifier[IOException] {
Keyword[if] operator[SEP] identifier[writer] operator[==] Other[null] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[type] operator[==] Other[null] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[level] operator[==] Other[null] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
identifier[JavaScriptEscapeUtil] operator[SEP] identifier[escape] operator[SEP] identifier[reader] , identifier[writer] , identifier[type] , identifier[level] operator[SEP] operator[SEP]
}
|
@XmlElementDecl(namespace = "http://www.opengis.net/gml", name = "MultiSolidCoverage", substitutionHeadNamespace = "http://www.opengis.net/gml", substitutionHeadName = "_DiscreteCoverage")
public JAXBElement<MultiSolidCoverageType> createMultiSolidCoverage(MultiSolidCoverageType value) {
return new JAXBElement<MultiSolidCoverageType>(_MultiSolidCoverage_QNAME, MultiSolidCoverageType.class, null, value);
} | class class_name[name] begin[{]
method[createMultiSolidCoverage, return_type[type[JAXBElement]], modifier[public], parameter[value]] begin[{]
return[ClassCreator(arguments=[MemberReference(member=_MultiSolidCoverage_QNAME, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=MultiSolidCoverageType, 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=MultiSolidCoverageType, 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[substitutionHeadNamespace] operator[=] literal[String] , identifier[substitutionHeadName] operator[=] literal[String] operator[SEP] Keyword[public] identifier[JAXBElement] operator[<] identifier[MultiSolidCoverageType] operator[>] identifier[createMultiSolidCoverage] operator[SEP] identifier[MultiSolidCoverageType] identifier[value] operator[SEP] {
Keyword[return] Keyword[new] identifier[JAXBElement] operator[<] identifier[MultiSolidCoverageType] operator[>] operator[SEP] identifier[_MultiSolidCoverage_QNAME] , identifier[MultiSolidCoverageType] operator[SEP] Keyword[class] , Other[null] , identifier[value] operator[SEP] operator[SEP]
}
|
public Object lookup(String id,String toFind)
{
return lookup(id,new MyWrapper(toFind));
} | class class_name[name] begin[{]
method[lookup, return_type[type[Object]], modifier[public], parameter[id, toFind]] begin[{]
return[call[.lookup, parameter[member[.id], ClassCreator(arguments=[MemberReference(member=toFind, 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=MyWrapper, sub_type=None))]]]
end[}]
END[}] | Keyword[public] identifier[Object] identifier[lookup] operator[SEP] identifier[String] identifier[id] , identifier[String] identifier[toFind] operator[SEP] {
Keyword[return] identifier[lookup] operator[SEP] identifier[id] , Keyword[new] identifier[MyWrapper] operator[SEP] identifier[toFind] operator[SEP] operator[SEP] operator[SEP]
}
|
public Group updateGroup(Object groupIdOrPath, String name, String path, String description, Visibility visibility,
Boolean lfsEnabled, Boolean requestAccessEnabled, Integer parentId) throws GitLabApiException {
Form formData = new GitLabApiForm()
.withParam("name", name)
.withParam("path", path)
.withParam("description", description)
.withParam("visibility", visibility)
.withParam("lfs_enabled", lfsEnabled)
.withParam("request_access_enabled", requestAccessEnabled)
.withParam("parent_id", isApiVersion(ApiVersion.V3) ? null : parentId);
Response response = put(Response.Status.OK, formData.asMap(), "groups", getGroupIdOrPath(groupIdOrPath));
return (response.readEntity(Group.class));
} | class class_name[name] begin[{]
method[updateGroup, return_type[type[Group]], modifier[public], parameter[groupIdOrPath, name, path, description, visibility, lfsEnabled, requestAccessEnabled, parentId]] begin[{]
local_variable[type[Form], formData]
local_variable[type[Response], response]
return[call[response.readEntity, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Group, sub_type=None))]]]
end[}]
END[}] | Keyword[public] identifier[Group] identifier[updateGroup] operator[SEP] identifier[Object] identifier[groupIdOrPath] , identifier[String] identifier[name] , identifier[String] identifier[path] , identifier[String] identifier[description] , identifier[Visibility] identifier[visibility] , identifier[Boolean] identifier[lfsEnabled] , identifier[Boolean] identifier[requestAccessEnabled] , identifier[Integer] identifier[parentId] operator[SEP] Keyword[throws] identifier[GitLabApiException] {
identifier[Form] identifier[formData] operator[=] Keyword[new] identifier[GitLabApiForm] operator[SEP] operator[SEP] operator[SEP] identifier[withParam] operator[SEP] literal[String] , identifier[name] operator[SEP] operator[SEP] identifier[withParam] operator[SEP] literal[String] , identifier[path] operator[SEP] operator[SEP] identifier[withParam] operator[SEP] literal[String] , identifier[description] operator[SEP] operator[SEP] identifier[withParam] operator[SEP] literal[String] , identifier[visibility] operator[SEP] operator[SEP] identifier[withParam] operator[SEP] literal[String] , identifier[lfsEnabled] operator[SEP] operator[SEP] identifier[withParam] operator[SEP] literal[String] , identifier[requestAccessEnabled] operator[SEP] operator[SEP] identifier[withParam] operator[SEP] literal[String] , identifier[isApiVersion] operator[SEP] identifier[ApiVersion] operator[SEP] identifier[V3] operator[SEP] operator[?] Other[null] operator[:] identifier[parentId] operator[SEP] operator[SEP] identifier[Response] identifier[response] operator[=] identifier[put] operator[SEP] identifier[Response] operator[SEP] identifier[Status] operator[SEP] identifier[OK] , identifier[formData] operator[SEP] identifier[asMap] operator[SEP] operator[SEP] , literal[String] , identifier[getGroupIdOrPath] operator[SEP] identifier[groupIdOrPath] operator[SEP] operator[SEP] operator[SEP] Keyword[return] operator[SEP] identifier[response] operator[SEP] identifier[readEntity] operator[SEP] identifier[Group] operator[SEP] Keyword[class] operator[SEP] operator[SEP] operator[SEP]
}
|
@SuppressWarnings("unchecked")
private static void extractTables(
String pdfDirPath,
String outputDirPath,
String parserType) throws IOException
{
/*
* directory existence check
*/
File pdfDir = new File(pdfDirPath);
if (!pdfDir.exists())
{
System.out.printf("[Error] %s does not exist\n", pdfDirPath);
return;
}
/*
* must be a directory
*/
if (!pdfDir.isDirectory())
{
System.out.printf("[Error] %s is not a directory\n", pdfDirPath);
return;
}
/*
* Creates the output directory if not exist
*/
File outputDir = new File(outputDirPath);
if (!outputDir.exists())
{
outputDir.mkdirs();
System.out.printf("[Info] output dir %s created\n", outputDirPath);
}
/*
* to output the XML files
*/
File xmlDir = new File(outputDirPath, "xml");
if (!xmlDir.exists())
{
xmlDir.mkdirs();
System.out.printf("[Info] xml dir %s created\n", xmlDir);
}
TableExtractor extractor = new TableExtractor();
/*
* Sets PDF parser. Now we have two parsers: PDFBOX or TET. Other parsers can be easily added here.
*/
IPdfParser parser = null;
if (parserType.compareToIgnoreCase("pdfbox") == 0)
{
try
{
parser = new PdfBoxParser();
}
catch (IOException e)
{
System.out.printf("[Error] PDFBox parser cannot be created\n");
return;
}
extractor.setParser(parser);
}
else
{
System.out.printf(
"[Error] %s is not a correct parser name\n",
parserType);
return;
}
PdfFileFilter filter = new PdfFileFilter();
File[] pdfFiles = pdfDir.listFiles(filter);
System.out.printf("[Info] %d PDF documents found\n", pdfFiles.length);
/*
* Main loop over files
*/
int success = 0;
int fail = 0;
int tableCount = 0;
XMLOutputter outputter = new XMLOutputter(Format.getPrettyFormat());
XMLOutputter rawOutputter = new XMLOutputter(Format.getCompactFormat());
File mysqlInFile = new File(outputDir, "mysql-infile");
PrintWriter mysqlInFileWriter = new PrintWriter(new FileOutputStream(
mysqlInFile));
int i = 0;
for (File pdfFile : pdfFiles)
{
/*
* handling one file each time
*/
try
{
ArrayList<Table> extractedTableSet = extractor.extract(
pdfFile,
outputDirPath);
if (extractedTableSet != null)
{
/*
* Writes new standard XML
*/
String xmlFileName = pdfFile.getName().replaceFirst(
".pdf",
".xml");
File xmlFile = new File(xmlDir, xmlFileName);
PrintWriter xmlWriter = new PrintWriter(
new FileOutputStream(xmlFile));
Document xmlDoc = extractor.getXMLDoc();
outputter.output(xmlDoc, xmlWriter);
xmlWriter.close();
tableCount += extractor.getDocInfo().getTableNum();
success++;
Element xRoot = xmlDoc.getRootElement();
Element xTables = xRoot.getChild("tables");
String paperid = xRoot.getAttributeValue("id");
if (xTables != null)
{
List<Element> tableRecords = xTables.getChildren();
for (Element tableRecord : tableRecords)
{
String id = paperid + "-"
+ tableRecord.getAttributeValue("id");
String caption = "";
String content = "";
String footNote = "";
String refText = "";
String pageNumInDoc = "\\N";
Element xTable = tableRecord.getChild("table");
if (xTable != null)
{
content = cleanString(rawOutputter.outputString(xTable));
}
Element xCaption = tableRecord.getChild("caption");
if (xCaption != null)
{
caption = cleanString(xCaption.getText());
}
Element xFootNote = tableRecord.getChild("footnote");
if (xFootNote != null)
{
footNote = cleanString(xFootNote.getText());
}
Element xRefText = tableRecord.getChild("referenceText");
if (xRefText != null)
{
refText = cleanString(xRefText.getText());
}
Element xPageNumInDoc = tableRecord.getChild("pageNumInDoc");
if (xPageNumInDoc != null)
{
pageNumInDoc = xPageNumInDoc.getText();
}
String line = id + "\t" + caption + "\t"
+ content + "\t" + footNote + "\t"
+ refText + "\t" + paperid + "\t"
+ pageNumInDoc + "\n";
mysqlInFileWriter.write(line);
}
}
}
else
{
fail++;
}
}
catch (Exception e)
{
System.out.printf(
"[Error] unhandled exception of %s\n",
pdfFile.getName());
/*
* Print to standard error
*/
System.err.printf("----- %s -----\n", pdfFile.getName());
System.err.printf("%s\n", e.getMessage());
e.printStackTrace();
fail++;
}
i++;
if (Config.SMALL_TEST && i >= 10)
{
break;
}
}
mysqlInFileWriter.close();
/*
* Prints the summary information after processing all the PDF documents.
*/
File summaryFile = new File(outputDir, "summary");
PrintWriter summaryWriter = null;
try
{
summaryWriter = new PrintWriter(new FileOutputStream(summaryFile));
summaryWriter.write("total=" + pdfFiles.length + "\n");
summaryWriter.write("success=" + success + "\n");
summaryWriter.write("fail=" + fail + "\n");
summaryWriter.write("table=" + tableCount + "\n");
}
catch (FileNotFoundException e)
{
// ignore
}
finally
{
if (summaryWriter != null)
{
summaryWriter.close();
}
}
System.out.printf("--------------------\n");
System.out.printf("success=%d\n", success);
System.out.printf("fail=%d\n", fail);
System.out.printf("--------------------\n");
} | class class_name[name] begin[{]
method[extractTables, return_type[void], modifier[private static], parameter[pdfDirPath, outputDirPath, parserType]] begin[{]
local_variable[type[File], pdfDir]
if[call[pdfDir.exists, parameter[]]] begin[{]
call[System.out.printf, parameter[literal["[Error] %s does not exist\n"], member[.pdfDirPath]]]
return[None]
else begin[{]
None
end[}]
if[call[pdfDir.isDirectory, parameter[]]] begin[{]
call[System.out.printf, parameter[literal["[Error] %s is not a directory\n"], member[.pdfDirPath]]]
return[None]
else begin[{]
None
end[}]
local_variable[type[File], outputDir]
if[call[outputDir.exists, parameter[]]] begin[{]
call[outputDir.mkdirs, parameter[]]
call[System.out.printf, parameter[literal["[Info] output dir %s created\n"], member[.outputDirPath]]]
else begin[{]
None
end[}]
local_variable[type[File], xmlDir]
if[call[xmlDir.exists, parameter[]]] begin[{]
call[xmlDir.mkdirs, parameter[]]
call[System.out.printf, parameter[literal["[Info] xml dir %s created\n"], member[.xmlDir]]]
else begin[{]
None
end[}]
local_variable[type[TableExtractor], extractor]
local_variable[type[IPdfParser], parser]
if[binary_operation[call[parserType.compareToIgnoreCase, parameter[literal["pdfbox"]]], ==, literal[0]]] begin[{]
TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=parser, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=PdfBoxParser, sub_type=None))), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="[Error] PDFBox parser cannot be created\n")], member=printf, postfix_operators=[], prefix_operators=[], qualifier=System.out, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=None, label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IOException']))], finally_block=None, label=None, resources=None)
call[extractor.setParser, parameter[member[.parser]]]
else begin[{]
call[System.out.printf, parameter[literal["[Error] %s is not a correct parser name\n"], member[.parserType]]]
return[None]
end[}]
local_variable[type[PdfFileFilter], filter]
local_variable[type[File], pdfFiles]
call[System.out.printf, parameter[literal["[Info] %d PDF documents found\n"], member[pdfFiles.length]]]
local_variable[type[int], success]
local_variable[type[int], fail]
local_variable[type[int], tableCount]
local_variable[type[XMLOutputter], outputter]
local_variable[type[XMLOutputter], rawOutputter]
local_variable[type[File], mysqlInFile]
local_variable[type[PrintWriter], mysqlInFileWriter]
local_variable[type[int], i]
ForStatement(body=BlockStatement(label=None, statements=[TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=pdfFile, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=outputDirPath, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=extract, postfix_operators=[], prefix_operators=[], qualifier=extractor, selectors=[], type_arguments=None), name=extractedTableSet)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Table, sub_type=None))], dimensions=[], name=ArrayList, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=extractedTableSet, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MemberReference(member=fail, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=pdfFile, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=".pdf"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=".xml")], member=replaceFirst, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=xmlFileName)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MemberReference(member=xmlDir, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=xmlFileName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=File, sub_type=None)), name=xmlFile)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=File, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[ClassCreator(arguments=[MemberReference(member=xmlFile, 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=FileOutputStream, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=PrintWriter, sub_type=None)), name=xmlWriter)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=PrintWriter, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getXMLDoc, postfix_operators=[], prefix_operators=[], qualifier=extractor, selectors=[], type_arguments=None), name=xmlDoc)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Document, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=xmlDoc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=xmlWriter, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=output, postfix_operators=[], prefix_operators=[], qualifier=outputter, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=close, postfix_operators=[], prefix_operators=[], qualifier=xmlWriter, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=tableCount, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=MethodInvocation(arguments=[], member=getDocInfo, postfix_operators=[], prefix_operators=[], qualifier=extractor, selectors=[MethodInvocation(arguments=[], member=getTableNum, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)), label=None), StatementExpression(expression=MemberReference(member=success, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getRootElement, postfix_operators=[], prefix_operators=[], qualifier=xmlDoc, selectors=[], type_arguments=None), name=xRoot)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Element, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="tables")], member=getChild, postfix_operators=[], prefix_operators=[], qualifier=xRoot, selectors=[], type_arguments=None), name=xTables)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Element, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="id")], member=getAttributeValue, postfix_operators=[], prefix_operators=[], qualifier=xRoot, selectors=[], type_arguments=None), name=paperid)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=xTables, 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=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getChildren, postfix_operators=[], prefix_operators=[], qualifier=xTables, selectors=[], type_arguments=None), name=tableRecords)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Element, sub_type=None))], dimensions=[], name=List, sub_type=None)), ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=paperid, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="-"), operator=+), operandr=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="id")], member=getAttributeValue, postfix_operators=[], prefix_operators=[], qualifier=tableRecord, selectors=[], type_arguments=None), operator=+), name=id)], 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=""), name=caption)], 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=""), name=content)], 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=""), name=footNote)], 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=""), name=refText)], 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="\\N"), name=pageNumInDoc)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="table")], member=getChild, postfix_operators=[], prefix_operators=[], qualifier=tableRecord, selectors=[], type_arguments=None), name=xTable)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Element, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=xTable, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=content, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=xTable, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=outputString, postfix_operators=[], prefix_operators=[], qualifier=rawOutputter, selectors=[], type_arguments=None)], member=cleanString, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="caption")], member=getChild, postfix_operators=[], prefix_operators=[], qualifier=tableRecord, selectors=[], type_arguments=None), name=xCaption)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Element, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=xCaption, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=caption, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getText, postfix_operators=[], prefix_operators=[], qualifier=xCaption, selectors=[], type_arguments=None)], member=cleanString, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="footnote")], member=getChild, postfix_operators=[], prefix_operators=[], qualifier=tableRecord, selectors=[], type_arguments=None), name=xFootNote)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Element, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=xFootNote, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=footNote, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getText, postfix_operators=[], prefix_operators=[], qualifier=xFootNote, selectors=[], type_arguments=None)], member=cleanString, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="referenceText")], member=getChild, postfix_operators=[], prefix_operators=[], qualifier=tableRecord, selectors=[], type_arguments=None), name=xRefText)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Element, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=xRefText, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=refText, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getText, postfix_operators=[], prefix_operators=[], qualifier=xRefText, selectors=[], type_arguments=None)], member=cleanString, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="pageNumInDoc")], member=getChild, postfix_operators=[], prefix_operators=[], qualifier=tableRecord, selectors=[], type_arguments=None), name=xPageNumInDoc)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Element, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=xPageNumInDoc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=pageNumInDoc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=getText, postfix_operators=[], prefix_operators=[], qualifier=xPageNumInDoc, selectors=[], type_arguments=None)), label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=id, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\t"), operator=+), operandr=MemberReference(member=caption, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\t"), operator=+), operandr=MemberReference(member=content, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\t"), operator=+), operandr=MemberReference(member=footNote, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\t"), operator=+), operandr=MemberReference(member=refText, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\t"), operator=+), operandr=MemberReference(member=paperid, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\t"), operator=+), operandr=MemberReference(member=pageNumInDoc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\n"), operator=+), name=line)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=line, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=write, postfix_operators=[], prefix_operators=[], qualifier=mysqlInFileWriter, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=tableRecords, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=tableRecord)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Element, sub_type=None))), label=None)]))]))], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="[Error] unhandled exception of %s\n"), MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=pdfFile, selectors=[], type_arguments=None)], member=printf, postfix_operators=[], prefix_operators=[], qualifier=System.out, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="----- %s -----\n"), MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=pdfFile, selectors=[], type_arguments=None)], member=printf, postfix_operators=[], prefix_operators=[], qualifier=System.err, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="%s\n"), MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None)], member=printf, postfix_operators=[], prefix_operators=[], qualifier=System.err, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=printStackTrace, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MemberReference(member=fail, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None), StatementExpression(expression=MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=SMALL_TEST, postfix_operators=[], prefix_operators=[], qualifier=Config, selectors=[]), operandr=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=10), operator=>=), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[BreakStatement(goto=None, label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=pdfFiles, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=pdfFile)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=File, sub_type=None))), label=None)
call[mysqlInFileWriter.close, parameter[]]
local_variable[type[File], summaryFile]
local_variable[type[PrintWriter], summaryWriter]
TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=summaryWriter, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[ClassCreator(arguments=[MemberReference(member=summaryFile, 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=FileOutputStream, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=PrintWriter, sub_type=None))), label=None), StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="total="), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=pdfFiles, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\n"), operator=+)], member=write, postfix_operators=[], prefix_operators=[], qualifier=summaryWriter, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="success="), operandr=MemberReference(member=success, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\n"), operator=+)], member=write, postfix_operators=[], prefix_operators=[], qualifier=summaryWriter, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="fail="), operandr=MemberReference(member=fail, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\n"), operator=+)], member=write, postfix_operators=[], prefix_operators=[], qualifier=summaryWriter, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="table="), operandr=MemberReference(member=tableCount, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\n"), operator=+)], member=write, postfix_operators=[], prefix_operators=[], qualifier=summaryWriter, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['FileNotFoundException']))], finally_block=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=summaryWriter, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=close, postfix_operators=[], prefix_operators=[], qualifier=summaryWriter, selectors=[], type_arguments=None), label=None)]))], label=None, resources=None)
call[System.out.printf, parameter[literal["--------------------\n"]]]
call[System.out.printf, parameter[literal["success=%d\n"], member[.success]]]
call[System.out.printf, parameter[literal["fail=%d\n"], member[.fail]]]
call[System.out.printf, parameter[literal["--------------------\n"]]]
end[}]
END[}] | annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] Keyword[private] Keyword[static] Keyword[void] identifier[extractTables] operator[SEP] identifier[String] identifier[pdfDirPath] , identifier[String] identifier[outputDirPath] , identifier[String] identifier[parserType] operator[SEP] Keyword[throws] identifier[IOException] {
identifier[File] identifier[pdfDir] operator[=] Keyword[new] identifier[File] operator[SEP] identifier[pdfDirPath] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[pdfDir] operator[SEP] identifier[exists] operator[SEP] operator[SEP] operator[SEP] {
identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[printf] operator[SEP] literal[String] , identifier[pdfDirPath] operator[SEP] operator[SEP] Keyword[return] operator[SEP]
}
Keyword[if] operator[SEP] operator[!] identifier[pdfDir] operator[SEP] identifier[isDirectory] operator[SEP] operator[SEP] operator[SEP] {
identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[printf] operator[SEP] literal[String] , identifier[pdfDirPath] operator[SEP] operator[SEP] Keyword[return] operator[SEP]
}
identifier[File] identifier[outputDir] operator[=] Keyword[new] identifier[File] operator[SEP] identifier[outputDirPath] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[outputDir] operator[SEP] identifier[exists] operator[SEP] operator[SEP] operator[SEP] {
identifier[outputDir] operator[SEP] identifier[mkdirs] operator[SEP] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[printf] operator[SEP] literal[String] , identifier[outputDirPath] operator[SEP] operator[SEP]
}
identifier[File] identifier[xmlDir] operator[=] Keyword[new] identifier[File] operator[SEP] identifier[outputDirPath] , literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[xmlDir] operator[SEP] identifier[exists] operator[SEP] operator[SEP] operator[SEP] {
identifier[xmlDir] operator[SEP] identifier[mkdirs] operator[SEP] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[printf] operator[SEP] literal[String] , identifier[xmlDir] operator[SEP] operator[SEP]
}
identifier[TableExtractor] identifier[extractor] operator[=] Keyword[new] identifier[TableExtractor] operator[SEP] operator[SEP] operator[SEP] identifier[IPdfParser] identifier[parser] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[parserType] operator[SEP] identifier[compareToIgnoreCase] operator[SEP] literal[String] operator[SEP] operator[==] Other[0] operator[SEP] {
Keyword[try] {
identifier[parser] operator[=] Keyword[new] identifier[PdfBoxParser] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[IOException] identifier[e] operator[SEP] {
identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[printf] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[return] operator[SEP]
}
identifier[extractor] operator[SEP] identifier[setParser] operator[SEP] identifier[parser] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[printf] operator[SEP] literal[String] , identifier[parserType] operator[SEP] operator[SEP] Keyword[return] operator[SEP]
}
identifier[PdfFileFilter] identifier[filter] operator[=] Keyword[new] identifier[PdfFileFilter] operator[SEP] operator[SEP] operator[SEP] identifier[File] operator[SEP] operator[SEP] identifier[pdfFiles] operator[=] identifier[pdfDir] operator[SEP] identifier[listFiles] operator[SEP] identifier[filter] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[printf] operator[SEP] literal[String] , identifier[pdfFiles] operator[SEP] identifier[length] operator[SEP] operator[SEP] Keyword[int] identifier[success] operator[=] Other[0] operator[SEP] Keyword[int] identifier[fail] operator[=] Other[0] operator[SEP] Keyword[int] identifier[tableCount] operator[=] Other[0] operator[SEP] identifier[XMLOutputter] identifier[outputter] operator[=] Keyword[new] identifier[XMLOutputter] operator[SEP] identifier[Format] operator[SEP] identifier[getPrettyFormat] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[XMLOutputter] identifier[rawOutputter] operator[=] Keyword[new] identifier[XMLOutputter] operator[SEP] identifier[Format] operator[SEP] identifier[getCompactFormat] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[File] identifier[mysqlInFile] operator[=] Keyword[new] identifier[File] operator[SEP] identifier[outputDir] , literal[String] operator[SEP] operator[SEP] identifier[PrintWriter] identifier[mysqlInFileWriter] operator[=] Keyword[new] identifier[PrintWriter] operator[SEP] Keyword[new] identifier[FileOutputStream] operator[SEP] identifier[mysqlInFile] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] Keyword[for] operator[SEP] identifier[File] identifier[pdfFile] operator[:] identifier[pdfFiles] operator[SEP] {
Keyword[try] {
identifier[ArrayList] operator[<] identifier[Table] operator[>] identifier[extractedTableSet] operator[=] identifier[extractor] operator[SEP] identifier[extract] operator[SEP] identifier[pdfFile] , identifier[outputDirPath] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[extractedTableSet] operator[!=] Other[null] operator[SEP] {
identifier[String] identifier[xmlFileName] operator[=] identifier[pdfFile] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] identifier[replaceFirst] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[File] identifier[xmlFile] operator[=] Keyword[new] identifier[File] operator[SEP] identifier[xmlDir] , identifier[xmlFileName] operator[SEP] operator[SEP] identifier[PrintWriter] identifier[xmlWriter] operator[=] Keyword[new] identifier[PrintWriter] operator[SEP] Keyword[new] identifier[FileOutputStream] operator[SEP] identifier[xmlFile] operator[SEP] operator[SEP] operator[SEP] identifier[Document] identifier[xmlDoc] operator[=] identifier[extractor] operator[SEP] identifier[getXMLDoc] operator[SEP] operator[SEP] operator[SEP] identifier[outputter] operator[SEP] identifier[output] operator[SEP] identifier[xmlDoc] , identifier[xmlWriter] operator[SEP] operator[SEP] identifier[xmlWriter] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP] identifier[tableCount] operator[+=] identifier[extractor] operator[SEP] identifier[getDocInfo] operator[SEP] operator[SEP] operator[SEP] identifier[getTableNum] operator[SEP] operator[SEP] operator[SEP] identifier[success] operator[++] operator[SEP] identifier[Element] identifier[xRoot] operator[=] identifier[xmlDoc] operator[SEP] identifier[getRootElement] operator[SEP] operator[SEP] operator[SEP] identifier[Element] identifier[xTables] operator[=] identifier[xRoot] operator[SEP] identifier[getChild] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[String] identifier[paperid] operator[=] identifier[xRoot] operator[SEP] identifier[getAttributeValue] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[xTables] operator[!=] Other[null] operator[SEP] {
identifier[List] operator[<] identifier[Element] operator[>] identifier[tableRecords] operator[=] identifier[xTables] operator[SEP] identifier[getChildren] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Element] identifier[tableRecord] operator[:] identifier[tableRecords] operator[SEP] {
identifier[String] identifier[id] operator[=] identifier[paperid] operator[+] literal[String] operator[+] identifier[tableRecord] operator[SEP] identifier[getAttributeValue] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[String] identifier[caption] operator[=] literal[String] operator[SEP] identifier[String] identifier[content] operator[=] literal[String] operator[SEP] identifier[String] identifier[footNote] operator[=] literal[String] operator[SEP] identifier[String] identifier[refText] operator[=] literal[String] operator[SEP] identifier[String] identifier[pageNumInDoc] operator[=] literal[String] operator[SEP] identifier[Element] identifier[xTable] operator[=] identifier[tableRecord] operator[SEP] identifier[getChild] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[xTable] operator[!=] Other[null] operator[SEP] {
identifier[content] operator[=] identifier[cleanString] operator[SEP] identifier[rawOutputter] operator[SEP] identifier[outputString] operator[SEP] identifier[xTable] operator[SEP] operator[SEP] operator[SEP]
}
identifier[Element] identifier[xCaption] operator[=] identifier[tableRecord] operator[SEP] identifier[getChild] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[xCaption] operator[!=] Other[null] operator[SEP] {
identifier[caption] operator[=] identifier[cleanString] operator[SEP] identifier[xCaption] operator[SEP] identifier[getText] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
identifier[Element] identifier[xFootNote] operator[=] identifier[tableRecord] operator[SEP] identifier[getChild] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[xFootNote] operator[!=] Other[null] operator[SEP] {
identifier[footNote] operator[=] identifier[cleanString] operator[SEP] identifier[xFootNote] operator[SEP] identifier[getText] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
identifier[Element] identifier[xRefText] operator[=] identifier[tableRecord] operator[SEP] identifier[getChild] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[xRefText] operator[!=] Other[null] operator[SEP] {
identifier[refText] operator[=] identifier[cleanString] operator[SEP] identifier[xRefText] operator[SEP] identifier[getText] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
identifier[Element] identifier[xPageNumInDoc] operator[=] identifier[tableRecord] operator[SEP] identifier[getChild] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[xPageNumInDoc] operator[!=] Other[null] operator[SEP] {
identifier[pageNumInDoc] operator[=] identifier[xPageNumInDoc] operator[SEP] identifier[getText] operator[SEP] operator[SEP] operator[SEP]
}
identifier[String] identifier[line] operator[=] identifier[id] operator[+] literal[String] operator[+] identifier[caption] operator[+] literal[String] operator[+] identifier[content] operator[+] literal[String] operator[+] identifier[footNote] operator[+] literal[String] operator[+] identifier[refText] operator[+] literal[String] operator[+] identifier[paperid] operator[+] literal[String] operator[+] identifier[pageNumInDoc] operator[+] literal[String] operator[SEP] identifier[mysqlInFileWriter] operator[SEP] identifier[write] operator[SEP] identifier[line] operator[SEP] operator[SEP]
}
}
}
Keyword[else] {
identifier[fail] operator[++] operator[SEP]
}
}
Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] {
identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[printf] operator[SEP] literal[String] , identifier[pdfFile] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[err] operator[SEP] identifier[printf] operator[SEP] literal[String] , identifier[pdfFile] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[err] operator[SEP] identifier[printf] operator[SEP] literal[String] , identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[e] operator[SEP] identifier[printStackTrace] operator[SEP] operator[SEP] operator[SEP] identifier[fail] operator[++] operator[SEP]
}
identifier[i] operator[++] operator[SEP] Keyword[if] operator[SEP] identifier[Config] operator[SEP] identifier[SMALL_TEST] operator[&&] identifier[i] operator[>=] Other[10] operator[SEP] {
Keyword[break] operator[SEP]
}
}
identifier[mysqlInFileWriter] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP] identifier[File] identifier[summaryFile] operator[=] Keyword[new] identifier[File] operator[SEP] identifier[outputDir] , literal[String] operator[SEP] operator[SEP] identifier[PrintWriter] identifier[summaryWriter] operator[=] Other[null] operator[SEP] Keyword[try] {
identifier[summaryWriter] operator[=] Keyword[new] identifier[PrintWriter] operator[SEP] Keyword[new] identifier[FileOutputStream] operator[SEP] identifier[summaryFile] operator[SEP] operator[SEP] operator[SEP] identifier[summaryWriter] operator[SEP] identifier[write] operator[SEP] literal[String] operator[+] identifier[pdfFiles] operator[SEP] identifier[length] operator[+] literal[String] operator[SEP] operator[SEP] identifier[summaryWriter] operator[SEP] identifier[write] operator[SEP] literal[String] operator[+] identifier[success] operator[+] literal[String] operator[SEP] operator[SEP] identifier[summaryWriter] operator[SEP] identifier[write] operator[SEP] literal[String] operator[+] identifier[fail] operator[+] literal[String] operator[SEP] operator[SEP] identifier[summaryWriter] operator[SEP] identifier[write] operator[SEP] literal[String] operator[+] identifier[tableCount] operator[+] literal[String] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[FileNotFoundException] identifier[e] operator[SEP] {
}
Keyword[finally] {
Keyword[if] operator[SEP] identifier[summaryWriter] operator[!=] Other[null] operator[SEP] {
identifier[summaryWriter] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP]
}
}
identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[printf] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[printf] operator[SEP] literal[String] , identifier[success] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[printf] operator[SEP] literal[String] , identifier[fail] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[printf] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
|
private void parseBody(Node parent, String tag, String bodyType)
throws JasperException
{
if( bodyType.equalsIgnoreCase( TagInfo.BODY_CONTENT_TAG_DEPENDENT ) ) {
parseTagDependentBody( parent, tag );
}
else if( bodyType.equalsIgnoreCase( TagInfo.BODY_CONTENT_EMPTY ) ) {
if( !reader.matchesETag( tag ) ) {
err.jspError(start, "jasper.error.emptybodycontent.nonempty",
tag);
}
}
else if( bodyType == JAVAX_BODY_CONTENT_PLUGIN ) {
// (note the == since we won't recognize JAVAX_*
// from outside this module).
parsePluginTags(parent);
if( !reader.matchesETag( tag ) ) {
err.jspError( reader.mark(), "jsp.error.unterminated",
"<" + tag );
}
}
else if( bodyType.equalsIgnoreCase( TagInfo.BODY_CONTENT_JSP ) ||
bodyType.equalsIgnoreCase( TagInfo.BODY_CONTENT_SCRIPTLESS ) ||
(bodyType == JAVAX_BODY_CONTENT_PARAM) ||
(bodyType == JAVAX_BODY_CONTENT_TEMPLATE_TEXT) )
{
while (reader.hasMoreInput()) {
if (reader.matchesETag(tag)) {
return;
}
// Check for nested jsp:body or jsp:attribute
if (tag.equals("jsp:body") || tag.equals("jsp:attribute")) {
if (reader.matches("<jsp:attribute")) {
err.jspError(reader.mark(), "jsp.error.nested.jspattribute");
}
else if (reader.matches("<jsp:body")) {
err.jspError(reader.mark(), "jsp.error.nested.jspbody");
}
}
if( bodyType.equalsIgnoreCase( TagInfo.BODY_CONTENT_JSP ) ) {
parseElements( parent );
}
else if( bodyType.equalsIgnoreCase(
TagInfo.BODY_CONTENT_SCRIPTLESS ) )
{
parseElementsScriptless( parent );
}
else if( bodyType == JAVAX_BODY_CONTENT_PARAM ) {
// (note the == since we won't recognize JAVAX_*
// from outside this module).
reader.skipSpaces();
parseParam( parent );
}
else if (bodyType == JAVAX_BODY_CONTENT_TEMPLATE_TEXT) {
parseElementsTemplateText(parent);
}
}
err.jspError(start, "jsp.error.unterminated", "<"+tag );
}
else {
err.jspError(start, "jsp.error.tld.badbodycontent", bodyType,
tag);
}
} | class class_name[name] begin[{]
method[parseBody, return_type[void], modifier[private], parameter[parent, tag, bodyType]] begin[{]
if[call[bodyType.equalsIgnoreCase, parameter[member[TagInfo.BODY_CONTENT_TAG_DEPENDENT]]]] begin[{]
call[.parseTagDependentBody, parameter[member[.parent], member[.tag]]]
else begin[{]
if[call[bodyType.equalsIgnoreCase, parameter[member[TagInfo.BODY_CONTENT_EMPTY]]]] begin[{]
if[call[reader.matchesETag, parameter[member[.tag]]]] begin[{]
call[err.jspError, parameter[member[.start], literal["jasper.error.emptybodycontent.nonempty"], member[.tag]]]
else begin[{]
None
end[}]
else begin[{]
if[binary_operation[member[.bodyType], ==, member[.JAVAX_BODY_CONTENT_PLUGIN]]] begin[{]
call[.parsePluginTags, parameter[member[.parent]]]
if[call[reader.matchesETag, parameter[member[.tag]]]] begin[{]
call[err.jspError, parameter[call[reader.mark, parameter[]], literal["jsp.error.unterminated"], binary_operation[literal["<"], +, member[.tag]]]]
else begin[{]
None
end[}]
else begin[{]
if[binary_operation[binary_operation[binary_operation[call[bodyType.equalsIgnoreCase, parameter[member[TagInfo.BODY_CONTENT_JSP]]], ||, call[bodyType.equalsIgnoreCase, parameter[member[TagInfo.BODY_CONTENT_SCRIPTLESS]]]], ||, binary_operation[member[.bodyType], ==, member[.JAVAX_BODY_CONTENT_PARAM]]], ||, binary_operation[member[.bodyType], ==, member[.JAVAX_BODY_CONTENT_TEMPLATE_TEXT]]]] begin[{]
while[call[reader.hasMoreInput, parameter[]]] begin[{]
if[call[reader.matchesETag, parameter[member[.tag]]]] begin[{]
return[None]
else begin[{]
None
end[}]
if[binary_operation[call[tag.equals, parameter[literal["jsp:body"]]], ||, call[tag.equals, parameter[literal["jsp:attribute"]]]]] begin[{]
if[call[reader.matches, parameter[literal["<jsp:attribute"]]]] begin[{]
call[err.jspError, parameter[call[reader.mark, parameter[]], literal["jsp.error.nested.jspattribute"]]]
else begin[{]
if[call[reader.matches, parameter[literal["<jsp:body"]]]] begin[{]
call[err.jspError, parameter[call[reader.mark, parameter[]], literal["jsp.error.nested.jspbody"]]]
else begin[{]
None
end[}]
end[}]
else begin[{]
None
end[}]
if[call[bodyType.equalsIgnoreCase, parameter[member[TagInfo.BODY_CONTENT_JSP]]]] begin[{]
call[.parseElements, parameter[member[.parent]]]
else begin[{]
if[call[bodyType.equalsIgnoreCase, parameter[member[TagInfo.BODY_CONTENT_SCRIPTLESS]]]] begin[{]
call[.parseElementsScriptless, parameter[member[.parent]]]
else begin[{]
if[binary_operation[member[.bodyType], ==, member[.JAVAX_BODY_CONTENT_PARAM]]] begin[{]
call[reader.skipSpaces, parameter[]]
call[.parseParam, parameter[member[.parent]]]
else begin[{]
if[binary_operation[member[.bodyType], ==, member[.JAVAX_BODY_CONTENT_TEMPLATE_TEXT]]] begin[{]
call[.parseElementsTemplateText, parameter[member[.parent]]]
else begin[{]
None
end[}]
end[}]
end[}]
end[}]
end[}]
call[err.jspError, parameter[member[.start], literal["jsp.error.unterminated"], binary_operation[literal["<"], +, member[.tag]]]]
else begin[{]
call[err.jspError, parameter[member[.start], literal["jsp.error.tld.badbodycontent"], member[.bodyType], member[.tag]]]
end[}]
end[}]
end[}]
end[}]
end[}]
END[}] | Keyword[private] Keyword[void] identifier[parseBody] operator[SEP] identifier[Node] identifier[parent] , identifier[String] identifier[tag] , identifier[String] identifier[bodyType] operator[SEP] Keyword[throws] identifier[JasperException] {
Keyword[if] operator[SEP] identifier[bodyType] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] identifier[TagInfo] operator[SEP] identifier[BODY_CONTENT_TAG_DEPENDENT] operator[SEP] operator[SEP] {
identifier[parseTagDependentBody] operator[SEP] identifier[parent] , identifier[tag] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[bodyType] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] identifier[TagInfo] operator[SEP] identifier[BODY_CONTENT_EMPTY] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] operator[!] identifier[reader] operator[SEP] identifier[matchesETag] operator[SEP] identifier[tag] operator[SEP] operator[SEP] {
identifier[err] operator[SEP] identifier[jspError] operator[SEP] identifier[start] , literal[String] , identifier[tag] operator[SEP] operator[SEP]
}
}
Keyword[else] Keyword[if] operator[SEP] identifier[bodyType] operator[==] identifier[JAVAX_BODY_CONTENT_PLUGIN] operator[SEP] {
identifier[parsePluginTags] operator[SEP] identifier[parent] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[reader] operator[SEP] identifier[matchesETag] operator[SEP] identifier[tag] operator[SEP] operator[SEP] {
identifier[err] operator[SEP] identifier[jspError] operator[SEP] identifier[reader] operator[SEP] identifier[mark] operator[SEP] operator[SEP] , literal[String] , literal[String] operator[+] identifier[tag] operator[SEP] operator[SEP]
}
}
Keyword[else] Keyword[if] operator[SEP] identifier[bodyType] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] identifier[TagInfo] operator[SEP] identifier[BODY_CONTENT_JSP] operator[SEP] operator[||] identifier[bodyType] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] identifier[TagInfo] operator[SEP] identifier[BODY_CONTENT_SCRIPTLESS] operator[SEP] operator[||] operator[SEP] identifier[bodyType] operator[==] identifier[JAVAX_BODY_CONTENT_PARAM] operator[SEP] operator[||] operator[SEP] identifier[bodyType] operator[==] identifier[JAVAX_BODY_CONTENT_TEMPLATE_TEXT] operator[SEP] operator[SEP] {
Keyword[while] operator[SEP] identifier[reader] operator[SEP] identifier[hasMoreInput] operator[SEP] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[reader] operator[SEP] identifier[matchesETag] operator[SEP] identifier[tag] operator[SEP] operator[SEP] {
Keyword[return] operator[SEP]
}
Keyword[if] operator[SEP] identifier[tag] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[||] identifier[tag] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[reader] operator[SEP] identifier[matches] operator[SEP] literal[String] operator[SEP] operator[SEP] {
identifier[err] operator[SEP] identifier[jspError] operator[SEP] identifier[reader] operator[SEP] identifier[mark] operator[SEP] operator[SEP] , literal[String] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[reader] operator[SEP] identifier[matches] operator[SEP] literal[String] operator[SEP] operator[SEP] {
identifier[err] operator[SEP] identifier[jspError] operator[SEP] identifier[reader] operator[SEP] identifier[mark] operator[SEP] operator[SEP] , literal[String] operator[SEP] operator[SEP]
}
}
Keyword[if] operator[SEP] identifier[bodyType] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] identifier[TagInfo] operator[SEP] identifier[BODY_CONTENT_JSP] operator[SEP] operator[SEP] {
identifier[parseElements] operator[SEP] identifier[parent] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[bodyType] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] identifier[TagInfo] operator[SEP] identifier[BODY_CONTENT_SCRIPTLESS] operator[SEP] operator[SEP] {
identifier[parseElementsScriptless] operator[SEP] identifier[parent] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[bodyType] operator[==] identifier[JAVAX_BODY_CONTENT_PARAM] operator[SEP] {
identifier[reader] operator[SEP] identifier[skipSpaces] operator[SEP] operator[SEP] operator[SEP] identifier[parseParam] operator[SEP] identifier[parent] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[bodyType] operator[==] identifier[JAVAX_BODY_CONTENT_TEMPLATE_TEXT] operator[SEP] {
identifier[parseElementsTemplateText] operator[SEP] identifier[parent] operator[SEP] operator[SEP]
}
}
identifier[err] operator[SEP] identifier[jspError] operator[SEP] identifier[start] , literal[String] , literal[String] operator[+] identifier[tag] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[err] operator[SEP] identifier[jspError] operator[SEP] identifier[start] , literal[String] , identifier[bodyType] , identifier[tag] operator[SEP] operator[SEP]
}
}
|
public static VertexData generateCone(float radius, float height) {
final VertexData destination = new VertexData();
final VertexAttribute positionsAttribute = new VertexAttribute("positions", DataType.FLOAT, 3);
destination.addAttribute(0, positionsAttribute);
final TFloatList positions = new TFloatArrayList();
final VertexAttribute normalsAttribute = new VertexAttribute("normals", DataType.FLOAT, 3);
destination.addAttribute(1, normalsAttribute);
final TFloatList normals = new TFloatArrayList();
final TIntList indices = destination.getIndices();
// Generate the mesh
generateCone(positions, normals, indices, radius, height);
// Put the mesh in the vertex data
positionsAttribute.setData(positions);
normalsAttribute.setData(normals);
return destination;
} | class class_name[name] begin[{]
method[generateCone, return_type[type[VertexData]], modifier[public static], parameter[radius, height]] begin[{]
local_variable[type[VertexData], destination]
local_variable[type[VertexAttribute], positionsAttribute]
call[destination.addAttribute, parameter[literal[0], member[.positionsAttribute]]]
local_variable[type[TFloatList], positions]
local_variable[type[VertexAttribute], normalsAttribute]
call[destination.addAttribute, parameter[literal[1], member[.normalsAttribute]]]
local_variable[type[TFloatList], normals]
local_variable[type[TIntList], indices]
call[.generateCone, parameter[member[.positions], member[.normals], member[.indices], member[.radius], member[.height]]]
call[positionsAttribute.setData, parameter[member[.positions]]]
call[normalsAttribute.setData, parameter[member[.normals]]]
return[member[.destination]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[VertexData] identifier[generateCone] operator[SEP] Keyword[float] identifier[radius] , Keyword[float] identifier[height] operator[SEP] {
Keyword[final] identifier[VertexData] identifier[destination] operator[=] Keyword[new] identifier[VertexData] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[VertexAttribute] identifier[positionsAttribute] operator[=] Keyword[new] identifier[VertexAttribute] operator[SEP] literal[String] , identifier[DataType] operator[SEP] identifier[FLOAT] , Other[3] operator[SEP] operator[SEP] identifier[destination] operator[SEP] identifier[addAttribute] operator[SEP] Other[0] , identifier[positionsAttribute] operator[SEP] operator[SEP] Keyword[final] identifier[TFloatList] identifier[positions] operator[=] Keyword[new] identifier[TFloatArrayList] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[VertexAttribute] identifier[normalsAttribute] operator[=] Keyword[new] identifier[VertexAttribute] operator[SEP] literal[String] , identifier[DataType] operator[SEP] identifier[FLOAT] , Other[3] operator[SEP] operator[SEP] identifier[destination] operator[SEP] identifier[addAttribute] operator[SEP] Other[1] , identifier[normalsAttribute] operator[SEP] operator[SEP] Keyword[final] identifier[TFloatList] identifier[normals] operator[=] Keyword[new] identifier[TFloatArrayList] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[TIntList] identifier[indices] operator[=] identifier[destination] operator[SEP] identifier[getIndices] operator[SEP] operator[SEP] operator[SEP] identifier[generateCone] operator[SEP] identifier[positions] , identifier[normals] , identifier[indices] , identifier[radius] , identifier[height] operator[SEP] operator[SEP] identifier[positionsAttribute] operator[SEP] identifier[setData] operator[SEP] identifier[positions] operator[SEP] operator[SEP] identifier[normalsAttribute] operator[SEP] identifier[setData] operator[SEP] identifier[normals] operator[SEP] operator[SEP] Keyword[return] identifier[destination] operator[SEP]
}
|
private static CtClass[] generateClassField(Class<?>... classes) throws NotFoundException {
CtClass[] result = new CtClass[classes.length];
for (int i = 0; i < classes.length; i++) {
result[i] = cp.get(classes[i].getName());
}
return result;
} | class class_name[name] begin[{]
method[generateClassField, return_type[type[CtClass]], modifier[private static], parameter[classes]] begin[{]
local_variable[type[CtClass], result]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MethodInvocation(arguments=[MemberReference(member=classes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MethodInvocation(arguments=[], member=getName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)])], member=get, postfix_operators=[], prefix_operators=[], qualifier=cp, 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=classes, 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[.result]]
end[}]
END[}] | Keyword[private] Keyword[static] identifier[CtClass] operator[SEP] operator[SEP] identifier[generateClassField] operator[SEP] identifier[Class] operator[<] operator[?] operator[>] operator[...] identifier[classes] operator[SEP] Keyword[throws] identifier[NotFoundException] {
identifier[CtClass] operator[SEP] operator[SEP] identifier[result] operator[=] Keyword[new] identifier[CtClass] operator[SEP] identifier[classes] 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[classes] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] {
identifier[result] operator[SEP] identifier[i] operator[SEP] operator[=] identifier[cp] operator[SEP] identifier[get] operator[SEP] identifier[classes] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] identifier[result] operator[SEP]
}
|
public static void addEntry(File zip, ZipEntrySource entry, File destZip) {
addEntries(zip, new ZipEntrySource[] { entry }, destZip);
} | class class_name[name] begin[{]
method[addEntry, return_type[void], modifier[public static], parameter[zip, entry, destZip]] begin[{]
call[.addEntries, parameter[member[.zip], ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MemberReference(member=entry, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ZipEntrySource, sub_type=None)), member[.destZip]]]
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[void] identifier[addEntry] operator[SEP] identifier[File] identifier[zip] , identifier[ZipEntrySource] identifier[entry] , identifier[File] identifier[destZip] operator[SEP] {
identifier[addEntries] operator[SEP] identifier[zip] , Keyword[new] identifier[ZipEntrySource] operator[SEP] operator[SEP] {
identifier[entry]
} , identifier[destZip] operator[SEP] operator[SEP]
}
|
protected SerializationPolicy doGetSerializationPolicy(HttpServletRequest request, String moduleBaseURL,
String strongName) {
if (getSerializationPolicyLocator() == null) {
return super.doGetSerializationPolicy(request, moduleBaseURL, strongName);
} else {
return getSerializationPolicyLocator().loadPolicy(request, moduleBaseURL, strongName);
}
} | class class_name[name] begin[{]
method[doGetSerializationPolicy, return_type[type[SerializationPolicy]], modifier[protected], parameter[request, moduleBaseURL, strongName]] begin[{]
if[binary_operation[call[.getSerializationPolicyLocator, parameter[]], ==, literal[null]]] begin[{]
return[SuperMethodInvocation(arguments=[MemberReference(member=request, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=moduleBaseURL, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=strongName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=doGetSerializationPolicy, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None)]
else begin[{]
return[call[.getSerializationPolicyLocator, parameter[]]]
end[}]
end[}]
END[}] | Keyword[protected] identifier[SerializationPolicy] identifier[doGetSerializationPolicy] operator[SEP] identifier[HttpServletRequest] identifier[request] , identifier[String] identifier[moduleBaseURL] , identifier[String] identifier[strongName] operator[SEP] {
Keyword[if] operator[SEP] identifier[getSerializationPolicyLocator] operator[SEP] operator[SEP] operator[==] Other[null] operator[SEP] {
Keyword[return] Keyword[super] operator[SEP] identifier[doGetSerializationPolicy] operator[SEP] identifier[request] , identifier[moduleBaseURL] , identifier[strongName] operator[SEP] operator[SEP]
}
Keyword[else] {
Keyword[return] identifier[getSerializationPolicyLocator] operator[SEP] operator[SEP] operator[SEP] identifier[loadPolicy] operator[SEP] identifier[request] , identifier[moduleBaseURL] , identifier[strongName] operator[SEP] operator[SEP]
}
}
|
public static <T> boolean all(Iterator<T> iterator, Predicate<? super T> predicate) {
checkNotNull(predicate);
while (iterator.hasNext()) {
T element = iterator.next();
if (!predicate.apply(element)) {
return false;
}
}
return true;
} | class class_name[name] begin[{]
method[all, return_type[type[boolean]], modifier[public static], parameter[iterator, predicate]] begin[{]
call[.checkNotNull, parameter[member[.predicate]]]
while[call[iterator.hasNext, parameter[]]] begin[{]
local_variable[type[T], element]
if[call[predicate.apply, parameter[member[.element]]]] begin[{]
return[literal[false]]
else begin[{]
None
end[}]
end[}]
return[literal[true]]
end[}]
END[}] | Keyword[public] Keyword[static] operator[<] identifier[T] operator[>] Keyword[boolean] identifier[all] operator[SEP] identifier[Iterator] operator[<] identifier[T] operator[>] identifier[iterator] , identifier[Predicate] operator[<] operator[?] Keyword[super] identifier[T] operator[>] identifier[predicate] operator[SEP] {
identifier[checkNotNull] operator[SEP] identifier[predicate] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[iterator] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] {
identifier[T] identifier[element] operator[=] identifier[iterator] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[predicate] operator[SEP] identifier[apply] operator[SEP] identifier[element] operator[SEP] operator[SEP] {
Keyword[return] literal[boolean] operator[SEP]
}
}
Keyword[return] literal[boolean] operator[SEP]
}
|
private void writeObject(final ObjectOutputStream s) throws IOException {
s.defaultWriteObject();
s.writeInt(level);
s.writeInt(syslogEquivalent);
s.writeUTF(levelStr);
} | class class_name[name] begin[{]
method[writeObject, return_type[void], modifier[private], parameter[s]] begin[{]
call[s.defaultWriteObject, parameter[]]
call[s.writeInt, parameter[member[.level]]]
call[s.writeInt, parameter[member[.syslogEquivalent]]]
call[s.writeUTF, parameter[member[.levelStr]]]
end[}]
END[}] | Keyword[private] Keyword[void] identifier[writeObject] operator[SEP] Keyword[final] identifier[ObjectOutputStream] identifier[s] operator[SEP] Keyword[throws] identifier[IOException] {
identifier[s] operator[SEP] identifier[defaultWriteObject] operator[SEP] operator[SEP] operator[SEP] identifier[s] operator[SEP] identifier[writeInt] operator[SEP] identifier[level] operator[SEP] operator[SEP] identifier[s] operator[SEP] identifier[writeInt] operator[SEP] identifier[syslogEquivalent] operator[SEP] operator[SEP] identifier[s] operator[SEP] identifier[writeUTF] operator[SEP] identifier[levelStr] operator[SEP] operator[SEP]
}
|
private void run(String key, ConcurrentLinkedQueue<Work> workQueue) {
Work work = workQueue.poll();
CompletableFuture<Void> future;
try {
future = processEvent(work.getEvent());
} catch (Exception e) {
future = Futures.failedFuture(e);
}
future.whenComplete((r, e) -> {
if (e != null && toPostpone(work.getEvent(), work.getPickupTime(), e)) {
handleWorkPostpone(key, workQueue, work);
} else {
if (e != null) {
work.getResult().completeExceptionally(e);
} else {
work.getResult().complete(r);
}
handleWorkComplete(key, workQueue, work);
}
});
} | class class_name[name] begin[{]
method[run, return_type[void], modifier[private], parameter[key, workQueue]] begin[{]
local_variable[type[Work], work]
local_variable[type[CompletableFuture], future]
TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=future, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getEvent, postfix_operators=[], prefix_operators=[], qualifier=work, selectors=[], type_arguments=None)], member=processEvent, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None)], catches=[CatchClause(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=future, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=failedFuture, postfix_operators=[], prefix_operators=[], qualifier=Futures, selectors=[], type_arguments=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None)
call[future.whenComplete, parameter[LambdaExpression(body=[IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operandr=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getEvent, postfix_operators=[], prefix_operators=[], qualifier=work, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getPickupTime, postfix_operators=[], prefix_operators=[], qualifier=work, selectors=[], type_arguments=None), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=toPostpone, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), operator=&&), else_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=getResult, postfix_operators=[], prefix_operators=[], qualifier=work, selectors=[MethodInvocation(arguments=[MemberReference(member=r, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=complete, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=getResult, postfix_operators=[], prefix_operators=[], qualifier=work, selectors=[MethodInvocation(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=completeExceptionally, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=workQueue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=work, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=handleWorkComplete, 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=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=workQueue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=work, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=handleWorkPostpone, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]))], parameters=[InferredFormalParameter(name=r), InferredFormalParameter(name=e)])]]
end[}]
END[}] | Keyword[private] Keyword[void] identifier[run] operator[SEP] identifier[String] identifier[key] , identifier[ConcurrentLinkedQueue] operator[<] identifier[Work] operator[>] identifier[workQueue] operator[SEP] {
identifier[Work] identifier[work] operator[=] identifier[workQueue] operator[SEP] identifier[poll] operator[SEP] operator[SEP] operator[SEP] identifier[CompletableFuture] operator[<] identifier[Void] operator[>] identifier[future] operator[SEP] Keyword[try] {
identifier[future] operator[=] identifier[processEvent] operator[SEP] identifier[work] operator[SEP] identifier[getEvent] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] {
identifier[future] operator[=] identifier[Futures] operator[SEP] identifier[failedFuture] operator[SEP] identifier[e] operator[SEP] operator[SEP]
}
identifier[future] operator[SEP] identifier[whenComplete] operator[SEP] operator[SEP] identifier[r] , identifier[e] operator[SEP] operator[->] {
Keyword[if] operator[SEP] identifier[e] operator[!=] Other[null] operator[&&] identifier[toPostpone] operator[SEP] identifier[work] operator[SEP] identifier[getEvent] operator[SEP] operator[SEP] , identifier[work] operator[SEP] identifier[getPickupTime] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP] {
identifier[handleWorkPostpone] operator[SEP] identifier[key] , identifier[workQueue] , identifier[work] operator[SEP] operator[SEP]
}
Keyword[else] {
Keyword[if] operator[SEP] identifier[e] operator[!=] Other[null] operator[SEP] {
identifier[work] operator[SEP] identifier[getResult] operator[SEP] operator[SEP] operator[SEP] identifier[completeExceptionally] operator[SEP] identifier[e] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[work] operator[SEP] identifier[getResult] operator[SEP] operator[SEP] operator[SEP] identifier[complete] operator[SEP] identifier[r] operator[SEP] operator[SEP]
}
identifier[handleWorkComplete] operator[SEP] identifier[key] , identifier[workQueue] , identifier[work] operator[SEP] operator[SEP]
}
} operator[SEP] operator[SEP]
}
|
public ImageSource BFS(int startI, int startJ, /*String imageName*/ImageSource originalImage) {
LinkedList<Vector2i> queue = new LinkedList<>();
//=============================================================================
int gapX = 30;
int gapY = 30;
MatrixSource letter = new MatrixSource(letterWidth, letterHeight);
//BufferedImage letter = new BufferedImage(letterWidth, letterHeight, BufferedImage.TYPE_BYTE_BINARY);
int alpha = originalImage.getA(startI, startJ);
int white = ColorHelper.getARGB(255, 255, 255, alpha);
int black = ColorHelper.getARGB(0, 0, 0, alpha);
for (int j = 0; j < letterHeight; j++) {
for (int i = 0; i < letterWidth; i++) {
letter.setRGB(i, j, white);
}
}
//=============================================================================
int count = 0;
Vector2i positions = new Vector2i(startI, startJ);
visited[startI][startJ] = true;
queue.addLast(positions);
while (!queue.isEmpty()) {
Vector2i pos = queue.removeFirst();
int x = pos.getX();
int y = pos.getY();
visited[x][y] = true;
//set black pixel to letter image===================================
int posX = startI - x + gapX;
int posY = startJ - y + gapY;
count++;
if(posX>=originalImage.getWidth() || posY>=originalImage.getHeight()) {
continue;
} else {
letter.setRGB(posX, posY, black);
/*try {
letter.setRGB(posX, posY, black);
} catch (Exception e) {
e.printStackTrace();
System.out.println("posX " + posX);
System.out.println("posY " + posY);
System.out.println("letterWidth " + letter.getWidth());
System.out.println("letterHeight " + letter.getHeight());
throw e;
}*/
}
//==================================================================
for (int i = x - 1; i <= x + 1; i++) {
for (int j = y - 1; j <= y + 1; j++) {
if (i >= 0 && j >= 0 && i < originalImage.getWidth() && j < originalImage.getHeight()) {
if (!visited[i][j]) {
int color = originalImage.getGray(i, j);
if (color < 10) {
visited[i][j] = true;
Vector2i tmpPos = new Vector2i(i, j);
queue.addLast(tmpPos);
}
}
}
} //i
} //j
}
System.out.println("count = " + count);
//save letter===========================================================
if (count < 3) {
return letter;
}
/*try {
saveToFile(letter, imageName);
//
} catch (IOException ex) {
ex.printStackTrace();
}*/
return letter;
} | class class_name[name] begin[{]
method[BFS, return_type[type[ImageSource]], modifier[public], parameter[startI, startJ, originalImage]] begin[{]
local_variable[type[LinkedList], queue]
local_variable[type[int], gapX]
local_variable[type[int], gapY]
local_variable[type[MatrixSource], letter]
local_variable[type[int], alpha]
local_variable[type[int], white]
local_variable[type[int], black]
ForStatement(body=BlockStatement(label=None, statements=[ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=white, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setRGB, postfix_operators=[], prefix_operators=[], qualifier=letter, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=letterWidth, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=letterHeight, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=j)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=j, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
local_variable[type[int], count]
local_variable[type[Vector2i], positions]
assign[member[.visited], literal[true]]
call[queue.addLast, parameter[member[.positions]]]
while[call[queue.isEmpty, parameter[]]] begin[{]
local_variable[type[Vector2i], pos]
local_variable[type[int], x]
local_variable[type[int], y]
assign[member[.visited], literal[true]]
local_variable[type[int], posX]
local_variable[type[int], posY]
member[.count]
if[binary_operation[binary_operation[member[.posX], >=, call[originalImage.getWidth, parameter[]]], ||, binary_operation[member[.posY], >=, call[originalImage.getHeight, parameter[]]]]] begin[{]
ContinueStatement(goto=None, label=None)
else begin[{]
call[letter.setRGB, parameter[member[.posX], member[.posY], member[.black]]]
end[}]
ForStatement(body=BlockStatement(label=None, statements=[ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=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=0), operator=>=), operandr=BinaryOperation(operandl=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>=), operator=&&), operandr=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=getWidth, postfix_operators=[], prefix_operators=[], qualifier=originalImage, selectors=[], type_arguments=None), operator=<), operator=&&), operandr=BinaryOperation(operandl=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=getHeight, postfix_operators=[], prefix_operators=[], qualifier=originalImage, selectors=[], type_arguments=None), operator=<), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=MemberReference(member=visited, postfix_operators=[], prefix_operators=['!'], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), ArraySelector(index=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getGray, postfix_operators=[], prefix_operators=[], qualifier=originalImage, selectors=[], type_arguments=None), name=color)], modifiers=set(), type=BasicType(dimensions=[], name=int)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=color, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=10), operator=<), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=visited, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), ArraySelector(index=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=j, 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=Vector2i, sub_type=None)), name=tmpPos)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Vector2i, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=tmpPos, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addLast, postfix_operators=[], prefix_operators=[], qualifier=queue, selectors=[], type_arguments=None), label=None)]))]))]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=BinaryOperation(operandl=MemberReference(member=y, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+), operator=<=), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=BinaryOperation(operandl=MemberReference(member=y, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-), name=j)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=j, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=BinaryOperation(operandl=MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+), operator=<=), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=BinaryOperation(operandl=MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
end[}]
call[System.out.println, parameter[binary_operation[literal["count = "], +, member[.count]]]]
if[binary_operation[member[.count], <, literal[3]]] begin[{]
return[member[.letter]]
else begin[{]
None
end[}]
return[member[.letter]]
end[}]
END[}] | Keyword[public] identifier[ImageSource] identifier[BFS] operator[SEP] Keyword[int] identifier[startI] , Keyword[int] identifier[startJ] , identifier[ImageSource] identifier[originalImage] operator[SEP] {
identifier[LinkedList] operator[<] identifier[Vector2i] operator[>] identifier[queue] operator[=] Keyword[new] identifier[LinkedList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[gapX] operator[=] Other[30] operator[SEP] Keyword[int] identifier[gapY] operator[=] Other[30] operator[SEP] identifier[MatrixSource] identifier[letter] operator[=] Keyword[new] identifier[MatrixSource] operator[SEP] identifier[letterWidth] , identifier[letterHeight] operator[SEP] operator[SEP] Keyword[int] identifier[alpha] operator[=] identifier[originalImage] operator[SEP] identifier[getA] operator[SEP] identifier[startI] , identifier[startJ] operator[SEP] operator[SEP] Keyword[int] identifier[white] operator[=] identifier[ColorHelper] operator[SEP] identifier[getARGB] operator[SEP] Other[255] , Other[255] , Other[255] , identifier[alpha] operator[SEP] operator[SEP] Keyword[int] identifier[black] operator[=] identifier[ColorHelper] operator[SEP] identifier[getARGB] operator[SEP] Other[0] , Other[0] , Other[0] , identifier[alpha] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[j] operator[=] Other[0] operator[SEP] identifier[j] operator[<] identifier[letterHeight] operator[SEP] identifier[j] operator[++] operator[SEP] {
Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[letterWidth] operator[SEP] identifier[i] operator[++] operator[SEP] {
identifier[letter] operator[SEP] identifier[setRGB] operator[SEP] identifier[i] , identifier[j] , identifier[white] operator[SEP] operator[SEP]
}
}
Keyword[int] identifier[count] operator[=] Other[0] operator[SEP] identifier[Vector2i] identifier[positions] operator[=] Keyword[new] identifier[Vector2i] operator[SEP] identifier[startI] , identifier[startJ] operator[SEP] operator[SEP] identifier[visited] operator[SEP] identifier[startI] operator[SEP] operator[SEP] identifier[startJ] operator[SEP] operator[=] literal[boolean] operator[SEP] identifier[queue] operator[SEP] identifier[addLast] operator[SEP] identifier[positions] operator[SEP] operator[SEP] Keyword[while] operator[SEP] operator[!] identifier[queue] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] {
identifier[Vector2i] identifier[pos] operator[=] identifier[queue] operator[SEP] identifier[removeFirst] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[x] operator[=] identifier[pos] operator[SEP] identifier[getX] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[y] operator[=] identifier[pos] operator[SEP] identifier[getY] operator[SEP] operator[SEP] operator[SEP] identifier[visited] operator[SEP] identifier[x] operator[SEP] operator[SEP] identifier[y] operator[SEP] operator[=] literal[boolean] operator[SEP] Keyword[int] identifier[posX] operator[=] identifier[startI] operator[-] identifier[x] operator[+] identifier[gapX] operator[SEP] Keyword[int] identifier[posY] operator[=] identifier[startJ] operator[-] identifier[y] operator[+] identifier[gapY] operator[SEP] identifier[count] operator[++] operator[SEP] Keyword[if] operator[SEP] identifier[posX] operator[>=] identifier[originalImage] operator[SEP] identifier[getWidth] operator[SEP] operator[SEP] operator[||] identifier[posY] operator[>=] identifier[originalImage] operator[SEP] identifier[getHeight] operator[SEP] operator[SEP] operator[SEP] {
Keyword[continue] operator[SEP]
}
Keyword[else] {
identifier[letter] operator[SEP] identifier[setRGB] operator[SEP] identifier[posX] , identifier[posY] , identifier[black] operator[SEP] operator[SEP]
}
Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] identifier[x] operator[-] Other[1] operator[SEP] identifier[i] operator[<=] identifier[x] operator[+] Other[1] operator[SEP] identifier[i] operator[++] operator[SEP] {
Keyword[for] operator[SEP] Keyword[int] identifier[j] operator[=] identifier[y] operator[-] Other[1] operator[SEP] identifier[j] operator[<=] identifier[y] operator[+] Other[1] operator[SEP] identifier[j] operator[++] operator[SEP] {
Keyword[if] operator[SEP] identifier[i] operator[>=] Other[0] operator[&&] identifier[j] operator[>=] Other[0] operator[&&] identifier[i] operator[<] identifier[originalImage] operator[SEP] identifier[getWidth] operator[SEP] operator[SEP] operator[&&] identifier[j] operator[<] identifier[originalImage] operator[SEP] identifier[getHeight] operator[SEP] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] operator[!] identifier[visited] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[j] operator[SEP] operator[SEP] {
Keyword[int] identifier[color] operator[=] identifier[originalImage] operator[SEP] identifier[getGray] operator[SEP] identifier[i] , identifier[j] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[color] operator[<] Other[10] operator[SEP] {
identifier[visited] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[j] operator[SEP] operator[=] literal[boolean] operator[SEP] identifier[Vector2i] identifier[tmpPos] operator[=] Keyword[new] identifier[Vector2i] operator[SEP] identifier[i] , identifier[j] operator[SEP] operator[SEP] identifier[queue] operator[SEP] identifier[addLast] operator[SEP] identifier[tmpPos] operator[SEP] operator[SEP]
}
}
}
}
}
}
identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[println] operator[SEP] literal[String] operator[+] identifier[count] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[count] operator[<] Other[3] operator[SEP] {
Keyword[return] identifier[letter] operator[SEP]
}
Keyword[return] identifier[letter] operator[SEP]
}
|
private ImmutableSetMultimap<Class<? extends Annotation>, Element> validElements(
ImmutableMap<String, Optional<? extends Element>> deferredElements,
RoundEnvironment roundEnv) {
ImmutableSetMultimap.Builder<Class<? extends Annotation>, Element>
deferredElementsByAnnotationBuilder = ImmutableSetMultimap.builder();
for (Entry<String, Optional<? extends Element>> deferredTypeElementEntry :
deferredElements.entrySet()) {
Optional<? extends Element> deferredElement = deferredTypeElementEntry.getValue();
if (deferredElement.isPresent()) {
findAnnotatedElements(
deferredElement.get(),
getSupportedAnnotationClasses(),
deferredElementsByAnnotationBuilder);
} else {
deferredElementNames.add(ElementName.forTypeName(deferredTypeElementEntry.getKey()));
}
}
ImmutableSetMultimap<Class<? extends Annotation>, Element> deferredElementsByAnnotation =
deferredElementsByAnnotationBuilder.build();
ImmutableSetMultimap.Builder<Class<? extends Annotation>, Element> validElements =
ImmutableSetMultimap.builder();
Set<ElementName> validElementNames = new LinkedHashSet<ElementName>();
// Look at the elements we've found and the new elements from this round and validate them.
for (Class<? extends Annotation> annotationClass : getSupportedAnnotationClasses()) {
// This should just call roundEnv.getElementsAnnotatedWith(Class) directly, but there is a bug
// in some versions of eclipse that cause that method to crash.
TypeElement annotationType = elements.getTypeElement(annotationClass.getCanonicalName());
Set<? extends Element> elementsAnnotatedWith =
(annotationType == null)
? ImmutableSet.<Element>of()
: roundEnv.getElementsAnnotatedWith(annotationType);
for (Element annotatedElement :
Sets.union(elementsAnnotatedWith, deferredElementsByAnnotation.get(annotationClass))) {
if (annotatedElement.getKind().equals(PACKAGE)) {
PackageElement annotatedPackageElement = (PackageElement) annotatedElement;
ElementName annotatedPackageName =
ElementName.forPackageName(annotatedPackageElement.getQualifiedName().toString());
boolean validPackage =
validElementNames.contains(annotatedPackageName)
|| (!deferredElementNames.contains(annotatedPackageName)
&& validateElement(annotatedPackageElement));
if (validPackage) {
validElements.put(annotationClass, annotatedPackageElement);
validElementNames.add(annotatedPackageName);
} else {
deferredElementNames.add(annotatedPackageName);
}
} else {
TypeElement enclosingType = getEnclosingType(annotatedElement);
ElementName enclosingTypeName =
ElementName.forTypeName(enclosingType.getQualifiedName().toString());
boolean validEnclosingType =
validElementNames.contains(enclosingTypeName)
|| (!deferredElementNames.contains(enclosingTypeName)
&& validateElement(enclosingType));
if (validEnclosingType) {
validElements.put(annotationClass, annotatedElement);
validElementNames.add(enclosingTypeName);
} else {
deferredElementNames.add(enclosingTypeName);
}
}
}
}
return validElements.build();
} | class class_name[name] begin[{]
method[validElements, return_type[type[ImmutableSetMultimap]], modifier[private], parameter[deferredElements, roundEnv]] begin[{]
local_variable[type[ImmutableSetMultimap], deferredElementsByAnnotationBuilder]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=deferredTypeElementEntry, selectors=[], type_arguments=None), name=deferredElement)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=extends, type=ReferenceType(arguments=None, dimensions=[], name=Element, sub_type=None))], dimensions=[], name=Optional, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[], member=isPresent, postfix_operators=[], prefix_operators=[], qualifier=deferredElement, selectors=[], type_arguments=None), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getKey, postfix_operators=[], prefix_operators=[], qualifier=deferredTypeElementEntry, selectors=[], type_arguments=None)], member=forTypeName, postfix_operators=[], prefix_operators=[], qualifier=ElementName, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=deferredElementNames, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=get, postfix_operators=[], prefix_operators=[], qualifier=deferredElement, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getSupportedAnnotationClasses, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), MemberReference(member=deferredElementsByAnnotationBuilder, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=findAnnotatedElements, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=entrySet, postfix_operators=[], prefix_operators=[], qualifier=deferredElements, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=deferredTypeElementEntry)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=[TypeArgument(pattern_type=extends, type=ReferenceType(arguments=None, dimensions=[], name=Element, sub_type=None))], dimensions=[], name=Optional, sub_type=None))], dimensions=[], name=Entry, sub_type=None))), label=None)
local_variable[type[ImmutableSetMultimap], deferredElementsByAnnotation]
local_variable[type[ImmutableSetMultimap], validElements]
local_variable[type[Set], validElementNames]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getCanonicalName, postfix_operators=[], prefix_operators=[], qualifier=annotationClass, selectors=[], type_arguments=None)], member=getTypeElement, postfix_operators=[], prefix_operators=[], qualifier=elements, selectors=[], type_arguments=None), name=annotationType)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=TypeElement, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=annotationType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), if_false=MethodInvocation(arguments=[MemberReference(member=annotationType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getElementsAnnotatedWith, postfix_operators=[], prefix_operators=[], qualifier=roundEnv, selectors=[], type_arguments=None), if_true=MethodInvocation(arguments=[], member=ImmutableSet, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Element, sub_type=None))])), name=elementsAnnotatedWith)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=extends, type=ReferenceType(arguments=None, dimensions=[], name=Element, sub_type=None))], dimensions=[], name=Set, sub_type=None)), ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[], member=getKind, postfix_operators=[], prefix_operators=[], qualifier=annotatedElement, selectors=[MethodInvocation(arguments=[MemberReference(member=PACKAGE, 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=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=annotatedElement, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getEnclosingType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=enclosingType)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=TypeElement, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getQualifiedName, postfix_operators=[], prefix_operators=[], qualifier=enclosingType, selectors=[MethodInvocation(arguments=[], member=toString, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=forTypeName, postfix_operators=[], prefix_operators=[], qualifier=ElementName, selectors=[], type_arguments=None), name=enclosingTypeName)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ElementName, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=enclosingTypeName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=contains, postfix_operators=[], prefix_operators=[], qualifier=validElementNames, selectors=[], type_arguments=None), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=enclosingTypeName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=contains, postfix_operators=[], prefix_operators=['!'], qualifier=deferredElementNames, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[MemberReference(member=enclosingType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=validateElement, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), operator=&&), operator=||), name=validEnclosingType)], modifiers=set(), type=BasicType(dimensions=[], name=boolean)), IfStatement(condition=MemberReference(member=validEnclosingType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=enclosingTypeName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=deferredElementNames, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=annotationClass, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=annotatedElement, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=put, postfix_operators=[], prefix_operators=[], qualifier=validElements, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=enclosingTypeName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=validElementNames, selectors=[], type_arguments=None), label=None)]))]), label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MemberReference(member=annotatedElement, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=PackageElement, sub_type=None)), name=annotatedPackageElement)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=PackageElement, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getQualifiedName, postfix_operators=[], prefix_operators=[], qualifier=annotatedPackageElement, selectors=[MethodInvocation(arguments=[], member=toString, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=forPackageName, postfix_operators=[], prefix_operators=[], qualifier=ElementName, selectors=[], type_arguments=None), name=annotatedPackageName)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ElementName, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=annotatedPackageName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=contains, postfix_operators=[], prefix_operators=[], qualifier=validElementNames, selectors=[], type_arguments=None), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=annotatedPackageName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=contains, postfix_operators=[], prefix_operators=['!'], qualifier=deferredElementNames, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[MemberReference(member=annotatedPackageElement, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=validateElement, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), operator=&&), operator=||), name=validPackage)], modifiers=set(), type=BasicType(dimensions=[], name=boolean)), IfStatement(condition=MemberReference(member=validPackage, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=annotatedPackageName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=deferredElementNames, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=annotationClass, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=annotatedPackageElement, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=put, postfix_operators=[], prefix_operators=[], qualifier=validElements, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=annotatedPackageName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=validElementNames, selectors=[], type_arguments=None), label=None)]))]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[MemberReference(member=elementsAnnotatedWith, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[MemberReference(member=annotationClass, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=deferredElementsByAnnotation, selectors=[], type_arguments=None)], member=union, postfix_operators=[], prefix_operators=[], qualifier=Sets, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=annotatedElement)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Element, sub_type=None))), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getSupportedAnnotationClasses, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=annotationClass)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=extends, type=ReferenceType(arguments=None, dimensions=[], name=Annotation, sub_type=None))], dimensions=[], name=Class, sub_type=None))), label=None)
return[call[validElements.build, parameter[]]]
end[}]
END[}] | Keyword[private] identifier[ImmutableSetMultimap] operator[<] identifier[Class] operator[<] operator[?] Keyword[extends] identifier[Annotation] operator[>] , identifier[Element] operator[>] identifier[validElements] operator[SEP] identifier[ImmutableMap] operator[<] identifier[String] , identifier[Optional] operator[<] operator[?] Keyword[extends] identifier[Element] operator[>] operator[>] identifier[deferredElements] , identifier[RoundEnvironment] identifier[roundEnv] operator[SEP] {
identifier[ImmutableSetMultimap] operator[SEP] identifier[Builder] operator[<] identifier[Class] operator[<] operator[?] Keyword[extends] identifier[Annotation] operator[>] , identifier[Element] operator[>] identifier[deferredElementsByAnnotationBuilder] operator[=] identifier[ImmutableSetMultimap] operator[SEP] identifier[builder] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Entry] operator[<] identifier[String] , identifier[Optional] operator[<] operator[?] Keyword[extends] identifier[Element] operator[>] operator[>] identifier[deferredTypeElementEntry] operator[:] identifier[deferredElements] operator[SEP] identifier[entrySet] operator[SEP] operator[SEP] operator[SEP] {
identifier[Optional] operator[<] operator[?] Keyword[extends] identifier[Element] operator[>] identifier[deferredElement] operator[=] identifier[deferredTypeElementEntry] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[deferredElement] operator[SEP] identifier[isPresent] operator[SEP] operator[SEP] operator[SEP] {
identifier[findAnnotatedElements] operator[SEP] identifier[deferredElement] operator[SEP] identifier[get] operator[SEP] operator[SEP] , identifier[getSupportedAnnotationClasses] operator[SEP] operator[SEP] , identifier[deferredElementsByAnnotationBuilder] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[deferredElementNames] operator[SEP] identifier[add] operator[SEP] identifier[ElementName] operator[SEP] identifier[forTypeName] operator[SEP] identifier[deferredTypeElementEntry] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
}
identifier[ImmutableSetMultimap] operator[<] identifier[Class] operator[<] operator[?] Keyword[extends] identifier[Annotation] operator[>] , identifier[Element] operator[>] identifier[deferredElementsByAnnotation] operator[=] identifier[deferredElementsByAnnotationBuilder] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP] identifier[ImmutableSetMultimap] operator[SEP] identifier[Builder] operator[<] identifier[Class] operator[<] operator[?] Keyword[extends] identifier[Annotation] operator[>] , identifier[Element] operator[>] identifier[validElements] operator[=] identifier[ImmutableSetMultimap] operator[SEP] identifier[builder] operator[SEP] operator[SEP] operator[SEP] identifier[Set] operator[<] identifier[ElementName] operator[>] identifier[validElementNames] operator[=] Keyword[new] identifier[LinkedHashSet] operator[<] identifier[ElementName] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Class] operator[<] operator[?] Keyword[extends] identifier[Annotation] operator[>] identifier[annotationClass] operator[:] identifier[getSupportedAnnotationClasses] operator[SEP] operator[SEP] operator[SEP] {
identifier[TypeElement] identifier[annotationType] operator[=] identifier[elements] operator[SEP] identifier[getTypeElement] operator[SEP] identifier[annotationClass] operator[SEP] identifier[getCanonicalName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[Set] operator[<] operator[?] Keyword[extends] identifier[Element] operator[>] identifier[elementsAnnotatedWith] operator[=] operator[SEP] identifier[annotationType] operator[==] Other[null] operator[SEP] operator[?] identifier[ImmutableSet] operator[SEP] operator[<] identifier[Element] operator[>] identifier[of] operator[SEP] operator[SEP] operator[:] identifier[roundEnv] operator[SEP] identifier[getElementsAnnotatedWith] operator[SEP] identifier[annotationType] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Element] identifier[annotatedElement] operator[:] identifier[Sets] operator[SEP] identifier[union] operator[SEP] identifier[elementsAnnotatedWith] , identifier[deferredElementsByAnnotation] operator[SEP] identifier[get] operator[SEP] identifier[annotationClass] operator[SEP] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[annotatedElement] operator[SEP] identifier[getKind] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[PACKAGE] operator[SEP] operator[SEP] {
identifier[PackageElement] identifier[annotatedPackageElement] operator[=] operator[SEP] identifier[PackageElement] operator[SEP] identifier[annotatedElement] operator[SEP] identifier[ElementName] identifier[annotatedPackageName] operator[=] identifier[ElementName] operator[SEP] identifier[forPackageName] operator[SEP] identifier[annotatedPackageElement] operator[SEP] identifier[getQualifiedName] operator[SEP] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[boolean] identifier[validPackage] operator[=] identifier[validElementNames] operator[SEP] identifier[contains] operator[SEP] identifier[annotatedPackageName] operator[SEP] operator[||] operator[SEP] operator[!] identifier[deferredElementNames] operator[SEP] identifier[contains] operator[SEP] identifier[annotatedPackageName] operator[SEP] operator[&&] identifier[validateElement] operator[SEP] identifier[annotatedPackageElement] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[validPackage] operator[SEP] {
identifier[validElements] operator[SEP] identifier[put] operator[SEP] identifier[annotationClass] , identifier[annotatedPackageElement] operator[SEP] operator[SEP] identifier[validElementNames] operator[SEP] identifier[add] operator[SEP] identifier[annotatedPackageName] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[deferredElementNames] operator[SEP] identifier[add] operator[SEP] identifier[annotatedPackageName] operator[SEP] operator[SEP]
}
}
Keyword[else] {
identifier[TypeElement] identifier[enclosingType] operator[=] identifier[getEnclosingType] operator[SEP] identifier[annotatedElement] operator[SEP] operator[SEP] identifier[ElementName] identifier[enclosingTypeName] operator[=] identifier[ElementName] operator[SEP] identifier[forTypeName] operator[SEP] identifier[enclosingType] operator[SEP] identifier[getQualifiedName] operator[SEP] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[boolean] identifier[validEnclosingType] operator[=] identifier[validElementNames] operator[SEP] identifier[contains] operator[SEP] identifier[enclosingTypeName] operator[SEP] operator[||] operator[SEP] operator[!] identifier[deferredElementNames] operator[SEP] identifier[contains] operator[SEP] identifier[enclosingTypeName] operator[SEP] operator[&&] identifier[validateElement] operator[SEP] identifier[enclosingType] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[validEnclosingType] operator[SEP] {
identifier[validElements] operator[SEP] identifier[put] operator[SEP] identifier[annotationClass] , identifier[annotatedElement] operator[SEP] operator[SEP] identifier[validElementNames] operator[SEP] identifier[add] operator[SEP] identifier[enclosingTypeName] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[deferredElementNames] operator[SEP] identifier[add] operator[SEP] identifier[enclosingTypeName] operator[SEP] operator[SEP]
}
}
}
}
Keyword[return] identifier[validElements] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP]
}
|
public TableRef create(String primaryKeyName, StorageDataType primaryKeyDataType, String secondaryKeyName,
StorageDataType secondaryKeyDataType, StorageProvisionType provisionType,
StorageProvisionLoad provisionLoad, OnTableCreation onTableCreation, OnError onError){
PostBodyBuilder pbb = new PostBodyBuilder(context);
pbb.addObject("table", this.name);
pbb.addObject("provisionLoad", provisionLoad.getValue());
pbb.addObject("provisionType", provisionType.getValue());
Map <String, Object> key = new HashMap<String, Object>();
Map <String, Object> primary = new HashMap<String, Object>();
primary.put("name", primaryKeyName);
primary.put("dataType", primaryKeyDataType.toString());
key.put("primary", primary);
if(secondaryKeyName != null && secondaryKeyDataType != null){
Map <String, Object> secondary = new HashMap<String, Object>();
secondary.put("name", secondaryKeyName);
secondary.put("dataType", secondaryKeyDataType.toString());
key.put("secondary", secondary);
}
pbb.addObject("key", key);
Rest r = new Rest(context, RestType.CREATETABLE, pbb, null);
r.onError = onError;
r.onTableCreation = onTableCreation;
context.processRest(r);
return this;
} | class class_name[name] begin[{]
method[create, return_type[type[TableRef]], modifier[public], parameter[primaryKeyName, primaryKeyDataType, secondaryKeyName, secondaryKeyDataType, provisionType, provisionLoad, onTableCreation, onError]] begin[{]
local_variable[type[PostBodyBuilder], pbb]
call[pbb.addObject, parameter[literal["table"], THIS[member[None.name]]]]
call[pbb.addObject, parameter[literal["provisionLoad"], call[provisionLoad.getValue, parameter[]]]]
call[pbb.addObject, parameter[literal["provisionType"], call[provisionType.getValue, parameter[]]]]
local_variable[type[Map], key]
local_variable[type[Map], primary]
call[primary.put, parameter[literal["name"], member[.primaryKeyName]]]
call[primary.put, parameter[literal["dataType"], call[primaryKeyDataType.toString, parameter[]]]]
call[key.put, parameter[literal["primary"], member[.primary]]]
if[binary_operation[binary_operation[member[.secondaryKeyName], !=, literal[null]], &&, binary_operation[member[.secondaryKeyDataType], !=, literal[null]]]] begin[{]
local_variable[type[Map], secondary]
call[secondary.put, parameter[literal["name"], member[.secondaryKeyName]]]
call[secondary.put, parameter[literal["dataType"], call[secondaryKeyDataType.toString, parameter[]]]]
call[key.put, parameter[literal["secondary"], member[.secondary]]]
else begin[{]
None
end[}]
call[pbb.addObject, parameter[literal["key"], member[.key]]]
local_variable[type[Rest], r]
assign[member[r.onError], member[.onError]]
assign[member[r.onTableCreation], member[.onTableCreation]]
call[context.processRest, parameter[member[.r]]]
return[THIS[]]
end[}]
END[}] | Keyword[public] identifier[TableRef] identifier[create] operator[SEP] identifier[String] identifier[primaryKeyName] , identifier[StorageDataType] identifier[primaryKeyDataType] , identifier[String] identifier[secondaryKeyName] , identifier[StorageDataType] identifier[secondaryKeyDataType] , identifier[StorageProvisionType] identifier[provisionType] , identifier[StorageProvisionLoad] identifier[provisionLoad] , identifier[OnTableCreation] identifier[onTableCreation] , identifier[OnError] identifier[onError] operator[SEP] {
identifier[PostBodyBuilder] identifier[pbb] operator[=] Keyword[new] identifier[PostBodyBuilder] operator[SEP] identifier[context] operator[SEP] operator[SEP] identifier[pbb] operator[SEP] identifier[addObject] operator[SEP] literal[String] , Keyword[this] operator[SEP] identifier[name] operator[SEP] operator[SEP] identifier[pbb] operator[SEP] identifier[addObject] operator[SEP] literal[String] , identifier[provisionLoad] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[pbb] operator[SEP] identifier[addObject] operator[SEP] literal[String] , identifier[provisionType] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] identifier[key] operator[=] Keyword[new] identifier[HashMap] operator[<] identifier[String] , identifier[Object] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] identifier[primary] operator[=] Keyword[new] identifier[HashMap] operator[<] identifier[String] , identifier[Object] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[primary] operator[SEP] identifier[put] operator[SEP] literal[String] , identifier[primaryKeyName] operator[SEP] operator[SEP] identifier[primary] operator[SEP] identifier[put] operator[SEP] literal[String] , identifier[primaryKeyDataType] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[key] operator[SEP] identifier[put] operator[SEP] literal[String] , identifier[primary] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[secondaryKeyName] operator[!=] Other[null] operator[&&] identifier[secondaryKeyDataType] operator[!=] Other[null] operator[SEP] {
identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] identifier[secondary] operator[=] Keyword[new] identifier[HashMap] operator[<] identifier[String] , identifier[Object] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[secondary] operator[SEP] identifier[put] operator[SEP] literal[String] , identifier[secondaryKeyName] operator[SEP] operator[SEP] identifier[secondary] operator[SEP] identifier[put] operator[SEP] literal[String] , identifier[secondaryKeyDataType] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[key] operator[SEP] identifier[put] operator[SEP] literal[String] , identifier[secondary] operator[SEP] operator[SEP]
}
identifier[pbb] operator[SEP] identifier[addObject] operator[SEP] literal[String] , identifier[key] operator[SEP] operator[SEP] identifier[Rest] identifier[r] operator[=] Keyword[new] identifier[Rest] operator[SEP] identifier[context] , identifier[RestType] operator[SEP] identifier[CREATETABLE] , identifier[pbb] , Other[null] operator[SEP] operator[SEP] identifier[r] operator[SEP] identifier[onError] operator[=] identifier[onError] operator[SEP] identifier[r] operator[SEP] identifier[onTableCreation] operator[=] identifier[onTableCreation] operator[SEP] identifier[context] operator[SEP] identifier[processRest] operator[SEP] identifier[r] operator[SEP] operator[SEP] Keyword[return] Keyword[this] operator[SEP]
}
|
public void splitStart(long stamp)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(this, tc, "splitStart", new Object[] {Long.valueOf(stamp), Integer.valueOf(cursor)});
RangeObject ro = (RangeObject) blockVector.get(cursor);
if (ro.startstamp == stamp)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "splitStart");
return;
}
if (stamp > ro.endstamp)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(
tc,
"splitStart",
new Object[] { "A", Long.valueOf(stamp), Long.valueOf(ro.endstamp)});
SIErrorException e =
new SIErrorException(
nls.getFormattedMessage(
"INTERNAL_MESSAGING_ERROR_CWSIP0001",
new Object[] {
"com.ibm.ws.sib.processor.gd.ARangeList",
"1:445:1.25" },
null));
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
SibTr.exception(tc, e);
SibTr.error(tc, "INTERNAL_MESSAGING_ERROR_CWSIP0001",
new Object[] {
"com.ibm.ws.sib.processor.gd.ARangeList",
"1:454:1.25" });
// FFDC
FFDCFilter.processException(
e,
"com.ibm.ws.sib.processor.gd.ARangeList.splitStart",
"1:460:1.25",
this);
throw e;
}
if (stamp < ro.startstamp)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(
tc,
"splitStart",
new Object[] { "B", Long.valueOf(stamp), Long.valueOf(ro.startstamp)});
SIErrorException e =
new SIErrorException(
nls.getFormattedMessage(
"INTERNAL_MESSAGING_ERROR_CWSIP0001",
new Object[] {
"com.ibm.ws.sib.processor.gd.ARangeList",
"1:479:1.25" },
null));
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
SibTr.exception(tc, e);
SibTr.error(tc, "INTERNAL_MESSAGING_ERROR_CWSIP0001",
new Object[] {
"com.ibm.ws.sib.processor.gd.ARangeList",
"1:487:1.25" });
// FFDC
FFDCFilter.processException(
e,
"com.ibm.ws.sib.processor.gd.ARangeList.splitStart",
"1:493:1.25",
this);
throw e;
}
RangeObject ro2 = (RangeObject) ro.clone();
ro2.endstamp = stamp - 1;
ro.startstamp = stamp;
blockVector.insertNullElementsAt(cursor, 1);
blockVector.set(cursor, ro2);
cursor++;
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "splitStart", Integer.valueOf(cursor));
} | class class_name[name] begin[{]
method[splitStart, return_type[void], modifier[public], parameter[stamp]] begin[{]
if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{]
call[SibTr.entry, parameter[THIS[], member[.tc], literal["splitStart"], ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MethodInvocation(arguments=[MemberReference(member=stamp, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=valueOf, postfix_operators=[], prefix_operators=[], qualifier=Long, selectors=[], type_arguments=None), MethodInvocation(arguments=[MemberReference(member=cursor, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=valueOf, postfix_operators=[], prefix_operators=[], qualifier=Integer, selectors=[], type_arguments=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[RangeObject], ro]
if[binary_operation[member[ro.startstamp], ==, member[.stamp]]] begin[{]
if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{]
call[SibTr.exit, parameter[member[.tc], literal["splitStart"]]]
else begin[{]
None
end[}]
return[None]
else begin[{]
None
end[}]
if[binary_operation[member[.stamp], >, member[ro.endstamp]]] begin[{]
if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{]
call[SibTr.exit, parameter[member[.tc], literal["splitStart"], ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="A"), MethodInvocation(arguments=[MemberReference(member=stamp, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=valueOf, postfix_operators=[], prefix_operators=[], qualifier=Long, selectors=[], type_arguments=None), MethodInvocation(arguments=[MemberReference(member=endstamp, postfix_operators=[], prefix_operators=[], qualifier=ro, selectors=[])], member=valueOf, postfix_operators=[], prefix_operators=[], qualifier=Long, selectors=[], type_arguments=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[SIErrorException], e]
if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isDebugEnabled, parameter[]]]] begin[{]
call[SibTr.exception, parameter[member[.tc], member[.e]]]
else begin[{]
None
end[}]
call[SibTr.error, parameter[member[.tc], literal["INTERNAL_MESSAGING_ERROR_CWSIP0001"], ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="com.ibm.ws.sib.processor.gd.ARangeList"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="1:454:1.25")]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Object, sub_type=None))]]
call[FFDCFilter.processException, parameter[member[.e], literal["com.ibm.ws.sib.processor.gd.ARangeList.splitStart"], literal["1:460:1.25"], THIS[]]]
ThrowStatement(expression=MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)
else begin[{]
None
end[}]
if[binary_operation[member[.stamp], <, member[ro.startstamp]]] begin[{]
if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{]
call[SibTr.exit, parameter[member[.tc], literal["splitStart"], ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="B"), MethodInvocation(arguments=[MemberReference(member=stamp, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=valueOf, postfix_operators=[], prefix_operators=[], qualifier=Long, selectors=[], type_arguments=None), MethodInvocation(arguments=[MemberReference(member=startstamp, postfix_operators=[], prefix_operators=[], qualifier=ro, selectors=[])], member=valueOf, postfix_operators=[], prefix_operators=[], qualifier=Long, selectors=[], type_arguments=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[SIErrorException], e]
if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isDebugEnabled, parameter[]]]] begin[{]
call[SibTr.exception, parameter[member[.tc], member[.e]]]
else begin[{]
None
end[}]
call[SibTr.error, parameter[member[.tc], literal["INTERNAL_MESSAGING_ERROR_CWSIP0001"], ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="com.ibm.ws.sib.processor.gd.ARangeList"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="1:487:1.25")]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Object, sub_type=None))]]
call[FFDCFilter.processException, parameter[member[.e], literal["com.ibm.ws.sib.processor.gd.ARangeList.splitStart"], literal["1:493:1.25"], THIS[]]]
ThrowStatement(expression=MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)
else begin[{]
None
end[}]
local_variable[type[RangeObject], ro2]
assign[member[ro2.endstamp], binary_operation[member[.stamp], -, literal[1]]]
assign[member[ro.startstamp], member[.stamp]]
call[blockVector.insertNullElementsAt, parameter[member[.cursor], literal[1]]]
call[blockVector.set, parameter[member[.cursor], member[.ro2]]]
member[.cursor]
if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{]
call[SibTr.exit, parameter[member[.tc], literal["splitStart"], call[Integer.valueOf, parameter[member[.cursor]]]]]
else begin[{]
None
end[}]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[splitStart] operator[SEP] Keyword[long] identifier[stamp] operator[SEP] {
Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[entry] operator[SEP] Keyword[this] , identifier[tc] , literal[String] , Keyword[new] identifier[Object] operator[SEP] operator[SEP] {
identifier[Long] operator[SEP] identifier[valueOf] operator[SEP] identifier[stamp] operator[SEP] , identifier[Integer] operator[SEP] identifier[valueOf] operator[SEP] identifier[cursor] operator[SEP]
} operator[SEP] operator[SEP] identifier[RangeObject] identifier[ro] operator[=] operator[SEP] identifier[RangeObject] operator[SEP] identifier[blockVector] operator[SEP] identifier[get] operator[SEP] identifier[cursor] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[ro] operator[SEP] identifier[startstamp] operator[==] identifier[stamp] 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] operator[SEP] operator[SEP] Keyword[return] operator[SEP]
}
Keyword[if] operator[SEP] identifier[stamp] operator[>] identifier[ro] operator[SEP] identifier[endstamp] 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[Object] operator[SEP] operator[SEP] {
literal[String] , identifier[Long] operator[SEP] identifier[valueOf] operator[SEP] identifier[stamp] operator[SEP] , identifier[Long] operator[SEP] identifier[valueOf] operator[SEP] identifier[ro] operator[SEP] identifier[endstamp] operator[SEP]
} operator[SEP] operator[SEP] identifier[SIErrorException] identifier[e] operator[=] Keyword[new] identifier[SIErrorException] operator[SEP] identifier[nls] operator[SEP] identifier[getFormattedMessage] operator[SEP] literal[String] , Keyword[new] identifier[Object] operator[SEP] operator[SEP] {
literal[String] , literal[String]
} , Other[null] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[exception] operator[SEP] identifier[tc] , identifier[e] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[error] operator[SEP] identifier[tc] , literal[String] , Keyword[new] identifier[Object] operator[SEP] operator[SEP] {
literal[String] , literal[String]
} operator[SEP] operator[SEP] identifier[FFDCFilter] operator[SEP] identifier[processException] operator[SEP] identifier[e] , literal[String] , literal[String] , Keyword[this] operator[SEP] operator[SEP] Keyword[throw] identifier[e] operator[SEP]
}
Keyword[if] operator[SEP] identifier[stamp] operator[<] identifier[ro] operator[SEP] identifier[startstamp] 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[Object] operator[SEP] operator[SEP] {
literal[String] , identifier[Long] operator[SEP] identifier[valueOf] operator[SEP] identifier[stamp] operator[SEP] , identifier[Long] operator[SEP] identifier[valueOf] operator[SEP] identifier[ro] operator[SEP] identifier[startstamp] operator[SEP]
} operator[SEP] operator[SEP] identifier[SIErrorException] identifier[e] operator[=] Keyword[new] identifier[SIErrorException] operator[SEP] identifier[nls] operator[SEP] identifier[getFormattedMessage] operator[SEP] literal[String] , Keyword[new] identifier[Object] operator[SEP] operator[SEP] {
literal[String] , literal[String]
} , Other[null] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[exception] operator[SEP] identifier[tc] , identifier[e] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[error] operator[SEP] identifier[tc] , literal[String] , Keyword[new] identifier[Object] operator[SEP] operator[SEP] {
literal[String] , literal[String]
} operator[SEP] operator[SEP] identifier[FFDCFilter] operator[SEP] identifier[processException] operator[SEP] identifier[e] , literal[String] , literal[String] , Keyword[this] operator[SEP] operator[SEP] Keyword[throw] identifier[e] operator[SEP]
}
identifier[RangeObject] identifier[ro2] operator[=] operator[SEP] identifier[RangeObject] operator[SEP] identifier[ro] operator[SEP] identifier[clone] operator[SEP] operator[SEP] operator[SEP] identifier[ro2] operator[SEP] identifier[endstamp] operator[=] identifier[stamp] operator[-] Other[1] operator[SEP] identifier[ro] operator[SEP] identifier[startstamp] operator[=] identifier[stamp] operator[SEP] identifier[blockVector] operator[SEP] identifier[insertNullElementsAt] operator[SEP] identifier[cursor] , Other[1] operator[SEP] operator[SEP] identifier[blockVector] operator[SEP] identifier[set] operator[SEP] identifier[cursor] , identifier[ro2] operator[SEP] operator[SEP] identifier[cursor] operator[++] 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] , identifier[Integer] operator[SEP] identifier[valueOf] operator[SEP] identifier[cursor] operator[SEP] operator[SEP] operator[SEP]
}
|
public Matrix4d rotationY(double ang) {
double sin, cos;
sin = Math.sin(ang);
cos = Math.cosFromSin(sin, ang);
if ((properties & PROPERTY_IDENTITY) == 0)
this._identity();
m00 = cos;
m02 = -sin;
m20 = sin;
m22 = cos;
properties = PROPERTY_AFFINE | PROPERTY_ORTHONORMAL;
return this;
} | class class_name[name] begin[{]
method[rotationY, return_type[type[Matrix4d]], modifier[public], parameter[ang]] begin[{]
local_variable[type[double], sin]
assign[member[.sin], call[Math.sin, parameter[member[.ang]]]]
assign[member[.cos], call[Math.cosFromSin, parameter[member[.sin], member[.ang]]]]
if[binary_operation[binary_operation[member[.properties], &, member[.PROPERTY_IDENTITY]], ==, literal[0]]] begin[{]
THIS[call[None._identity, parameter[]]]
else begin[{]
None
end[}]
assign[member[.m00], member[.cos]]
assign[member[.m02], member[.sin]]
assign[member[.m20], member[.sin]]
assign[member[.m22], member[.cos]]
assign[member[.properties], binary_operation[member[.PROPERTY_AFFINE], |, member[.PROPERTY_ORTHONORMAL]]]
return[THIS[]]
end[}]
END[}] | Keyword[public] identifier[Matrix4d] identifier[rotationY] operator[SEP] Keyword[double] identifier[ang] operator[SEP] {
Keyword[double] identifier[sin] , identifier[cos] operator[SEP] identifier[sin] operator[=] identifier[Math] operator[SEP] identifier[sin] operator[SEP] identifier[ang] operator[SEP] operator[SEP] identifier[cos] operator[=] identifier[Math] operator[SEP] identifier[cosFromSin] operator[SEP] identifier[sin] , identifier[ang] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[SEP] identifier[properties] operator[&] identifier[PROPERTY_IDENTITY] operator[SEP] operator[==] Other[0] operator[SEP] Keyword[this] operator[SEP] identifier[_identity] operator[SEP] operator[SEP] operator[SEP] identifier[m00] operator[=] identifier[cos] operator[SEP] identifier[m02] operator[=] operator[-] identifier[sin] operator[SEP] identifier[m20] operator[=] identifier[sin] operator[SEP] identifier[m22] operator[=] identifier[cos] operator[SEP] identifier[properties] operator[=] identifier[PROPERTY_AFFINE] operator[|] identifier[PROPERTY_ORTHONORMAL] operator[SEP] Keyword[return] Keyword[this] operator[SEP]
}
|
public java.util.List<String> getCustomDnsServers() {
if (customDnsServers == null) {
customDnsServers = new com.amazonaws.internal.SdkInternalList<String>();
}
return customDnsServers;
} | class class_name[name] begin[{]
method[getCustomDnsServers, return_type[type[java]], modifier[public], parameter[]] begin[{]
if[binary_operation[member[.customDnsServers], ==, literal[null]]] begin[{]
assign[member[.customDnsServers], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=com, sub_type=ReferenceType(arguments=None, dimensions=None, name=amazonaws, sub_type=ReferenceType(arguments=None, dimensions=None, name=internal, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=None, name=SdkInternalList, sub_type=None)))))]
else begin[{]
None
end[}]
return[member[.customDnsServers]]
end[}]
END[}] | Keyword[public] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[List] operator[<] identifier[String] operator[>] identifier[getCustomDnsServers] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[customDnsServers] operator[==] Other[null] operator[SEP] {
identifier[customDnsServers] operator[=] Keyword[new] identifier[com] operator[SEP] identifier[amazonaws] operator[SEP] identifier[internal] operator[SEP] identifier[SdkInternalList] operator[<] identifier[String] operator[>] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] identifier[customDnsServers] operator[SEP]
}
|
public static boolean isTypeIncludedIn(TypeName value, Type... types) {
for (Type item : types) {
if (value.equals(typeName(item))) {
return true;
}
}
return false;
} | class class_name[name] begin[{]
method[isTypeIncludedIn, return_type[type[boolean]], modifier[public static], parameter[value, types]] begin[{]
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=item, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=typeName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=equals, postfix_operators=[], prefix_operators=[], qualifier=value, 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=true), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=types, 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=Type, sub_type=None))), label=None)
return[literal[false]]
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[boolean] identifier[isTypeIncludedIn] operator[SEP] identifier[TypeName] identifier[value] , identifier[Type] operator[...] identifier[types] operator[SEP] {
Keyword[for] operator[SEP] identifier[Type] identifier[item] operator[:] identifier[types] operator[SEP] {
Keyword[if] operator[SEP] identifier[value] operator[SEP] identifier[equals] operator[SEP] identifier[typeName] operator[SEP] identifier[item] operator[SEP] operator[SEP] operator[SEP] {
Keyword[return] literal[boolean] operator[SEP]
}
}
Keyword[return] literal[boolean] operator[SEP]
}
|
public static int calculateQuotientScale(int precision1, int scale1,int precision2, int scale2)
{
return Math.max(scale1 + precision2 -scale2 + 1, 6);
} | class class_name[name] begin[{]
method[calculateQuotientScale, return_type[type[int]], modifier[public static], parameter[precision1, scale1, precision2, scale2]] begin[{]
return[call[Math.max, parameter[binary_operation[binary_operation[binary_operation[member[.scale1], +, member[.precision2]], -, member[.scale2]], +, literal[1]], literal[6]]]]
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[int] identifier[calculateQuotientScale] operator[SEP] Keyword[int] identifier[precision1] , Keyword[int] identifier[scale1] , Keyword[int] identifier[precision2] , Keyword[int] identifier[scale2] operator[SEP] {
Keyword[return] identifier[Math] operator[SEP] identifier[max] operator[SEP] identifier[scale1] operator[+] identifier[precision2] operator[-] identifier[scale2] operator[+] Other[1] , Other[6] operator[SEP] operator[SEP]
}
|
public WorkSheet swapRowAndColumns() throws Exception {
WorkSheet swappedWorkSheet = new WorkSheet(getColumns(), getRows());
for (String row : getRows()) {
for (String col : getColumns()) {
String value = getCell(row, col);
swappedWorkSheet.addCell(col, row, value);
}
}
ArrayList<String> metadataRows = this.getMetaDataRows();
ArrayList<String> metadataColumns = this.getMetaDataColumns();
swappedWorkSheet.setMetaDataColumns(metadataRows);
swappedWorkSheet.setMetaDataRows(metadataColumns);
return swappedWorkSheet;
} | class class_name[name] begin[{]
method[swapRowAndColumns, return_type[type[WorkSheet]], modifier[public], parameter[]] begin[{]
local_variable[type[WorkSheet], swappedWorkSheet]
ForStatement(body=BlockStatement(label=None, statements=[ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=row, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=col, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getCell, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=value)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=col, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=row, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addCell, postfix_operators=[], prefix_operators=[], qualifier=swappedWorkSheet, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getColumns, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=col)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getRows, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=row)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None)
local_variable[type[ArrayList], metadataRows]
local_variable[type[ArrayList], metadataColumns]
call[swappedWorkSheet.setMetaDataColumns, parameter[member[.metadataRows]]]
call[swappedWorkSheet.setMetaDataRows, parameter[member[.metadataColumns]]]
return[member[.swappedWorkSheet]]
end[}]
END[}] | Keyword[public] identifier[WorkSheet] identifier[swapRowAndColumns] operator[SEP] operator[SEP] Keyword[throws] identifier[Exception] {
identifier[WorkSheet] identifier[swappedWorkSheet] operator[=] Keyword[new] identifier[WorkSheet] operator[SEP] identifier[getColumns] operator[SEP] operator[SEP] , identifier[getRows] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[String] identifier[row] operator[:] identifier[getRows] operator[SEP] operator[SEP] operator[SEP] {
Keyword[for] operator[SEP] identifier[String] identifier[col] operator[:] identifier[getColumns] operator[SEP] operator[SEP] operator[SEP] {
identifier[String] identifier[value] operator[=] identifier[getCell] operator[SEP] identifier[row] , identifier[col] operator[SEP] operator[SEP] identifier[swappedWorkSheet] operator[SEP] identifier[addCell] operator[SEP] identifier[col] , identifier[row] , identifier[value] operator[SEP] operator[SEP]
}
}
identifier[ArrayList] operator[<] identifier[String] operator[>] identifier[metadataRows] operator[=] Keyword[this] operator[SEP] identifier[getMetaDataRows] operator[SEP] operator[SEP] operator[SEP] identifier[ArrayList] operator[<] identifier[String] operator[>] identifier[metadataColumns] operator[=] Keyword[this] operator[SEP] identifier[getMetaDataColumns] operator[SEP] operator[SEP] operator[SEP] identifier[swappedWorkSheet] operator[SEP] identifier[setMetaDataColumns] operator[SEP] identifier[metadataRows] operator[SEP] operator[SEP] identifier[swappedWorkSheet] operator[SEP] identifier[setMetaDataRows] operator[SEP] identifier[metadataColumns] operator[SEP] operator[SEP] Keyword[return] identifier[swappedWorkSheet] operator[SEP]
}
|
protected LocaleSymbol setupConditionLocaleSymbol(final ConditionFormatter formatter, final Token.Condition token) {
final Matcher matcher = PATTERN_CONDITION_LOCALE_SYMBOL.matcher(token.getValue());
if(!matcher.matches()) {
throw new IllegalArgumentException("not match condition:" + token.getValue());
}
final String symbol = matcher.group(1);
final String number = matcher.group(2);
// 16進数=>10進数に直す
final int value = Integer.valueOf(number, 16);
MSLocale locale = MSLocale.createKnownLocale(value);
if(locale == null) {
locale = new MSLocale(value);
}
formatter.setLocale(locale);
return new LocaleSymbol(locale, symbol);
} | class class_name[name] begin[{]
method[setupConditionLocaleSymbol, return_type[type[LocaleSymbol]], modifier[protected], parameter[formatter, token]] begin[{]
local_variable[type[Matcher], matcher]
if[call[matcher.matches, parameter[]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="not match condition:"), operandr=MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=token, selectors=[], type_arguments=None), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None)
else begin[{]
None
end[}]
local_variable[type[String], symbol]
local_variable[type[String], number]
local_variable[type[int], value]
local_variable[type[MSLocale], locale]
if[binary_operation[member[.locale], ==, literal[null]]] begin[{]
assign[member[.locale], ClassCreator(arguments=[MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=MSLocale, sub_type=None))]
else begin[{]
None
end[}]
call[formatter.setLocale, parameter[member[.locale]]]
return[ClassCreator(arguments=[MemberReference(member=locale, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=symbol, 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=LocaleSymbol, sub_type=None))]
end[}]
END[}] | Keyword[protected] identifier[LocaleSymbol] identifier[setupConditionLocaleSymbol] operator[SEP] Keyword[final] identifier[ConditionFormatter] identifier[formatter] , Keyword[final] identifier[Token] operator[SEP] identifier[Condition] identifier[token] operator[SEP] {
Keyword[final] identifier[Matcher] identifier[matcher] operator[=] identifier[PATTERN_CONDITION_LOCALE_SYMBOL] operator[SEP] identifier[matcher] operator[SEP] identifier[token] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[matcher] operator[SEP] identifier[matches] operator[SEP] operator[SEP] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[+] identifier[token] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[final] identifier[String] identifier[symbol] operator[=] identifier[matcher] operator[SEP] identifier[group] operator[SEP] Other[1] operator[SEP] operator[SEP] Keyword[final] identifier[String] identifier[number] operator[=] identifier[matcher] operator[SEP] identifier[group] operator[SEP] Other[2] operator[SEP] operator[SEP] Keyword[final] Keyword[int] identifier[value] operator[=] identifier[Integer] operator[SEP] identifier[valueOf] operator[SEP] identifier[number] , Other[16] operator[SEP] operator[SEP] identifier[MSLocale] identifier[locale] operator[=] identifier[MSLocale] operator[SEP] identifier[createKnownLocale] operator[SEP] identifier[value] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[locale] operator[==] Other[null] operator[SEP] {
identifier[locale] operator[=] Keyword[new] identifier[MSLocale] operator[SEP] identifier[value] operator[SEP] operator[SEP]
}
identifier[formatter] operator[SEP] identifier[setLocale] operator[SEP] identifier[locale] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[LocaleSymbol] operator[SEP] identifier[locale] , identifier[symbol] operator[SEP] operator[SEP]
}
|
@NullSafe
@SafeVarargs
public static <T> Set<T> asSet(T... elements) {
return stream(nullSafeArray(elements)).collect(Collectors.toSet());
} | class class_name[name] begin[{]
method[asSet, return_type[type[Set]], modifier[public static], parameter[elements]] begin[{]
return[call[.stream, parameter[call[.nullSafeArray, parameter[member[.elements]]]]]]
end[}]
END[}] | annotation[@] identifier[NullSafe] annotation[@] identifier[SafeVarargs] Keyword[public] Keyword[static] operator[<] identifier[T] operator[>] identifier[Set] operator[<] identifier[T] operator[>] identifier[asSet] operator[SEP] identifier[T] operator[...] identifier[elements] operator[SEP] {
Keyword[return] identifier[stream] operator[SEP] identifier[nullSafeArray] operator[SEP] identifier[elements] operator[SEP] operator[SEP] operator[SEP] identifier[collect] operator[SEP] identifier[Collectors] operator[SEP] identifier[toSet] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
public synchronized void truncate(long len) throws SQLException {
checkFreed();
if (!conn.haveMinimumServerVersion(ServerVersion.v8_3)) {
throw new PSQLException(
GT.tr("Truncation of large objects is only implemented in 8.3 and later servers."),
PSQLState.NOT_IMPLEMENTED);
}
if (len < 0) {
throw new PSQLException(GT.tr("Cannot truncate LOB to a negative length."),
PSQLState.INVALID_PARAMETER_VALUE);
}
if (len > Integer.MAX_VALUE) {
if (support64bit) {
getLo(true).truncate64(len);
} else {
throw new PSQLException(GT.tr("PostgreSQL LOBs can only index to: {0}", Integer.MAX_VALUE),
PSQLState.INVALID_PARAMETER_VALUE);
}
} else {
getLo(true).truncate((int) len);
}
} | class class_name[name] begin[{]
method[truncate, return_type[void], modifier[synchronized public], parameter[len]] begin[{]
call[.checkFreed, parameter[]]
if[call[conn.haveMinimumServerVersion, parameter[member[ServerVersion.v8_3]]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Truncation of large objects is only implemented in 8.3 and later servers.")], member=tr, postfix_operators=[], prefix_operators=[], qualifier=GT, selectors=[], type_arguments=None), MemberReference(member=NOT_IMPLEMENTED, postfix_operators=[], prefix_operators=[], qualifier=PSQLState, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=PSQLException, sub_type=None)), label=None)
else begin[{]
None
end[}]
if[binary_operation[member[.len], <, literal[0]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Cannot truncate LOB to a negative length.")], member=tr, postfix_operators=[], prefix_operators=[], qualifier=GT, selectors=[], type_arguments=None), MemberReference(member=INVALID_PARAMETER_VALUE, postfix_operators=[], prefix_operators=[], qualifier=PSQLState, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=PSQLException, sub_type=None)), label=None)
else begin[{]
None
end[}]
if[binary_operation[member[.len], >, member[Integer.MAX_VALUE]]] begin[{]
if[member[.support64bit]] begin[{]
call[.getLo, parameter[literal[true]]]
else begin[{]
ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="PostgreSQL LOBs can only index to: {0}"), MemberReference(member=MAX_VALUE, postfix_operators=[], prefix_operators=[], qualifier=Integer, selectors=[])], member=tr, postfix_operators=[], prefix_operators=[], qualifier=GT, selectors=[], type_arguments=None), MemberReference(member=INVALID_PARAMETER_VALUE, postfix_operators=[], prefix_operators=[], qualifier=PSQLState, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=PSQLException, sub_type=None)), label=None)
end[}]
else begin[{]
call[.getLo, parameter[literal[true]]]
end[}]
end[}]
END[}] | Keyword[public] Keyword[synchronized] Keyword[void] identifier[truncate] operator[SEP] Keyword[long] identifier[len] operator[SEP] Keyword[throws] identifier[SQLException] {
identifier[checkFreed] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[conn] operator[SEP] identifier[haveMinimumServerVersion] operator[SEP] identifier[ServerVersion] operator[SEP] identifier[v8_3] operator[SEP] operator[SEP] {
Keyword[throw] Keyword[new] identifier[PSQLException] operator[SEP] identifier[GT] operator[SEP] identifier[tr] operator[SEP] literal[String] operator[SEP] , identifier[PSQLState] operator[SEP] identifier[NOT_IMPLEMENTED] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[len] operator[<] Other[0] operator[SEP] {
Keyword[throw] Keyword[new] identifier[PSQLException] operator[SEP] identifier[GT] operator[SEP] identifier[tr] operator[SEP] literal[String] operator[SEP] , identifier[PSQLState] operator[SEP] identifier[INVALID_PARAMETER_VALUE] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[len] operator[>] identifier[Integer] operator[SEP] identifier[MAX_VALUE] operator[SEP] {
Keyword[if] operator[SEP] identifier[support64bit] operator[SEP] {
identifier[getLo] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[truncate64] operator[SEP] identifier[len] operator[SEP] operator[SEP]
}
Keyword[else] {
Keyword[throw] Keyword[new] identifier[PSQLException] operator[SEP] identifier[GT] operator[SEP] identifier[tr] operator[SEP] literal[String] , identifier[Integer] operator[SEP] identifier[MAX_VALUE] operator[SEP] , identifier[PSQLState] operator[SEP] identifier[INVALID_PARAMETER_VALUE] operator[SEP] operator[SEP]
}
}
Keyword[else] {
identifier[getLo] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[truncate] operator[SEP] operator[SEP] Keyword[int] operator[SEP] identifier[len] operator[SEP] operator[SEP]
}
}
|
public static void stripWhitespaceNodes(Node element) {
Node node, child;
for (child = element.getFirstChild(); child != null; child = node) {
node = child.getNextSibling();
stripWhitespaceNodes(child);
}
if (element.getNodeType() == Node.TEXT_NODE && element.getNodeValue().trim().length()==0) {
element.getParentNode().removeChild(element);
}
} | class class_name[name] begin[{]
method[stripWhitespaceNodes, return_type[void], modifier[public static], parameter[element]] begin[{]
local_variable[type[Node], node]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=node, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=getNextSibling, postfix_operators=[], prefix_operators=[], qualifier=child, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=child, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=stripWhitespaceNodes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=child, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), init=[Assignment(expressionl=MemberReference(member=child, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=getFirstChild, postfix_operators=[], prefix_operators=[], qualifier=element, selectors=[], type_arguments=None))], update=[Assignment(expressionl=MemberReference(member=child, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=node, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), label=None)
if[binary_operation[binary_operation[call[element.getNodeType, parameter[]], ==, member[Node.TEXT_NODE]], &&, binary_operation[call[element.getNodeValue, parameter[]], ==, literal[0]]]] begin[{]
call[element.getParentNode, parameter[]]
else begin[{]
None
end[}]
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[void] identifier[stripWhitespaceNodes] operator[SEP] identifier[Node] identifier[element] operator[SEP] {
identifier[Node] identifier[node] , identifier[child] operator[SEP] Keyword[for] operator[SEP] identifier[child] operator[=] identifier[element] operator[SEP] identifier[getFirstChild] operator[SEP] operator[SEP] operator[SEP] identifier[child] operator[!=] Other[null] operator[SEP] identifier[child] operator[=] identifier[node] operator[SEP] {
identifier[node] operator[=] identifier[child] operator[SEP] identifier[getNextSibling] operator[SEP] operator[SEP] operator[SEP] identifier[stripWhitespaceNodes] operator[SEP] identifier[child] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[element] operator[SEP] identifier[getNodeType] operator[SEP] operator[SEP] operator[==] identifier[Node] operator[SEP] identifier[TEXT_NODE] operator[&&] identifier[element] operator[SEP] identifier[getNodeValue] operator[SEP] operator[SEP] operator[SEP] identifier[trim] operator[SEP] operator[SEP] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[==] Other[0] operator[SEP] {
identifier[element] operator[SEP] identifier[getParentNode] operator[SEP] operator[SEP] operator[SEP] identifier[removeChild] operator[SEP] identifier[element] operator[SEP] operator[SEP]
}
}
|
public DOMSource createDOMSource(DocumentSource src)
{
try
{
Constructor<? extends DOMSource> constr = getDOMSourceClass().getConstructor(DocumentSource.class);
return constr.newInstance(src);
} catch (Exception e) {
log.warn("BoxFactory: Warning: could not create the DOMSource instance: " + e.getMessage());
return null;
}
} | class class_name[name] begin[{]
method[createDOMSource, return_type[type[DOMSource]], modifier[public], parameter[src]] begin[{]
TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getDOMSourceClass, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=DocumentSource, sub_type=None))], member=getConstructor, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=constr)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=extends, type=ReferenceType(arguments=None, dimensions=[], name=DOMSource, sub_type=None))], dimensions=[], name=Constructor, sub_type=None)), ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=src, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=newInstance, postfix_operators=[], prefix_operators=[], qualifier=constr, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="BoxFactory: Warning: could not create the DOMSource instance: "), operandr=MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), operator=+)], member=warn, postfix_operators=[], prefix_operators=[], qualifier=log, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None)
end[}]
END[}] | Keyword[public] identifier[DOMSource] identifier[createDOMSource] operator[SEP] identifier[DocumentSource] identifier[src] operator[SEP] {
Keyword[try] {
identifier[Constructor] operator[<] operator[?] Keyword[extends] identifier[DOMSource] operator[>] identifier[constr] operator[=] identifier[getDOMSourceClass] operator[SEP] operator[SEP] operator[SEP] identifier[getConstructor] operator[SEP] identifier[DocumentSource] operator[SEP] Keyword[class] operator[SEP] operator[SEP] Keyword[return] identifier[constr] operator[SEP] identifier[newInstance] operator[SEP] identifier[src] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] {
identifier[log] operator[SEP] identifier[warn] operator[SEP] literal[String] operator[+] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] Other[null] operator[SEP]
}
}
|
public static String trimInFront(String buffer) {
// remove spaces in front
int count = 0;
for (int i = 0; i < buffer.length(); i++) {
if (buffer.charAt(i) == SPACE_CHAR)
count++;
else
break;
}
if (count > 0)
return buffer.substring(count);
else
return buffer;
} | class class_name[name] begin[{]
method[trimInFront, return_type[type[String]], modifier[public static], parameter[buffer]] begin[{]
local_variable[type[int], count]
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=charAt, postfix_operators=[], prefix_operators=[], qualifier=buffer, selectors=[], type_arguments=None), operandr=MemberReference(member=SPACE_CHAR, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), else_statement=BreakStatement(goto=None, label=None), label=None, then_statement=StatementExpression(expression=MemberReference(member=count, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]), label=None))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=buffer, selectors=[], type_arguments=None), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
if[binary_operation[member[.count], >, literal[0]]] begin[{]
return[call[buffer.substring, parameter[member[.count]]]]
else begin[{]
return[member[.buffer]]
end[}]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[String] identifier[trimInFront] operator[SEP] identifier[String] identifier[buffer] operator[SEP] {
Keyword[int] identifier[count] operator[=] Other[0] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[buffer] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[++] operator[SEP] {
Keyword[if] operator[SEP] identifier[buffer] operator[SEP] identifier[charAt] operator[SEP] identifier[i] operator[SEP] operator[==] identifier[SPACE_CHAR] operator[SEP] identifier[count] operator[++] operator[SEP] Keyword[else] Keyword[break] operator[SEP]
}
Keyword[if] operator[SEP] identifier[count] operator[>] Other[0] operator[SEP] Keyword[return] identifier[buffer] operator[SEP] identifier[substring] operator[SEP] identifier[count] operator[SEP] operator[SEP] Keyword[else] Keyword[return] identifier[buffer] operator[SEP]
}
|
private void processConfig(final HttpServerExchange exchange, final RequestData requestData) {
// Get the node builder
List<String> hosts = null;
List<String> contexts = null;
final Balancer.BalancerBuilder balancer = Balancer.builder();
final NodeConfig.NodeBuilder node = NodeConfig.builder(modCluster);
final Iterator<HttpString> i = requestData.iterator();
while (i.hasNext()) {
final HttpString name = i.next();
final String value = requestData.getFirst(name);
UndertowLogger.ROOT_LOGGER.mcmpKeyValue(name, value);
if (!checkString(value)) {
processError(TYPESYNTAX, SBADFLD + name + SBADFLD1, exchange);
return;
}
if (BALANCER.equals(name)) {
node.setBalancer(value);
balancer.setName(value);
} else if (MAXATTEMPTS.equals(name)) {
balancer.setMaxRetries(Integer.parseInt(value));
} else if (STICKYSESSION.equals(name)) {
if ("No".equalsIgnoreCase(value)) {
balancer.setStickySession(false);
}
} else if (STICKYSESSIONCOOKIE.equals(name)) {
balancer.setStickySessionCookie(value);
} else if (STICKYSESSIONPATH.equals(name)) {
balancer.setStickySessionPath(value);
} else if (STICKYSESSIONREMOVE.equals(name)) {
if ("Yes".equalsIgnoreCase(value)) {
balancer.setStickySessionRemove(true);
}
} else if (STICKYSESSIONFORCE.equals(name)) {
if ("no".equalsIgnoreCase(value)) {
balancer.setStickySessionForce(false);
}
} else if (JVMROUTE.equals(name)) {
node.setJvmRoute(value);
} else if (DOMAIN.equals(name)) {
node.setDomain(value);
} else if (HOST.equals(name)) {
node.setHostname(value);
} else if (PORT.equals(name)) {
node.setPort(Integer.parseInt(value));
} else if (TYPE.equals(name)) {
node.setType(value);
} else if (REVERSED.equals(name)) {
continue; // ignore
} else if (FLUSH_PACKET.equals(name)) {
if ("on".equalsIgnoreCase(value)) {
node.setFlushPackets(true);
} else if ("auto".equalsIgnoreCase(value)) {
node.setFlushPackets(true);
}
} else if (FLUSH_WAIT.equals(name)) {
node.setFlushwait(Integer.parseInt(value));
} else if (MCMPConstants.PING.equals(name)) {
node.setPing(Integer.parseInt(value));
} else if (SMAX.equals(name)) {
node.setSmax(Integer.parseInt(value));
} else if (TTL.equals(name)) {
node.setTtl(TimeUnit.SECONDS.toMillis(Long.parseLong(value)));
} else if (TIMEOUT.equals(name)) {
node.setTimeout(Integer.parseInt(value));
} else if (CONTEXT.equals(name)) {
final String[] context = value.split(",");
contexts = Arrays.asList(context);
} else if (ALIAS.equals(name)) {
final String[] alias = value.split(",");
hosts = Arrays.asList(alias);
} else if(WAITWORKER.equals(name)) {
node.setWaitWorker(Integer.parseInt(value));
} else {
processError(TYPESYNTAX, SBADFLD + name + SBADFLD1, exchange);
return;
}
}
final NodeConfig config;
try {
// Build the config
config = node.build();
if (container.addNode(config, balancer, exchange.getIoThread(), exchange.getConnection().getByteBufferPool())) {
// Apparently this is hard to do in the C part, so maybe we should just remove this
if (contexts != null && hosts != null) {
for (final String context : contexts) {
container.enableContext(context, config.getJvmRoute(), hosts);
}
}
processOK(exchange);
} else {
processError(MCMPErrorCode.NODE_STILL_EXISTS, exchange);
}
} catch (Exception e) {
processError(MCMPErrorCode.CANT_UPDATE_NODE, exchange);
}
} | class class_name[name] begin[{]
method[processConfig, return_type[void], modifier[private], parameter[exchange, requestData]] begin[{]
local_variable[type[List], hosts]
local_variable[type[List], contexts]
local_variable[type[Balancer], balancer]
local_variable[type[NodeConfig], node]
local_variable[type[Iterator], i]
while[call[i.hasNext, parameter[]]] begin[{]
local_variable[type[HttpString], name]
local_variable[type[String], value]
call[UndertowLogger.ROOT_LOGGER.mcmpKeyValue, parameter[member[.name], member[.value]]]
if[call[.checkString, parameter[member[.value]]]] begin[{]
call[.processError, parameter[member[.TYPESYNTAX], binary_operation[binary_operation[member[.SBADFLD], +, member[.name]], +, member[.SBADFLD1]], member[.exchange]]]
return[None]
else begin[{]
None
end[}]
if[call[BALANCER.equals, parameter[member[.name]]]] begin[{]
call[node.setBalancer, parameter[member[.value]]]
call[balancer.setName, parameter[member[.value]]]
else begin[{]
if[call[MAXATTEMPTS.equals, parameter[member[.name]]]] begin[{]
call[balancer.setMaxRetries, parameter[call[Integer.parseInt, parameter[member[.value]]]]]
else begin[{]
if[call[STICKYSESSION.equals, parameter[member[.name]]]] begin[{]
if[literal["No"]] begin[{]
call[balancer.setStickySession, parameter[literal[false]]]
else begin[{]
None
end[}]
else begin[{]
if[call[STICKYSESSIONCOOKIE.equals, parameter[member[.name]]]] begin[{]
call[balancer.setStickySessionCookie, parameter[member[.value]]]
else begin[{]
if[call[STICKYSESSIONPATH.equals, parameter[member[.name]]]] begin[{]
call[balancer.setStickySessionPath, parameter[member[.value]]]
else begin[{]
if[call[STICKYSESSIONREMOVE.equals, parameter[member[.name]]]] begin[{]
if[literal["Yes"]] begin[{]
call[balancer.setStickySessionRemove, parameter[literal[true]]]
else begin[{]
None
end[}]
else begin[{]
if[call[STICKYSESSIONFORCE.equals, parameter[member[.name]]]] begin[{]
if[literal["no"]] begin[{]
call[balancer.setStickySessionForce, parameter[literal[false]]]
else begin[{]
None
end[}]
else begin[{]
if[call[JVMROUTE.equals, parameter[member[.name]]]] begin[{]
call[node.setJvmRoute, parameter[member[.value]]]
else begin[{]
if[call[DOMAIN.equals, parameter[member[.name]]]] begin[{]
call[node.setDomain, parameter[member[.value]]]
else begin[{]
if[call[HOST.equals, parameter[member[.name]]]] begin[{]
call[node.setHostname, parameter[member[.value]]]
else begin[{]
if[call[PORT.equals, parameter[member[.name]]]] begin[{]
call[node.setPort, parameter[call[Integer.parseInt, parameter[member[.value]]]]]
else begin[{]
if[call[TYPE.equals, parameter[member[.name]]]] begin[{]
call[node.setType, parameter[member[.value]]]
else begin[{]
if[call[REVERSED.equals, parameter[member[.name]]]] begin[{]
ContinueStatement(goto=None, label=None)
else begin[{]
if[call[FLUSH_PACKET.equals, parameter[member[.name]]]] begin[{]
if[literal["on"]] begin[{]
call[node.setFlushPackets, parameter[literal[true]]]
else begin[{]
if[literal["auto"]] begin[{]
call[node.setFlushPackets, parameter[literal[true]]]
else begin[{]
None
end[}]
end[}]
else begin[{]
if[call[FLUSH_WAIT.equals, parameter[member[.name]]]] begin[{]
call[node.setFlushwait, parameter[call[Integer.parseInt, parameter[member[.value]]]]]
else begin[{]
if[call[MCMPConstants.PING.equals, parameter[member[.name]]]] begin[{]
call[node.setPing, parameter[call[Integer.parseInt, parameter[member[.value]]]]]
else begin[{]
if[call[SMAX.equals, parameter[member[.name]]]] begin[{]
call[node.setSmax, parameter[call[Integer.parseInt, parameter[member[.value]]]]]
else begin[{]
if[call[TTL.equals, parameter[member[.name]]]] begin[{]
call[node.setTtl, parameter[call[TimeUnit.SECONDS.toMillis, parameter[call[Long.parseLong, parameter[member[.value]]]]]]]
else begin[{]
if[call[TIMEOUT.equals, parameter[member[.name]]]] begin[{]
call[node.setTimeout, parameter[call[Integer.parseInt, parameter[member[.value]]]]]
else begin[{]
if[call[CONTEXT.equals, parameter[member[.name]]]] begin[{]
local_variable[type[String], context]
assign[member[.contexts], call[Arrays.asList, parameter[member[.context]]]]
else begin[{]
if[call[ALIAS.equals, parameter[member[.name]]]] begin[{]
local_variable[type[String], alias]
assign[member[.hosts], call[Arrays.asList, parameter[member[.alias]]]]
else begin[{]
if[call[WAITWORKER.equals, parameter[member[.name]]]] begin[{]
call[node.setWaitWorker, parameter[call[Integer.parseInt, parameter[member[.value]]]]]
else begin[{]
call[.processError, parameter[member[.TYPESYNTAX], binary_operation[binary_operation[member[.SBADFLD], +, member[.name]], +, member[.SBADFLD1]], member[.exchange]]]
return[None]
end[}]
end[}]
end[}]
end[}]
end[}]
end[}]
end[}]
end[}]
end[}]
end[}]
end[}]
end[}]
end[}]
end[}]
end[}]
end[}]
end[}]
end[}]
end[}]
end[}]
end[}]
end[}]
end[}]
local_variable[type[NodeConfig], config]
TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=config, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=build, postfix_operators=[], prefix_operators=[], qualifier=node, selectors=[], type_arguments=None)), label=None), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=config, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=balancer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getIoThread, postfix_operators=[], prefix_operators=[], qualifier=exchange, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getConnection, postfix_operators=[], prefix_operators=[], qualifier=exchange, selectors=[MethodInvocation(arguments=[], member=getByteBufferPool, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=addNode, postfix_operators=[], prefix_operators=[], qualifier=container, selectors=[], type_arguments=None), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=NODE_STILL_EXISTS, postfix_operators=[], prefix_operators=[], qualifier=MCMPErrorCode, selectors=[]), MemberReference(member=exchange, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=processError, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=contexts, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operandr=BinaryOperation(operandl=MemberReference(member=hosts, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=context, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getJvmRoute, postfix_operators=[], prefix_operators=[], qualifier=config, selectors=[], type_arguments=None), MemberReference(member=hosts, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=enableContext, postfix_operators=[], prefix_operators=[], qualifier=container, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=contexts, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=context)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=exchange, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=processOK, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]))], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=CANT_UPDATE_NODE, postfix_operators=[], prefix_operators=[], qualifier=MCMPErrorCode, selectors=[]), MemberReference(member=exchange, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=processError, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None)
end[}]
END[}] | Keyword[private] Keyword[void] identifier[processConfig] operator[SEP] Keyword[final] identifier[HttpServerExchange] identifier[exchange] , Keyword[final] identifier[RequestData] identifier[requestData] operator[SEP] {
identifier[List] operator[<] identifier[String] operator[>] identifier[hosts] operator[=] Other[null] operator[SEP] identifier[List] operator[<] identifier[String] operator[>] identifier[contexts] operator[=] Other[null] operator[SEP] Keyword[final] identifier[Balancer] operator[SEP] identifier[BalancerBuilder] identifier[balancer] operator[=] identifier[Balancer] operator[SEP] identifier[builder] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[NodeConfig] operator[SEP] identifier[NodeBuilder] identifier[node] operator[=] identifier[NodeConfig] operator[SEP] identifier[builder] operator[SEP] identifier[modCluster] operator[SEP] operator[SEP] Keyword[final] identifier[Iterator] operator[<] identifier[HttpString] operator[>] identifier[i] operator[=] identifier[requestData] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[i] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] {
Keyword[final] identifier[HttpString] identifier[name] operator[=] identifier[i] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[String] identifier[value] operator[=] identifier[requestData] operator[SEP] identifier[getFirst] operator[SEP] identifier[name] operator[SEP] operator[SEP] identifier[UndertowLogger] operator[SEP] identifier[ROOT_LOGGER] operator[SEP] identifier[mcmpKeyValue] operator[SEP] identifier[name] , identifier[value] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[checkString] operator[SEP] identifier[value] operator[SEP] operator[SEP] {
identifier[processError] operator[SEP] identifier[TYPESYNTAX] , identifier[SBADFLD] operator[+] identifier[name] operator[+] identifier[SBADFLD1] , identifier[exchange] operator[SEP] operator[SEP] Keyword[return] operator[SEP]
}
Keyword[if] operator[SEP] identifier[BALANCER] operator[SEP] identifier[equals] operator[SEP] identifier[name] operator[SEP] operator[SEP] {
identifier[node] operator[SEP] identifier[setBalancer] operator[SEP] identifier[value] operator[SEP] operator[SEP] identifier[balancer] operator[SEP] identifier[setName] operator[SEP] identifier[value] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[MAXATTEMPTS] operator[SEP] identifier[equals] operator[SEP] identifier[name] operator[SEP] operator[SEP] {
identifier[balancer] operator[SEP] identifier[setMaxRetries] operator[SEP] identifier[Integer] operator[SEP] identifier[parseInt] operator[SEP] identifier[value] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[STICKYSESSION] operator[SEP] identifier[equals] operator[SEP] identifier[name] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] literal[String] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] identifier[value] operator[SEP] operator[SEP] {
identifier[balancer] operator[SEP] identifier[setStickySession] operator[SEP] literal[boolean] operator[SEP] operator[SEP]
}
}
Keyword[else] Keyword[if] operator[SEP] identifier[STICKYSESSIONCOOKIE] operator[SEP] identifier[equals] operator[SEP] identifier[name] operator[SEP] operator[SEP] {
identifier[balancer] operator[SEP] identifier[setStickySessionCookie] operator[SEP] identifier[value] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[STICKYSESSIONPATH] operator[SEP] identifier[equals] operator[SEP] identifier[name] operator[SEP] operator[SEP] {
identifier[balancer] operator[SEP] identifier[setStickySessionPath] operator[SEP] identifier[value] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[STICKYSESSIONREMOVE] operator[SEP] identifier[equals] operator[SEP] identifier[name] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] literal[String] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] identifier[value] operator[SEP] operator[SEP] {
identifier[balancer] operator[SEP] identifier[setStickySessionRemove] operator[SEP] literal[boolean] operator[SEP] operator[SEP]
}
}
Keyword[else] Keyword[if] operator[SEP] identifier[STICKYSESSIONFORCE] operator[SEP] identifier[equals] operator[SEP] identifier[name] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] literal[String] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] identifier[value] operator[SEP] operator[SEP] {
identifier[balancer] operator[SEP] identifier[setStickySessionForce] operator[SEP] literal[boolean] operator[SEP] operator[SEP]
}
}
Keyword[else] Keyword[if] operator[SEP] identifier[JVMROUTE] operator[SEP] identifier[equals] operator[SEP] identifier[name] operator[SEP] operator[SEP] {
identifier[node] operator[SEP] identifier[setJvmRoute] operator[SEP] identifier[value] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[DOMAIN] operator[SEP] identifier[equals] operator[SEP] identifier[name] operator[SEP] operator[SEP] {
identifier[node] operator[SEP] identifier[setDomain] operator[SEP] identifier[value] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[HOST] operator[SEP] identifier[equals] operator[SEP] identifier[name] operator[SEP] operator[SEP] {
identifier[node] operator[SEP] identifier[setHostname] operator[SEP] identifier[value] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[PORT] operator[SEP] identifier[equals] operator[SEP] identifier[name] operator[SEP] operator[SEP] {
identifier[node] operator[SEP] identifier[setPort] operator[SEP] identifier[Integer] operator[SEP] identifier[parseInt] operator[SEP] identifier[value] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[TYPE] operator[SEP] identifier[equals] operator[SEP] identifier[name] operator[SEP] operator[SEP] {
identifier[node] operator[SEP] identifier[setType] operator[SEP] identifier[value] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[REVERSED] operator[SEP] identifier[equals] operator[SEP] identifier[name] operator[SEP] operator[SEP] {
Keyword[continue] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[FLUSH_PACKET] operator[SEP] identifier[equals] operator[SEP] identifier[name] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] literal[String] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] identifier[value] operator[SEP] operator[SEP] {
identifier[node] operator[SEP] identifier[setFlushPackets] operator[SEP] literal[boolean] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] literal[String] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] identifier[value] operator[SEP] operator[SEP] {
identifier[node] operator[SEP] identifier[setFlushPackets] operator[SEP] literal[boolean] operator[SEP] operator[SEP]
}
}
Keyword[else] Keyword[if] operator[SEP] identifier[FLUSH_WAIT] operator[SEP] identifier[equals] operator[SEP] identifier[name] operator[SEP] operator[SEP] {
identifier[node] operator[SEP] identifier[setFlushwait] operator[SEP] identifier[Integer] operator[SEP] identifier[parseInt] operator[SEP] identifier[value] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[MCMPConstants] operator[SEP] identifier[PING] operator[SEP] identifier[equals] operator[SEP] identifier[name] operator[SEP] operator[SEP] {
identifier[node] operator[SEP] identifier[setPing] operator[SEP] identifier[Integer] operator[SEP] identifier[parseInt] operator[SEP] identifier[value] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[SMAX] operator[SEP] identifier[equals] operator[SEP] identifier[name] operator[SEP] operator[SEP] {
identifier[node] operator[SEP] identifier[setSmax] operator[SEP] identifier[Integer] operator[SEP] identifier[parseInt] operator[SEP] identifier[value] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[TTL] operator[SEP] identifier[equals] operator[SEP] identifier[name] operator[SEP] operator[SEP] {
identifier[node] operator[SEP] identifier[setTtl] operator[SEP] identifier[TimeUnit] operator[SEP] identifier[SECONDS] operator[SEP] identifier[toMillis] operator[SEP] identifier[Long] operator[SEP] identifier[parseLong] operator[SEP] identifier[value] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[TIMEOUT] operator[SEP] identifier[equals] operator[SEP] identifier[name] operator[SEP] operator[SEP] {
identifier[node] operator[SEP] identifier[setTimeout] operator[SEP] identifier[Integer] operator[SEP] identifier[parseInt] operator[SEP] identifier[value] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[CONTEXT] operator[SEP] identifier[equals] operator[SEP] identifier[name] operator[SEP] operator[SEP] {
Keyword[final] identifier[String] operator[SEP] operator[SEP] identifier[context] operator[=] identifier[value] operator[SEP] identifier[split] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[contexts] operator[=] identifier[Arrays] operator[SEP] identifier[asList] operator[SEP] identifier[context] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[ALIAS] operator[SEP] identifier[equals] operator[SEP] identifier[name] operator[SEP] operator[SEP] {
Keyword[final] identifier[String] operator[SEP] operator[SEP] identifier[alias] operator[=] identifier[value] operator[SEP] identifier[split] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[hosts] operator[=] identifier[Arrays] operator[SEP] identifier[asList] operator[SEP] identifier[alias] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[WAITWORKER] operator[SEP] identifier[equals] operator[SEP] identifier[name] operator[SEP] operator[SEP] {
identifier[node] operator[SEP] identifier[setWaitWorker] operator[SEP] identifier[Integer] operator[SEP] identifier[parseInt] operator[SEP] identifier[value] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[processError] operator[SEP] identifier[TYPESYNTAX] , identifier[SBADFLD] operator[+] identifier[name] operator[+] identifier[SBADFLD1] , identifier[exchange] operator[SEP] operator[SEP] Keyword[return] operator[SEP]
}
}
Keyword[final] identifier[NodeConfig] identifier[config] operator[SEP] Keyword[try] {
identifier[config] operator[=] identifier[node] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[container] operator[SEP] identifier[addNode] operator[SEP] identifier[config] , identifier[balancer] , identifier[exchange] operator[SEP] identifier[getIoThread] operator[SEP] operator[SEP] , identifier[exchange] operator[SEP] identifier[getConnection] operator[SEP] operator[SEP] operator[SEP] identifier[getByteBufferPool] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[contexts] operator[!=] Other[null] operator[&&] identifier[hosts] operator[!=] Other[null] operator[SEP] {
Keyword[for] operator[SEP] Keyword[final] identifier[String] identifier[context] operator[:] identifier[contexts] operator[SEP] {
identifier[container] operator[SEP] identifier[enableContext] operator[SEP] identifier[context] , identifier[config] operator[SEP] identifier[getJvmRoute] operator[SEP] operator[SEP] , identifier[hosts] operator[SEP] operator[SEP]
}
}
identifier[processOK] operator[SEP] identifier[exchange] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[processError] operator[SEP] identifier[MCMPErrorCode] operator[SEP] identifier[NODE_STILL_EXISTS] , identifier[exchange] operator[SEP] operator[SEP]
}
}
Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] {
identifier[processError] operator[SEP] identifier[MCMPErrorCode] operator[SEP] identifier[CANT_UPDATE_NODE] , identifier[exchange] operator[SEP] operator[SEP]
}
}
|
public Notebook loadNotebook() throws EDAMUserException, EDAMSystemException, TException, EDAMNotFoundException {
if (mNotebookGuid == null) {
return null;
}
if (mLinked) {
LinkedNotebook linkedNotebook = NoteRefHelper.getLinkedNotebook(mNotebookGuid);
return NoteRefHelper.getSession().getEvernoteClientFactory().getLinkedNotebookHelper(linkedNotebook).getCorrespondingNotebook();
}
EvernoteNoteStoreClient noteStore = NoteRefHelper.getNoteStore(this);
if (noteStore == null) {
return null;
}
return noteStore.getNotebook(mNotebookGuid);
} | class class_name[name] begin[{]
method[loadNotebook, return_type[type[Notebook]], modifier[public], parameter[]] begin[{]
if[binary_operation[member[.mNotebookGuid], ==, literal[null]]] begin[{]
return[literal[null]]
else begin[{]
None
end[}]
if[member[.mLinked]] begin[{]
local_variable[type[LinkedNotebook], linkedNotebook]
return[call[NoteRefHelper.getSession, parameter[]]]
else begin[{]
None
end[}]
local_variable[type[EvernoteNoteStoreClient], noteStore]
if[binary_operation[member[.noteStore], ==, literal[null]]] begin[{]
return[literal[null]]
else begin[{]
None
end[}]
return[call[noteStore.getNotebook, parameter[member[.mNotebookGuid]]]]
end[}]
END[}] | Keyword[public] identifier[Notebook] identifier[loadNotebook] operator[SEP] operator[SEP] Keyword[throws] identifier[EDAMUserException] , identifier[EDAMSystemException] , identifier[TException] , identifier[EDAMNotFoundException] {
Keyword[if] operator[SEP] identifier[mNotebookGuid] operator[==] Other[null] operator[SEP] {
Keyword[return] Other[null] operator[SEP]
}
Keyword[if] operator[SEP] identifier[mLinked] operator[SEP] {
identifier[LinkedNotebook] identifier[linkedNotebook] operator[=] identifier[NoteRefHelper] operator[SEP] identifier[getLinkedNotebook] operator[SEP] identifier[mNotebookGuid] operator[SEP] operator[SEP] Keyword[return] identifier[NoteRefHelper] operator[SEP] identifier[getSession] operator[SEP] operator[SEP] operator[SEP] identifier[getEvernoteClientFactory] operator[SEP] operator[SEP] operator[SEP] identifier[getLinkedNotebookHelper] operator[SEP] identifier[linkedNotebook] operator[SEP] operator[SEP] identifier[getCorrespondingNotebook] operator[SEP] operator[SEP] operator[SEP]
}
identifier[EvernoteNoteStoreClient] identifier[noteStore] operator[=] identifier[NoteRefHelper] operator[SEP] identifier[getNoteStore] operator[SEP] Keyword[this] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[noteStore] operator[==] Other[null] operator[SEP] {
Keyword[return] Other[null] operator[SEP]
}
Keyword[return] identifier[noteStore] operator[SEP] identifier[getNotebook] operator[SEP] identifier[mNotebookGuid] operator[SEP] operator[SEP]
}
|
@SuppressWarnings({ "squid:S1166" })
private static UserDetails loadUserByUsername(final String username) {
final UserDetailsService userDetailsService = SpringContextHelper.getBean(UserDetailsService.class);
try {
return userDetailsService.loadUserByUsername(username);
} catch (final UsernameNotFoundException e) {
return new User(username, "", Collections.emptyList());
}
} | class class_name[name] begin[{]
method[loadUserByUsername, return_type[type[UserDetails]], modifier[private static], parameter[username]] begin[{]
local_variable[type[UserDetailsService], userDetailsService]
TryStatement(block=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=username, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=loadUserByUsername, postfix_operators=[], prefix_operators=[], qualifier=userDetailsService, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ReturnStatement(expression=ClassCreator(arguments=[MemberReference(member=username, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=""), MethodInvocation(arguments=[], member=emptyList, postfix_operators=[], prefix_operators=[], qualifier=Collections, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=User, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['UsernameNotFoundException']))], finally_block=None, label=None, resources=None)
end[}]
END[}] | annotation[@] identifier[SuppressWarnings] operator[SEP] {
literal[String]
} operator[SEP] Keyword[private] Keyword[static] identifier[UserDetails] identifier[loadUserByUsername] operator[SEP] Keyword[final] identifier[String] identifier[username] operator[SEP] {
Keyword[final] identifier[UserDetailsService] identifier[userDetailsService] operator[=] identifier[SpringContextHelper] operator[SEP] identifier[getBean] operator[SEP] identifier[UserDetailsService] operator[SEP] Keyword[class] operator[SEP] operator[SEP] Keyword[try] {
Keyword[return] identifier[userDetailsService] operator[SEP] identifier[loadUserByUsername] operator[SEP] identifier[username] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] Keyword[final] identifier[UsernameNotFoundException] identifier[e] operator[SEP] {
Keyword[return] Keyword[new] identifier[User] operator[SEP] identifier[username] , literal[String] , identifier[Collections] operator[SEP] identifier[emptyList] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
}
|
public Object execute(final Map<Object, Object> iArgs) {
final StringBuilder result = new StringBuilder();
if (optimizeEdges)
result.append(optimizeEdges());
return result.toString();
} | class class_name[name] begin[{]
method[execute, return_type[type[Object]], modifier[public], parameter[iArgs]] begin[{]
local_variable[type[StringBuilder], result]
if[member[.optimizeEdges]] begin[{]
call[result.append, parameter[call[.optimizeEdges, parameter[]]]]
else begin[{]
None
end[}]
return[call[result.toString, parameter[]]]
end[}]
END[}] | Keyword[public] identifier[Object] identifier[execute] operator[SEP] Keyword[final] identifier[Map] operator[<] identifier[Object] , identifier[Object] operator[>] identifier[iArgs] operator[SEP] {
Keyword[final] identifier[StringBuilder] identifier[result] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[optimizeEdges] operator[SEP] identifier[result] operator[SEP] identifier[append] operator[SEP] identifier[optimizeEdges] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[result] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP]
}
|
public static void enableProxy( String url, String port, String user, String pwd, String nonProxyHosts ) {
_url = url;
_port = port;
_user = user;
_pwd = pwd;
System.setProperty("http.proxyHost", url);
System.setProperty("https.proxyHost", url);
if (port != null && port.trim().length() != 0) {
System.setProperty("http.proxyPort", port);
System.setProperty("https.proxyPort", port);
}
if (user != null && pwd != null && user.trim().length() != 0 && pwd.trim().length() != 0) {
System.setProperty("http.proxyUserName", user);
System.setProperty("https.proxyUserName", user);
System.setProperty("http.proxyUser", user);
System.setProperty("https.proxyUser", user);
System.setProperty("http.proxyPassword", pwd);
System.setProperty("https.proxyPassword", pwd);
Authenticator.setDefault(new ProxyAuthenticator(user, pwd));
}
if (nonProxyHosts != null) {
System.setProperty("http.nonProxyHosts", nonProxyHosts);
}
hasProxy = true;
} | class class_name[name] begin[{]
method[enableProxy, return_type[void], modifier[public static], parameter[url, port, user, pwd, nonProxyHosts]] begin[{]
assign[member[._url], member[.url]]
assign[member[._port], member[.port]]
assign[member[._user], member[.user]]
assign[member[._pwd], member[.pwd]]
call[System.setProperty, parameter[literal["http.proxyHost"], member[.url]]]
call[System.setProperty, parameter[literal["https.proxyHost"], member[.url]]]
if[binary_operation[binary_operation[member[.port], !=, literal[null]], &&, binary_operation[call[port.trim, parameter[]], !=, literal[0]]]] begin[{]
call[System.setProperty, parameter[literal["http.proxyPort"], member[.port]]]
call[System.setProperty, parameter[literal["https.proxyPort"], member[.port]]]
else begin[{]
None
end[}]
if[binary_operation[binary_operation[binary_operation[binary_operation[member[.user], !=, literal[null]], &&, binary_operation[member[.pwd], !=, literal[null]]], &&, binary_operation[call[user.trim, parameter[]], !=, literal[0]]], &&, binary_operation[call[pwd.trim, parameter[]], !=, literal[0]]]] begin[{]
call[System.setProperty, parameter[literal["http.proxyUserName"], member[.user]]]
call[System.setProperty, parameter[literal["https.proxyUserName"], member[.user]]]
call[System.setProperty, parameter[literal["http.proxyUser"], member[.user]]]
call[System.setProperty, parameter[literal["https.proxyUser"], member[.user]]]
call[System.setProperty, parameter[literal["http.proxyPassword"], member[.pwd]]]
call[System.setProperty, parameter[literal["https.proxyPassword"], member[.pwd]]]
call[Authenticator.setDefault, parameter[ClassCreator(arguments=[MemberReference(member=user, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=pwd, 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=ProxyAuthenticator, sub_type=None))]]
else begin[{]
None
end[}]
if[binary_operation[member[.nonProxyHosts], !=, literal[null]]] begin[{]
call[System.setProperty, parameter[literal["http.nonProxyHosts"], member[.nonProxyHosts]]]
else begin[{]
None
end[}]
assign[member[.hasProxy], literal[true]]
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[void] identifier[enableProxy] operator[SEP] identifier[String] identifier[url] , identifier[String] identifier[port] , identifier[String] identifier[user] , identifier[String] identifier[pwd] , identifier[String] identifier[nonProxyHosts] operator[SEP] {
identifier[_url] operator[=] identifier[url] operator[SEP] identifier[_port] operator[=] identifier[port] operator[SEP] identifier[_user] operator[=] identifier[user] operator[SEP] identifier[_pwd] operator[=] identifier[pwd] operator[SEP] identifier[System] operator[SEP] identifier[setProperty] operator[SEP] literal[String] , identifier[url] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[setProperty] operator[SEP] literal[String] , identifier[url] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[port] operator[!=] Other[null] operator[&&] identifier[port] operator[SEP] identifier[trim] operator[SEP] operator[SEP] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[!=] Other[0] operator[SEP] {
identifier[System] operator[SEP] identifier[setProperty] operator[SEP] literal[String] , identifier[port] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[setProperty] operator[SEP] literal[String] , identifier[port] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[user] operator[!=] Other[null] operator[&&] identifier[pwd] operator[!=] Other[null] operator[&&] identifier[user] operator[SEP] identifier[trim] operator[SEP] operator[SEP] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[!=] Other[0] operator[&&] identifier[pwd] operator[SEP] identifier[trim] operator[SEP] operator[SEP] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[!=] Other[0] operator[SEP] {
identifier[System] operator[SEP] identifier[setProperty] operator[SEP] literal[String] , identifier[user] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[setProperty] operator[SEP] literal[String] , identifier[user] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[setProperty] operator[SEP] literal[String] , identifier[user] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[setProperty] operator[SEP] literal[String] , identifier[user] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[setProperty] operator[SEP] literal[String] , identifier[pwd] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[setProperty] operator[SEP] literal[String] , identifier[pwd] operator[SEP] operator[SEP] identifier[Authenticator] operator[SEP] identifier[setDefault] operator[SEP] Keyword[new] identifier[ProxyAuthenticator] operator[SEP] identifier[user] , identifier[pwd] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[nonProxyHosts] operator[!=] Other[null] operator[SEP] {
identifier[System] operator[SEP] identifier[setProperty] operator[SEP] literal[String] , identifier[nonProxyHosts] operator[SEP] operator[SEP]
}
identifier[hasProxy] operator[=] literal[boolean] operator[SEP]
}
|
public BaseField setupField(int iFieldSeq)
{
BaseField field = null;
if (iFieldSeq == 0)
field = new ClassProjectField(this, CLASS_PROJECT_ID, Constants.DEFAULT_FIELD_LENGTH, null, null);
if (iFieldSeq == 1)
field = new StringField(this, NAME, 10, null, null);
if (iFieldSeq == 2)
field = new StringField(this, PACKAGE, 20, null, null);
if (iFieldSeq == 3)
field = new BooleanField(this, INCLUDE_EMPTY_FILES, Constants.DEFAULT_FIELD_LENGTH, null, null);
if (field == null)
field = super.setupField(iFieldSeq);
return field;
} | class class_name[name] begin[{]
method[setupField, return_type[type[BaseField]], modifier[public], parameter[iFieldSeq]] begin[{]
local_variable[type[BaseField], field]
if[binary_operation[member[.iFieldSeq], ==, literal[0]]] begin[{]
assign[member[.field], ClassCreator(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), MemberReference(member=CLASS_PROJECT_ID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=DEFAULT_FIELD_LENGTH, postfix_operators=[], prefix_operators=[], qualifier=Constants, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ClassProjectField, sub_type=None))]
else begin[{]
None
end[}]
if[binary_operation[member[.iFieldSeq], ==, literal[1]]] begin[{]
assign[member[.field], ClassCreator(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), MemberReference(member=NAME, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=10), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=StringField, sub_type=None))]
else begin[{]
None
end[}]
if[binary_operation[member[.iFieldSeq], ==, literal[2]]] begin[{]
assign[member[.field], ClassCreator(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), MemberReference(member=PACKAGE, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=20), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=StringField, sub_type=None))]
else begin[{]
None
end[}]
if[binary_operation[member[.iFieldSeq], ==, literal[3]]] begin[{]
assign[member[.field], ClassCreator(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), MemberReference(member=INCLUDE_EMPTY_FILES, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=DEFAULT_FIELD_LENGTH, postfix_operators=[], prefix_operators=[], qualifier=Constants, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=BooleanField, sub_type=None))]
else begin[{]
None
end[}]
if[binary_operation[member[.field], ==, literal[null]]] begin[{]
assign[member[.field], SuperMethodInvocation(arguments=[MemberReference(member=iFieldSeq, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setupField, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None)]
else begin[{]
None
end[}]
return[member[.field]]
end[}]
END[}] | Keyword[public] identifier[BaseField] identifier[setupField] operator[SEP] Keyword[int] identifier[iFieldSeq] operator[SEP] {
identifier[BaseField] identifier[field] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[iFieldSeq] operator[==] Other[0] operator[SEP] identifier[field] operator[=] Keyword[new] identifier[ClassProjectField] operator[SEP] Keyword[this] , identifier[CLASS_PROJECT_ID] , identifier[Constants] operator[SEP] identifier[DEFAULT_FIELD_LENGTH] , Other[null] , Other[null] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[iFieldSeq] operator[==] Other[1] operator[SEP] identifier[field] operator[=] Keyword[new] identifier[StringField] operator[SEP] Keyword[this] , identifier[NAME] , Other[10] , Other[null] , Other[null] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[iFieldSeq] operator[==] Other[2] operator[SEP] identifier[field] operator[=] Keyword[new] identifier[StringField] operator[SEP] Keyword[this] , identifier[PACKAGE] , Other[20] , Other[null] , Other[null] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[iFieldSeq] operator[==] Other[3] operator[SEP] identifier[field] operator[=] Keyword[new] identifier[BooleanField] operator[SEP] Keyword[this] , identifier[INCLUDE_EMPTY_FILES] , identifier[Constants] operator[SEP] identifier[DEFAULT_FIELD_LENGTH] , Other[null] , Other[null] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[field] operator[==] Other[null] operator[SEP] identifier[field] operator[=] Keyword[super] operator[SEP] identifier[setupField] operator[SEP] identifier[iFieldSeq] operator[SEP] operator[SEP] Keyword[return] identifier[field] operator[SEP]
}
|
@Override
public void removeCallback(Callback callback) {
callbacks.remove(callback);
if (manager != null) {
callback.cleanup();
}
} | class class_name[name] begin[{]
method[removeCallback, return_type[void], modifier[public], parameter[callback]] begin[{]
call[callbacks.remove, parameter[member[.callback]]]
if[binary_operation[member[.manager], !=, literal[null]]] begin[{]
call[callback.cleanup, parameter[]]
else begin[{]
None
end[}]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[removeCallback] operator[SEP] identifier[Callback] identifier[callback] operator[SEP] {
identifier[callbacks] operator[SEP] identifier[remove] operator[SEP] identifier[callback] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[manager] operator[!=] Other[null] operator[SEP] {
identifier[callback] operator[SEP] identifier[cleanup] operator[SEP] operator[SEP] operator[SEP]
}
}
|
public int getDataSize() {
// Data size is given by lvs
int size = 0;
for(int i=0; i<numLVs; i++) {
size += IOUtils.toInt(lvs[i]);
}
return size;
} | class class_name[name] begin[{]
method[getDataSize, return_type[type[int]], modifier[public], parameter[]] begin[{]
local_variable[type[int], size]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=size, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=MethodInvocation(arguments=[MemberReference(member=lvs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])], member=toInt, postfix_operators=[], prefix_operators=[], qualifier=IOUtils, selectors=[], type_arguments=None)), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=numLVs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
return[member[.size]]
end[}]
END[}] | Keyword[public] Keyword[int] identifier[getDataSize] operator[SEP] operator[SEP] {
Keyword[int] identifier[size] operator[=] Other[0] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[numLVs] operator[SEP] identifier[i] operator[++] operator[SEP] {
identifier[size] operator[+=] identifier[IOUtils] operator[SEP] identifier[toInt] operator[SEP] identifier[lvs] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] identifier[size] operator[SEP]
}
|
public int indexs(final Integer fromIndex, String... indexWith) {
int index = INDEX_NONE_EXISTS;
final String target = ignoreCase ? delegate.get().toLowerCase() : delegate.get();
for (String input : indexWith) {
String target2 = ignoreCase ? input.toLowerCase() : input;
if ((index = target.indexOf(target2, fromIndex)) >= 0) {
return index;
}
}
return index;
} | class class_name[name] begin[{]
method[indexs, return_type[type[int]], modifier[public], parameter[fromIndex, indexWith]] begin[{]
local_variable[type[int], index]
local_variable[type[String], target]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=TernaryExpression(condition=MemberReference(member=ignoreCase, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_false=MemberReference(member=input, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_true=MethodInvocation(arguments=[], member=toLowerCase, postfix_operators=[], prefix_operators=[], qualifier=input, selectors=[], type_arguments=None)), name=target2)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=Assignment(expressionl=MemberReference(member=index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=target2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=fromIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=indexOf, postfix_operators=[], prefix_operators=[], qualifier=target, 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=[ReturnStatement(expression=MemberReference(member=index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=indexWith, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=input)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None)
return[member[.index]]
end[}]
END[}] | Keyword[public] Keyword[int] identifier[indexs] operator[SEP] Keyword[final] identifier[Integer] identifier[fromIndex] , identifier[String] operator[...] identifier[indexWith] operator[SEP] {
Keyword[int] identifier[index] operator[=] identifier[INDEX_NONE_EXISTS] operator[SEP] Keyword[final] identifier[String] identifier[target] operator[=] identifier[ignoreCase] operator[?] identifier[delegate] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[toLowerCase] operator[SEP] operator[SEP] operator[:] identifier[delegate] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[String] identifier[input] operator[:] identifier[indexWith] operator[SEP] {
identifier[String] identifier[target2] operator[=] identifier[ignoreCase] operator[?] identifier[input] operator[SEP] identifier[toLowerCase] operator[SEP] operator[SEP] operator[:] identifier[input] operator[SEP] Keyword[if] operator[SEP] operator[SEP] identifier[index] operator[=] identifier[target] operator[SEP] identifier[indexOf] operator[SEP] identifier[target2] , identifier[fromIndex] operator[SEP] operator[SEP] operator[>=] Other[0] operator[SEP] {
Keyword[return] identifier[index] operator[SEP]
}
}
Keyword[return] identifier[index] operator[SEP]
}
|
public void addAllIfNotExist(Properties properties) {
for (String key : properties.stringPropertyNames()) {
if (!this.specProperties.containsKey(key) && !this.commonProperties.containsKey(key)) {
this.specProperties.setProperty(key, properties.getProperty(key));
}
}
} | class class_name[name] begin[{]
method[addAllIfNotExist, return_type[void], modifier[public], parameter[properties]] begin[{]
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=This(postfix_operators=[], prefix_operators=['!'], qualifier=None, selectors=[MemberReference(member=specProperties, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=containsKey, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), operandr=This(postfix_operators=[], prefix_operators=['!'], qualifier=None, selectors=[MemberReference(member=commonProperties, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=containsKey, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=specProperties, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getProperty, postfix_operators=[], prefix_operators=[], qualifier=properties, selectors=[], type_arguments=None)], member=setProperty, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=stringPropertyNames, postfix_operators=[], prefix_operators=[], qualifier=properties, selectors=[], type_arguments=None), 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)
end[}]
END[}] | Keyword[public] Keyword[void] identifier[addAllIfNotExist] operator[SEP] identifier[Properties] identifier[properties] operator[SEP] {
Keyword[for] operator[SEP] identifier[String] identifier[key] operator[:] identifier[properties] operator[SEP] identifier[stringPropertyNames] operator[SEP] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] operator[!] Keyword[this] operator[SEP] identifier[specProperties] operator[SEP] identifier[containsKey] operator[SEP] identifier[key] operator[SEP] operator[&&] operator[!] Keyword[this] operator[SEP] identifier[commonProperties] operator[SEP] identifier[containsKey] operator[SEP] identifier[key] operator[SEP] operator[SEP] {
Keyword[this] operator[SEP] identifier[specProperties] operator[SEP] identifier[setProperty] operator[SEP] identifier[key] , identifier[properties] operator[SEP] identifier[getProperty] operator[SEP] identifier[key] operator[SEP] operator[SEP] operator[SEP]
}
}
}
|
public static void apply(Activity activity, int viewId, Face type){
TextView text = (TextView) activity.findViewById(viewId);
if(text != null)
apply(text, type);
} | class class_name[name] begin[{]
method[apply, return_type[void], modifier[public static], parameter[activity, viewId, type]] begin[{]
local_variable[type[TextView], text]
if[binary_operation[member[.text], !=, literal[null]]] begin[{]
call[.apply, parameter[member[.text], member[.type]]]
else begin[{]
None
end[}]
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[void] identifier[apply] operator[SEP] identifier[Activity] identifier[activity] , Keyword[int] identifier[viewId] , identifier[Face] identifier[type] operator[SEP] {
identifier[TextView] identifier[text] operator[=] operator[SEP] identifier[TextView] operator[SEP] identifier[activity] operator[SEP] identifier[findViewById] operator[SEP] identifier[viewId] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[text] operator[!=] Other[null] operator[SEP] identifier[apply] operator[SEP] identifier[text] , identifier[type] operator[SEP] operator[SEP]
}
|
public static String renameSuffix(String path, String suffix) {
int pos = path.length();
for (--pos; pos > 0; pos--) {
if (path.charAt(pos) == '.')
break;
if (path.charAt(pos) == '/' || path.charAt(pos) == '\\') {
pos = -1;
break;
}
}
if (0 >= pos)
return path + suffix;
return path.substring(0, pos) + suffix;
} | class class_name[name] begin[{]
method[renameSuffix, return_type[type[String]], modifier[public static], parameter[path, suffix]] begin[{]
local_variable[type[int], pos]
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=pos, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=charAt, postfix_operators=[], prefix_operators=[], qualifier=path, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='.'), operator===), else_statement=None, label=None, then_statement=BreakStatement(goto=None, label=None)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=pos, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=charAt, postfix_operators=[], prefix_operators=[], qualifier=path, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='/'), operator===), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=pos, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=charAt, postfix_operators=[], prefix_operators=[], qualifier=path, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='\\'), operator===), operator=||), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=pos, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=1)), label=None), BreakStatement(goto=None, label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=pos, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>), init=[MemberReference(member=pos, postfix_operators=[], prefix_operators=['--'], qualifier=, selectors=[])], update=[MemberReference(member=pos, postfix_operators=['--'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
if[binary_operation[literal[0], >=, member[.pos]]] begin[{]
return[binary_operation[member[.path], +, member[.suffix]]]
else begin[{]
None
end[}]
return[binary_operation[call[path.substring, parameter[literal[0], member[.pos]]], +, member[.suffix]]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[String] identifier[renameSuffix] operator[SEP] identifier[String] identifier[path] , identifier[String] identifier[suffix] operator[SEP] {
Keyword[int] identifier[pos] operator[=] identifier[path] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] operator[--] identifier[pos] operator[SEP] identifier[pos] operator[>] Other[0] operator[SEP] identifier[pos] operator[--] operator[SEP] {
Keyword[if] operator[SEP] identifier[path] operator[SEP] identifier[charAt] operator[SEP] identifier[pos] operator[SEP] operator[==] literal[String] operator[SEP] Keyword[break] operator[SEP] Keyword[if] operator[SEP] identifier[path] operator[SEP] identifier[charAt] operator[SEP] identifier[pos] operator[SEP] operator[==] literal[String] operator[||] identifier[path] operator[SEP] identifier[charAt] operator[SEP] identifier[pos] operator[SEP] operator[==] literal[String] operator[SEP] {
identifier[pos] operator[=] operator[-] Other[1] operator[SEP] Keyword[break] operator[SEP]
}
}
Keyword[if] operator[SEP] Other[0] operator[>=] identifier[pos] operator[SEP] Keyword[return] identifier[path] operator[+] identifier[suffix] operator[SEP] Keyword[return] identifier[path] operator[SEP] identifier[substring] operator[SEP] Other[0] , identifier[pos] operator[SEP] operator[+] identifier[suffix] operator[SEP]
}
|
public void resetIndex(long index, long timestamp) {
currentOperation = OperationType.COMMAND;
operationIndex = index;
currentIndex = index;
currentTimestamp = timestamp;
setCommitIndex(index);
service.tick(new WallClockTimestamp(currentTimestamp));
} | class class_name[name] begin[{]
method[resetIndex, return_type[void], modifier[public], parameter[index, timestamp]] begin[{]
assign[member[.currentOperation], member[OperationType.COMMAND]]
assign[member[.operationIndex], member[.index]]
assign[member[.currentIndex], member[.index]]
assign[member[.currentTimestamp], member[.timestamp]]
call[.setCommitIndex, parameter[member[.index]]]
call[service.tick, parameter[ClassCreator(arguments=[MemberReference(member=currentTimestamp, 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=WallClockTimestamp, sub_type=None))]]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[resetIndex] operator[SEP] Keyword[long] identifier[index] , Keyword[long] identifier[timestamp] operator[SEP] {
identifier[currentOperation] operator[=] identifier[OperationType] operator[SEP] identifier[COMMAND] operator[SEP] identifier[operationIndex] operator[=] identifier[index] operator[SEP] identifier[currentIndex] operator[=] identifier[index] operator[SEP] identifier[currentTimestamp] operator[=] identifier[timestamp] operator[SEP] identifier[setCommitIndex] operator[SEP] identifier[index] operator[SEP] operator[SEP] identifier[service] operator[SEP] identifier[tick] operator[SEP] Keyword[new] identifier[WallClockTimestamp] operator[SEP] identifier[currentTimestamp] operator[SEP] operator[SEP] operator[SEP]
}
|
public static StringBuilder createQueryStringFromMap(Map m, String ampersand) {
StringBuilder aReturn = new StringBuilder("");
Set aEntryS = m.entrySet();
Iterator aEntryI = aEntryS.iterator();
while (aEntryI.hasNext()) {
Map.Entry aEntry = (Map.Entry) aEntryI.next();
Object o = aEntry.getValue();
if (o == null) {
append(aEntry.getKey(), "", aReturn, ampersand);
} else if (o instanceof String) {
append(aEntry.getKey(), o, aReturn, ampersand);
} else if (o instanceof String[]) {
String[] aValues = (String[]) o;
for (int i = 0; i < aValues.length; i++) {
append(aEntry.getKey(), aValues[i], aReturn, ampersand);
}
} else {
append(aEntry.getKey(), o, aReturn, ampersand);
}
}
return aReturn;
} | class class_name[name] begin[{]
method[createQueryStringFromMap, return_type[type[StringBuilder]], modifier[public static], parameter[m, ampersand]] begin[{]
local_variable[type[StringBuilder], aReturn]
local_variable[type[Set], aEntryS]
local_variable[type[Iterator], aEntryI]
while[call[aEntryI.hasNext, parameter[]]] begin[{]
local_variable[type[Map], aEntry]
local_variable[type[Object], o]
if[binary_operation[member[.o], ==, literal[null]]] begin[{]
call[.append, parameter[call[aEntry.getKey, parameter[]], literal[""], member[.aReturn], member[.ampersand]]]
else begin[{]
if[binary_operation[member[.o], instanceof, type[String]]] begin[{]
call[.append, parameter[call[aEntry.getKey, parameter[]], member[.o], member[.aReturn], member[.ampersand]]]
else begin[{]
if[binary_operation[member[.o], instanceof, type[String]]] begin[{]
local_variable[type[String], aValues]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getKey, postfix_operators=[], prefix_operators=[], qualifier=aEntry, selectors=[], type_arguments=None), MemberReference(member=aValues, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), MemberReference(member=aReturn, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=ampersand, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=append, 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=aValues, 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)
else begin[{]
call[.append, parameter[call[aEntry.getKey, parameter[]], member[.o], member[.aReturn], member[.ampersand]]]
end[}]
end[}]
end[}]
end[}]
return[member[.aReturn]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[StringBuilder] identifier[createQueryStringFromMap] operator[SEP] identifier[Map] identifier[m] , identifier[String] identifier[ampersand] operator[SEP] {
identifier[StringBuilder] identifier[aReturn] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[Set] identifier[aEntryS] operator[=] identifier[m] operator[SEP] identifier[entrySet] operator[SEP] operator[SEP] operator[SEP] identifier[Iterator] identifier[aEntryI] operator[=] identifier[aEntryS] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[aEntryI] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] {
identifier[Map] operator[SEP] identifier[Entry] identifier[aEntry] operator[=] operator[SEP] identifier[Map] operator[SEP] identifier[Entry] operator[SEP] identifier[aEntryI] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] identifier[Object] identifier[o] operator[=] identifier[aEntry] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[o] operator[==] Other[null] operator[SEP] {
identifier[append] operator[SEP] identifier[aEntry] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] , literal[String] , identifier[aReturn] , identifier[ampersand] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[o] Keyword[instanceof] identifier[String] operator[SEP] {
identifier[append] operator[SEP] identifier[aEntry] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] , identifier[o] , identifier[aReturn] , identifier[ampersand] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[o] Keyword[instanceof] identifier[String] operator[SEP] operator[SEP] operator[SEP] {
identifier[String] operator[SEP] operator[SEP] identifier[aValues] operator[=] operator[SEP] identifier[String] operator[SEP] operator[SEP] operator[SEP] identifier[o] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[aValues] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] {
identifier[append] operator[SEP] identifier[aEntry] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] , identifier[aValues] operator[SEP] identifier[i] operator[SEP] , identifier[aReturn] , identifier[ampersand] operator[SEP] operator[SEP]
}
}
Keyword[else] {
identifier[append] operator[SEP] identifier[aEntry] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] , identifier[o] , identifier[aReturn] , identifier[ampersand] operator[SEP] operator[SEP]
}
}
Keyword[return] identifier[aReturn] operator[SEP]
}
|
private boolean applyCorsConfig(final HttpRequest req, final AbstractHttpQuery query)
throws BadRequestException {
final String domain = req.headers().get("Origin");
// catch CORS requests and add the header or refuse them if the domain
// list has been configured
if (query.method() == HttpMethod.OPTIONS ||
(cors_domains != null && domain != null && !domain.isEmpty())) {
if (cors_domains == null || domain == null || domain.isEmpty()) {
throw new BadRequestException(HttpResponseStatus.METHOD_NOT_ALLOWED,
"Method not allowed", "The HTTP method [" +
query.method().getName() + "] is not permitted");
}
if (cors_domains.contains("*") ||
cors_domains.contains(domain.toUpperCase())) {
// when a domain has matched successfully, we need to add the header
query.response().headers().add(HttpHeaders.ACCESS_CONTROL_ALLOW_ORIGIN,
domain);
query.response().headers().add(HttpHeaders.ACCESS_CONTROL_ALLOW_METHODS,
"GET, POST, PUT, DELETE");
query.response().headers().add(HttpHeaders.ACCESS_CONTROL_ALLOW_HEADERS,
cors_headers);
// if the method requested was for OPTIONS then we'll return an OK
// here and no further processing is needed.
if (query.method() == HttpMethod.OPTIONS) {
query.sendStatusOnly(HttpResponseStatus.OK);
return true;
}
} else {
// You'd think that they would want the server to return a 403 if
// the Origin wasn't in the CORS domain list, but they want a 200
// without the allow origin header. We'll return an error in the
// body though.
throw new BadRequestException(HttpResponseStatus.OK,
"CORS domain not allowed", "The domain [" + domain +
"] is not permitted access");
}
}
return false;
} | class class_name[name] begin[{]
method[applyCorsConfig, return_type[type[boolean]], modifier[private], parameter[req, query]] begin[{]
local_variable[type[String], domain]
if[binary_operation[binary_operation[call[query.method, parameter[]], ==, member[HttpMethod.OPTIONS]], ||, binary_operation[binary_operation[binary_operation[member[.cors_domains], !=, literal[null]], &&, binary_operation[member[.domain], !=, literal[null]]], &&, call[domain.isEmpty, parameter[]]]]] begin[{]
if[binary_operation[binary_operation[binary_operation[member[.cors_domains], ==, literal[null]], ||, binary_operation[member[.domain], ==, literal[null]]], ||, call[domain.isEmpty, parameter[]]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=METHOD_NOT_ALLOWED, postfix_operators=[], prefix_operators=[], qualifier=HttpResponseStatus, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Method not allowed"), BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="The HTTP method ["), operandr=MethodInvocation(arguments=[], member=method, postfix_operators=[], prefix_operators=[], qualifier=query, 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="] is not permitted"), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=BadRequestException, sub_type=None)), label=None)
else begin[{]
None
end[}]
if[binary_operation[call[cors_domains.contains, parameter[literal["*"]]], ||, call[cors_domains.contains, parameter[call[domain.toUpperCase, parameter[]]]]]] begin[{]
call[query.response, parameter[]]
call[query.response, parameter[]]
call[query.response, parameter[]]
if[binary_operation[call[query.method, parameter[]], ==, member[HttpMethod.OPTIONS]]] begin[{]
call[query.sendStatusOnly, parameter[member[HttpResponseStatus.OK]]]
return[literal[true]]
else begin[{]
None
end[}]
else begin[{]
ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=OK, postfix_operators=[], prefix_operators=[], qualifier=HttpResponseStatus, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="CORS domain not allowed"), BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="The domain ["), operandr=MemberReference(member=domain, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="] is not permitted access"), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=BadRequestException, sub_type=None)), label=None)
end[}]
else begin[{]
None
end[}]
return[literal[false]]
end[}]
END[}] | Keyword[private] Keyword[boolean] identifier[applyCorsConfig] operator[SEP] Keyword[final] identifier[HttpRequest] identifier[req] , Keyword[final] identifier[AbstractHttpQuery] identifier[query] operator[SEP] Keyword[throws] identifier[BadRequestException] {
Keyword[final] identifier[String] identifier[domain] operator[=] identifier[req] operator[SEP] identifier[headers] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[query] operator[SEP] identifier[method] operator[SEP] operator[SEP] operator[==] identifier[HttpMethod] operator[SEP] identifier[OPTIONS] operator[||] operator[SEP] identifier[cors_domains] operator[!=] Other[null] operator[&&] identifier[domain] operator[!=] Other[null] operator[&&] operator[!] identifier[domain] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[cors_domains] operator[==] Other[null] operator[||] identifier[domain] operator[==] Other[null] operator[||] identifier[domain] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] {
Keyword[throw] Keyword[new] identifier[BadRequestException] operator[SEP] identifier[HttpResponseStatus] operator[SEP] identifier[METHOD_NOT_ALLOWED] , literal[String] , literal[String] operator[+] identifier[query] operator[SEP] identifier[method] operator[SEP] operator[SEP] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[cors_domains] operator[SEP] identifier[contains] operator[SEP] literal[String] operator[SEP] operator[||] identifier[cors_domains] operator[SEP] identifier[contains] operator[SEP] identifier[domain] operator[SEP] identifier[toUpperCase] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
identifier[query] operator[SEP] identifier[response] operator[SEP] operator[SEP] operator[SEP] identifier[headers] operator[SEP] operator[SEP] operator[SEP] identifier[add] operator[SEP] identifier[HttpHeaders] operator[SEP] identifier[ACCESS_CONTROL_ALLOW_ORIGIN] , identifier[domain] operator[SEP] operator[SEP] identifier[query] operator[SEP] identifier[response] operator[SEP] operator[SEP] operator[SEP] identifier[headers] operator[SEP] operator[SEP] operator[SEP] identifier[add] operator[SEP] identifier[HttpHeaders] operator[SEP] identifier[ACCESS_CONTROL_ALLOW_METHODS] , literal[String] operator[SEP] operator[SEP] identifier[query] operator[SEP] identifier[response] operator[SEP] operator[SEP] operator[SEP] identifier[headers] operator[SEP] operator[SEP] operator[SEP] identifier[add] operator[SEP] identifier[HttpHeaders] operator[SEP] identifier[ACCESS_CONTROL_ALLOW_HEADERS] , identifier[cors_headers] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[query] operator[SEP] identifier[method] operator[SEP] operator[SEP] operator[==] identifier[HttpMethod] operator[SEP] identifier[OPTIONS] operator[SEP] {
identifier[query] operator[SEP] identifier[sendStatusOnly] operator[SEP] identifier[HttpResponseStatus] operator[SEP] identifier[OK] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP]
}
}
Keyword[else] {
Keyword[throw] Keyword[new] identifier[BadRequestException] operator[SEP] identifier[HttpResponseStatus] operator[SEP] identifier[OK] , literal[String] , literal[String] operator[+] identifier[domain] operator[+] literal[String] operator[SEP] operator[SEP]
}
}
Keyword[return] literal[boolean] operator[SEP]
}
|
private void returnDocumentBuilderToPool(DocumentBuilder db) {
try {
db.reset();
documentBuilderPool.offerFirst(db);
} catch (UnsupportedOperationException e) {
// document builders that don't support reset() can't be pooled
}
} | class class_name[name] begin[{]
method[returnDocumentBuilderToPool, return_type[void], modifier[private], parameter[db]] begin[{]
TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=reset, postfix_operators=[], prefix_operators=[], qualifier=db, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=db, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=offerFirst, postfix_operators=[], prefix_operators=[], qualifier=documentBuilderPool, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['UnsupportedOperationException']))], finally_block=None, label=None, resources=None)
end[}]
END[}] | Keyword[private] Keyword[void] identifier[returnDocumentBuilderToPool] operator[SEP] identifier[DocumentBuilder] identifier[db] operator[SEP] {
Keyword[try] {
identifier[db] operator[SEP] identifier[reset] operator[SEP] operator[SEP] operator[SEP] identifier[documentBuilderPool] operator[SEP] identifier[offerFirst] operator[SEP] identifier[db] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[UnsupportedOperationException] identifier[e] operator[SEP] {
}
}
|
static void rcvSendToExceptionDest(CommsServerByteBuffer request,
Conversation conversation,
int requestNumber,
boolean allocatedFromBufferPool,
boolean partOfExchange)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "rcvSendToExceptionDest",
new Object[]
{
request,
conversation,
""+requestNumber,
""+allocatedFromBufferPool,
""+partOfExchange
});
ServerLinkLevelState linkState = (ServerLinkLevelState) conversation.getLinkLevelAttachment();
ConversationState convState = (ConversationState) conversation.getAttachment();
final boolean optimizedTx = CommsUtils.requiresOptimizedTransaction(conversation);
try
{
/**************************************************************/
/* Connection object id */
/**************************************************************/
short connectionObjId = request.getShort();
/**************************************************************/
/* Transaction id */
/**************************************************************/
int txId = request.getSITransactionId(connectionObjId, linkState, optimizedTx);
/**************************************************************/
/* Destination address */
/**************************************************************/
SIDestinationAddress destAddr = request.getSIDestinationAddress(conversation.getHandshakeProperties().getFapLevel());
/**************************************************************/
/* Reason code */
/**************************************************************/
int reason = request.getInt();
/**************************************************************/
/* Alternate user */
/**************************************************************/
String alternateUser = request.getString();
/**************************************************************/
/* JMO Message length */
/**************************************************************/
int messageLength = (int) request.peekLong();
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
{
SibTr.debug(tc, "ConnectionObjectId", ""+connectionObjId);
SibTr.debug(tc, "DestinationAddress", destAddr);
SibTr.debug(tc, "Reason", ""+reason);
SibTr.debug(tc, "TransactionId", ""+txId);
SibTr.debug(tc, "MessageLength", ""+messageLength);
SibTr.debug(tc, "AlternateUser", alternateUser);
}
// Now decode the JMO
SIBusMessage jsMessage = request.getMessage(null);
// Now grab all the inserts
String[] inserts = null;
int numberOfInserts = request.getShort();
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(tc, "Number of inserts", ""+numberOfInserts);
if (numberOfInserts != 0)
{
inserts = new String[numberOfInserts];
for (int x = 0; x < numberOfInserts; x++)
{
inserts[x] = request.getString();
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(tc, "Insert[" + x + "] = " + inserts[x]);
}
}
// Get the transaction
SITransaction tran = linkState.getTransactionTable().get(txId);
// Get the SICoreConnection
SICoreConnection connection =
((CATConnection) convState.getObject(connectionObjId)).getSICoreConnection();
// Now call the core SPI method
if (tran != IdToTransactionTable.INVALID_TRANSACTION)
{
connection.sendToExceptionDestination(destAddr,
jsMessage,
reason,
inserts,
tran,
alternateUser);
}
try
{
conversation.send(poolManager.allocate(),
JFapChannelConstants.SEG_SEND_TO_EXCEPTION_DESTINATION_R,
requestNumber,
JFapChannelConstants.PRIORITY_MEDIUM,
true,
ThrottlingPolicy.BLOCK_THREAD,
null);
}
catch (SIException e)
{
FFDCFilter.processException(e,
CLASS_NAME + ".rcvSendToExceptionDest",
CommsConstants.STATICCATDESTINATION_SENDTOEXCEP_01);
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(tc, e.getMessage(), e);
SibTr.error(tc, "COMMUNICATION_ERROR_SICO2022", e);
}
}
catch (SINotAuthorizedException e)
{
// No FFDC Code Needed
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(tc, e.getMessage(), e);
StaticCATHelper.sendExceptionToClient(e,
null,
conversation, requestNumber);
}
catch (SIException e)
{
//No FFDC code needed
//Only FFDC if we haven't received a meTerminated event.
if(!convState.hasMETerminated())
{
FFDCFilter.processException(e,
CLASS_NAME + ".rcvSendToExceptionDest",
CommsConstants.STATICCATDESTINATION_SENDTOEXCEP_02);
}
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(tc, e.getMessage(), e);
StaticCATHelper.sendExceptionToClient(e,
CommsConstants.STATICCATDESTINATION_SENDTOEXCEP_02,
conversation, requestNumber);
}
catch (Exception e)
{
FFDCFilter.processException(e,
CLASS_NAME + ".rcvSendToExceptionDest",
CommsConstants.STATICCATDESTINATION_SENDTOEXCEP_03);
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(tc, e.getMessage(), e);
StaticCATHelper.sendExceptionToClient(e,
CommsConstants.STATICCATDESTINATION_SENDTOEXCEP_03,
conversation, requestNumber);
}
if (allocatedFromBufferPool) request.release();
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "rcvSendToExceptionDest");
} | class class_name[name] begin[{]
method[rcvSendToExceptionDest, return_type[void], modifier[static], parameter[request, conversation, requestNumber, allocatedFromBufferPool, partOfExchange]] begin[{]
if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{]
call[SibTr.entry, parameter[member[.tc], literal["rcvSendToExceptionDest"], ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MemberReference(member=request, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=conversation, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=""), operandr=MemberReference(member=requestNumber, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=""), operandr=MemberReference(member=allocatedFromBufferPool, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=""), operandr=MemberReference(member=partOfExchange, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Object, sub_type=None))]]
else begin[{]
None
end[}]
local_variable[type[ServerLinkLevelState], linkState]
local_variable[type[ConversationState], convState]
local_variable[type[boolean], optimizedTx]
TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getShort, postfix_operators=[], prefix_operators=[], qualifier=request, selectors=[], type_arguments=None), name=connectionObjId)], modifiers=set(), type=BasicType(dimensions=[], name=short)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=connectionObjId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=linkState, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=optimizedTx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getSITransactionId, postfix_operators=[], prefix_operators=[], qualifier=request, selectors=[], type_arguments=None), name=txId)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getHandshakeProperties, postfix_operators=[], prefix_operators=[], qualifier=conversation, selectors=[MethodInvocation(arguments=[], member=getFapLevel, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=getSIDestinationAddress, postfix_operators=[], prefix_operators=[], qualifier=request, selectors=[], type_arguments=None), name=destAddr)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=SIDestinationAddress, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getInt, postfix_operators=[], prefix_operators=[], qualifier=request, selectors=[], type_arguments=None), name=reason)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getString, postfix_operators=[], prefix_operators=[], qualifier=request, selectors=[], type_arguments=None), name=alternateUser)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MethodInvocation(arguments=[], member=peekLong, postfix_operators=[], prefix_operators=[], qualifier=request, selectors=[], type_arguments=None), type=BasicType(dimensions=[], name=int)), name=messageLength)], modifiers=set(), type=BasicType(dimensions=[], name=int)), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=isAnyTracingEnabled, postfix_operators=[], prefix_operators=[], qualifier=TraceComponent, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[], member=isDebugEnabled, postfix_operators=[], prefix_operators=[], qualifier=tc, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=tc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="ConnectionObjectId"), BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=""), operandr=MemberReference(member=connectionObjId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=debug, postfix_operators=[], prefix_operators=[], qualifier=SibTr, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=tc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="DestinationAddress"), MemberReference(member=destAddr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=debug, postfix_operators=[], prefix_operators=[], qualifier=SibTr, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=tc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Reason"), BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=""), operandr=MemberReference(member=reason, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=debug, postfix_operators=[], prefix_operators=[], qualifier=SibTr, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=tc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="TransactionId"), BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=""), operandr=MemberReference(member=txId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=debug, postfix_operators=[], prefix_operators=[], qualifier=SibTr, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=tc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="MessageLength"), BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=""), operandr=MemberReference(member=messageLength, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=debug, postfix_operators=[], prefix_operators=[], qualifier=SibTr, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=tc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="AlternateUser"), MemberReference(member=alternateUser, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=debug, postfix_operators=[], prefix_operators=[], qualifier=SibTr, selectors=[], type_arguments=None), label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=request, selectors=[], type_arguments=None), name=jsMessage)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=SIBusMessage, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), name=inserts)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[None], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getShort, postfix_operators=[], prefix_operators=[], qualifier=request, selectors=[], type_arguments=None), name=numberOfInserts)], modifiers=set(), type=BasicType(dimensions=[], name=int)), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=isAnyTracingEnabled, postfix_operators=[], prefix_operators=[], qualifier=TraceComponent, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[], member=isDebugEnabled, postfix_operators=[], prefix_operators=[], qualifier=tc, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=tc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Number of inserts"), BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=""), operandr=MemberReference(member=numberOfInserts, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=debug, postfix_operators=[], prefix_operators=[], qualifier=SibTr, selectors=[], type_arguments=None), label=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=numberOfInserts, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=inserts, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ArrayCreator(dimensions=[MemberReference(member=numberOfInserts, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=String, sub_type=None))), label=None), ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=inserts, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MethodInvocation(arguments=[], member=getString, postfix_operators=[], prefix_operators=[], qualifier=request, selectors=[], type_arguments=None)), label=None), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=isAnyTracingEnabled, postfix_operators=[], prefix_operators=[], qualifier=TraceComponent, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[], member=isDebugEnabled, postfix_operators=[], prefix_operators=[], qualifier=tc, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=tc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Insert["), operandr=MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="] = "), operator=+), operandr=MemberReference(member=inserts, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operator=+)], member=debug, postfix_operators=[], prefix_operators=[], qualifier=SibTr, selectors=[], type_arguments=None), label=None))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=numberOfInserts, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=x)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=x, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getTransactionTable, postfix_operators=[], prefix_operators=[], qualifier=linkState, selectors=[MethodInvocation(arguments=[MemberReference(member=txId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=tran)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=SITransaction, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MethodInvocation(arguments=[MemberReference(member=connectionObjId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getObject, postfix_operators=[], prefix_operators=[], qualifier=convState, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=CATConnection, sub_type=None)), name=connection)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=SICoreConnection, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=tran, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=INVALID_TRANSACTION, postfix_operators=[], prefix_operators=[], qualifier=IdToTransactionTable, selectors=[]), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=destAddr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=jsMessage, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=reason, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=inserts, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=tran, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=alternateUser, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=sendToExceptionDestination, postfix_operators=[], prefix_operators=[], qualifier=connection, selectors=[], type_arguments=None), label=None)])), TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=allocate, postfix_operators=[], prefix_operators=[], qualifier=poolManager, selectors=[], type_arguments=None), MemberReference(member=SEG_SEND_TO_EXCEPTION_DESTINATION_R, postfix_operators=[], prefix_operators=[], qualifier=JFapChannelConstants, selectors=[]), MemberReference(member=requestNumber, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=PRIORITY_MEDIUM, postfix_operators=[], prefix_operators=[], qualifier=JFapChannelConstants, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true), MemberReference(member=BLOCK_THREAD, postfix_operators=[], prefix_operators=[], qualifier=ThrottlingPolicy, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], member=send, postfix_operators=[], prefix_operators=[], qualifier=conversation, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=MemberReference(member=CLASS_NAME, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=".rcvSendToExceptionDest"), operator=+), MemberReference(member=STATICCATDESTINATION_SENDTOEXCEP_01, postfix_operators=[], prefix_operators=[], qualifier=CommsConstants, selectors=[])], member=processException, postfix_operators=[], prefix_operators=[], qualifier=FFDCFilter, selectors=[], type_arguments=None), label=None), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=isAnyTracingEnabled, postfix_operators=[], prefix_operators=[], qualifier=TraceComponent, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[], member=isDebugEnabled, postfix_operators=[], prefix_operators=[], qualifier=tc, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=tc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=debug, postfix_operators=[], prefix_operators=[], qualifier=SibTr, selectors=[], type_arguments=None), label=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=tc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="COMMUNICATION_ERROR_SICO2022"), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=SibTr, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['SIException']))], finally_block=None, label=None, resources=None)], catches=[CatchClause(block=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=isAnyTracingEnabled, postfix_operators=[], prefix_operators=[], qualifier=TraceComponent, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[], member=isDebugEnabled, postfix_operators=[], prefix_operators=[], qualifier=tc, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=tc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=debug, postfix_operators=[], prefix_operators=[], qualifier=SibTr, selectors=[], type_arguments=None), label=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), MemberReference(member=conversation, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=requestNumber, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=sendExceptionToClient, postfix_operators=[], prefix_operators=[], qualifier=StaticCATHelper, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['SINotAuthorizedException'])), CatchClause(block=[IfStatement(condition=MethodInvocation(arguments=[], member=hasMETerminated, postfix_operators=[], prefix_operators=['!'], qualifier=convState, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=MemberReference(member=CLASS_NAME, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=".rcvSendToExceptionDest"), operator=+), MemberReference(member=STATICCATDESTINATION_SENDTOEXCEP_02, postfix_operators=[], prefix_operators=[], qualifier=CommsConstants, selectors=[])], member=processException, postfix_operators=[], prefix_operators=[], qualifier=FFDCFilter, selectors=[], type_arguments=None), label=None)])), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=isAnyTracingEnabled, postfix_operators=[], prefix_operators=[], qualifier=TraceComponent, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[], member=isDebugEnabled, postfix_operators=[], prefix_operators=[], qualifier=tc, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=tc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=debug, postfix_operators=[], prefix_operators=[], qualifier=SibTr, selectors=[], type_arguments=None), label=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=STATICCATDESTINATION_SENDTOEXCEP_02, postfix_operators=[], prefix_operators=[], qualifier=CommsConstants, selectors=[]), MemberReference(member=conversation, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=requestNumber, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=sendExceptionToClient, postfix_operators=[], prefix_operators=[], qualifier=StaticCATHelper, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['SIException'])), CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=MemberReference(member=CLASS_NAME, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=".rcvSendToExceptionDest"), operator=+), MemberReference(member=STATICCATDESTINATION_SENDTOEXCEP_03, postfix_operators=[], prefix_operators=[], qualifier=CommsConstants, selectors=[])], member=processException, postfix_operators=[], prefix_operators=[], qualifier=FFDCFilter, selectors=[], type_arguments=None), label=None), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=isAnyTracingEnabled, postfix_operators=[], prefix_operators=[], qualifier=TraceComponent, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[], member=isDebugEnabled, postfix_operators=[], prefix_operators=[], qualifier=tc, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=tc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=debug, postfix_operators=[], prefix_operators=[], qualifier=SibTr, selectors=[], type_arguments=None), label=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=STATICCATDESTINATION_SENDTOEXCEP_03, postfix_operators=[], prefix_operators=[], qualifier=CommsConstants, selectors=[]), MemberReference(member=conversation, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=requestNumber, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=sendExceptionToClient, postfix_operators=[], prefix_operators=[], qualifier=StaticCATHelper, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None)
if[member[.allocatedFromBufferPool]] begin[{]
call[request.release, parameter[]]
else begin[{]
None
end[}]
if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{]
call[SibTr.entry, parameter[member[.tc], literal["rcvSendToExceptionDest"]]]
else begin[{]
None
end[}]
end[}]
END[}] | Keyword[static] Keyword[void] identifier[rcvSendToExceptionDest] operator[SEP] identifier[CommsServerByteBuffer] identifier[request] , identifier[Conversation] identifier[conversation] , Keyword[int] identifier[requestNumber] , Keyword[boolean] identifier[allocatedFromBufferPool] , Keyword[boolean] identifier[partOfExchange] operator[SEP] {
Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[entry] operator[SEP] identifier[tc] , literal[String] , Keyword[new] identifier[Object] operator[SEP] operator[SEP] {
identifier[request] , identifier[conversation] , literal[String] operator[+] identifier[requestNumber] , literal[String] operator[+] identifier[allocatedFromBufferPool] , literal[String] operator[+] identifier[partOfExchange]
} operator[SEP] operator[SEP] identifier[ServerLinkLevelState] identifier[linkState] operator[=] operator[SEP] identifier[ServerLinkLevelState] operator[SEP] identifier[conversation] operator[SEP] identifier[getLinkLevelAttachment] operator[SEP] operator[SEP] operator[SEP] identifier[ConversationState] identifier[convState] operator[=] operator[SEP] identifier[ConversationState] operator[SEP] identifier[conversation] operator[SEP] identifier[getAttachment] operator[SEP] operator[SEP] operator[SEP] Keyword[final] Keyword[boolean] identifier[optimizedTx] operator[=] identifier[CommsUtils] operator[SEP] identifier[requiresOptimizedTransaction] operator[SEP] identifier[conversation] operator[SEP] operator[SEP] Keyword[try] {
Keyword[short] identifier[connectionObjId] operator[=] identifier[request] operator[SEP] identifier[getShort] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[txId] operator[=] identifier[request] operator[SEP] identifier[getSITransactionId] operator[SEP] identifier[connectionObjId] , identifier[linkState] , identifier[optimizedTx] operator[SEP] operator[SEP] identifier[SIDestinationAddress] identifier[destAddr] operator[=] identifier[request] operator[SEP] identifier[getSIDestinationAddress] operator[SEP] identifier[conversation] operator[SEP] identifier[getHandshakeProperties] operator[SEP] operator[SEP] operator[SEP] identifier[getFapLevel] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[reason] operator[=] identifier[request] operator[SEP] identifier[getInt] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[alternateUser] operator[=] identifier[request] operator[SEP] identifier[getString] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[messageLength] operator[=] operator[SEP] Keyword[int] operator[SEP] identifier[request] operator[SEP] identifier[peekLong] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] {
identifier[SibTr] operator[SEP] identifier[debug] operator[SEP] identifier[tc] , literal[String] , literal[String] operator[+] identifier[connectionObjId] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[debug] operator[SEP] identifier[tc] , literal[String] , identifier[destAddr] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[debug] operator[SEP] identifier[tc] , literal[String] , literal[String] operator[+] identifier[reason] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[debug] operator[SEP] identifier[tc] , literal[String] , literal[String] operator[+] identifier[txId] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[debug] operator[SEP] identifier[tc] , literal[String] , literal[String] operator[+] identifier[messageLength] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[debug] operator[SEP] identifier[tc] , literal[String] , identifier[alternateUser] operator[SEP] operator[SEP]
}
identifier[SIBusMessage] identifier[jsMessage] operator[=] identifier[request] operator[SEP] identifier[getMessage] operator[SEP] Other[null] operator[SEP] operator[SEP] identifier[String] operator[SEP] operator[SEP] identifier[inserts] operator[=] Other[null] operator[SEP] Keyword[int] identifier[numberOfInserts] operator[=] identifier[request] operator[SEP] identifier[getShort] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[debug] operator[SEP] identifier[tc] , literal[String] , literal[String] operator[+] identifier[numberOfInserts] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[numberOfInserts] operator[!=] Other[0] operator[SEP] {
identifier[inserts] operator[=] Keyword[new] identifier[String] operator[SEP] identifier[numberOfInserts] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[x] operator[=] Other[0] operator[SEP] identifier[x] operator[<] identifier[numberOfInserts] operator[SEP] identifier[x] operator[++] operator[SEP] {
identifier[inserts] operator[SEP] identifier[x] operator[SEP] operator[=] identifier[request] operator[SEP] identifier[getString] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[debug] operator[SEP] identifier[tc] , literal[String] operator[+] identifier[x] operator[+] literal[String] operator[+] identifier[inserts] operator[SEP] identifier[x] operator[SEP] operator[SEP] operator[SEP]
}
}
identifier[SITransaction] identifier[tran] operator[=] identifier[linkState] operator[SEP] identifier[getTransactionTable] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] identifier[txId] operator[SEP] operator[SEP] identifier[SICoreConnection] identifier[connection] operator[=] operator[SEP] operator[SEP] identifier[CATConnection] operator[SEP] identifier[convState] operator[SEP] identifier[getObject] operator[SEP] identifier[connectionObjId] operator[SEP] operator[SEP] operator[SEP] identifier[getSICoreConnection] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[tran] operator[!=] identifier[IdToTransactionTable] operator[SEP] identifier[INVALID_TRANSACTION] operator[SEP] {
identifier[connection] operator[SEP] identifier[sendToExceptionDestination] operator[SEP] identifier[destAddr] , identifier[jsMessage] , identifier[reason] , identifier[inserts] , identifier[tran] , identifier[alternateUser] operator[SEP] operator[SEP]
}
Keyword[try] {
identifier[conversation] operator[SEP] identifier[send] operator[SEP] identifier[poolManager] operator[SEP] identifier[allocate] operator[SEP] operator[SEP] , identifier[JFapChannelConstants] operator[SEP] identifier[SEG_SEND_TO_EXCEPTION_DESTINATION_R] , identifier[requestNumber] , identifier[JFapChannelConstants] operator[SEP] identifier[PRIORITY_MEDIUM] , literal[boolean] , identifier[ThrottlingPolicy] operator[SEP] identifier[BLOCK_THREAD] , Other[null] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[SIException] identifier[e] operator[SEP] {
identifier[FFDCFilter] operator[SEP] identifier[processException] operator[SEP] identifier[e] , identifier[CLASS_NAME] operator[+] literal[String] , identifier[CommsConstants] operator[SEP] identifier[STATICCATDESTINATION_SENDTOEXCEP_01] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[debug] operator[SEP] identifier[tc] , identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[error] operator[SEP] identifier[tc] , literal[String] , identifier[e] operator[SEP] operator[SEP]
}
}
Keyword[catch] operator[SEP] identifier[SINotAuthorizedException] identifier[e] operator[SEP] {
Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[debug] operator[SEP] identifier[tc] , identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP] identifier[StaticCATHelper] operator[SEP] identifier[sendExceptionToClient] operator[SEP] identifier[e] , Other[null] , identifier[conversation] , identifier[requestNumber] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[SIException] identifier[e] operator[SEP] {
Keyword[if] operator[SEP] operator[!] identifier[convState] operator[SEP] identifier[hasMETerminated] operator[SEP] operator[SEP] operator[SEP] {
identifier[FFDCFilter] operator[SEP] identifier[processException] operator[SEP] identifier[e] , identifier[CLASS_NAME] operator[+] literal[String] , identifier[CommsConstants] operator[SEP] identifier[STATICCATDESTINATION_SENDTOEXCEP_02] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[debug] operator[SEP] identifier[tc] , identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP] identifier[StaticCATHelper] operator[SEP] identifier[sendExceptionToClient] operator[SEP] identifier[e] , identifier[CommsConstants] operator[SEP] identifier[STATICCATDESTINATION_SENDTOEXCEP_02] , identifier[conversation] , identifier[requestNumber] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] {
identifier[FFDCFilter] operator[SEP] identifier[processException] operator[SEP] identifier[e] , identifier[CLASS_NAME] operator[+] literal[String] , identifier[CommsConstants] operator[SEP] identifier[STATICCATDESTINATION_SENDTOEXCEP_03] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[debug] operator[SEP] identifier[tc] , identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP] identifier[StaticCATHelper] operator[SEP] identifier[sendExceptionToClient] operator[SEP] identifier[e] , identifier[CommsConstants] operator[SEP] identifier[STATICCATDESTINATION_SENDTOEXCEP_03] , identifier[conversation] , identifier[requestNumber] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[allocatedFromBufferPool] operator[SEP] identifier[request] operator[SEP] identifier[release] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[entry] operator[SEP] identifier[tc] , literal[String] operator[SEP] operator[SEP]
}
|
public static Map<DomainParts, String> splitDomain(String domain) {
Map<DomainParts, String> domainParts = null;
String[] dottedParts = domain.trim().toLowerCase(Locale.ENGLISH).split("\\.");
if(dottedParts.length==2) {
domainParts = new HashMap<>();
domainParts.put(DomainParts.SUBDOMAIN, null);
domainParts.put(DomainParts.DOMAINNAME, dottedParts[0]);
domainParts.put(DomainParts.TLD, dottedParts[1]);
}
else if(dottedParts.length>2) {
int n = dottedParts.length;
if( COMMON_TLD.contains(dottedParts[n-2]+"."+dottedParts[n-1]) ||
(COMMON_TLD.contains(dottedParts[n-1]) && COMMON_SLD.contains(dottedParts[n-2])) ||
(COMMON_TLD.contains(dottedParts[n-2]) && COMMON_SLD.contains(dottedParts[n-1]))) {
domainParts = new HashMap<>();
domainParts.put(DomainParts.TLD, dottedParts[n-2]+"."+dottedParts[n-1]);
domainParts.put(DomainParts.DOMAINNAME, dottedParts[n-3]);
StringBuilder sb = new StringBuilder(dottedParts[0]);
for(int i=1;i<n-3;++i) {
sb.append(".").append(dottedParts[i]);
}
domainParts.put(DomainParts.SUBDOMAIN, sb.toString());
}
else if(COMMON_TLD.contains(dottedParts[n-1])) {
domainParts = new HashMap<>();
domainParts.put(DomainParts.TLD, dottedParts[n-1]);
domainParts.put(DomainParts.DOMAINNAME, dottedParts[n-2]);
StringBuilder sb = new StringBuilder(dottedParts[0]);
for(int i=1;i<n-2;++i) {
sb.append(".").append(dottedParts[i]);
}
domainParts.put(DomainParts.SUBDOMAIN, sb.toString());
}
}
return domainParts;
} | class class_name[name] begin[{]
method[splitDomain, return_type[type[Map]], modifier[public static], parameter[domain]] begin[{]
local_variable[type[Map], domainParts]
local_variable[type[String], dottedParts]
if[binary_operation[member[dottedParts.length], ==, literal[2]]] begin[{]
assign[member[.domainParts], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=HashMap, sub_type=None))]
call[domainParts.put, parameter[member[DomainParts.SUBDOMAIN], literal[null]]]
call[domainParts.put, parameter[member[DomainParts.DOMAINNAME], member[.dottedParts]]]
call[domainParts.put, parameter[member[DomainParts.TLD], member[.dottedParts]]]
else begin[{]
if[binary_operation[member[dottedParts.length], >, literal[2]]] begin[{]
local_variable[type[int], n]
if[binary_operation[binary_operation[call[COMMON_TLD.contains, parameter[binary_operation[binary_operation[member[.dottedParts], +, literal["."]], +, member[.dottedParts]]]], ||, binary_operation[call[COMMON_TLD.contains, parameter[member[.dottedParts]]], &&, call[COMMON_SLD.contains, parameter[member[.dottedParts]]]]], ||, binary_operation[call[COMMON_TLD.contains, parameter[member[.dottedParts]]], &&, call[COMMON_SLD.contains, parameter[member[.dottedParts]]]]]] begin[{]
assign[member[.domainParts], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=HashMap, sub_type=None))]
call[domainParts.put, parameter[member[DomainParts.TLD], binary_operation[binary_operation[member[.dottedParts], +, literal["."]], +, member[.dottedParts]]]]
call[domainParts.put, parameter[member[DomainParts.DOMAINNAME], member[.dottedParts]]]
local_variable[type[StringBuilder], sb]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=".")], member=append, postfix_operators=[], prefix_operators=[], qualifier=sb, selectors=[MethodInvocation(arguments=[MemberReference(member=dottedParts, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])], member=append, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=BinaryOperation(operandl=MemberReference(member=n, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=3), operator=-), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=[], prefix_operators=['++'], qualifier=, selectors=[])]), label=None)
call[domainParts.put, parameter[member[DomainParts.SUBDOMAIN], call[sb.toString, parameter[]]]]
else begin[{]
if[call[COMMON_TLD.contains, parameter[member[.dottedParts]]]] begin[{]
assign[member[.domainParts], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=HashMap, sub_type=None))]
call[domainParts.put, parameter[member[DomainParts.TLD], member[.dottedParts]]]
call[domainParts.put, parameter[member[DomainParts.DOMAINNAME], member[.dottedParts]]]
local_variable[type[StringBuilder], sb]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=".")], member=append, postfix_operators=[], prefix_operators=[], qualifier=sb, selectors=[MethodInvocation(arguments=[MemberReference(member=dottedParts, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])], member=append, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=BinaryOperation(operandl=MemberReference(member=n, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), operator=-), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=[], prefix_operators=['++'], qualifier=, selectors=[])]), label=None)
call[domainParts.put, parameter[member[DomainParts.SUBDOMAIN], call[sb.toString, parameter[]]]]
else begin[{]
None
end[}]
end[}]
else begin[{]
None
end[}]
end[}]
return[member[.domainParts]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[Map] operator[<] identifier[DomainParts] , identifier[String] operator[>] identifier[splitDomain] operator[SEP] identifier[String] identifier[domain] operator[SEP] {
identifier[Map] operator[<] identifier[DomainParts] , identifier[String] operator[>] identifier[domainParts] operator[=] Other[null] operator[SEP] identifier[String] operator[SEP] operator[SEP] identifier[dottedParts] operator[=] identifier[domain] operator[SEP] identifier[trim] operator[SEP] operator[SEP] operator[SEP] identifier[toLowerCase] operator[SEP] identifier[Locale] operator[SEP] identifier[ENGLISH] operator[SEP] operator[SEP] identifier[split] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[dottedParts] operator[SEP] identifier[length] operator[==] Other[2] operator[SEP] {
identifier[domainParts] operator[=] Keyword[new] identifier[HashMap] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[domainParts] operator[SEP] identifier[put] operator[SEP] identifier[DomainParts] operator[SEP] identifier[SUBDOMAIN] , Other[null] operator[SEP] operator[SEP] identifier[domainParts] operator[SEP] identifier[put] operator[SEP] identifier[DomainParts] operator[SEP] identifier[DOMAINNAME] , identifier[dottedParts] operator[SEP] Other[0] operator[SEP] operator[SEP] operator[SEP] identifier[domainParts] operator[SEP] identifier[put] operator[SEP] identifier[DomainParts] operator[SEP] identifier[TLD] , identifier[dottedParts] operator[SEP] Other[1] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[dottedParts] operator[SEP] identifier[length] operator[>] Other[2] operator[SEP] {
Keyword[int] identifier[n] operator[=] identifier[dottedParts] operator[SEP] identifier[length] operator[SEP] Keyword[if] operator[SEP] identifier[COMMON_TLD] operator[SEP] identifier[contains] operator[SEP] identifier[dottedParts] operator[SEP] identifier[n] operator[-] Other[2] operator[SEP] operator[+] literal[String] operator[+] identifier[dottedParts] operator[SEP] identifier[n] operator[-] Other[1] operator[SEP] operator[SEP] operator[||] operator[SEP] identifier[COMMON_TLD] operator[SEP] identifier[contains] operator[SEP] identifier[dottedParts] operator[SEP] identifier[n] operator[-] Other[1] operator[SEP] operator[SEP] operator[&&] identifier[COMMON_SLD] operator[SEP] identifier[contains] operator[SEP] identifier[dottedParts] operator[SEP] identifier[n] operator[-] Other[2] operator[SEP] operator[SEP] operator[SEP] operator[||] operator[SEP] identifier[COMMON_TLD] operator[SEP] identifier[contains] operator[SEP] identifier[dottedParts] operator[SEP] identifier[n] operator[-] Other[2] operator[SEP] operator[SEP] operator[&&] identifier[COMMON_SLD] operator[SEP] identifier[contains] operator[SEP] identifier[dottedParts] operator[SEP] identifier[n] operator[-] Other[1] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
identifier[domainParts] operator[=] Keyword[new] identifier[HashMap] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[domainParts] operator[SEP] identifier[put] operator[SEP] identifier[DomainParts] operator[SEP] identifier[TLD] , identifier[dottedParts] operator[SEP] identifier[n] operator[-] Other[2] operator[SEP] operator[+] literal[String] operator[+] identifier[dottedParts] operator[SEP] identifier[n] operator[-] Other[1] operator[SEP] operator[SEP] operator[SEP] identifier[domainParts] operator[SEP] identifier[put] operator[SEP] identifier[DomainParts] operator[SEP] identifier[DOMAINNAME] , identifier[dottedParts] operator[SEP] identifier[n] operator[-] Other[3] operator[SEP] operator[SEP] operator[SEP] identifier[StringBuilder] identifier[sb] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] identifier[dottedParts] operator[SEP] Other[0] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[1] operator[SEP] identifier[i] operator[<] identifier[n] operator[-] Other[3] operator[SEP] operator[++] identifier[i] operator[SEP] {
identifier[sb] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[dottedParts] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP]
}
identifier[domainParts] operator[SEP] identifier[put] operator[SEP] identifier[DomainParts] operator[SEP] identifier[SUBDOMAIN] , identifier[sb] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[COMMON_TLD] operator[SEP] identifier[contains] operator[SEP] identifier[dottedParts] operator[SEP] identifier[n] operator[-] Other[1] operator[SEP] operator[SEP] operator[SEP] {
identifier[domainParts] operator[=] Keyword[new] identifier[HashMap] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[domainParts] operator[SEP] identifier[put] operator[SEP] identifier[DomainParts] operator[SEP] identifier[TLD] , identifier[dottedParts] operator[SEP] identifier[n] operator[-] Other[1] operator[SEP] operator[SEP] operator[SEP] identifier[domainParts] operator[SEP] identifier[put] operator[SEP] identifier[DomainParts] operator[SEP] identifier[DOMAINNAME] , identifier[dottedParts] operator[SEP] identifier[n] operator[-] Other[2] operator[SEP] operator[SEP] operator[SEP] identifier[StringBuilder] identifier[sb] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] identifier[dottedParts] operator[SEP] Other[0] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[1] operator[SEP] identifier[i] operator[<] identifier[n] operator[-] Other[2] operator[SEP] operator[++] identifier[i] operator[SEP] {
identifier[sb] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[dottedParts] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP]
}
identifier[domainParts] operator[SEP] identifier[put] operator[SEP] identifier[DomainParts] operator[SEP] identifier[SUBDOMAIN] , identifier[sb] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[return] identifier[domainParts] operator[SEP]
}
|
public ParameterBuilder<T> property(String key, Object value) {
if (key == null) {
throw new IllegalArgumentException("Key argument must not be null.");
}
this.properties.put(key, value);
return this;
} | class class_name[name] begin[{]
method[property, return_type[type[ParameterBuilder]], modifier[public], parameter[key, value]] begin[{]
if[binary_operation[member[.key], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Key argument must not 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[}]
THIS[member[None.properties]call[None.put, parameter[member[.key], member[.value]]]]
return[THIS[]]
end[}]
END[}] | Keyword[public] identifier[ParameterBuilder] operator[<] identifier[T] operator[>] identifier[property] operator[SEP] identifier[String] identifier[key] , identifier[Object] identifier[value] operator[SEP] {
Keyword[if] operator[SEP] identifier[key] operator[==] Other[null] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[this] operator[SEP] identifier[properties] operator[SEP] identifier[put] operator[SEP] identifier[key] , identifier[value] operator[SEP] operator[SEP] Keyword[return] Keyword[this] operator[SEP]
}
|
@Override
public int[] sort(final int col, final boolean ascending) {
if (!isSortable(col)) {
throw new IllegalStateException("Attempted to sort on column "
+ col + ", which is not sortable");
}
// Obtains the list of top level nodes, sorts them & re-add them in order
TableTreeNode root = getRootNode();
List<TableTreeNode> topLevelNodes = new ArrayList<>(root.getChildCount());
for (int i = 0; i < root.getChildCount(); i++) {
topLevelNodes.add((TableTreeNode) root.getChildAt(i));
}
Comparator<TableTreeNode> comp = new Comparator<TableTreeNode>() {
@Override
public int compare(final TableTreeNode obj1, final TableTreeNode obj2) {
Comparator backing = comparators.get(col);
return backing.compare(obj1.getData(), obj2.getData());
}
};
if (ascending) {
Collections.sort(topLevelNodes, comp);
} else {
Collections.sort(topLevelNodes, Collections.reverseOrder(comp));
}
root.removeAll();
for (TableTreeNode node : topLevelNodes) {
root.add(node);
}
return null;
} | class class_name[name] begin[{]
method[sort, return_type[type[int]], modifier[public], parameter[col, ascending]] begin[{]
if[call[.isSortable, parameter[member[.col]]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Attempted to sort on column "), operandr=MemberReference(member=col, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=", which is not sortable"), 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[}]
local_variable[type[TableTreeNode], root]
local_variable[type[List], topLevelNodes]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Cast(expression=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getChildAt, postfix_operators=[], prefix_operators=[], qualifier=root, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=TableTreeNode, sub_type=None))], member=add, postfix_operators=[], prefix_operators=[], qualifier=topLevelNodes, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=getChildCount, postfix_operators=[], prefix_operators=[], qualifier=root, selectors=[], type_arguments=None), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
local_variable[type[Comparator], comp]
if[member[.ascending]] begin[{]
call[Collections.sort, parameter[member[.topLevelNodes], member[.comp]]]
else begin[{]
call[Collections.sort, parameter[member[.topLevelNodes], call[Collections.reverseOrder, parameter[member[.comp]]]]]
end[}]
call[root.removeAll, parameter[]]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=node, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=root, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=topLevelNodes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=node)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=TableTreeNode, sub_type=None))), label=None)
return[literal[null]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] Keyword[int] operator[SEP] operator[SEP] identifier[sort] operator[SEP] Keyword[final] Keyword[int] identifier[col] , Keyword[final] Keyword[boolean] identifier[ascending] operator[SEP] {
Keyword[if] operator[SEP] operator[!] identifier[isSortable] operator[SEP] identifier[col] operator[SEP] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] literal[String] operator[+] identifier[col] operator[+] literal[String] operator[SEP] operator[SEP]
}
identifier[TableTreeNode] identifier[root] operator[=] identifier[getRootNode] operator[SEP] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[TableTreeNode] operator[>] identifier[topLevelNodes] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] identifier[root] operator[SEP] identifier[getChildCount] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[root] operator[SEP] identifier[getChildCount] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[++] operator[SEP] {
identifier[topLevelNodes] operator[SEP] identifier[add] operator[SEP] operator[SEP] identifier[TableTreeNode] operator[SEP] identifier[root] operator[SEP] identifier[getChildAt] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP]
}
identifier[Comparator] operator[<] identifier[TableTreeNode] operator[>] identifier[comp] operator[=] Keyword[new] identifier[Comparator] operator[<] identifier[TableTreeNode] operator[>] operator[SEP] operator[SEP] {
annotation[@] identifier[Override] Keyword[public] Keyword[int] identifier[compare] operator[SEP] Keyword[final] identifier[TableTreeNode] identifier[obj1] , Keyword[final] identifier[TableTreeNode] identifier[obj2] operator[SEP] {
identifier[Comparator] identifier[backing] operator[=] identifier[comparators] operator[SEP] identifier[get] operator[SEP] identifier[col] operator[SEP] operator[SEP] Keyword[return] identifier[backing] operator[SEP] identifier[compare] operator[SEP] identifier[obj1] operator[SEP] identifier[getData] operator[SEP] operator[SEP] , identifier[obj2] operator[SEP] identifier[getData] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
} operator[SEP] Keyword[if] operator[SEP] identifier[ascending] operator[SEP] {
identifier[Collections] operator[SEP] identifier[sort] operator[SEP] identifier[topLevelNodes] , identifier[comp] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[Collections] operator[SEP] identifier[sort] operator[SEP] identifier[topLevelNodes] , identifier[Collections] operator[SEP] identifier[reverseOrder] operator[SEP] identifier[comp] operator[SEP] operator[SEP] operator[SEP]
}
identifier[root] operator[SEP] identifier[removeAll] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[TableTreeNode] identifier[node] operator[:] identifier[topLevelNodes] operator[SEP] {
identifier[root] operator[SEP] identifier[add] operator[SEP] identifier[node] operator[SEP] operator[SEP]
}
Keyword[return] Other[null] operator[SEP]
}
|
@CheckForNull
public ActiveRule getActiveRule(Rule rule) {
return getActiveRule(rule.getRepositoryKey(), rule.getKey());
} | class class_name[name] begin[{]
method[getActiveRule, return_type[type[ActiveRule]], modifier[public], parameter[rule]] begin[{]
return[call[.getActiveRule, parameter[call[rule.getRepositoryKey, parameter[]], call[rule.getKey, parameter[]]]]]
end[}]
END[}] | annotation[@] identifier[CheckForNull] Keyword[public] identifier[ActiveRule] identifier[getActiveRule] operator[SEP] identifier[Rule] identifier[rule] operator[SEP] {
Keyword[return] identifier[getActiveRule] operator[SEP] identifier[rule] operator[SEP] identifier[getRepositoryKey] operator[SEP] operator[SEP] , identifier[rule] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
@Override
protected PreparedStatementCreator getPreparedStatementCreator(String sql, SqlParameterSource parameterSource) {
return new NamedPreparedStatementCreator(sql, parameterSource);
} | class class_name[name] begin[{]
method[getPreparedStatementCreator, return_type[type[PreparedStatementCreator]], modifier[protected], parameter[sql, parameterSource]] begin[{]
return[ClassCreator(arguments=[MemberReference(member=sql, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=parameterSource, 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=NamedPreparedStatementCreator, sub_type=None))]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[protected] identifier[PreparedStatementCreator] identifier[getPreparedStatementCreator] operator[SEP] identifier[String] identifier[sql] , identifier[SqlParameterSource] identifier[parameterSource] operator[SEP] {
Keyword[return] Keyword[new] identifier[NamedPreparedStatementCreator] operator[SEP] identifier[sql] , identifier[parameterSource] operator[SEP] operator[SEP]
}
|
public void enable(String jobId, JobEnableOptions jobEnableOptions) {
enableWithServiceResponseAsync(jobId, jobEnableOptions).toBlocking().single().body();
} | class class_name[name] begin[{]
method[enable, return_type[void], modifier[public], parameter[jobId, jobEnableOptions]] begin[{]
call[.enableWithServiceResponseAsync, parameter[member[.jobId], member[.jobEnableOptions]]]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[enable] operator[SEP] identifier[String] identifier[jobId] , identifier[JobEnableOptions] identifier[jobEnableOptions] operator[SEP] {
identifier[enableWithServiceResponseAsync] operator[SEP] identifier[jobId] , identifier[jobEnableOptions] operator[SEP] operator[SEP] identifier[toBlocking] operator[SEP] operator[SEP] operator[SEP] identifier[single] operator[SEP] operator[SEP] operator[SEP] identifier[body] operator[SEP] operator[SEP] operator[SEP]
}
|
private Double getRangeCost(ProjectCalendar projectCalendar, TimescaleUnits rangeUnits, DateRange range, List<TimephasedCost> assignments, int startIndex)
{
Double result;
switch (rangeUnits)
{
case MINUTES:
case HOURS:
{
result = getRangeCostSubDay(projectCalendar, rangeUnits, range, assignments, startIndex);
break;
}
default:
{
result = getRangeCostWholeDay(projectCalendar, rangeUnits, range, assignments, startIndex);
break;
}
}
return result;
} | class class_name[name] begin[{]
method[getRangeCost, return_type[type[Double]], modifier[private], parameter[projectCalendar, rangeUnits, range, assignments, startIndex]] begin[{]
local_variable[type[Double], result]
SwitchStatement(cases=[SwitchStatementCase(case=['MINUTES', 'HOURS'], statements=[BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=projectCalendar, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=rangeUnits, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=range, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=assignments, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=startIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getRangeCostSubDay, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), BreakStatement(goto=None, label=None)])]), SwitchStatementCase(case=[], statements=[BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=projectCalendar, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=rangeUnits, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=range, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=assignments, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=startIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getRangeCostWholeDay, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), BreakStatement(goto=None, label=None)])])], expression=MemberReference(member=rangeUnits, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)
return[member[.result]]
end[}]
END[}] | Keyword[private] identifier[Double] identifier[getRangeCost] operator[SEP] identifier[ProjectCalendar] identifier[projectCalendar] , identifier[TimescaleUnits] identifier[rangeUnits] , identifier[DateRange] identifier[range] , identifier[List] operator[<] identifier[TimephasedCost] operator[>] identifier[assignments] , Keyword[int] identifier[startIndex] operator[SEP] {
identifier[Double] identifier[result] operator[SEP] Keyword[switch] operator[SEP] identifier[rangeUnits] operator[SEP] {
Keyword[case] identifier[MINUTES] operator[:] Keyword[case] identifier[HOURS] operator[:] {
identifier[result] operator[=] identifier[getRangeCostSubDay] operator[SEP] identifier[projectCalendar] , identifier[rangeUnits] , identifier[range] , identifier[assignments] , identifier[startIndex] operator[SEP] operator[SEP] Keyword[break] operator[SEP]
}
Keyword[default] operator[:] {
identifier[result] operator[=] identifier[getRangeCostWholeDay] operator[SEP] identifier[projectCalendar] , identifier[rangeUnits] , identifier[range] , identifier[assignments] , identifier[startIndex] operator[SEP] operator[SEP] Keyword[break] operator[SEP]
}
}
Keyword[return] identifier[result] operator[SEP]
}
|
public static Set<Policy> policies(Config config) {
BasicSettings settings = new BasicSettings(config);
return settings.admission().stream().map(admission ->
new SegmentedLruPolicy(admission, config)
).collect(toSet());
} | class class_name[name] begin[{]
method[policies, return_type[type[Set]], modifier[public static], parameter[config]] begin[{]
local_variable[type[BasicSettings], settings]
return[call[settings.admission, parameter[]]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[Set] operator[<] identifier[Policy] operator[>] identifier[policies] operator[SEP] identifier[Config] identifier[config] operator[SEP] {
identifier[BasicSettings] identifier[settings] operator[=] Keyword[new] identifier[BasicSettings] operator[SEP] identifier[config] operator[SEP] operator[SEP] Keyword[return] identifier[settings] operator[SEP] identifier[admission] operator[SEP] operator[SEP] operator[SEP] identifier[stream] operator[SEP] operator[SEP] operator[SEP] identifier[map] operator[SEP] identifier[admission] operator[->] Keyword[new] identifier[SegmentedLruPolicy] operator[SEP] identifier[admission] , identifier[config] operator[SEP] operator[SEP] operator[SEP] identifier[collect] operator[SEP] identifier[toSet] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
@Override
public com.liferay.commerce.model.CommerceOrderNote getCommerceOrderNote(
long commerceOrderNoteId)
throws com.liferay.portal.kernel.exception.PortalException {
return _commerceOrderNoteLocalService.getCommerceOrderNote(commerceOrderNoteId);
} | class class_name[name] begin[{]
method[getCommerceOrderNote, return_type[type[com]], modifier[public], parameter[commerceOrderNoteId]] begin[{]
return[call[_commerceOrderNoteLocalService.getCommerceOrderNote, parameter[member[.commerceOrderNoteId]]]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] identifier[com] operator[SEP] identifier[liferay] operator[SEP] identifier[commerce] operator[SEP] identifier[model] operator[SEP] identifier[CommerceOrderNote] identifier[getCommerceOrderNote] operator[SEP] Keyword[long] identifier[commerceOrderNoteId] operator[SEP] Keyword[throws] identifier[com] operator[SEP] identifier[liferay] operator[SEP] identifier[portal] operator[SEP] identifier[kernel] operator[SEP] identifier[exception] operator[SEP] identifier[PortalException] {
Keyword[return] identifier[_commerceOrderNoteLocalService] operator[SEP] identifier[getCommerceOrderNote] operator[SEP] identifier[commerceOrderNoteId] operator[SEP] operator[SEP]
}
|
protected void addMultiTenantFilterIfNecessary(
HibernatePersistentEntity entity, PersistentClass persistentClass,
InFlightMetadataCollector mappings, String sessionFactoryBeanName) {
if (entity.isMultiTenant()) {
TenantId tenantId = entity.getTenantId();
if (tenantId != null) {
String filterCondition = getMultiTenantFilterCondition(sessionFactoryBeanName, entity);
persistentClass.addFilter(
GormProperties.TENANT_IDENTITY,
filterCondition,
true,
Collections.emptyMap(),
Collections.emptyMap()
);
mappings.addFilterDefinition(new FilterDefinition(
GormProperties.TENANT_IDENTITY,
filterCondition,
Collections.singletonMap(GormProperties.TENANT_IDENTITY, persistentClass.getProperty(tenantId.getName()).getType())
));
}
}
} | class class_name[name] begin[{]
method[addMultiTenantFilterIfNecessary, return_type[void], modifier[protected], parameter[entity, persistentClass, mappings, sessionFactoryBeanName]] begin[{]
if[call[entity.isMultiTenant, parameter[]]] begin[{]
local_variable[type[TenantId], tenantId]
if[binary_operation[member[.tenantId], !=, literal[null]]] begin[{]
local_variable[type[String], filterCondition]
call[persistentClass.addFilter, parameter[member[GormProperties.TENANT_IDENTITY], member[.filterCondition], literal[true], call[Collections.emptyMap, parameter[]], call[Collections.emptyMap, parameter[]]]]
call[mappings.addFilterDefinition, parameter[ClassCreator(arguments=[MemberReference(member=TENANT_IDENTITY, postfix_operators=[], prefix_operators=[], qualifier=GormProperties, selectors=[]), MemberReference(member=filterCondition, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[MemberReference(member=TENANT_IDENTITY, postfix_operators=[], prefix_operators=[], qualifier=GormProperties, selectors=[]), MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=tenantId, selectors=[], type_arguments=None)], member=getProperty, postfix_operators=[], prefix_operators=[], qualifier=persistentClass, selectors=[MethodInvocation(arguments=[], member=getType, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=singletonMap, postfix_operators=[], prefix_operators=[], qualifier=Collections, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=FilterDefinition, sub_type=None))]]
else begin[{]
None
end[}]
else begin[{]
None
end[}]
end[}]
END[}] | Keyword[protected] Keyword[void] identifier[addMultiTenantFilterIfNecessary] operator[SEP] identifier[HibernatePersistentEntity] identifier[entity] , identifier[PersistentClass] identifier[persistentClass] , identifier[InFlightMetadataCollector] identifier[mappings] , identifier[String] identifier[sessionFactoryBeanName] operator[SEP] {
Keyword[if] operator[SEP] identifier[entity] operator[SEP] identifier[isMultiTenant] operator[SEP] operator[SEP] operator[SEP] {
identifier[TenantId] identifier[tenantId] operator[=] identifier[entity] operator[SEP] identifier[getTenantId] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[tenantId] operator[!=] Other[null] operator[SEP] {
identifier[String] identifier[filterCondition] operator[=] identifier[getMultiTenantFilterCondition] operator[SEP] identifier[sessionFactoryBeanName] , identifier[entity] operator[SEP] operator[SEP] identifier[persistentClass] operator[SEP] identifier[addFilter] operator[SEP] identifier[GormProperties] operator[SEP] identifier[TENANT_IDENTITY] , identifier[filterCondition] , literal[boolean] , identifier[Collections] operator[SEP] identifier[emptyMap] operator[SEP] operator[SEP] , identifier[Collections] operator[SEP] identifier[emptyMap] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[mappings] operator[SEP] identifier[addFilterDefinition] operator[SEP] Keyword[new] identifier[FilterDefinition] operator[SEP] identifier[GormProperties] operator[SEP] identifier[TENANT_IDENTITY] , identifier[filterCondition] , identifier[Collections] operator[SEP] identifier[singletonMap] operator[SEP] identifier[GormProperties] operator[SEP] identifier[TENANT_IDENTITY] , identifier[persistentClass] operator[SEP] identifier[getProperty] operator[SEP] identifier[tenantId] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
}
}
|
public static <T> T runWithSleepThenReturnValueThrowOnInterrupt(long milliseconds, ReturningRunnable<T> runnable) {
Assert.isTrue(milliseconds > 0, "Milliseconds [%d] must be greater than 0", milliseconds);
T returnValue = runnable.run();
if (!ThreadUtils.sleep(milliseconds, 0)) {
throw new SleepDeprivedException(String.format("Failed to wait for [%d] millisecond(s)", milliseconds));
}
return returnValue;
} | class class_name[name] begin[{]
method[runWithSleepThenReturnValueThrowOnInterrupt, return_type[type[T]], modifier[public static], parameter[milliseconds, runnable]] begin[{]
call[Assert.isTrue, parameter[binary_operation[member[.milliseconds], >, literal[0]], literal["Milliseconds [%d] must be greater than 0"], member[.milliseconds]]]
local_variable[type[T], returnValue]
if[call[ThreadUtils.sleep, parameter[member[.milliseconds], literal[0]]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Failed to wait for [%d] millisecond(s)"), MemberReference(member=milliseconds, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=format, postfix_operators=[], prefix_operators=[], qualifier=String, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SleepDeprivedException, sub_type=None)), label=None)
else begin[{]
None
end[}]
return[member[.returnValue]]
end[}]
END[}] | Keyword[public] Keyword[static] operator[<] identifier[T] operator[>] identifier[T] identifier[runWithSleepThenReturnValueThrowOnInterrupt] operator[SEP] Keyword[long] identifier[milliseconds] , identifier[ReturningRunnable] operator[<] identifier[T] operator[>] identifier[runnable] operator[SEP] {
identifier[Assert] operator[SEP] identifier[isTrue] operator[SEP] identifier[milliseconds] operator[>] Other[0] , literal[String] , identifier[milliseconds] operator[SEP] operator[SEP] identifier[T] identifier[returnValue] operator[=] identifier[runnable] operator[SEP] identifier[run] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[ThreadUtils] operator[SEP] identifier[sleep] operator[SEP] identifier[milliseconds] , Other[0] operator[SEP] operator[SEP] {
Keyword[throw] Keyword[new] identifier[SleepDeprivedException] operator[SEP] identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[milliseconds] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] identifier[returnValue] operator[SEP]
}
|
public void seekToRecord(long recordNumber) throws IOException {
if (currentRecordNumber == recordNumber)
return;
long skip;
if (recordNumber < fileIndex.getStartingRecordNumber()) {
if (currentRecordNumber < recordNumber)
skip = recordNumber - currentRecordNumber;
else {
skip = recordNumber;
seek0(0);
}
} else if (recordNumber > fileIndex.getLastRecordNumber()) {
if (currentRecordNumber < recordNumber)
skip = recordNumber - currentRecordNumber;
else {
long record = fileIndex.getLastRecordNumber();
skip = recordNumber - record;
seek0(fileIndex.getNearestPosition(record));
}
} else if (recordNumber > currentRecordNumber && recordNumber - currentRecordNumber < fileIndex.getStep()) {
skip = recordNumber - currentRecordNumber;
} else {
seek0(fileIndex.getNearestPosition(recordNumber));
skip = recordNumber - fileIndex.getNearestRecordNumber(recordNumber);
}
for (; skip > 0; --skip)
skip();
currentRecordNumber = recordNumber;
} | class class_name[name] begin[{]
method[seekToRecord, return_type[void], modifier[public], parameter[recordNumber]] begin[{]
if[binary_operation[member[.currentRecordNumber], ==, member[.recordNumber]]] begin[{]
return[None]
else begin[{]
None
end[}]
local_variable[type[long], skip]
if[binary_operation[member[.recordNumber], <, call[fileIndex.getStartingRecordNumber, parameter[]]]] begin[{]
if[binary_operation[member[.currentRecordNumber], <, member[.recordNumber]]] begin[{]
assign[member[.skip], binary_operation[member[.recordNumber], -, member[.currentRecordNumber]]]
else begin[{]
assign[member[.skip], member[.recordNumber]]
call[.seek0, parameter[literal[0]]]
end[}]
else begin[{]
if[binary_operation[member[.recordNumber], >, call[fileIndex.getLastRecordNumber, parameter[]]]] begin[{]
if[binary_operation[member[.currentRecordNumber], <, member[.recordNumber]]] begin[{]
assign[member[.skip], binary_operation[member[.recordNumber], -, member[.currentRecordNumber]]]
else begin[{]
local_variable[type[long], record]
assign[member[.skip], binary_operation[member[.recordNumber], -, member[.record]]]
call[.seek0, parameter[call[fileIndex.getNearestPosition, parameter[member[.record]]]]]
end[}]
else begin[{]
if[binary_operation[binary_operation[member[.recordNumber], >, member[.currentRecordNumber]], &&, binary_operation[binary_operation[member[.recordNumber], -, member[.currentRecordNumber]], <, call[fileIndex.getStep, parameter[]]]]] begin[{]
assign[member[.skip], binary_operation[member[.recordNumber], -, member[.currentRecordNumber]]]
else begin[{]
call[.seek0, parameter[call[fileIndex.getNearestPosition, parameter[member[.recordNumber]]]]]
assign[member[.skip], binary_operation[member[.recordNumber], -, call[fileIndex.getNearestRecordNumber, parameter[member[.recordNumber]]]]]
end[}]
end[}]
end[}]
ForStatement(body=StatementExpression(expression=MethodInvocation(arguments=[], member=skip, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=skip, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>), init=None, update=[MemberReference(member=skip, postfix_operators=[], prefix_operators=['--'], qualifier=, selectors=[])]), label=None)
assign[member[.currentRecordNumber], member[.recordNumber]]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[seekToRecord] operator[SEP] Keyword[long] identifier[recordNumber] operator[SEP] Keyword[throws] identifier[IOException] {
Keyword[if] operator[SEP] identifier[currentRecordNumber] operator[==] identifier[recordNumber] operator[SEP] Keyword[return] operator[SEP] Keyword[long] identifier[skip] operator[SEP] Keyword[if] operator[SEP] identifier[recordNumber] operator[<] identifier[fileIndex] operator[SEP] identifier[getStartingRecordNumber] operator[SEP] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[currentRecordNumber] operator[<] identifier[recordNumber] operator[SEP] identifier[skip] operator[=] identifier[recordNumber] operator[-] identifier[currentRecordNumber] operator[SEP] Keyword[else] {
identifier[skip] operator[=] identifier[recordNumber] operator[SEP] identifier[seek0] operator[SEP] Other[0] operator[SEP] operator[SEP]
}
}
Keyword[else] Keyword[if] operator[SEP] identifier[recordNumber] operator[>] identifier[fileIndex] operator[SEP] identifier[getLastRecordNumber] operator[SEP] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[currentRecordNumber] operator[<] identifier[recordNumber] operator[SEP] identifier[skip] operator[=] identifier[recordNumber] operator[-] identifier[currentRecordNumber] operator[SEP] Keyword[else] {
Keyword[long] identifier[record] operator[=] identifier[fileIndex] operator[SEP] identifier[getLastRecordNumber] operator[SEP] operator[SEP] operator[SEP] identifier[skip] operator[=] identifier[recordNumber] operator[-] identifier[record] operator[SEP] identifier[seek0] operator[SEP] identifier[fileIndex] operator[SEP] identifier[getNearestPosition] operator[SEP] identifier[record] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[else] Keyword[if] operator[SEP] identifier[recordNumber] operator[>] identifier[currentRecordNumber] operator[&&] identifier[recordNumber] operator[-] identifier[currentRecordNumber] operator[<] identifier[fileIndex] operator[SEP] identifier[getStep] operator[SEP] operator[SEP] operator[SEP] {
identifier[skip] operator[=] identifier[recordNumber] operator[-] identifier[currentRecordNumber] operator[SEP]
}
Keyword[else] {
identifier[seek0] operator[SEP] identifier[fileIndex] operator[SEP] identifier[getNearestPosition] operator[SEP] identifier[recordNumber] operator[SEP] operator[SEP] operator[SEP] identifier[skip] operator[=] identifier[recordNumber] operator[-] identifier[fileIndex] operator[SEP] identifier[getNearestRecordNumber] operator[SEP] identifier[recordNumber] operator[SEP] operator[SEP]
}
Keyword[for] operator[SEP] operator[SEP] identifier[skip] operator[>] Other[0] operator[SEP] operator[--] identifier[skip] operator[SEP] identifier[skip] operator[SEP] operator[SEP] operator[SEP] identifier[currentRecordNumber] operator[=] identifier[recordNumber] operator[SEP]
}
|
public Deferred<byte[]> resolveTags(final TSDB tsdb,
final Set<String> literals) {
final Config config = tsdb.getConfig();
/**
* Allows the filter to avoid killing the entire query when we can't resolve
* a tag value to a UID.
*/
class TagVErrback implements Callback<byte[], Exception> {
@Override
public byte[] call(final Exception e) throws Exception {
if (config.getBoolean("tsd.query.skip_unresolved_tagvs")) {
LOG.warn("Query tag value not found: " + e.getMessage());
return null;
} else {
throw e;
}
}
}
/**
* Stores the non-null UIDs in the local list and then sorts them in
* prep for use in the regex filter
*/
class ResolvedTagVCB implements Callback<byte[], ArrayList<byte[]>> {
@Override
public byte[] call(final ArrayList<byte[]> results)
throws Exception {
tagv_uids = new ArrayList<byte[]>(results.size() - 1);
for (final byte[] tagv : results) {
if (tagv != null) {
tagv_uids.add(tagv);
}
}
Collections.sort(tagv_uids, Bytes.MEMCMP);
return tagk_bytes;
}
}
/**
* Super simple callback to set the local tagk and returns null so it won't
* be included in the tag value UID lookups.
*/
class ResolvedTagKCB implements Callback<byte[], byte[]> {
@Override
public byte[] call(final byte[] uid) throws Exception {
tagk_bytes = uid;
return null;
}
}
final List<Deferred<byte[]>> tagvs =
new ArrayList<Deferred<byte[]>>(literals.size());
for (final String tagv : literals) {
tagvs.add(tsdb.getUIDAsync(UniqueIdType.TAGV, tagv)
.addErrback(new TagVErrback()));
}
// ugly hack to resolve the tagk UID. The callback will return null and we'll
// remove it from the UID list.
tagvs.add(tsdb.getUIDAsync(UniqueIdType.TAGK, tagk)
.addCallback(new ResolvedTagKCB()));
return Deferred.group(tagvs).addCallback(new ResolvedTagVCB());
} | class class_name[name] begin[{]
method[resolveTags, return_type[type[Deferred]], modifier[public], parameter[tsdb, literals]] begin[{]
local_variable[type[Config], config]
class class_name[TagVErrback] begin[{]
method[call, return_type[type[byte]], modifier[public], parameter[e]] begin[{]
if[call[config.getBoolean, parameter[literal["tsd.query.skip_unresolved_tagvs"]]]] begin[{]
call[LOG.warn, parameter[binary_operation[literal["Query tag value not found: "], +, call[e.getMessage, parameter[]]]]]
return[literal[null]]
else begin[{]
ThrowStatement(expression=MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)
end[}]
end[}]
END[}]
class class_name[ResolvedTagVCB] begin[{]
method[call, return_type[type[byte]], modifier[public], parameter[results]] begin[{]
assign[member[.tagv_uids], ClassCreator(arguments=[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=1), operator=-)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=BasicType(dimensions=[None], name=byte))], dimensions=None, name=ArrayList, sub_type=None))]
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=tagv, 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=tagv, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=tagv_uids, 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=tagv)], modifiers={'final'}, type=BasicType(dimensions=[None], name=byte))), label=None)
call[Collections.sort, parameter[member[.tagv_uids], member[Bytes.MEMCMP]]]
return[member[.tagk_bytes]]
end[}]
END[}]
class class_name[ResolvedTagKCB] begin[{]
method[call, return_type[type[byte]], modifier[public], parameter[uid]] begin[{]
assign[member[.tagk_bytes], member[.uid]]
return[literal[null]]
end[}]
END[}]
local_variable[type[List], tagvs]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=TAGV, postfix_operators=[], prefix_operators=[], qualifier=UniqueIdType, selectors=[]), MemberReference(member=tagv, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getUIDAsync, postfix_operators=[], prefix_operators=[], qualifier=tsdb, selectors=[MethodInvocation(arguments=[ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=TagVErrback, sub_type=None))], member=addErrback, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=tagvs, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=literals, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=tagv)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None)
call[tagvs.add, parameter[call[tsdb.getUIDAsync, parameter[member[UniqueIdType.TAGK], member[.tagk]]]]]
return[call[Deferred.group, parameter[member[.tagvs]]]]
end[}]
END[}] | Keyword[public] identifier[Deferred] operator[<] Keyword[byte] operator[SEP] operator[SEP] operator[>] identifier[resolveTags] operator[SEP] Keyword[final] identifier[TSDB] identifier[tsdb] , Keyword[final] identifier[Set] operator[<] identifier[String] operator[>] identifier[literals] operator[SEP] {
Keyword[final] identifier[Config] identifier[config] operator[=] identifier[tsdb] operator[SEP] identifier[getConfig] operator[SEP] operator[SEP] operator[SEP] Keyword[class] identifier[TagVErrback] Keyword[implements] identifier[Callback] operator[<] Keyword[byte] operator[SEP] operator[SEP] , identifier[Exception] operator[>] {
annotation[@] identifier[Override] Keyword[public] Keyword[byte] operator[SEP] operator[SEP] identifier[call] operator[SEP] Keyword[final] identifier[Exception] identifier[e] operator[SEP] Keyword[throws] identifier[Exception] {
Keyword[if] operator[SEP] identifier[config] operator[SEP] identifier[getBoolean] operator[SEP] literal[String] operator[SEP] operator[SEP] {
identifier[LOG] operator[SEP] identifier[warn] operator[SEP] literal[String] operator[+] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] Other[null] operator[SEP]
}
Keyword[else] {
Keyword[throw] identifier[e] operator[SEP]
}
}
}
Keyword[class] identifier[ResolvedTagVCB] Keyword[implements] identifier[Callback] operator[<] Keyword[byte] operator[SEP] operator[SEP] , identifier[ArrayList] operator[<] Keyword[byte] operator[SEP] operator[SEP] operator[>] operator[>] {
annotation[@] identifier[Override] Keyword[public] Keyword[byte] operator[SEP] operator[SEP] identifier[call] operator[SEP] Keyword[final] identifier[ArrayList] operator[<] Keyword[byte] operator[SEP] operator[SEP] operator[>] identifier[results] operator[SEP] Keyword[throws] identifier[Exception] {
identifier[tagv_uids] operator[=] Keyword[new] identifier[ArrayList] operator[<] Keyword[byte] operator[SEP] operator[SEP] operator[>] operator[SEP] identifier[results] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[-] Other[1] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[final] Keyword[byte] operator[SEP] operator[SEP] identifier[tagv] operator[:] identifier[results] operator[SEP] {
Keyword[if] operator[SEP] identifier[tagv] operator[!=] Other[null] operator[SEP] {
identifier[tagv_uids] operator[SEP] identifier[add] operator[SEP] identifier[tagv] operator[SEP] operator[SEP]
}
}
identifier[Collections] operator[SEP] identifier[sort] operator[SEP] identifier[tagv_uids] , identifier[Bytes] operator[SEP] identifier[MEMCMP] operator[SEP] operator[SEP] Keyword[return] identifier[tagk_bytes] operator[SEP]
}
}
Keyword[class] identifier[ResolvedTagKCB] Keyword[implements] identifier[Callback] operator[<] Keyword[byte] operator[SEP] operator[SEP] , Keyword[byte] operator[SEP] operator[SEP] operator[>] {
annotation[@] identifier[Override] Keyword[public] Keyword[byte] operator[SEP] operator[SEP] identifier[call] operator[SEP] Keyword[final] Keyword[byte] operator[SEP] operator[SEP] identifier[uid] operator[SEP] Keyword[throws] identifier[Exception] {
identifier[tagk_bytes] operator[=] identifier[uid] operator[SEP] Keyword[return] Other[null] operator[SEP]
}
}
Keyword[final] identifier[List] operator[<] identifier[Deferred] operator[<] Keyword[byte] operator[SEP] operator[SEP] operator[>] operator[>] identifier[tagvs] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[Deferred] operator[<] Keyword[byte] operator[SEP] operator[SEP] operator[>] operator[>] operator[SEP] identifier[literals] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[final] identifier[String] identifier[tagv] operator[:] identifier[literals] operator[SEP] {
identifier[tagvs] operator[SEP] identifier[add] operator[SEP] identifier[tsdb] operator[SEP] identifier[getUIDAsync] operator[SEP] identifier[UniqueIdType] operator[SEP] identifier[TAGV] , identifier[tagv] operator[SEP] operator[SEP] identifier[addErrback] operator[SEP] Keyword[new] identifier[TagVErrback] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
identifier[tagvs] operator[SEP] identifier[add] operator[SEP] identifier[tsdb] operator[SEP] identifier[getUIDAsync] operator[SEP] identifier[UniqueIdType] operator[SEP] identifier[TAGK] , identifier[tagk] operator[SEP] operator[SEP] identifier[addCallback] operator[SEP] Keyword[new] identifier[ResolvedTagKCB] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[Deferred] operator[SEP] identifier[group] operator[SEP] identifier[tagvs] operator[SEP] operator[SEP] identifier[addCallback] operator[SEP] Keyword[new] identifier[ResolvedTagVCB] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case AfplibPackage.BCP__RS_NAME:
return RS_NAME_EDEFAULT == null ? rsName != null : !RS_NAME_EDEFAULT.equals(rsName);
case AfplibPackage.BCP__TRIPLETS:
return triplets != null && !triplets.isEmpty();
}
return super.eIsSet(featureID);
} | class class_name[name] begin[{]
method[eIsSet, return_type[type[boolean]], modifier[public], parameter[featureID]] begin[{]
SwitchStatement(cases=[SwitchStatementCase(case=[MemberReference(member=BCP__RS_NAME, postfix_operators=[], prefix_operators=[], qualifier=AfplibPackage, selectors=[])], statements=[ReturnStatement(expression=TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=RS_NAME_EDEFAULT, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), if_false=MethodInvocation(arguments=[MemberReference(member=rsName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equals, postfix_operators=[], prefix_operators=['!'], qualifier=RS_NAME_EDEFAULT, selectors=[], type_arguments=None), if_true=BinaryOperation(operandl=MemberReference(member=rsName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=)), label=None)]), SwitchStatementCase(case=[MemberReference(member=BCP__TRIPLETS, postfix_operators=[], prefix_operators=[], qualifier=AfplibPackage, selectors=[])], statements=[ReturnStatement(expression=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=triplets, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operandr=MethodInvocation(arguments=[], member=isEmpty, postfix_operators=[], prefix_operators=['!'], qualifier=triplets, selectors=[], type_arguments=None), operator=&&), label=None)])], expression=MemberReference(member=featureID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)
return[SuperMethodInvocation(arguments=[MemberReference(member=featureID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=eIsSet, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None)]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] Keyword[boolean] identifier[eIsSet] operator[SEP] Keyword[int] identifier[featureID] operator[SEP] {
Keyword[switch] operator[SEP] identifier[featureID] operator[SEP] {
Keyword[case] identifier[AfplibPackage] operator[SEP] identifier[BCP__RS_NAME] operator[:] Keyword[return] identifier[RS_NAME_EDEFAULT] operator[==] Other[null] operator[?] identifier[rsName] operator[!=] Other[null] operator[:] operator[!] identifier[RS_NAME_EDEFAULT] operator[SEP] identifier[equals] operator[SEP] identifier[rsName] operator[SEP] operator[SEP] Keyword[case] identifier[AfplibPackage] operator[SEP] identifier[BCP__TRIPLETS] operator[:] Keyword[return] identifier[triplets] operator[!=] Other[null] operator[&&] operator[!] identifier[triplets] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] Keyword[super] operator[SEP] identifier[eIsSet] operator[SEP] identifier[featureID] operator[SEP] operator[SEP]
}
|
public void importFromMixed(Reader r, boolean deduceFromSeeds) {
BufferedReader reader = new BufferedReader(r);
String s;
Iterator<String> iter =
new RegexLineIterator(
new LineReadingIterator(reader),
RegexLineIterator.COMMENT_LINE,
RegexLineIterator.NONWHITESPACE_ENTRY_TRAILING_COMMENT,
RegexLineIterator.ENTRY);
while (iter.hasNext()) {
s = (String) iter.next();
if(s.startsWith(SURT_PREFIX_DIRECTIVE)) {
considerAsAddDirective(s.substring(SURT_PREFIX_DIRECTIVE.length()));
continue;
} else {
if(deduceFromSeeds) {
// also deducing 'implied' SURT prefixes
// from normal URIs/hostname seeds
addFromPlain(s);
}
}
}
} | class class_name[name] begin[{]
method[importFromMixed, return_type[void], modifier[public], parameter[r, deduceFromSeeds]] begin[{]
local_variable[type[BufferedReader], reader]
local_variable[type[String], s]
local_variable[type[Iterator], iter]
while[call[iter.hasNext, parameter[]]] begin[{]
assign[member[.s], Cast(expression=MethodInvocation(arguments=[], member=next, postfix_operators=[], prefix_operators=[], qualifier=iter, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))]
if[call[s.startsWith, parameter[member[.SURT_PREFIX_DIRECTIVE]]]] begin[{]
call[.considerAsAddDirective, parameter[call[s.substring, parameter[call[SURT_PREFIX_DIRECTIVE.length, parameter[]]]]]]
ContinueStatement(goto=None, label=None)
else begin[{]
if[member[.deduceFromSeeds]] begin[{]
call[.addFromPlain, parameter[member[.s]]]
else begin[{]
None
end[}]
end[}]
end[}]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[importFromMixed] operator[SEP] identifier[Reader] identifier[r] , Keyword[boolean] identifier[deduceFromSeeds] operator[SEP] {
identifier[BufferedReader] identifier[reader] operator[=] Keyword[new] identifier[BufferedReader] operator[SEP] identifier[r] operator[SEP] operator[SEP] identifier[String] identifier[s] operator[SEP] identifier[Iterator] operator[<] identifier[String] operator[>] identifier[iter] operator[=] Keyword[new] identifier[RegexLineIterator] operator[SEP] Keyword[new] identifier[LineReadingIterator] operator[SEP] identifier[reader] operator[SEP] , identifier[RegexLineIterator] operator[SEP] identifier[COMMENT_LINE] , identifier[RegexLineIterator] operator[SEP] identifier[NONWHITESPACE_ENTRY_TRAILING_COMMENT] , identifier[RegexLineIterator] operator[SEP] identifier[ENTRY] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[iter] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] {
identifier[s] operator[=] operator[SEP] identifier[String] operator[SEP] identifier[iter] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[s] operator[SEP] identifier[startsWith] operator[SEP] identifier[SURT_PREFIX_DIRECTIVE] operator[SEP] operator[SEP] {
identifier[considerAsAddDirective] operator[SEP] identifier[s] operator[SEP] identifier[substring] operator[SEP] identifier[SURT_PREFIX_DIRECTIVE] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[continue] operator[SEP]
}
Keyword[else] {
Keyword[if] operator[SEP] identifier[deduceFromSeeds] operator[SEP] {
identifier[addFromPlain] operator[SEP] identifier[s] operator[SEP] operator[SEP]
}
}
}
}
|
@Override
public Collection<FacetRank> calculateRank(@NotNull Collection<Facet> facets) {
return rankingAlgorithm.calculate(facets);
} | class class_name[name] begin[{]
method[calculateRank, return_type[type[Collection]], modifier[public], parameter[facets]] begin[{]
return[call[rankingAlgorithm.calculate, parameter[member[.facets]]]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] identifier[Collection] operator[<] identifier[FacetRank] operator[>] identifier[calculateRank] operator[SEP] annotation[@] identifier[NotNull] identifier[Collection] operator[<] identifier[Facet] operator[>] identifier[facets] operator[SEP] {
Keyword[return] identifier[rankingAlgorithm] operator[SEP] identifier[calculate] operator[SEP] identifier[facets] operator[SEP] operator[SEP]
}
|
public static <T extends XMLObject> void addAttributeValue(Attribute attribute, T value) {
attribute.getAttributeValues().add(value);
} | class class_name[name] begin[{]
method[addAttributeValue, return_type[void], modifier[public static], parameter[attribute, value]] begin[{]
call[attribute.getAttributeValues, parameter[]]
end[}]
END[}] | Keyword[public] Keyword[static] operator[<] identifier[T] Keyword[extends] identifier[XMLObject] operator[>] Keyword[void] identifier[addAttributeValue] operator[SEP] identifier[Attribute] identifier[attribute] , identifier[T] identifier[value] operator[SEP] {
identifier[attribute] operator[SEP] identifier[getAttributeValues] operator[SEP] operator[SEP] operator[SEP] identifier[add] operator[SEP] identifier[value] operator[SEP] operator[SEP]
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.