code stringlengths 63 466k | code_sememe stringlengths 141 3.79M | token_type stringlengths 274 1.23M |
|---|---|---|
public List<IndexableField> indexableFields(Columns columns) {
List<IndexableField> fields = new LinkedList<>();
mappers.values().forEach(mapper -> fields.addAll(mapper.bestEffortIndexableFields(columns)));
return fields;
} | class class_name[name] begin[{]
method[indexableFields, return_type[type[List]], modifier[public], parameter[columns]] begin[{]
local_variable[type[List], fields]
call[mappers.values, parameter[]]
return[member[.fields]]
end[}]
END[}] | Keyword[public] identifier[List] operator[<] identifier[IndexableField] operator[>] identifier[indexableFields] operator[SEP] identifier[Columns] identifier[columns] operator[SEP] {
identifier[List] operator[<] identifier[IndexableField] operator[>] identifier[fields] operator[=] Keyword[new] identifier[LinkedList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[mappers] operator[SEP] identifier[values] operator[SEP] operator[SEP] operator[SEP] identifier[forEach] operator[SEP] identifier[mapper] operator[->] identifier[fields] operator[SEP] identifier[addAll] operator[SEP] identifier[mapper] operator[SEP] identifier[bestEffortIndexableFields] operator[SEP] identifier[columns] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[fields] operator[SEP]
}
|
public static boolean isPut(final WebContext context) {
return HttpConstants.HTTP_METHOD.PUT.name().equalsIgnoreCase(context.getRequestMethod());
} | class class_name[name] begin[{]
method[isPut, return_type[type[boolean]], modifier[public static], parameter[context]] begin[{]
return[call[HttpConstants.HTTP_METHOD.PUT.name, parameter[]]]
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[boolean] identifier[isPut] operator[SEP] Keyword[final] identifier[WebContext] identifier[context] operator[SEP] {
Keyword[return] identifier[HttpConstants] operator[SEP] identifier[HTTP_METHOD] operator[SEP] identifier[PUT] operator[SEP] identifier[name] operator[SEP] operator[SEP] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] identifier[context] operator[SEP] identifier[getRequestMethod] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
public static List<DependencyNode> getExtraDependencies(List<DependencyNode> nodes) {
ExtraArtifactsHandler fetcher = new ExtraArtifactsHandler(nodes);
if (isSet("thorntail.download.sources")) {
fetcher.addWithClassifier("sources");
}
if (isSet("thorntail.download.poms")) {
fetcher.addWithExtension("pom");
}
if (isSet("thorntail.download.javadocs")) {
fetcher.addWithClassifier("javadoc");
}
return fetcher.output;
} | class class_name[name] begin[{]
method[getExtraDependencies, return_type[type[List]], modifier[public static], parameter[nodes]] begin[{]
local_variable[type[ExtraArtifactsHandler], fetcher]
if[call[.isSet, parameter[literal["thorntail.download.sources"]]]] begin[{]
call[fetcher.addWithClassifier, parameter[literal["sources"]]]
else begin[{]
None
end[}]
if[call[.isSet, parameter[literal["thorntail.download.poms"]]]] begin[{]
call[fetcher.addWithExtension, parameter[literal["pom"]]]
else begin[{]
None
end[}]
if[call[.isSet, parameter[literal["thorntail.download.javadocs"]]]] begin[{]
call[fetcher.addWithClassifier, parameter[literal["javadoc"]]]
else begin[{]
None
end[}]
return[member[fetcher.output]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[List] operator[<] identifier[DependencyNode] operator[>] identifier[getExtraDependencies] operator[SEP] identifier[List] operator[<] identifier[DependencyNode] operator[>] identifier[nodes] operator[SEP] {
identifier[ExtraArtifactsHandler] identifier[fetcher] operator[=] Keyword[new] identifier[ExtraArtifactsHandler] operator[SEP] identifier[nodes] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[isSet] operator[SEP] literal[String] operator[SEP] operator[SEP] {
identifier[fetcher] operator[SEP] identifier[addWithClassifier] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[isSet] operator[SEP] literal[String] operator[SEP] operator[SEP] {
identifier[fetcher] operator[SEP] identifier[addWithExtension] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[isSet] operator[SEP] literal[String] operator[SEP] operator[SEP] {
identifier[fetcher] operator[SEP] identifier[addWithClassifier] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[return] identifier[fetcher] operator[SEP] identifier[output] operator[SEP]
}
|
@Override
public RoundedMoney with(MonetaryOperator operator) {
Objects.requireNonNull(operator);
try {
return RoundedMoney.from(operator.apply(this));
} catch (MonetaryException | ArithmeticException e) {
throw e;
} catch (Exception e) {
throw new MonetaryException("Query failed: " + operator, e);
}
} | class class_name[name] begin[{]
method[with, return_type[type[RoundedMoney]], modifier[public], parameter[operator]] begin[{]
call[Objects.requireNonNull, parameter[member[.operator]]]
TryStatement(block=[ReturnStatement(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[])], member=apply, postfix_operators=[], prefix_operators=[], qualifier=operator, selectors=[], type_arguments=None)], member=from, postfix_operators=[], prefix_operators=[], qualifier=RoundedMoney, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['MonetaryException', 'ArithmeticException'])), CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Query failed: "), operandr=MemberReference(member=operator, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=MonetaryException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None)
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] identifier[RoundedMoney] identifier[with] operator[SEP] identifier[MonetaryOperator] identifier[operator] operator[SEP] {
identifier[Objects] operator[SEP] identifier[requireNonNull] operator[SEP] identifier[operator] operator[SEP] operator[SEP] Keyword[try] {
Keyword[return] identifier[RoundedMoney] operator[SEP] identifier[from] operator[SEP] identifier[operator] operator[SEP] identifier[apply] operator[SEP] Keyword[this] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[MonetaryException] operator[|] identifier[ArithmeticException] identifier[e] operator[SEP] {
Keyword[throw] identifier[e] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] {
Keyword[throw] Keyword[new] identifier[MonetaryException] operator[SEP] literal[String] operator[+] identifier[operator] , identifier[e] operator[SEP] operator[SEP]
}
}
|
private void resizeStorage() {
int currentElementsPerNode = maxElementsPerNode;
int newElementsPerNode = (int) (currentElementsPerNode * RESIZE_MULTIPLE);
if (newElementsPerNode <= currentElementsPerNode) {
throw new IllegalStateException("cannot resize fixed length array from "
+ currentElementsPerNode + " to " + newElementsPerNode);
}
FixedLengthElementArray newStorage = new FixedLengthElementArray(memoryRecycler,
numNodes * bitsPerElement * newElementsPerNode);
LongStream.range(0, numNodes).forEach(nodeIndex -> {
long currentBucketStart = nodeIndex * currentElementsPerNode * bitsPerElement;
long newBucketStart = nodeIndex * newElementsPerNode * bitsPerElement;
for (int offset = 0; offset < currentElementsPerNode; offset++) {
long element = storage.getElementValue(currentBucketStart + offset * bitsPerElement,
bitsPerElement, elementMask);
if (element == NO_ELEMENT) {
break; // we have exhausted the elements at this index
}
newStorage.setElementValue(
newBucketStart + offset * bitsPerElement, bitsPerElement, element);
}
});
storage.destroy(memoryRecycler);
storage = newStorage;
maxElementsPerNode = newElementsPerNode;
} | class class_name[name] begin[{]
method[resizeStorage, return_type[void], modifier[private], parameter[]] begin[{]
local_variable[type[int], currentElementsPerNode]
local_variable[type[int], newElementsPerNode]
if[binary_operation[member[.newElementsPerNode], <=, member[.currentElementsPerNode]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="cannot resize fixed length array from "), operandr=MemberReference(member=currentElementsPerNode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" to "), operator=+), operandr=MemberReference(member=newElementsPerNode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalStateException, sub_type=None)), label=None)
else begin[{]
None
end[}]
local_variable[type[FixedLengthElementArray], newStorage]
call[LongStream.range, parameter[literal[0], member[.numNodes]]]
call[storage.destroy, parameter[member[.memoryRecycler]]]
assign[member[.storage], member[.newStorage]]
assign[member[.maxElementsPerNode], member[.newElementsPerNode]]
end[}]
END[}] | Keyword[private] Keyword[void] identifier[resizeStorage] operator[SEP] operator[SEP] {
Keyword[int] identifier[currentElementsPerNode] operator[=] identifier[maxElementsPerNode] operator[SEP] Keyword[int] identifier[newElementsPerNode] operator[=] operator[SEP] Keyword[int] operator[SEP] operator[SEP] identifier[currentElementsPerNode] operator[*] identifier[RESIZE_MULTIPLE] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[newElementsPerNode] operator[<=] identifier[currentElementsPerNode] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] literal[String] operator[+] identifier[currentElementsPerNode] operator[+] literal[String] operator[+] identifier[newElementsPerNode] operator[SEP] operator[SEP]
}
identifier[FixedLengthElementArray] identifier[newStorage] operator[=] Keyword[new] identifier[FixedLengthElementArray] operator[SEP] identifier[memoryRecycler] , identifier[numNodes] operator[*] identifier[bitsPerElement] operator[*] identifier[newElementsPerNode] operator[SEP] operator[SEP] identifier[LongStream] operator[SEP] identifier[range] operator[SEP] Other[0] , identifier[numNodes] operator[SEP] operator[SEP] identifier[forEach] operator[SEP] identifier[nodeIndex] operator[->] {
Keyword[long] identifier[currentBucketStart] operator[=] identifier[nodeIndex] operator[*] identifier[currentElementsPerNode] operator[*] identifier[bitsPerElement] operator[SEP] Keyword[long] identifier[newBucketStart] operator[=] identifier[nodeIndex] operator[*] identifier[newElementsPerNode] operator[*] identifier[bitsPerElement] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[offset] operator[=] Other[0] operator[SEP] identifier[offset] operator[<] identifier[currentElementsPerNode] operator[SEP] identifier[offset] operator[++] operator[SEP] {
Keyword[long] identifier[element] operator[=] identifier[storage] operator[SEP] identifier[getElementValue] operator[SEP] identifier[currentBucketStart] operator[+] identifier[offset] operator[*] identifier[bitsPerElement] , identifier[bitsPerElement] , identifier[elementMask] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[element] operator[==] identifier[NO_ELEMENT] operator[SEP] {
Keyword[break] operator[SEP]
}
identifier[newStorage] operator[SEP] identifier[setElementValue] operator[SEP] identifier[newBucketStart] operator[+] identifier[offset] operator[*] identifier[bitsPerElement] , identifier[bitsPerElement] , identifier[element] operator[SEP] operator[SEP]
}
} operator[SEP] operator[SEP] identifier[storage] operator[SEP] identifier[destroy] operator[SEP] identifier[memoryRecycler] operator[SEP] operator[SEP] identifier[storage] operator[=] identifier[newStorage] operator[SEP] identifier[maxElementsPerNode] operator[=] identifier[newElementsPerNode] operator[SEP]
}
|
public static PTtlAction toProtobuf(TtlAction ttlAction) {
if (ttlAction == null) {
return PTtlAction.DELETE;
}
switch (ttlAction) {
case DELETE:
return PTtlAction.DELETE;
case FREE:
return PTtlAction.FREE;
default:
throw new IllegalStateException("Unknown ttl action: " + ttlAction);
}
} | class class_name[name] begin[{]
method[toProtobuf, return_type[type[PTtlAction]], modifier[public static], parameter[ttlAction]] begin[{]
if[binary_operation[member[.ttlAction], ==, literal[null]]] begin[{]
return[member[PTtlAction.DELETE]]
else begin[{]
None
end[}]
SwitchStatement(cases=[SwitchStatementCase(case=['DELETE'], statements=[ReturnStatement(expression=MemberReference(member=DELETE, postfix_operators=[], prefix_operators=[], qualifier=PTtlAction, selectors=[]), label=None)]), SwitchStatementCase(case=['FREE'], statements=[ReturnStatement(expression=MemberReference(member=FREE, postfix_operators=[], prefix_operators=[], qualifier=PTtlAction, selectors=[]), label=None)]), SwitchStatementCase(case=[], statements=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unknown ttl action: "), operandr=MemberReference(member=ttlAction, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalStateException, sub_type=None)), label=None)])], expression=MemberReference(member=ttlAction, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)
end[}]
END[}] | Keyword[public] Keyword[static] identifier[PTtlAction] identifier[toProtobuf] operator[SEP] identifier[TtlAction] identifier[ttlAction] operator[SEP] {
Keyword[if] operator[SEP] identifier[ttlAction] operator[==] Other[null] operator[SEP] {
Keyword[return] identifier[PTtlAction] operator[SEP] identifier[DELETE] operator[SEP]
}
Keyword[switch] operator[SEP] identifier[ttlAction] operator[SEP] {
Keyword[case] identifier[DELETE] operator[:] Keyword[return] identifier[PTtlAction] operator[SEP] identifier[DELETE] operator[SEP] Keyword[case] identifier[FREE] operator[:] Keyword[return] identifier[PTtlAction] operator[SEP] identifier[FREE] operator[SEP] Keyword[default] operator[:] Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] literal[String] operator[+] identifier[ttlAction] operator[SEP] operator[SEP]
}
}
|
public static BufferedImage loadImage(URL url) {
if( url == null )
return null;
try {
BufferedImage buffered = ImageIO.read(url);
if( buffered != null )
return buffered;
if( url.getProtocol().equals("file")) {
String path = URLDecoder.decode(url.getPath(), "UTF-8");
if( !new File(path).exists() ) {
System.err.println("File does not exist: "+path);
return null;
}
}
} catch (IOException ignore) {}
try {
InputStream stream = url.openStream();
String path = url.toString();
if( path.toLowerCase().endsWith("ppm")) {
return loadPPM(stream,null);
} else if( path.toLowerCase().endsWith("pgm") ) {
return loadPGM(stream, null);
}
stream.close();
} catch (IOException ignore) {}
return null;
} | class class_name[name] begin[{]
method[loadImage, return_type[type[BufferedImage]], modifier[public static], parameter[url]] begin[{]
if[binary_operation[member[.url], ==, literal[null]]] begin[{]
return[literal[null]]
else begin[{]
None
end[}]
TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=url, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=read, postfix_operators=[], prefix_operators=[], qualifier=ImageIO, selectors=[], type_arguments=None), name=buffered)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=BufferedImage, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=buffered, 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=ReturnStatement(expression=MemberReference(member=buffered, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)), IfStatement(condition=MethodInvocation(arguments=[], member=getProtocol, postfix_operators=[], prefix_operators=[], qualifier=url, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="file")], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getPath, postfix_operators=[], prefix_operators=[], qualifier=url, selectors=[], type_arguments=None), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="UTF-8")], member=decode, postfix_operators=[], prefix_operators=[], qualifier=URLDecoder, selectors=[], type_arguments=None), name=path)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=ClassCreator(arguments=[MemberReference(member=path, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=['!'], qualifier=None, selectors=[MethodInvocation(arguments=[], member=exists, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=File, sub_type=None)), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="File does not exist: "), operandr=MemberReference(member=path, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=println, postfix_operators=[], prefix_operators=[], qualifier=System.err, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), label=None)]))]))], catches=[CatchClause(block=[], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ignore, types=['IOException']))], finally_block=None, label=None, resources=None)
TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=openStream, postfix_operators=[], prefix_operators=[], qualifier=url, selectors=[], type_arguments=None), name=stream)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=InputStream, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=url, selectors=[], type_arguments=None), name=path)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[], member=toLowerCase, postfix_operators=[], prefix_operators=[], qualifier=path, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="ppm")], member=endsWith, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), else_statement=IfStatement(condition=MethodInvocation(arguments=[], member=toLowerCase, postfix_operators=[], prefix_operators=[], qualifier=path, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="pgm")], member=endsWith, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=stream, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], member=loadPGM, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=stream, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], member=loadPPM, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[], member=close, postfix_operators=[], prefix_operators=[], qualifier=stream, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ignore, types=['IOException']))], finally_block=None, label=None, resources=None)
return[literal[null]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[BufferedImage] identifier[loadImage] operator[SEP] identifier[URL] identifier[url] operator[SEP] {
Keyword[if] operator[SEP] identifier[url] operator[==] Other[null] operator[SEP] Keyword[return] Other[null] operator[SEP] Keyword[try] {
identifier[BufferedImage] identifier[buffered] operator[=] identifier[ImageIO] operator[SEP] identifier[read] operator[SEP] identifier[url] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[buffered] operator[!=] Other[null] operator[SEP] Keyword[return] identifier[buffered] operator[SEP] Keyword[if] operator[SEP] identifier[url] operator[SEP] identifier[getProtocol] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] {
identifier[String] identifier[path] operator[=] identifier[URLDecoder] operator[SEP] identifier[decode] operator[SEP] identifier[url] operator[SEP] identifier[getPath] operator[SEP] operator[SEP] , literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] Keyword[new] identifier[File] operator[SEP] identifier[path] operator[SEP] operator[SEP] identifier[exists] operator[SEP] operator[SEP] operator[SEP] {
identifier[System] operator[SEP] identifier[err] operator[SEP] identifier[println] operator[SEP] literal[String] operator[+] identifier[path] operator[SEP] operator[SEP] Keyword[return] Other[null] operator[SEP]
}
}
}
Keyword[catch] operator[SEP] identifier[IOException] identifier[ignore] operator[SEP] {
}
Keyword[try] {
identifier[InputStream] identifier[stream] operator[=] identifier[url] operator[SEP] identifier[openStream] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[path] operator[=] identifier[url] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[path] operator[SEP] identifier[toLowerCase] operator[SEP] operator[SEP] operator[SEP] identifier[endsWith] operator[SEP] literal[String] operator[SEP] operator[SEP] {
Keyword[return] identifier[loadPPM] operator[SEP] identifier[stream] , Other[null] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[path] operator[SEP] identifier[toLowerCase] operator[SEP] operator[SEP] operator[SEP] identifier[endsWith] operator[SEP] literal[String] operator[SEP] operator[SEP] {
Keyword[return] identifier[loadPGM] operator[SEP] identifier[stream] , Other[null] operator[SEP] operator[SEP]
}
identifier[stream] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[IOException] identifier[ignore] operator[SEP] {
}
Keyword[return] Other[null] operator[SEP]
}
|
public AbstractUsageParameterSet getInstalledUsageParameterSet(String name) {
if (name == null) {
return getDefaultInstalledUsageParameterSet();
} else {
UsageMBeanImpl usageMBean = usageMBeans.get(name);
if (usageMBean == null) {
return null;
} else {
return usageMBean.getUsageParameter();
}
}
} | class class_name[name] begin[{]
method[getInstalledUsageParameterSet, return_type[type[AbstractUsageParameterSet]], modifier[public], parameter[name]] begin[{]
if[binary_operation[member[.name], ==, literal[null]]] begin[{]
return[call[.getDefaultInstalledUsageParameterSet, parameter[]]]
else begin[{]
local_variable[type[UsageMBeanImpl], usageMBean]
if[binary_operation[member[.usageMBean], ==, literal[null]]] begin[{]
return[literal[null]]
else begin[{]
return[call[usageMBean.getUsageParameter, parameter[]]]
end[}]
end[}]
end[}]
END[}] | Keyword[public] identifier[AbstractUsageParameterSet] identifier[getInstalledUsageParameterSet] operator[SEP] identifier[String] identifier[name] operator[SEP] {
Keyword[if] operator[SEP] identifier[name] operator[==] Other[null] operator[SEP] {
Keyword[return] identifier[getDefaultInstalledUsageParameterSet] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[UsageMBeanImpl] identifier[usageMBean] operator[=] identifier[usageMBeans] operator[SEP] identifier[get] operator[SEP] identifier[name] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[usageMBean] operator[==] Other[null] operator[SEP] {
Keyword[return] Other[null] operator[SEP]
}
Keyword[else] {
Keyword[return] identifier[usageMBean] operator[SEP] identifier[getUsageParameter] operator[SEP] operator[SEP] operator[SEP]
}
}
}
|
public static boolean read(InputStream ios, BufrTables.Tables tables) throws IOException {
if (ios == null)
return false;
if (tables.b == null)
tables.b = new TableB("fake", "fake");
if (tables.d == null)
tables.d = new TableD("fake", "fake");
HashMap<String, String> number = new HashMap<>(); // key = mnemonic value = fxy
HashMap<String, String> desc = new HashMap<>(); // key = mnemonic value = description
HashMap<String, String> mnseq = new HashMap<>();
try {
BufferedReader dataIS = new BufferedReader(new InputStreamReader(ios, CDM.utf8Charset));
// read mnemonic table
Matcher m;
// read header info and disregard
while (true) {
String line = dataIS.readLine();
if (line == null) throw new RuntimeException("Bad NCEP mnemonic BUFR table ");
if (line.contains("MNEMONIC")) break;
}
// read mnemonic, number, and description
//| HEADR | 362001 | TABLE D ENTRY - PROFILE COORDINATES |
while (true) {
String line = dataIS.readLine();
if (line == null) break;
if (line.contains("MNEMONIC")) break;
if (line.contains("----")) continue;
if (line.startsWith("*")) continue;
if (line.startsWith("| ")) continue;
m = fields3.matcher(line);
if (m.find()) {
String mnu = m.group(1).trim();
String fxy = m.group(2).trim();
if (fxy.startsWith("3")) {
number.put(mnu, fxy);
desc.put(mnu, m.group(3).replace("TABLE D ENTRY - ", "").trim());
} else if (fxy.startsWith("0")) {
number.put(mnu, fxy);
desc.put(mnu, m.group(3).replace("TABLE B ENTRY - ", "").trim());
} else if (fxy.startsWith("A")) {
number.put(mnu, fxy);
desc.put(mnu, m.group(3).replace("TABLE A ENTRY - ", "").trim());
}
} else if (debugTable) {
System.out.println("bad mnemonic, number, and description: " + line);
}
}
// read in sequences using mnemonics
//| ETACLS1 | HEADR {PROFILE} SURF FLUX HYDR D10M {SLYR} XTRA |
while (true) {
String line = dataIS.readLine();
if (line == null) break;
if (line.contains("MNEMONIC")) break;
if (line.contains("----")) continue;
if (line.startsWith("| ")) continue;
if (line.startsWith("*")) continue;
m = fields2.matcher(line);
if (m.find()) {
String mnu = m.group(1).trim();
if (mnseq.containsKey(mnu)) { // concat lines with same mnu
String value = mnseq.get(mnu);
value = value + " " + m.group(2);
mnseq.put(mnu, value);
} else {
mnseq.put(mnu, m.group(2));
}
} else if (debugTable) {
System.out.println("bad sequence mnemonic: " + line);
}
}
// create sequences, replacing mnemonics with numbers
for (Map.Entry<String, String> ent : mnseq.entrySet()) {
String seq = ent.getValue();
seq = seq.replaceAll("\\<", "1-1-0 0-31-0 ");
seq = seq.replaceAll("\\>", "");
seq = seq.replaceAll("\\{", "1-1-0 0-31-1 ");
seq = seq.replaceAll("\\}", "");
seq = seq.replaceAll("\\(", "1-1-0 0-31-2 ");
seq = seq.replaceAll("\\)", "");
StringTokenizer stoke = new StringTokenizer(seq, " ");
List<Short> list = new ArrayList<>();
while (stoke.hasMoreTokens()) {
String mn = stoke.nextToken();
if (mn.charAt(1) == '-') {
list.add(Descriptor.getFxy(mn));
continue;
}
// element descriptor needs hyphens
m = ints6.matcher(mn);
if (m.find()) {
String F = mn.substring(0, 1);
String X = removeLeading0(mn.substring(1, 3));
String Y = removeLeading0(mn.substring(3));
list.add(Descriptor.getFxy(F + "-" + X + "-" + Y));
continue;
}
if (mn.startsWith("\"")) {
int idx = mn.lastIndexOf('"');
String count = mn.substring(idx + 1);
list.add(Descriptor.getFxy("1-1-" + count));
mn = mn.substring(1, idx);
}
if (mn.startsWith(".")) {
String des = mn.substring(mn.length() - 4);
mn = mn.replace(des, "....");
}
String fxy = number.get(mn);
String F = fxy.substring(0, 1);
String X = removeLeading0(fxy.substring(1, 3));
String Y = removeLeading0(fxy.substring(3));
list.add(Descriptor.getFxy(F + "-" + X + "-" + Y));
}
String fxy = number.get(ent.getKey());
String X = removeLeading0(fxy.substring(1, 3));
String Y = removeLeading0(fxy.substring(3));
// these are in latest tables
if (XlocalCutoff > Integer.parseInt(X) && YlocalCutoff > Integer.parseInt(Y))
continue;
//key = F + "-" + X + "-" + Y;
short seqX = Short.parseShort(X.trim());
short seqY = Short.parseShort(Y.trim());
tables.d.addDescriptor(seqX, seqY, ent.getKey(), list);
//short id = Descriptor.getFxy(key);
//sequences.put(Short.valueOf(id), tableD);
}
// add some static repetition sequences
// LOOK why?
List<Short> list = new ArrayList<>();
// 16 bit delayed repetition
list.add(Descriptor.getFxy("1-1-0"));
list.add(Descriptor.getFxy("0-31-2"));
tables.d.addDescriptor((short) 60, (short) 1, "", list);
//tableD = new DescriptorTableD("", "3-60-1", list, false);
//tableD.put( "3-60-1", d);
//short id = Descriptor.getFxy("3-60-1");
//sequences.put(Short.valueOf(id), tableD);
list = new ArrayList<>();
// 8 bit delayed repetition
list.add(Descriptor.getFxy("1-1-0"));
list.add(Descriptor.getFxy("0-31-1"));
tables.d.addDescriptor((short) 60, (short) 2, "", list);
//tableD = new DescriptorTableD("", "3-60-2", list, false);
//tableD.put( "3-60-2", d);
//id = Descriptor.getFxy("3-60-2");
//sequences.put(Short.valueOf(id), tableD);
list = new ArrayList<>();
// 8 bit delayed repetition
list.add(Descriptor.getFxy("1-1-0"));
list.add(Descriptor.getFxy("0-31-1"));
tables.d.addDescriptor((short) 60, (short) 3, "", list);
//tableD = new DescriptorTableD("", "3-60-3", list, false);
//tableD.put( "3-60-3", d);
//id = Descriptor.getFxy("3-60-3");
//sequences.put(Short.valueOf(id), tableD);
list = new ArrayList<>();
// 1 bit delayed repetition
list.add(Descriptor.getFxy("1-1-0"));
list.add(Descriptor.getFxy("0-31-0"));
tables.d.addDescriptor((short) 60, (short) 4, "", list);
//tableD = new DescriptorTableD("", "3-60-4", list, false);
//tableD.put( "3-60-4", d);
//id = Descriptor.getFxy("3-60-4");
//sequences.put(Short.valueOf(id), tableD);
// add in element descriptors
// MNEMONIC | SCAL | REFERENCE | BIT | UNITS
//| FTIM | 0 | 0 | 24 | SECONDS |-------------|
//tableB = new TableB(tablename, tablename);
while (true) {
String line = dataIS.readLine();
if (line == null) break;
if (line.contains("MNEMONIC")) break;
if (line.startsWith("| ")) continue;
if (line.startsWith("*")) continue;
m = fields5.matcher(line);
if (m.find()) {
if (m.group(1).equals("")) {
continue;
} else if (number.containsKey(m.group(1).trim())) { // add descriptor to tableB
String fxy = number.get(m.group(1).trim());
String X = fxy.substring(1, 3);
String Y = fxy.substring(3);
String mnu = m.group(1).trim();
String descr = desc.get(mnu);
short x = Short.parseShort(X.trim());
short y = Short.parseShort(Y.trim());
// these are in latest tables so skip LOOK WHY
if (XlocalCutoff > x && YlocalCutoff > y)
continue;
int scale = Integer.parseInt(m.group(2).trim());
int refVal = Integer.parseInt(m.group(3).trim());
int width = Integer.parseInt(m.group(4).trim());
String units = m.group(5).trim();
tables.b.addDescriptor(x, y, scale, refVal, width, mnu, units, descr);
} else if (debugTable) {
System.out.println("bad element descriptors: " + line);
}
}
}
} finally {
ios.close();
}
// LOOK why ?
// default for NCEP
// 0; 63; 0; 0; 0; 16; Numeric; Byte count
tables.b.addDescriptor((short) 63, (short) 0, 0, 0, 16, "Byte count", "Numeric", null);
return true;
} | class class_name[name] begin[{]
method[read, return_type[type[boolean]], modifier[public static], parameter[ios, tables]] begin[{]
if[binary_operation[member[.ios], ==, literal[null]]] begin[{]
return[literal[false]]
else begin[{]
None
end[}]
if[binary_operation[member[tables.b], ==, literal[null]]] begin[{]
assign[member[tables.b], ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="fake"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="fake")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=TableB, sub_type=None))]
else begin[{]
None
end[}]
if[binary_operation[member[tables.d], ==, literal[null]]] begin[{]
assign[member[tables.d], ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="fake"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="fake")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=TableD, sub_type=None))]
else begin[{]
None
end[}]
local_variable[type[HashMap], number]
local_variable[type[HashMap], desc]
local_variable[type[HashMap], mnseq]
TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[ClassCreator(arguments=[MemberReference(member=ios, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=utf8Charset, postfix_operators=[], prefix_operators=[], qualifier=CDM, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=InputStreamReader, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=BufferedReader, sub_type=None)), name=dataIS)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=BufferedReader, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=None, name=m)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Matcher, sub_type=None)), WhileStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=readLine, postfix_operators=[], prefix_operators=[], qualifier=dataIS, selectors=[], type_arguments=None), name=line)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=line, 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=ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Bad NCEP mnemonic BUFR table ")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=RuntimeException, sub_type=None)), label=None)), IfStatement(condition=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="MNEMONIC")], member=contains, postfix_operators=[], prefix_operators=[], qualifier=line, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BreakStatement(goto=None, label=None))]), condition=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true), label=None), WhileStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=readLine, postfix_operators=[], prefix_operators=[], qualifier=dataIS, selectors=[], type_arguments=None), name=line)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=line, 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=BreakStatement(goto=None, label=None)), IfStatement(condition=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="MNEMONIC")], member=contains, postfix_operators=[], prefix_operators=[], qualifier=line, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BreakStatement(goto=None, label=None)), IfStatement(condition=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="----")], member=contains, postfix_operators=[], prefix_operators=[], qualifier=line, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=ContinueStatement(goto=None, label=None)), IfStatement(condition=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="*")], member=startsWith, postfix_operators=[], prefix_operators=[], qualifier=line, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=ContinueStatement(goto=None, label=None)), IfStatement(condition=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="| ")], member=startsWith, postfix_operators=[], prefix_operators=[], qualifier=line, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=ContinueStatement(goto=None, label=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=m, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=line, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=matcher, postfix_operators=[], prefix_operators=[], qualifier=fields3, selectors=[], type_arguments=None)), label=None), IfStatement(condition=MethodInvocation(arguments=[], member=find, postfix_operators=[], prefix_operators=[], qualifier=m, selectors=[], type_arguments=None), else_statement=IfStatement(condition=MemberReference(member=debugTable, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="bad mnemonic, number, and description: "), operandr=MemberReference(member=line, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=println, postfix_operators=[], prefix_operators=[], qualifier=System.out, selectors=[], type_arguments=None), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], member=group, postfix_operators=[], prefix_operators=[], qualifier=m, selectors=[MethodInvocation(arguments=[], member=trim, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=mnu)], 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=2)], member=group, postfix_operators=[], prefix_operators=[], qualifier=m, selectors=[MethodInvocation(arguments=[], member=trim, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=fxy)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="3")], member=startsWith, postfix_operators=[], prefix_operators=[], qualifier=fxy, selectors=[], type_arguments=None), else_statement=IfStatement(condition=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="0")], member=startsWith, postfix_operators=[], prefix_operators=[], qualifier=fxy, selectors=[], type_arguments=None), else_statement=IfStatement(condition=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="A")], member=startsWith, postfix_operators=[], prefix_operators=[], qualifier=fxy, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=mnu, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=fxy, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=put, postfix_operators=[], prefix_operators=[], qualifier=number, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=mnu, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=3)], member=group, postfix_operators=[], prefix_operators=[], qualifier=m, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="TABLE A ENTRY - "), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="")], member=replace, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=trim, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=put, postfix_operators=[], prefix_operators=[], qualifier=desc, selectors=[], type_arguments=None), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=mnu, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=fxy, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=put, postfix_operators=[], prefix_operators=[], qualifier=number, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=mnu, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=3)], member=group, postfix_operators=[], prefix_operators=[], qualifier=m, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="TABLE B ENTRY - "), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="")], member=replace, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=trim, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=put, postfix_operators=[], prefix_operators=[], qualifier=desc, selectors=[], type_arguments=None), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=mnu, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=fxy, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=put, postfix_operators=[], prefix_operators=[], qualifier=number, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=mnu, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=3)], member=group, postfix_operators=[], prefix_operators=[], qualifier=m, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="TABLE D ENTRY - "), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="")], member=replace, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=trim, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=put, postfix_operators=[], prefix_operators=[], qualifier=desc, selectors=[], type_arguments=None), label=None)]))]))]), condition=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true), label=None), WhileStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=readLine, postfix_operators=[], prefix_operators=[], qualifier=dataIS, selectors=[], type_arguments=None), name=line)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=line, 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=BreakStatement(goto=None, label=None)), IfStatement(condition=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="MNEMONIC")], member=contains, postfix_operators=[], prefix_operators=[], qualifier=line, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BreakStatement(goto=None, label=None)), IfStatement(condition=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="----")], member=contains, postfix_operators=[], prefix_operators=[], qualifier=line, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=ContinueStatement(goto=None, label=None)), IfStatement(condition=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="| ")], member=startsWith, postfix_operators=[], prefix_operators=[], qualifier=line, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=ContinueStatement(goto=None, label=None)), IfStatement(condition=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="*")], member=startsWith, postfix_operators=[], prefix_operators=[], qualifier=line, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=ContinueStatement(goto=None, label=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=m, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=line, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=matcher, postfix_operators=[], prefix_operators=[], qualifier=fields2, selectors=[], type_arguments=None)), label=None), IfStatement(condition=MethodInvocation(arguments=[], member=find, postfix_operators=[], prefix_operators=[], qualifier=m, selectors=[], type_arguments=None), else_statement=IfStatement(condition=MemberReference(member=debugTable, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="bad sequence mnemonic: "), operandr=MemberReference(member=line, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=println, postfix_operators=[], prefix_operators=[], qualifier=System.out, selectors=[], type_arguments=None), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], member=group, postfix_operators=[], prefix_operators=[], qualifier=m, selectors=[MethodInvocation(arguments=[], member=trim, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=mnu)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=mnu, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=containsKey, postfix_operators=[], prefix_operators=[], qualifier=mnseq, selectors=[], type_arguments=None), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=mnu, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2)], member=group, postfix_operators=[], prefix_operators=[], qualifier=m, selectors=[], type_arguments=None)], member=put, postfix_operators=[], prefix_operators=[], qualifier=mnseq, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=mnu, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=mnseq, selectors=[], type_arguments=None), name=value)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=value, 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=2)], member=group, postfix_operators=[], prefix_operators=[], qualifier=m, selectors=[], type_arguments=None), operator=+)), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=mnu, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=put, postfix_operators=[], prefix_operators=[], qualifier=mnseq, selectors=[], type_arguments=None), label=None)]))]))]), condition=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true), label=None), ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=ent, selectors=[], type_arguments=None), name=seq)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=seq, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\\<"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="1-1-0 0-31-0 ")], member=replaceAll, postfix_operators=[], prefix_operators=[], qualifier=seq, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=seq, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\\>"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="")], member=replaceAll, postfix_operators=[], prefix_operators=[], qualifier=seq, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=seq, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\\{"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="1-1-0 0-31-1 ")], member=replaceAll, postfix_operators=[], prefix_operators=[], qualifier=seq, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=seq, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\\}"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="")], member=replaceAll, postfix_operators=[], prefix_operators=[], qualifier=seq, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=seq, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\\("), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="1-1-0 0-31-2 ")], member=replaceAll, postfix_operators=[], prefix_operators=[], qualifier=seq, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=seq, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\\)"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="")], member=replaceAll, postfix_operators=[], prefix_operators=[], qualifier=seq, selectors=[], type_arguments=None)), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MemberReference(member=seq, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" ")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=StringTokenizer, sub_type=None)), name=stoke)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=StringTokenizer, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=ArrayList, sub_type=None)), name=list)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Short, sub_type=None))], dimensions=[], name=List, sub_type=None)), WhileStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=nextToken, postfix_operators=[], prefix_operators=[], qualifier=stoke, selectors=[], type_arguments=None), name=mn)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], member=charAt, postfix_operators=[], prefix_operators=[], qualifier=mn, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='-'), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=mn, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getFxy, postfix_operators=[], prefix_operators=[], qualifier=Descriptor, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=list, selectors=[], type_arguments=None), label=None), ContinueStatement(goto=None, label=None)])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=m, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=mn, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=matcher, postfix_operators=[], prefix_operators=[], qualifier=ints6, selectors=[], type_arguments=None)), label=None), IfStatement(condition=MethodInvocation(arguments=[], member=find, postfix_operators=[], prefix_operators=[], qualifier=m, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], member=substring, postfix_operators=[], prefix_operators=[], qualifier=mn, selectors=[], type_arguments=None), name=F)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=3)], member=substring, postfix_operators=[], prefix_operators=[], qualifier=mn, selectors=[], type_arguments=None)], member=removeLeading0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=X)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=3)], member=substring, postfix_operators=[], prefix_operators=[], qualifier=mn, selectors=[], type_arguments=None)], member=removeLeading0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=Y)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=F, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="-"), operator=+), 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=Y, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=getFxy, postfix_operators=[], prefix_operators=[], qualifier=Descriptor, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=list, selectors=[], type_arguments=None), label=None), ContinueStatement(goto=None, label=None)])), IfStatement(condition=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\"")], member=startsWith, postfix_operators=[], prefix_operators=[], qualifier=mn, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='"')], member=lastIndexOf, postfix_operators=[], prefix_operators=[], qualifier=mn, selectors=[], type_arguments=None), name=idx)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=idx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+)], member=substring, postfix_operators=[], prefix_operators=[], qualifier=mn, selectors=[], type_arguments=None), name=count)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="1-1-"), operandr=MemberReference(member=count, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=getFxy, postfix_operators=[], prefix_operators=[], qualifier=Descriptor, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=list, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=mn, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), MemberReference(member=idx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=substring, postfix_operators=[], prefix_operators=[], qualifier=mn, selectors=[], type_arguments=None)), label=None)])), IfStatement(condition=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=".")], member=startsWith, postfix_operators=[], prefix_operators=[], qualifier=mn, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[BinaryOperation(operandl=MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=mn, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=4), operator=-)], member=substring, postfix_operators=[], prefix_operators=[], qualifier=mn, selectors=[], type_arguments=None), name=des)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=mn, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=des, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="....")], member=replace, postfix_operators=[], prefix_operators=[], qualifier=mn, selectors=[], type_arguments=None)), label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=mn, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=number, selectors=[], type_arguments=None), name=fxy)], 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=0), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], member=substring, postfix_operators=[], prefix_operators=[], qualifier=fxy, selectors=[], type_arguments=None), name=F)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=3)], member=substring, postfix_operators=[], prefix_operators=[], qualifier=fxy, selectors=[], type_arguments=None)], member=removeLeading0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=X)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=3)], member=substring, postfix_operators=[], prefix_operators=[], qualifier=fxy, selectors=[], type_arguments=None)], member=removeLeading0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=Y)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=F, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="-"), operator=+), 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=Y, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=getFxy, postfix_operators=[], prefix_operators=[], qualifier=Descriptor, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=list, selectors=[], type_arguments=None), label=None)]), condition=MethodInvocation(arguments=[], member=hasMoreTokens, postfix_operators=[], prefix_operators=[], qualifier=stoke, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getKey, postfix_operators=[], prefix_operators=[], qualifier=ent, selectors=[], type_arguments=None)], member=get, postfix_operators=[], prefix_operators=[], qualifier=number, selectors=[], type_arguments=None), name=fxy)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=3)], member=substring, postfix_operators=[], prefix_operators=[], qualifier=fxy, selectors=[], type_arguments=None)], member=removeLeading0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=X)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=3)], member=substring, postfix_operators=[], prefix_operators=[], qualifier=fxy, selectors=[], type_arguments=None)], member=removeLeading0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=Y)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=XlocalCutoff, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[MemberReference(member=X, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=parseInt, postfix_operators=[], prefix_operators=[], qualifier=Integer, selectors=[], type_arguments=None), operator=>), operandr=BinaryOperation(operandl=MemberReference(member=YlocalCutoff, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[MemberReference(member=Y, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=parseInt, postfix_operators=[], prefix_operators=[], qualifier=Integer, selectors=[], type_arguments=None), operator=>), operator=&&), else_statement=None, label=None, then_statement=ContinueStatement(goto=None, label=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=trim, postfix_operators=[], prefix_operators=[], qualifier=X, selectors=[], type_arguments=None)], member=parseShort, postfix_operators=[], prefix_operators=[], qualifier=Short, selectors=[], type_arguments=None), name=seqX)], modifiers=set(), type=BasicType(dimensions=[], name=short)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=trim, postfix_operators=[], prefix_operators=[], qualifier=Y, selectors=[], type_arguments=None)], member=parseShort, postfix_operators=[], prefix_operators=[], qualifier=Short, selectors=[], type_arguments=None), name=seqY)], modifiers=set(), type=BasicType(dimensions=[], name=short)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=seqX, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=seqY, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getKey, postfix_operators=[], prefix_operators=[], qualifier=ent, selectors=[], type_arguments=None), MemberReference(member=list, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addDescriptor, postfix_operators=[], prefix_operators=[], qualifier=tables.d, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=entrySet, postfix_operators=[], prefix_operators=[], qualifier=mnseq, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=ent)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Map, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=None, name=Entry, sub_type=None)))), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=ArrayList, sub_type=None)), name=list)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Short, sub_type=None))], dimensions=[], name=List, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="1-1-0")], member=getFxy, postfix_operators=[], prefix_operators=[], qualifier=Descriptor, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=list, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="0-31-2")], member=getFxy, postfix_operators=[], prefix_operators=[], qualifier=Descriptor, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=list, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Cast(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=60), type=BasicType(dimensions=[], name=short)), Cast(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), type=BasicType(dimensions=[], name=short)), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=""), MemberReference(member=list, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addDescriptor, postfix_operators=[], prefix_operators=[], qualifier=tables.d, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=list, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=ArrayList, sub_type=None))), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="1-1-0")], member=getFxy, postfix_operators=[], prefix_operators=[], qualifier=Descriptor, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=list, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="0-31-1")], member=getFxy, postfix_operators=[], prefix_operators=[], qualifier=Descriptor, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=list, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Cast(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=60), type=BasicType(dimensions=[], name=short)), Cast(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), type=BasicType(dimensions=[], name=short)), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=""), MemberReference(member=list, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addDescriptor, postfix_operators=[], prefix_operators=[], qualifier=tables.d, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=list, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=ArrayList, sub_type=None))), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="1-1-0")], member=getFxy, postfix_operators=[], prefix_operators=[], qualifier=Descriptor, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=list, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="0-31-1")], member=getFxy, postfix_operators=[], prefix_operators=[], qualifier=Descriptor, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=list, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Cast(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=60), type=BasicType(dimensions=[], name=short)), Cast(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=3), type=BasicType(dimensions=[], name=short)), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=""), MemberReference(member=list, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addDescriptor, postfix_operators=[], prefix_operators=[], qualifier=tables.d, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=list, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=ArrayList, sub_type=None))), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="1-1-0")], member=getFxy, postfix_operators=[], prefix_operators=[], qualifier=Descriptor, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=list, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="0-31-0")], member=getFxy, postfix_operators=[], prefix_operators=[], qualifier=Descriptor, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=list, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Cast(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=60), type=BasicType(dimensions=[], name=short)), Cast(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=4), type=BasicType(dimensions=[], name=short)), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=""), MemberReference(member=list, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addDescriptor, postfix_operators=[], prefix_operators=[], qualifier=tables.d, selectors=[], type_arguments=None), label=None), WhileStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=readLine, postfix_operators=[], prefix_operators=[], qualifier=dataIS, selectors=[], type_arguments=None), name=line)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=line, 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=BreakStatement(goto=None, label=None)), IfStatement(condition=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="MNEMONIC")], member=contains, postfix_operators=[], prefix_operators=[], qualifier=line, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BreakStatement(goto=None, label=None)), IfStatement(condition=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="| ")], member=startsWith, postfix_operators=[], prefix_operators=[], qualifier=line, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=ContinueStatement(goto=None, label=None)), IfStatement(condition=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="*")], member=startsWith, postfix_operators=[], prefix_operators=[], qualifier=line, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=ContinueStatement(goto=None, label=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=m, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=line, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=matcher, postfix_operators=[], prefix_operators=[], qualifier=fields5, selectors=[], type_arguments=None)), label=None), IfStatement(condition=MethodInvocation(arguments=[], member=find, postfix_operators=[], prefix_operators=[], qualifier=m, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], member=group, postfix_operators=[], prefix_operators=[], qualifier=m, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="")], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), else_statement=IfStatement(condition=MethodInvocation(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], member=group, postfix_operators=[], prefix_operators=[], qualifier=m, selectors=[MethodInvocation(arguments=[], member=trim, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=containsKey, postfix_operators=[], prefix_operators=[], qualifier=number, selectors=[], type_arguments=None), else_statement=IfStatement(condition=MemberReference(member=debugTable, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="bad element descriptors: "), operandr=MemberReference(member=line, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=println, postfix_operators=[], prefix_operators=[], qualifier=System.out, selectors=[], type_arguments=None), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], member=group, postfix_operators=[], prefix_operators=[], qualifier=m, selectors=[MethodInvocation(arguments=[], member=trim, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=get, postfix_operators=[], prefix_operators=[], qualifier=number, selectors=[], type_arguments=None), name=fxy)], 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=1), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=3)], member=substring, postfix_operators=[], prefix_operators=[], qualifier=fxy, selectors=[], type_arguments=None), name=X)], 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=3)], member=substring, postfix_operators=[], prefix_operators=[], qualifier=fxy, selectors=[], type_arguments=None), name=Y)], 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=1)], member=group, postfix_operators=[], prefix_operators=[], qualifier=m, selectors=[MethodInvocation(arguments=[], member=trim, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=mnu)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=mnu, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=desc, selectors=[], type_arguments=None), name=descr)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=trim, postfix_operators=[], prefix_operators=[], qualifier=X, selectors=[], type_arguments=None)], member=parseShort, postfix_operators=[], prefix_operators=[], qualifier=Short, selectors=[], type_arguments=None), name=x)], modifiers=set(), type=BasicType(dimensions=[], name=short)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=trim, postfix_operators=[], prefix_operators=[], qualifier=Y, selectors=[], type_arguments=None)], member=parseShort, postfix_operators=[], prefix_operators=[], qualifier=Short, selectors=[], type_arguments=None), name=y)], modifiers=set(), type=BasicType(dimensions=[], name=short)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=XlocalCutoff, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=>), operandr=BinaryOperation(operandl=MemberReference(member=YlocalCutoff, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=y, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=>), operator=&&), else_statement=None, label=None, then_statement=ContinueStatement(goto=None, label=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2)], member=group, postfix_operators=[], prefix_operators=[], qualifier=m, selectors=[MethodInvocation(arguments=[], member=trim, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=parseInt, postfix_operators=[], prefix_operators=[], qualifier=Integer, selectors=[], type_arguments=None), name=scale)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=3)], member=group, postfix_operators=[], prefix_operators=[], qualifier=m, selectors=[MethodInvocation(arguments=[], member=trim, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=parseInt, postfix_operators=[], prefix_operators=[], qualifier=Integer, selectors=[], type_arguments=None), name=refVal)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=4)], member=group, postfix_operators=[], prefix_operators=[], qualifier=m, selectors=[MethodInvocation(arguments=[], member=trim, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=parseInt, postfix_operators=[], prefix_operators=[], qualifier=Integer, selectors=[], type_arguments=None), name=width)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=5)], member=group, postfix_operators=[], prefix_operators=[], qualifier=m, selectors=[MethodInvocation(arguments=[], member=trim, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=units)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=y, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=scale, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=refVal, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=width, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=mnu, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=units, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=descr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addDescriptor, postfix_operators=[], prefix_operators=[], qualifier=tables.b, selectors=[], type_arguments=None), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[ContinueStatement(goto=None, label=None)]))]))]), condition=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true), label=None)], catches=None, finally_block=[StatementExpression(expression=MethodInvocation(arguments=[], member=close, postfix_operators=[], prefix_operators=[], qualifier=ios, selectors=[], type_arguments=None), label=None)], label=None, resources=None)
call[tables.b.addDescriptor, parameter[Cast(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=63), type=BasicType(dimensions=[], name=short)), Cast(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), type=BasicType(dimensions=[], name=short)), literal[0], literal[0], literal[16], literal["Byte count"], literal["Numeric"], literal[null]]]
return[literal[true]]
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[boolean] identifier[read] operator[SEP] identifier[InputStream] identifier[ios] , identifier[BufrTables] operator[SEP] identifier[Tables] identifier[tables] operator[SEP] Keyword[throws] identifier[IOException] {
Keyword[if] operator[SEP] identifier[ios] operator[==] Other[null] operator[SEP] Keyword[return] literal[boolean] operator[SEP] Keyword[if] operator[SEP] identifier[tables] operator[SEP] identifier[b] operator[==] Other[null] operator[SEP] identifier[tables] operator[SEP] identifier[b] operator[=] Keyword[new] identifier[TableB] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[tables] operator[SEP] identifier[d] operator[==] Other[null] operator[SEP] identifier[tables] operator[SEP] identifier[d] operator[=] Keyword[new] identifier[TableD] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[HashMap] operator[<] identifier[String] , identifier[String] operator[>] identifier[number] operator[=] Keyword[new] identifier[HashMap] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[HashMap] operator[<] identifier[String] , identifier[String] operator[>] identifier[desc] operator[=] Keyword[new] identifier[HashMap] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[HashMap] operator[<] identifier[String] , identifier[String] operator[>] identifier[mnseq] operator[=] Keyword[new] identifier[HashMap] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[try] {
identifier[BufferedReader] identifier[dataIS] operator[=] Keyword[new] identifier[BufferedReader] operator[SEP] Keyword[new] identifier[InputStreamReader] operator[SEP] identifier[ios] , identifier[CDM] operator[SEP] identifier[utf8Charset] operator[SEP] operator[SEP] operator[SEP] identifier[Matcher] identifier[m] operator[SEP] Keyword[while] operator[SEP] literal[boolean] operator[SEP] {
identifier[String] identifier[line] operator[=] identifier[dataIS] operator[SEP] identifier[readLine] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[line] operator[==] Other[null] operator[SEP] Keyword[throw] Keyword[new] identifier[RuntimeException] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[line] operator[SEP] identifier[contains] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[break] operator[SEP]
}
Keyword[while] operator[SEP] literal[boolean] operator[SEP] {
identifier[String] identifier[line] operator[=] identifier[dataIS] operator[SEP] identifier[readLine] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[line] operator[==] Other[null] operator[SEP] Keyword[break] operator[SEP] Keyword[if] operator[SEP] identifier[line] operator[SEP] identifier[contains] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[if] operator[SEP] identifier[line] operator[SEP] identifier[contains] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[continue] operator[SEP] Keyword[if] operator[SEP] identifier[line] operator[SEP] identifier[startsWith] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[continue] operator[SEP] Keyword[if] operator[SEP] identifier[line] operator[SEP] identifier[startsWith] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[continue] operator[SEP] identifier[m] operator[=] identifier[fields3] operator[SEP] identifier[matcher] operator[SEP] identifier[line] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[m] operator[SEP] identifier[find] operator[SEP] operator[SEP] operator[SEP] {
identifier[String] identifier[mnu] operator[=] identifier[m] operator[SEP] identifier[group] operator[SEP] Other[1] operator[SEP] operator[SEP] identifier[trim] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[fxy] operator[=] identifier[m] operator[SEP] identifier[group] operator[SEP] Other[2] operator[SEP] operator[SEP] identifier[trim] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[fxy] operator[SEP] identifier[startsWith] operator[SEP] literal[String] operator[SEP] operator[SEP] {
identifier[number] operator[SEP] identifier[put] operator[SEP] identifier[mnu] , identifier[fxy] operator[SEP] operator[SEP] identifier[desc] operator[SEP] identifier[put] operator[SEP] identifier[mnu] , identifier[m] operator[SEP] identifier[group] operator[SEP] Other[3] operator[SEP] operator[SEP] identifier[replace] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[trim] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[fxy] operator[SEP] identifier[startsWith] operator[SEP] literal[String] operator[SEP] operator[SEP] {
identifier[number] operator[SEP] identifier[put] operator[SEP] identifier[mnu] , identifier[fxy] operator[SEP] operator[SEP] identifier[desc] operator[SEP] identifier[put] operator[SEP] identifier[mnu] , identifier[m] operator[SEP] identifier[group] operator[SEP] Other[3] operator[SEP] operator[SEP] identifier[replace] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[trim] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[fxy] operator[SEP] identifier[startsWith] operator[SEP] literal[String] operator[SEP] operator[SEP] {
identifier[number] operator[SEP] identifier[put] operator[SEP] identifier[mnu] , identifier[fxy] operator[SEP] operator[SEP] identifier[desc] operator[SEP] identifier[put] operator[SEP] identifier[mnu] , identifier[m] operator[SEP] identifier[group] operator[SEP] Other[3] operator[SEP] operator[SEP] identifier[replace] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[trim] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[else] Keyword[if] operator[SEP] identifier[debugTable] operator[SEP] {
identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[println] operator[SEP] literal[String] operator[+] identifier[line] operator[SEP] operator[SEP]
}
}
Keyword[while] operator[SEP] literal[boolean] operator[SEP] {
identifier[String] identifier[line] operator[=] identifier[dataIS] operator[SEP] identifier[readLine] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[line] operator[==] Other[null] operator[SEP] Keyword[break] operator[SEP] Keyword[if] operator[SEP] identifier[line] operator[SEP] identifier[contains] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[if] operator[SEP] identifier[line] operator[SEP] identifier[contains] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[continue] operator[SEP] Keyword[if] operator[SEP] identifier[line] operator[SEP] identifier[startsWith] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[continue] operator[SEP] Keyword[if] operator[SEP] identifier[line] operator[SEP] identifier[startsWith] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[continue] operator[SEP] identifier[m] operator[=] identifier[fields2] operator[SEP] identifier[matcher] operator[SEP] identifier[line] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[m] operator[SEP] identifier[find] operator[SEP] operator[SEP] operator[SEP] {
identifier[String] identifier[mnu] operator[=] identifier[m] operator[SEP] identifier[group] operator[SEP] Other[1] operator[SEP] operator[SEP] identifier[trim] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[mnseq] operator[SEP] identifier[containsKey] operator[SEP] identifier[mnu] operator[SEP] operator[SEP] {
identifier[String] identifier[value] operator[=] identifier[mnseq] operator[SEP] identifier[get] operator[SEP] identifier[mnu] operator[SEP] operator[SEP] identifier[value] operator[=] identifier[value] operator[+] literal[String] operator[+] identifier[m] operator[SEP] identifier[group] operator[SEP] Other[2] operator[SEP] operator[SEP] identifier[mnseq] operator[SEP] identifier[put] operator[SEP] identifier[mnu] , identifier[value] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[mnseq] operator[SEP] identifier[put] operator[SEP] identifier[mnu] , identifier[m] operator[SEP] identifier[group] operator[SEP] Other[2] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[else] Keyword[if] operator[SEP] identifier[debugTable] operator[SEP] {
identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[println] operator[SEP] literal[String] operator[+] identifier[line] operator[SEP] operator[SEP]
}
}
Keyword[for] operator[SEP] identifier[Map] operator[SEP] identifier[Entry] operator[<] identifier[String] , identifier[String] operator[>] identifier[ent] operator[:] identifier[mnseq] operator[SEP] identifier[entrySet] operator[SEP] operator[SEP] operator[SEP] {
identifier[String] identifier[seq] operator[=] identifier[ent] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] identifier[seq] operator[=] identifier[seq] operator[SEP] identifier[replaceAll] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[seq] operator[=] identifier[seq] operator[SEP] identifier[replaceAll] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[seq] operator[=] identifier[seq] operator[SEP] identifier[replaceAll] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[seq] operator[=] identifier[seq] operator[SEP] identifier[replaceAll] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[seq] operator[=] identifier[seq] operator[SEP] identifier[replaceAll] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[seq] operator[=] identifier[seq] operator[SEP] identifier[replaceAll] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[StringTokenizer] identifier[stoke] operator[=] Keyword[new] identifier[StringTokenizer] operator[SEP] identifier[seq] , literal[String] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[Short] operator[>] identifier[list] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[stoke] operator[SEP] identifier[hasMoreTokens] operator[SEP] operator[SEP] operator[SEP] {
identifier[String] identifier[mn] operator[=] identifier[stoke] operator[SEP] identifier[nextToken] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[mn] operator[SEP] identifier[charAt] operator[SEP] Other[1] operator[SEP] operator[==] literal[String] operator[SEP] {
identifier[list] operator[SEP] identifier[add] operator[SEP] identifier[Descriptor] operator[SEP] identifier[getFxy] operator[SEP] identifier[mn] operator[SEP] operator[SEP] operator[SEP] Keyword[continue] operator[SEP]
}
identifier[m] operator[=] identifier[ints6] operator[SEP] identifier[matcher] operator[SEP] identifier[mn] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[m] operator[SEP] identifier[find] operator[SEP] operator[SEP] operator[SEP] {
identifier[String] identifier[F] operator[=] identifier[mn] operator[SEP] identifier[substring] operator[SEP] Other[0] , Other[1] operator[SEP] operator[SEP] identifier[String] identifier[X] operator[=] identifier[removeLeading0] operator[SEP] identifier[mn] operator[SEP] identifier[substring] operator[SEP] Other[1] , Other[3] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[Y] operator[=] identifier[removeLeading0] operator[SEP] identifier[mn] operator[SEP] identifier[substring] operator[SEP] Other[3] operator[SEP] operator[SEP] operator[SEP] identifier[list] operator[SEP] identifier[add] operator[SEP] identifier[Descriptor] operator[SEP] identifier[getFxy] operator[SEP] identifier[F] operator[+] literal[String] operator[+] identifier[X] operator[+] literal[String] operator[+] identifier[Y] operator[SEP] operator[SEP] operator[SEP] Keyword[continue] operator[SEP]
}
Keyword[if] operator[SEP] identifier[mn] operator[SEP] identifier[startsWith] operator[SEP] literal[String] operator[SEP] operator[SEP] {
Keyword[int] identifier[idx] operator[=] identifier[mn] operator[SEP] identifier[lastIndexOf] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[String] identifier[count] operator[=] identifier[mn] operator[SEP] identifier[substring] operator[SEP] identifier[idx] operator[+] Other[1] operator[SEP] operator[SEP] identifier[list] operator[SEP] identifier[add] operator[SEP] identifier[Descriptor] operator[SEP] identifier[getFxy] operator[SEP] literal[String] operator[+] identifier[count] operator[SEP] operator[SEP] operator[SEP] identifier[mn] operator[=] identifier[mn] operator[SEP] identifier[substring] operator[SEP] Other[1] , identifier[idx] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[mn] operator[SEP] identifier[startsWith] operator[SEP] literal[String] operator[SEP] operator[SEP] {
identifier[String] identifier[des] operator[=] identifier[mn] operator[SEP] identifier[substring] operator[SEP] identifier[mn] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[-] Other[4] operator[SEP] operator[SEP] identifier[mn] operator[=] identifier[mn] operator[SEP] identifier[replace] operator[SEP] identifier[des] , literal[String] operator[SEP] operator[SEP]
}
identifier[String] identifier[fxy] operator[=] identifier[number] operator[SEP] identifier[get] operator[SEP] identifier[mn] operator[SEP] operator[SEP] identifier[String] identifier[F] operator[=] identifier[fxy] operator[SEP] identifier[substring] operator[SEP] Other[0] , Other[1] operator[SEP] operator[SEP] identifier[String] identifier[X] operator[=] identifier[removeLeading0] operator[SEP] identifier[fxy] operator[SEP] identifier[substring] operator[SEP] Other[1] , Other[3] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[Y] operator[=] identifier[removeLeading0] operator[SEP] identifier[fxy] operator[SEP] identifier[substring] operator[SEP] Other[3] operator[SEP] operator[SEP] operator[SEP] identifier[list] operator[SEP] identifier[add] operator[SEP] identifier[Descriptor] operator[SEP] identifier[getFxy] operator[SEP] identifier[F] operator[+] literal[String] operator[+] identifier[X] operator[+] literal[String] operator[+] identifier[Y] operator[SEP] operator[SEP] operator[SEP]
}
identifier[String] identifier[fxy] operator[=] identifier[number] operator[SEP] identifier[get] operator[SEP] identifier[ent] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[X] operator[=] identifier[removeLeading0] operator[SEP] identifier[fxy] operator[SEP] identifier[substring] operator[SEP] Other[1] , Other[3] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[Y] operator[=] identifier[removeLeading0] operator[SEP] identifier[fxy] operator[SEP] identifier[substring] operator[SEP] Other[3] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[XlocalCutoff] operator[>] identifier[Integer] operator[SEP] identifier[parseInt] operator[SEP] identifier[X] operator[SEP] operator[&&] identifier[YlocalCutoff] operator[>] identifier[Integer] operator[SEP] identifier[parseInt] operator[SEP] identifier[Y] operator[SEP] operator[SEP] Keyword[continue] operator[SEP] Keyword[short] identifier[seqX] operator[=] identifier[Short] operator[SEP] identifier[parseShort] operator[SEP] identifier[X] operator[SEP] identifier[trim] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[short] identifier[seqY] operator[=] identifier[Short] operator[SEP] identifier[parseShort] operator[SEP] identifier[Y] operator[SEP] identifier[trim] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[tables] operator[SEP] identifier[d] operator[SEP] identifier[addDescriptor] operator[SEP] identifier[seqX] , identifier[seqY] , identifier[ent] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] , identifier[list] operator[SEP] operator[SEP]
}
identifier[List] operator[<] identifier[Short] operator[>] identifier[list] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[list] operator[SEP] identifier[add] operator[SEP] identifier[Descriptor] operator[SEP] identifier[getFxy] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[list] operator[SEP] identifier[add] operator[SEP] identifier[Descriptor] operator[SEP] identifier[getFxy] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[tables] operator[SEP] identifier[d] operator[SEP] identifier[addDescriptor] operator[SEP] operator[SEP] Keyword[short] operator[SEP] Other[60] , operator[SEP] Keyword[short] operator[SEP] Other[1] , literal[String] , identifier[list] operator[SEP] operator[SEP] identifier[list] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[list] operator[SEP] identifier[add] operator[SEP] identifier[Descriptor] operator[SEP] identifier[getFxy] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[list] operator[SEP] identifier[add] operator[SEP] identifier[Descriptor] operator[SEP] identifier[getFxy] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[tables] operator[SEP] identifier[d] operator[SEP] identifier[addDescriptor] operator[SEP] operator[SEP] Keyword[short] operator[SEP] Other[60] , operator[SEP] Keyword[short] operator[SEP] Other[2] , literal[String] , identifier[list] operator[SEP] operator[SEP] identifier[list] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[list] operator[SEP] identifier[add] operator[SEP] identifier[Descriptor] operator[SEP] identifier[getFxy] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[list] operator[SEP] identifier[add] operator[SEP] identifier[Descriptor] operator[SEP] identifier[getFxy] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[tables] operator[SEP] identifier[d] operator[SEP] identifier[addDescriptor] operator[SEP] operator[SEP] Keyword[short] operator[SEP] Other[60] , operator[SEP] Keyword[short] operator[SEP] Other[3] , literal[String] , identifier[list] operator[SEP] operator[SEP] identifier[list] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[list] operator[SEP] identifier[add] operator[SEP] identifier[Descriptor] operator[SEP] identifier[getFxy] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[list] operator[SEP] identifier[add] operator[SEP] identifier[Descriptor] operator[SEP] identifier[getFxy] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[tables] operator[SEP] identifier[d] operator[SEP] identifier[addDescriptor] operator[SEP] operator[SEP] Keyword[short] operator[SEP] Other[60] , operator[SEP] Keyword[short] operator[SEP] Other[4] , literal[String] , identifier[list] operator[SEP] operator[SEP] Keyword[while] operator[SEP] literal[boolean] operator[SEP] {
identifier[String] identifier[line] operator[=] identifier[dataIS] operator[SEP] identifier[readLine] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[line] operator[==] Other[null] operator[SEP] Keyword[break] operator[SEP] Keyword[if] operator[SEP] identifier[line] operator[SEP] identifier[contains] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[if] operator[SEP] identifier[line] operator[SEP] identifier[startsWith] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[continue] operator[SEP] Keyword[if] operator[SEP] identifier[line] operator[SEP] identifier[startsWith] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[continue] operator[SEP] identifier[m] operator[=] identifier[fields5] operator[SEP] identifier[matcher] operator[SEP] identifier[line] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[m] operator[SEP] identifier[find] operator[SEP] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[m] operator[SEP] identifier[group] operator[SEP] Other[1] operator[SEP] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] {
Keyword[continue] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[number] operator[SEP] identifier[containsKey] operator[SEP] identifier[m] operator[SEP] identifier[group] operator[SEP] Other[1] operator[SEP] operator[SEP] identifier[trim] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
identifier[String] identifier[fxy] operator[=] identifier[number] operator[SEP] identifier[get] operator[SEP] identifier[m] operator[SEP] identifier[group] operator[SEP] Other[1] operator[SEP] operator[SEP] identifier[trim] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[X] operator[=] identifier[fxy] operator[SEP] identifier[substring] operator[SEP] Other[1] , Other[3] operator[SEP] operator[SEP] identifier[String] identifier[Y] operator[=] identifier[fxy] operator[SEP] identifier[substring] operator[SEP] Other[3] operator[SEP] operator[SEP] identifier[String] identifier[mnu] operator[=] identifier[m] operator[SEP] identifier[group] operator[SEP] Other[1] operator[SEP] operator[SEP] identifier[trim] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[descr] operator[=] identifier[desc] operator[SEP] identifier[get] operator[SEP] identifier[mnu] operator[SEP] operator[SEP] Keyword[short] identifier[x] operator[=] identifier[Short] operator[SEP] identifier[parseShort] operator[SEP] identifier[X] operator[SEP] identifier[trim] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[short] identifier[y] operator[=] identifier[Short] operator[SEP] identifier[parseShort] operator[SEP] identifier[Y] operator[SEP] identifier[trim] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[XlocalCutoff] operator[>] identifier[x] operator[&&] identifier[YlocalCutoff] operator[>] identifier[y] operator[SEP] Keyword[continue] operator[SEP] Keyword[int] identifier[scale] operator[=] identifier[Integer] operator[SEP] identifier[parseInt] operator[SEP] identifier[m] operator[SEP] identifier[group] operator[SEP] Other[2] operator[SEP] operator[SEP] identifier[trim] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[refVal] operator[=] identifier[Integer] operator[SEP] identifier[parseInt] operator[SEP] identifier[m] operator[SEP] identifier[group] operator[SEP] Other[3] operator[SEP] operator[SEP] identifier[trim] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[width] operator[=] identifier[Integer] operator[SEP] identifier[parseInt] operator[SEP] identifier[m] operator[SEP] identifier[group] operator[SEP] Other[4] operator[SEP] operator[SEP] identifier[trim] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[units] operator[=] identifier[m] operator[SEP] identifier[group] operator[SEP] Other[5] operator[SEP] operator[SEP] identifier[trim] operator[SEP] operator[SEP] operator[SEP] identifier[tables] operator[SEP] identifier[b] operator[SEP] identifier[addDescriptor] operator[SEP] identifier[x] , identifier[y] , identifier[scale] , identifier[refVal] , identifier[width] , identifier[mnu] , identifier[units] , identifier[descr] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[debugTable] operator[SEP] {
identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[println] operator[SEP] literal[String] operator[+] identifier[line] operator[SEP] operator[SEP]
}
}
}
}
Keyword[finally] {
identifier[ios] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP]
}
identifier[tables] operator[SEP] identifier[b] operator[SEP] identifier[addDescriptor] operator[SEP] operator[SEP] Keyword[short] operator[SEP] Other[63] , operator[SEP] Keyword[short] operator[SEP] Other[0] , Other[0] , Other[0] , Other[16] , literal[String] , literal[String] , Other[null] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP]
}
|
public void generate(Output out) throws IOException {
for (Section section : sections) {
section.generate(out);
out.lineBreak();
out.optionalLineBreak();
}
} | class class_name[name] begin[{]
method[generate, return_type[void], modifier[public], parameter[out]] begin[{]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=out, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=generate, postfix_operators=[], prefix_operators=[], qualifier=section, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=lineBreak, postfix_operators=[], prefix_operators=[], qualifier=out, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=optionalLineBreak, postfix_operators=[], prefix_operators=[], qualifier=out, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=sections, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=section)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Section, sub_type=None))), label=None)
end[}]
END[}] | Keyword[public] Keyword[void] identifier[generate] operator[SEP] identifier[Output] identifier[out] operator[SEP] Keyword[throws] identifier[IOException] {
Keyword[for] operator[SEP] identifier[Section] identifier[section] operator[:] identifier[sections] operator[SEP] {
identifier[section] operator[SEP] identifier[generate] operator[SEP] identifier[out] operator[SEP] operator[SEP] identifier[out] operator[SEP] identifier[lineBreak] operator[SEP] operator[SEP] operator[SEP] identifier[out] operator[SEP] identifier[optionalLineBreak] operator[SEP] operator[SEP] operator[SEP]
}
}
|
public static EntityMapper getEntityMapper(Class<?> entityClass) {
synchronized (entityClass) {
// 先从map中获取实体映射信息
EntityMapper entityMapper = tableMapperCache.get(entityClass);
// 如果存在直接返回
if (entityMapper != null) {
return entityMapper;
}
TableMapper tableMapper = getTableMapper(entityClass);
//获取实体ID泛型
Class<?> idClass = getIdClass(entityClass);
// 获取实体字段列表
List<Field> fields = getAllField(entityClass);
// 全部列
Set<ColumnMapper> columnMapperSet = new HashSet<ColumnMapper>();
// 主键
ColumnMapper idColumn = null;
GenerationType idStrategy = null;
for (Field field : fields) {
// 排除字段
if (field.isAnnotationPresent(Transient.class)) {
continue;
}
ColumnMapper columnMapper = new ColumnMapper();
// 数据库字段名
String columnName = null;
if (field.isAnnotationPresent(Column.class)) {
Column column = field.getAnnotation(Column.class);
columnName = column.name();
columnMapper.setInsertable(column.insertable());
columnMapper.setUpdatable(column.updatable());
}
// 如果为空,使用属性名并替换为下划线风格
if (columnName == null || columnName.equals("")) {
columnName = camelhumpToUnderline(field.getName());
}
columnMapper.setProperty(field.getName());
columnMapper.setColumn(columnName);
columnMapper.setJavaType(field.getType());
// 是否主键
if(field.isAnnotationPresent(Id.class)){
columnMapper.setId(true);
if(field.isAnnotationPresent(GeneratedValue.class)){
idStrategy = field.getAnnotation(GeneratedValue.class).strategy();
}
idColumn = columnMapper;
}
// 添加到所有字段映射信息
columnMapperSet.add(columnMapper);
}
if (columnMapperSet.size() <= 0) {
throw new RuntimeException("实体" + entityClass.getName() + "不存在映射字段");
}
if (idColumn == null) {
throw new RuntimeException("实体" + entityClass.getName() + "不存在主键");
}
// 解析实体映射信息
entityMapper = new EntityMapper();
entityMapper.setTableMapper(tableMapper);
entityMapper.setColumnsMapper(columnMapperSet);
entityMapper.setIdClass(idClass);
entityMapper.setIdColumn(idColumn);
entityMapper.setIdStrategy(idStrategy);
tableMapperCache.put(entityClass, entityMapper);
return entityMapper;
}
} | class class_name[name] begin[{]
method[getEntityMapper, return_type[type[EntityMapper]], modifier[public static], parameter[entityClass]] begin[{]
SYNCHRONIZED[member[.entityClass]] BEGIN[{]
local_variable[type[EntityMapper], entityMapper]
if[binary_operation[member[.entityMapper], !=, literal[null]]] begin[{]
return[member[.entityMapper]]
else begin[{]
None
end[}]
local_variable[type[TableMapper], tableMapper]
local_variable[type[Class], idClass]
local_variable[type[List], fields]
local_variable[type[Set], columnMapperSet]
local_variable[type[ColumnMapper], idColumn]
local_variable[type[GenerationType], idStrategy]
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Transient, sub_type=None))], member=isAnnotationPresent, postfix_operators=[], prefix_operators=[], qualifier=field, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ContinueStatement(goto=None, label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ColumnMapper, sub_type=None)), name=columnMapper)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ColumnMapper, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), name=columnName)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Column, sub_type=None))], member=isAnnotationPresent, postfix_operators=[], prefix_operators=[], qualifier=field, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Column, sub_type=None))], member=getAnnotation, postfix_operators=[], prefix_operators=[], qualifier=field, selectors=[], type_arguments=None), name=column)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Column, sub_type=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=columnName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=name, postfix_operators=[], prefix_operators=[], qualifier=column, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=insertable, postfix_operators=[], prefix_operators=[], qualifier=column, selectors=[], type_arguments=None)], member=setInsertable, postfix_operators=[], prefix_operators=[], qualifier=columnMapper, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=updatable, postfix_operators=[], prefix_operators=[], qualifier=column, selectors=[], type_arguments=None)], member=setUpdatable, postfix_operators=[], prefix_operators=[], qualifier=columnMapper, selectors=[], type_arguments=None), label=None)])), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=columnName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), operandr=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="")], member=equals, postfix_operators=[], prefix_operators=[], qualifier=columnName, selectors=[], type_arguments=None), operator=||), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=columnName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=field, selectors=[], type_arguments=None)], member=camelhumpToUnderline, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=field, selectors=[], type_arguments=None)], member=setProperty, postfix_operators=[], prefix_operators=[], qualifier=columnMapper, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=columnName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setColumn, postfix_operators=[], prefix_operators=[], qualifier=columnMapper, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getType, postfix_operators=[], prefix_operators=[], qualifier=field, selectors=[], type_arguments=None)], member=setJavaType, postfix_operators=[], prefix_operators=[], qualifier=columnMapper, selectors=[], type_arguments=None), label=None), IfStatement(condition=MethodInvocation(arguments=[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Id, sub_type=None))], member=isAnnotationPresent, postfix_operators=[], prefix_operators=[], qualifier=field, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], member=setId, postfix_operators=[], prefix_operators=[], qualifier=columnMapper, selectors=[], type_arguments=None), label=None), IfStatement(condition=MethodInvocation(arguments=[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=GeneratedValue, sub_type=None))], member=isAnnotationPresent, postfix_operators=[], prefix_operators=[], qualifier=field, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=idStrategy, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=GeneratedValue, sub_type=None))], member=getAnnotation, postfix_operators=[], prefix_operators=[], qualifier=field, selectors=[MethodInvocation(arguments=[], member=strategy, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)), label=None)])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=idColumn, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=columnMapper, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=columnMapper, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=columnMapperSet, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=fields, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=field)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Field, sub_type=None))), label=None)
if[binary_operation[call[columnMapperSet.size, parameter[]], <=, literal[0]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="实体"), operandr=MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=entityClass, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="不存在映射字段"), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=RuntimeException, sub_type=None)), label=None)
else begin[{]
None
end[}]
if[binary_operation[member[.idColumn], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="实体"), operandr=MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=entityClass, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="不存在主键"), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=RuntimeException, sub_type=None)), label=None)
else begin[{]
None
end[}]
assign[member[.entityMapper], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=EntityMapper, sub_type=None))]
call[entityMapper.setTableMapper, parameter[member[.tableMapper]]]
call[entityMapper.setColumnsMapper, parameter[member[.columnMapperSet]]]
call[entityMapper.setIdClass, parameter[member[.idClass]]]
call[entityMapper.setIdColumn, parameter[member[.idColumn]]]
call[entityMapper.setIdStrategy, parameter[member[.idStrategy]]]
call[tableMapperCache.put, parameter[member[.entityClass], member[.entityMapper]]]
return[member[.entityMapper]]
END[}]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[EntityMapper] identifier[getEntityMapper] operator[SEP] identifier[Class] operator[<] operator[?] operator[>] identifier[entityClass] operator[SEP] {
Keyword[synchronized] operator[SEP] identifier[entityClass] operator[SEP] {
identifier[EntityMapper] identifier[entityMapper] operator[=] identifier[tableMapperCache] operator[SEP] identifier[get] operator[SEP] identifier[entityClass] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[entityMapper] operator[!=] Other[null] operator[SEP] {
Keyword[return] identifier[entityMapper] operator[SEP]
}
identifier[TableMapper] identifier[tableMapper] operator[=] identifier[getTableMapper] operator[SEP] identifier[entityClass] operator[SEP] operator[SEP] identifier[Class] operator[<] operator[?] operator[>] identifier[idClass] operator[=] identifier[getIdClass] operator[SEP] identifier[entityClass] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[Field] operator[>] identifier[fields] operator[=] identifier[getAllField] operator[SEP] identifier[entityClass] operator[SEP] operator[SEP] identifier[Set] operator[<] identifier[ColumnMapper] operator[>] identifier[columnMapperSet] operator[=] Keyword[new] identifier[HashSet] operator[<] identifier[ColumnMapper] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[ColumnMapper] identifier[idColumn] operator[=] Other[null] operator[SEP] identifier[GenerationType] identifier[idStrategy] operator[=] Other[null] operator[SEP] Keyword[for] operator[SEP] identifier[Field] identifier[field] operator[:] identifier[fields] operator[SEP] {
Keyword[if] operator[SEP] identifier[field] operator[SEP] identifier[isAnnotationPresent] operator[SEP] identifier[Transient] operator[SEP] Keyword[class] operator[SEP] operator[SEP] {
Keyword[continue] operator[SEP]
}
identifier[ColumnMapper] identifier[columnMapper] operator[=] Keyword[new] identifier[ColumnMapper] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[columnName] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[field] operator[SEP] identifier[isAnnotationPresent] operator[SEP] identifier[Column] operator[SEP] Keyword[class] operator[SEP] operator[SEP] {
identifier[Column] identifier[column] operator[=] identifier[field] operator[SEP] identifier[getAnnotation] operator[SEP] identifier[Column] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[columnName] operator[=] identifier[column] operator[SEP] identifier[name] operator[SEP] operator[SEP] operator[SEP] identifier[columnMapper] operator[SEP] identifier[setInsertable] operator[SEP] identifier[column] operator[SEP] identifier[insertable] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[columnMapper] operator[SEP] identifier[setUpdatable] operator[SEP] identifier[column] operator[SEP] identifier[updatable] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[columnName] operator[==] Other[null] operator[||] identifier[columnName] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] {
identifier[columnName] operator[=] identifier[camelhumpToUnderline] operator[SEP] identifier[field] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
identifier[columnMapper] operator[SEP] identifier[setProperty] operator[SEP] identifier[field] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[columnMapper] operator[SEP] identifier[setColumn] operator[SEP] identifier[columnName] operator[SEP] operator[SEP] identifier[columnMapper] operator[SEP] identifier[setJavaType] operator[SEP] identifier[field] operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[field] operator[SEP] identifier[isAnnotationPresent] operator[SEP] identifier[Id] operator[SEP] Keyword[class] operator[SEP] operator[SEP] {
identifier[columnMapper] operator[SEP] identifier[setId] operator[SEP] literal[boolean] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[field] operator[SEP] identifier[isAnnotationPresent] operator[SEP] identifier[GeneratedValue] operator[SEP] Keyword[class] operator[SEP] operator[SEP] {
identifier[idStrategy] operator[=] identifier[field] operator[SEP] identifier[getAnnotation] operator[SEP] identifier[GeneratedValue] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[strategy] operator[SEP] operator[SEP] operator[SEP]
}
identifier[idColumn] operator[=] identifier[columnMapper] operator[SEP]
}
identifier[columnMapperSet] operator[SEP] identifier[add] operator[SEP] identifier[columnMapper] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[columnMapperSet] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[<=] Other[0] operator[SEP] {
Keyword[throw] Keyword[new] identifier[RuntimeException] operator[SEP] literal[String] operator[+] identifier[entityClass] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[idColumn] operator[==] Other[null] operator[SEP] {
Keyword[throw] Keyword[new] identifier[RuntimeException] operator[SEP] literal[String] operator[+] identifier[entityClass] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP]
}
identifier[entityMapper] operator[=] Keyword[new] identifier[EntityMapper] operator[SEP] operator[SEP] operator[SEP] identifier[entityMapper] operator[SEP] identifier[setTableMapper] operator[SEP] identifier[tableMapper] operator[SEP] operator[SEP] identifier[entityMapper] operator[SEP] identifier[setColumnsMapper] operator[SEP] identifier[columnMapperSet] operator[SEP] operator[SEP] identifier[entityMapper] operator[SEP] identifier[setIdClass] operator[SEP] identifier[idClass] operator[SEP] operator[SEP] identifier[entityMapper] operator[SEP] identifier[setIdColumn] operator[SEP] identifier[idColumn] operator[SEP] operator[SEP] identifier[entityMapper] operator[SEP] identifier[setIdStrategy] operator[SEP] identifier[idStrategy] operator[SEP] operator[SEP] identifier[tableMapperCache] operator[SEP] identifier[put] operator[SEP] identifier[entityClass] , identifier[entityMapper] operator[SEP] operator[SEP] Keyword[return] identifier[entityMapper] operator[SEP]
}
}
|
public static void traverseChangedFunctions(
final AbstractCompiler compiler, final ChangeScopeRootCallback callback) {
final Node jsRoot = compiler.getJsRoot();
NodeTraversal.traverse(compiler, jsRoot,
new AbstractPreOrderCallback() {
@Override
public final boolean shouldTraverse(NodeTraversal t, Node n, Node parent) {
if (NodeUtil.isChangeScopeRoot(n) && compiler.hasScopeChanged(n)) {
callback.enterChangeScopeRoot(compiler, n);
}
return true;
}
});
} | class class_name[name] begin[{]
method[traverseChangedFunctions, return_type[void], modifier[public static], parameter[compiler, callback]] begin[{]
local_variable[type[Node], jsRoot]
call[NodeTraversal.traverse, parameter[member[.compiler], member[.jsRoot], ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=n, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isChangeScopeRoot, postfix_operators=[], prefix_operators=[], qualifier=NodeUtil, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[MemberReference(member=n, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=hasScopeChanged, postfix_operators=[], prefix_operators=[], qualifier=compiler, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=compiler, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=n, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=enterChangeScopeRoot, postfix_operators=[], prefix_operators=[], qualifier=callback, selectors=[], type_arguments=None), label=None)])), ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true), label=None)], documentation=None, modifiers={'final', 'public'}, name=shouldTraverse, parameters=[FormalParameter(annotations=[], modifiers=set(), name=t, type=ReferenceType(arguments=None, dimensions=[], name=NodeTraversal, sub_type=None), varargs=False), FormalParameter(annotations=[], modifiers=set(), name=n, type=ReferenceType(arguments=None, dimensions=[], name=Node, sub_type=None), varargs=False), FormalParameter(annotations=[], modifiers=set(), name=parent, type=ReferenceType(arguments=None, dimensions=[], name=Node, sub_type=None), varargs=False)], return_type=BasicType(dimensions=[], name=boolean), throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=AbstractPreOrderCallback, sub_type=None))]]
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[void] identifier[traverseChangedFunctions] operator[SEP] Keyword[final] identifier[AbstractCompiler] identifier[compiler] , Keyword[final] identifier[ChangeScopeRootCallback] identifier[callback] operator[SEP] {
Keyword[final] identifier[Node] identifier[jsRoot] operator[=] identifier[compiler] operator[SEP] identifier[getJsRoot] operator[SEP] operator[SEP] operator[SEP] identifier[NodeTraversal] operator[SEP] identifier[traverse] operator[SEP] identifier[compiler] , identifier[jsRoot] , Keyword[new] identifier[AbstractPreOrderCallback] operator[SEP] operator[SEP] {
annotation[@] identifier[Override] Keyword[public] Keyword[final] Keyword[boolean] identifier[shouldTraverse] operator[SEP] identifier[NodeTraversal] identifier[t] , identifier[Node] identifier[n] , identifier[Node] identifier[parent] operator[SEP] {
Keyword[if] operator[SEP] identifier[NodeUtil] operator[SEP] identifier[isChangeScopeRoot] operator[SEP] identifier[n] operator[SEP] operator[&&] identifier[compiler] operator[SEP] identifier[hasScopeChanged] operator[SEP] identifier[n] operator[SEP] operator[SEP] {
identifier[callback] operator[SEP] identifier[enterChangeScopeRoot] operator[SEP] identifier[compiler] , identifier[n] operator[SEP] operator[SEP]
}
Keyword[return] literal[boolean] operator[SEP]
}
} operator[SEP] operator[SEP]
}
|
public boolean resourceNotReady(GoogleJsonError e) {
ErrorInfo errorInfo = getErrorInfo(e);
if (errorInfo != null) {
String reason = errorInfo.getReason();
return RESOURCE_NOT_READY_REASON_CODE.equals(reason);
}
return false;
} | class class_name[name] begin[{]
method[resourceNotReady, return_type[type[boolean]], modifier[public], parameter[e]] begin[{]
local_variable[type[ErrorInfo], errorInfo]
if[binary_operation[member[.errorInfo], !=, literal[null]]] begin[{]
local_variable[type[String], reason]
return[call[RESOURCE_NOT_READY_REASON_CODE.equals, parameter[member[.reason]]]]
else begin[{]
None
end[}]
return[literal[false]]
end[}]
END[}] | Keyword[public] Keyword[boolean] identifier[resourceNotReady] operator[SEP] identifier[GoogleJsonError] identifier[e] operator[SEP] {
identifier[ErrorInfo] identifier[errorInfo] operator[=] identifier[getErrorInfo] operator[SEP] identifier[e] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[errorInfo] operator[!=] Other[null] operator[SEP] {
identifier[String] identifier[reason] operator[=] identifier[errorInfo] operator[SEP] identifier[getReason] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[RESOURCE_NOT_READY_REASON_CODE] operator[SEP] identifier[equals] operator[SEP] identifier[reason] operator[SEP] operator[SEP]
}
Keyword[return] literal[boolean] operator[SEP]
}
|
public static com.liferay.commerce.model.CommerceAddressRestriction createCommerceAddressRestriction(
long commerceAddressRestrictionId) {
return getService()
.createCommerceAddressRestriction(commerceAddressRestrictionId);
} | class class_name[name] begin[{]
method[createCommerceAddressRestriction, return_type[type[com]], modifier[public static], parameter[commerceAddressRestrictionId]] begin[{]
return[call[.getService, parameter[]]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[com] operator[SEP] identifier[liferay] operator[SEP] identifier[commerce] operator[SEP] identifier[model] operator[SEP] identifier[CommerceAddressRestriction] identifier[createCommerceAddressRestriction] operator[SEP] Keyword[long] identifier[commerceAddressRestrictionId] operator[SEP] {
Keyword[return] identifier[getService] operator[SEP] operator[SEP] operator[SEP] identifier[createCommerceAddressRestriction] operator[SEP] identifier[commerceAddressRestrictionId] operator[SEP] operator[SEP]
}
|
public T parse(String jsonString) throws IOException {
JsonParser jsonParser = LoganSquare.JSON_FACTORY.createParser(jsonString);
jsonParser.nextToken();
return parse(jsonParser);
} | class class_name[name] begin[{]
method[parse, return_type[type[T]], modifier[public], parameter[jsonString]] begin[{]
local_variable[type[JsonParser], jsonParser]
call[jsonParser.nextToken, parameter[]]
return[call[.parse, parameter[member[.jsonParser]]]]
end[}]
END[}] | Keyword[public] identifier[T] identifier[parse] operator[SEP] identifier[String] identifier[jsonString] operator[SEP] Keyword[throws] identifier[IOException] {
identifier[JsonParser] identifier[jsonParser] operator[=] identifier[LoganSquare] operator[SEP] identifier[JSON_FACTORY] operator[SEP] identifier[createParser] operator[SEP] identifier[jsonString] operator[SEP] operator[SEP] identifier[jsonParser] operator[SEP] identifier[nextToken] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[parse] operator[SEP] identifier[jsonParser] operator[SEP] operator[SEP]
}
|
protected JCTree methodDeclaratorRest(int pos,
JCModifiers mods,
JCExpression type,
Name name,
List<JCTypeParameter> typarams,
boolean isInterface, boolean isVoid,
Comment dc) {
if (isInterface) {
if ((mods.flags & Flags.STATIC) != 0) {
checkStaticInterfaceMethods();
}
if ((mods.flags & Flags.PRIVATE) != 0) {
checkPrivateInterfaceMethods();
}
}
JCVariableDecl prevReceiverParam = this.receiverParam;
try {
this.receiverParam = null;
// Parsing formalParameters sets the receiverParam, if present
List<JCVariableDecl> params = formalParameters();
if (!isVoid) type = bracketsOpt(type);
List<JCExpression> thrown = List.nil();
if (token.kind == THROWS) {
nextToken();
thrown = qualidentList(true);
}
JCBlock body = null;
JCExpression defaultValue;
if (token.kind == LBRACE) {
body = block();
defaultValue = null;
} else {
if (token.kind == DEFAULT) {
accept(DEFAULT);
defaultValue = annotationValue();
} else {
defaultValue = null;
}
accept(SEMI);
if (token.pos <= endPosTable.errorEndPos) {
// error recovery
skip(false, true, false, false);
if (token.kind == LBRACE) {
body = block();
}
}
}
JCMethodDecl result =
toP(F.at(pos).MethodDef(mods, name, type, typarams,
receiverParam, params, thrown,
body, defaultValue));
attach(result, dc);
return result;
} finally {
this.receiverParam = prevReceiverParam;
}
} | class class_name[name] begin[{]
method[methodDeclaratorRest, return_type[type[JCTree]], modifier[protected], parameter[pos, mods, type, name, typarams, isInterface, isVoid, dc]] begin[{]
if[member[.isInterface]] begin[{]
if[binary_operation[binary_operation[member[mods.flags], &, member[Flags.STATIC]], !=, literal[0]]] begin[{]
call[.checkStaticInterfaceMethods, parameter[]]
else begin[{]
None
end[}]
if[binary_operation[binary_operation[member[mods.flags], &, member[Flags.PRIVATE]], !=, literal[0]]] begin[{]
call[.checkPrivateInterfaceMethods, parameter[]]
else begin[{]
None
end[}]
else begin[{]
None
end[}]
local_variable[type[JCVariableDecl], prevReceiverParam]
TryStatement(block=[StatementExpression(expression=Assignment(expressionl=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=receiverParam, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=formalParameters, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=params)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=JCVariableDecl, sub_type=None))], dimensions=[], name=List, sub_type=None)), IfStatement(condition=MemberReference(member=isVoid, postfix_operators=[], prefix_operators=['!'], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=StatementExpression(expression=Assignment(expressionl=MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=bracketsOpt, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=nil, postfix_operators=[], prefix_operators=[], qualifier=List, selectors=[], type_arguments=None), name=thrown)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=JCExpression, sub_type=None))], dimensions=[], name=List, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=kind, postfix_operators=[], prefix_operators=[], qualifier=token, selectors=[]), operandr=MemberReference(member=THROWS, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=nextToken, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=thrown, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], member=qualidentList, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), name=body)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=JCBlock, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=None, name=defaultValue)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=JCExpression, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=kind, postfix_operators=[], prefix_operators=[], qualifier=token, selectors=[]), operandr=MemberReference(member=LBRACE, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), else_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=kind, postfix_operators=[], prefix_operators=[], qualifier=token, selectors=[]), operandr=MemberReference(member=DEFAULT, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=defaultValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=DEFAULT, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=accept, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=defaultValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=annotationValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=SEMI, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=accept, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=pos, postfix_operators=[], prefix_operators=[], qualifier=token, selectors=[]), operandr=MemberReference(member=errorEndPos, postfix_operators=[], prefix_operators=[], qualifier=endPosTable, selectors=[]), operator=<=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)], member=skip, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=kind, postfix_operators=[], prefix_operators=[], qualifier=token, selectors=[]), operandr=MemberReference(member=LBRACE, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=body, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=block, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None)]))]))]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=body, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=block, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=defaultValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)), label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=pos, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=at, postfix_operators=[], prefix_operators=[], qualifier=F, selectors=[MethodInvocation(arguments=[MemberReference(member=mods, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=typarams, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=receiverParam, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=params, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=thrown, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=body, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=defaultValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=MethodDef, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=toP, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=result)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=JCMethodDecl, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=dc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=attach, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], catches=None, finally_block=[StatementExpression(expression=Assignment(expressionl=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=receiverParam, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), type==, value=MemberReference(member=prevReceiverParam, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)], label=None, resources=None)
end[}]
END[}] | Keyword[protected] identifier[JCTree] identifier[methodDeclaratorRest] operator[SEP] Keyword[int] identifier[pos] , identifier[JCModifiers] identifier[mods] , identifier[JCExpression] identifier[type] , identifier[Name] identifier[name] , identifier[List] operator[<] identifier[JCTypeParameter] operator[>] identifier[typarams] , Keyword[boolean] identifier[isInterface] , Keyword[boolean] identifier[isVoid] , identifier[Comment] identifier[dc] operator[SEP] {
Keyword[if] operator[SEP] identifier[isInterface] operator[SEP] {
Keyword[if] operator[SEP] operator[SEP] identifier[mods] operator[SEP] identifier[flags] operator[&] identifier[Flags] operator[SEP] identifier[STATIC] operator[SEP] operator[!=] Other[0] operator[SEP] {
identifier[checkStaticInterfaceMethods] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] operator[SEP] identifier[mods] operator[SEP] identifier[flags] operator[&] identifier[Flags] operator[SEP] identifier[PRIVATE] operator[SEP] operator[!=] Other[0] operator[SEP] {
identifier[checkPrivateInterfaceMethods] operator[SEP] operator[SEP] operator[SEP]
}
}
identifier[JCVariableDecl] identifier[prevReceiverParam] operator[=] Keyword[this] operator[SEP] identifier[receiverParam] operator[SEP] Keyword[try] {
Keyword[this] operator[SEP] identifier[receiverParam] operator[=] Other[null] operator[SEP] identifier[List] operator[<] identifier[JCVariableDecl] operator[>] identifier[params] operator[=] identifier[formalParameters] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[isVoid] operator[SEP] identifier[type] operator[=] identifier[bracketsOpt] operator[SEP] identifier[type] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[JCExpression] operator[>] identifier[thrown] operator[=] identifier[List] operator[SEP] identifier[nil] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[token] operator[SEP] identifier[kind] operator[==] identifier[THROWS] operator[SEP] {
identifier[nextToken] operator[SEP] operator[SEP] operator[SEP] identifier[thrown] operator[=] identifier[qualidentList] operator[SEP] literal[boolean] operator[SEP] operator[SEP]
}
identifier[JCBlock] identifier[body] operator[=] Other[null] operator[SEP] identifier[JCExpression] identifier[defaultValue] operator[SEP] Keyword[if] operator[SEP] identifier[token] operator[SEP] identifier[kind] operator[==] identifier[LBRACE] operator[SEP] {
identifier[body] operator[=] identifier[block] operator[SEP] operator[SEP] operator[SEP] identifier[defaultValue] operator[=] Other[null] operator[SEP]
}
Keyword[else] {
Keyword[if] operator[SEP] identifier[token] operator[SEP] identifier[kind] operator[==] identifier[DEFAULT] operator[SEP] {
identifier[accept] operator[SEP] identifier[DEFAULT] operator[SEP] operator[SEP] identifier[defaultValue] operator[=] identifier[annotationValue] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[defaultValue] operator[=] Other[null] operator[SEP]
}
identifier[accept] operator[SEP] identifier[SEMI] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[token] operator[SEP] identifier[pos] operator[<=] identifier[endPosTable] operator[SEP] identifier[errorEndPos] operator[SEP] {
identifier[skip] operator[SEP] literal[boolean] , literal[boolean] , literal[boolean] , literal[boolean] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[token] operator[SEP] identifier[kind] operator[==] identifier[LBRACE] operator[SEP] {
identifier[body] operator[=] identifier[block] operator[SEP] operator[SEP] operator[SEP]
}
}
}
identifier[JCMethodDecl] identifier[result] operator[=] identifier[toP] operator[SEP] identifier[F] operator[SEP] identifier[at] operator[SEP] identifier[pos] operator[SEP] operator[SEP] identifier[MethodDef] operator[SEP] identifier[mods] , identifier[name] , identifier[type] , identifier[typarams] , identifier[receiverParam] , identifier[params] , identifier[thrown] , identifier[body] , identifier[defaultValue] operator[SEP] operator[SEP] operator[SEP] identifier[attach] operator[SEP] identifier[result] , identifier[dc] operator[SEP] operator[SEP] Keyword[return] identifier[result] operator[SEP]
}
Keyword[finally] {
Keyword[this] operator[SEP] identifier[receiverParam] operator[=] identifier[prevReceiverParam] operator[SEP]
}
}
|
public static void setOutlineProvider(View view, final BalloonMarkerDrawable balloonMarkerDrawable) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
UiCompatNotCrash.setOutlineProvider(view, balloonMarkerDrawable);
}
} | class class_name[name] begin[{]
method[setOutlineProvider, return_type[void], modifier[public static], parameter[view, balloonMarkerDrawable]] begin[{]
if[binary_operation[member[Build.VERSION.SDK_INT], >=, member[Build.VERSION_CODES.LOLLIPOP]]] begin[{]
call[UiCompatNotCrash.setOutlineProvider, parameter[member[.view], member[.balloonMarkerDrawable]]]
else begin[{]
None
end[}]
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[void] identifier[setOutlineProvider] operator[SEP] identifier[View] identifier[view] , Keyword[final] identifier[BalloonMarkerDrawable] identifier[balloonMarkerDrawable] operator[SEP] {
Keyword[if] operator[SEP] identifier[Build] operator[SEP] identifier[VERSION] operator[SEP] identifier[SDK_INT] operator[>=] identifier[Build] operator[SEP] identifier[VERSION_CODES] operator[SEP] identifier[LOLLIPOP] operator[SEP] {
identifier[UiCompatNotCrash] operator[SEP] identifier[setOutlineProvider] operator[SEP] identifier[view] , identifier[balloonMarkerDrawable] operator[SEP] operator[SEP]
}
}
|
public static boolean contains(Iterator<String> iterator, String value) {
if (iterator == null || value == null) {
return false;
}
while (iterator.hasNext()) {
if (value.equals(iterator.next())) {
return true;
}
}
return false;
} | class class_name[name] begin[{]
method[contains, return_type[type[boolean]], modifier[public static], parameter[iterator, value]] begin[{]
if[binary_operation[binary_operation[member[.iterator], ==, literal[null]], ||, binary_operation[member[.value], ==, literal[null]]]] begin[{]
return[literal[false]]
else begin[{]
None
end[}]
while[call[iterator.hasNext, parameter[]]] begin[{]
if[call[value.equals, parameter[call[iterator.next, parameter[]]]]] begin[{]
return[literal[true]]
else begin[{]
None
end[}]
end[}]
return[literal[false]]
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[boolean] identifier[contains] operator[SEP] identifier[Iterator] operator[<] identifier[String] operator[>] identifier[iterator] , identifier[String] identifier[value] operator[SEP] {
Keyword[if] operator[SEP] identifier[iterator] operator[==] Other[null] operator[||] identifier[value] operator[==] Other[null] operator[SEP] {
Keyword[return] literal[boolean] operator[SEP]
}
Keyword[while] operator[SEP] identifier[iterator] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[value] operator[SEP] identifier[equals] operator[SEP] identifier[iterator] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
Keyword[return] literal[boolean] operator[SEP]
}
}
Keyword[return] literal[boolean] operator[SEP]
}
|
@Override
public T drain() {
T event = delayed.drain();
if (event != null) {
return event;
}
return source.drain();
} | class class_name[name] begin[{]
method[drain, return_type[type[T]], modifier[public], parameter[]] begin[{]
local_variable[type[T], event]
if[binary_operation[member[.event], !=, literal[null]]] begin[{]
return[member[.event]]
else begin[{]
None
end[}]
return[call[source.drain, parameter[]]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] identifier[T] identifier[drain] operator[SEP] operator[SEP] {
identifier[T] identifier[event] operator[=] identifier[delayed] operator[SEP] identifier[drain] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[event] operator[!=] Other[null] operator[SEP] {
Keyword[return] identifier[event] operator[SEP]
}
Keyword[return] identifier[source] operator[SEP] identifier[drain] operator[SEP] operator[SEP] operator[SEP]
}
|
public void marshall(DeleteEndpointGroupRequest deleteEndpointGroupRequest, ProtocolMarshaller protocolMarshaller) {
if (deleteEndpointGroupRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(deleteEndpointGroupRequest.getEndpointGroupArn(), ENDPOINTGROUPARN_BINDING);
} catch (Exception e) {
throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);
}
} | class class_name[name] begin[{]
method[marshall, return_type[void], modifier[public], parameter[deleteEndpointGroupRequest, protocolMarshaller]] begin[{]
if[binary_operation[member[.deleteEndpointGroupRequest], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Invalid argument passed to marshall(...)")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SdkClientException, sub_type=None)), label=None)
else begin[{]
None
end[}]
TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getEndpointGroupArn, postfix_operators=[], prefix_operators=[], qualifier=deleteEndpointGroupRequest, selectors=[], type_arguments=None), MemberReference(member=ENDPOINTGROUPARN_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unable to marshall request to JSON: "), operandr=MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), operator=+), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SdkClientException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None)
end[}]
END[}] | Keyword[public] Keyword[void] identifier[marshall] operator[SEP] identifier[DeleteEndpointGroupRequest] identifier[deleteEndpointGroupRequest] , identifier[ProtocolMarshaller] identifier[protocolMarshaller] operator[SEP] {
Keyword[if] operator[SEP] identifier[deleteEndpointGroupRequest] operator[==] Other[null] operator[SEP] {
Keyword[throw] Keyword[new] identifier[SdkClientException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[try] {
identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[deleteEndpointGroupRequest] operator[SEP] identifier[getEndpointGroupArn] operator[SEP] operator[SEP] , identifier[ENDPOINTGROUPARN_BINDING] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] {
Keyword[throw] Keyword[new] identifier[SdkClientException] operator[SEP] literal[String] operator[+] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP]
}
}
|
public static WriteFuture newWrittenFuture(IoSession session) {
DefaultWriteFuture unwrittenFuture = new DefaultWriteFuture(session);
unwrittenFuture.setWritten();
return unwrittenFuture;
} | class class_name[name] begin[{]
method[newWrittenFuture, return_type[type[WriteFuture]], modifier[public static], parameter[session]] begin[{]
local_variable[type[DefaultWriteFuture], unwrittenFuture]
call[unwrittenFuture.setWritten, parameter[]]
return[member[.unwrittenFuture]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[WriteFuture] identifier[newWrittenFuture] operator[SEP] identifier[IoSession] identifier[session] operator[SEP] {
identifier[DefaultWriteFuture] identifier[unwrittenFuture] operator[=] Keyword[new] identifier[DefaultWriteFuture] operator[SEP] identifier[session] operator[SEP] operator[SEP] identifier[unwrittenFuture] operator[SEP] identifier[setWritten] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[unwrittenFuture] operator[SEP]
}
|
public double lentz(double... args)
{
double f_n = getB(0, args);
if(f_n == 0.0)
f_n = 1e-30;
double c_n, c_0 = f_n;
double d_n, d_0 = 0;
double delta = 0;
int j = 0;
while(Math.abs(delta - 1) > 1e-15)
{
j++;
d_n = getB(j, args) + getA(j, args)*d_0;
if(d_n == 0.0)
d_n = 1e-30;
c_n = getB(j, args) + getA(j, args)/c_0;
if(c_n == 0.0)
c_n = 1e-30;
d_n = 1/d_n;
delta = c_n*d_n;
f_n *= delta;
d_0 = d_n;
c_0 = c_n;
}
return f_n;
} | class class_name[name] begin[{]
method[lentz, return_type[type[double]], modifier[public], parameter[args]] begin[{]
local_variable[type[double], f_n]
if[binary_operation[member[.f_n], ==, literal[0.0]]] begin[{]
assign[member[.f_n], literal[1e-30]]
else begin[{]
None
end[}]
local_variable[type[double], c_n]
local_variable[type[double], d_n]
local_variable[type[double], delta]
local_variable[type[int], j]
while[binary_operation[call[Math.abs, parameter[binary_operation[member[.delta], -, literal[1]]]], >, literal[1e-15]]] begin[{]
member[.j]
assign[member[.d_n], binary_operation[call[.getB, parameter[member[.j], member[.args]]], +, binary_operation[call[.getA, parameter[member[.j], member[.args]]], *, member[.d_0]]]]
if[binary_operation[member[.d_n], ==, literal[0.0]]] begin[{]
assign[member[.d_n], literal[1e-30]]
else begin[{]
None
end[}]
assign[member[.c_n], binary_operation[call[.getB, parameter[member[.j], member[.args]]], +, binary_operation[call[.getA, parameter[member[.j], member[.args]]], /, member[.c_0]]]]
if[binary_operation[member[.c_n], ==, literal[0.0]]] begin[{]
assign[member[.c_n], literal[1e-30]]
else begin[{]
None
end[}]
assign[member[.d_n], binary_operation[literal[1], /, member[.d_n]]]
assign[member[.delta], binary_operation[member[.c_n], *, member[.d_n]]]
assign[member[.f_n], member[.delta]]
assign[member[.d_0], member[.d_n]]
assign[member[.c_0], member[.c_n]]
end[}]
return[member[.f_n]]
end[}]
END[}] | Keyword[public] Keyword[double] identifier[lentz] operator[SEP] Keyword[double] operator[...] identifier[args] operator[SEP] {
Keyword[double] identifier[f_n] operator[=] identifier[getB] operator[SEP] Other[0] , identifier[args] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[f_n] operator[==] literal[Float] operator[SEP] identifier[f_n] operator[=] literal[Float] operator[SEP] Keyword[double] identifier[c_n] , identifier[c_0] operator[=] identifier[f_n] operator[SEP] Keyword[double] identifier[d_n] , identifier[d_0] operator[=] Other[0] operator[SEP] Keyword[double] identifier[delta] operator[=] Other[0] operator[SEP] Keyword[int] identifier[j] operator[=] Other[0] operator[SEP] Keyword[while] operator[SEP] identifier[Math] operator[SEP] identifier[abs] operator[SEP] identifier[delta] operator[-] Other[1] operator[SEP] operator[>] literal[Float] operator[SEP] {
identifier[j] operator[++] operator[SEP] identifier[d_n] operator[=] identifier[getB] operator[SEP] identifier[j] , identifier[args] operator[SEP] operator[+] identifier[getA] operator[SEP] identifier[j] , identifier[args] operator[SEP] operator[*] identifier[d_0] operator[SEP] Keyword[if] operator[SEP] identifier[d_n] operator[==] literal[Float] operator[SEP] identifier[d_n] operator[=] literal[Float] operator[SEP] identifier[c_n] operator[=] identifier[getB] operator[SEP] identifier[j] , identifier[args] operator[SEP] operator[+] identifier[getA] operator[SEP] identifier[j] , identifier[args] operator[SEP] operator[/] identifier[c_0] operator[SEP] Keyword[if] operator[SEP] identifier[c_n] operator[==] literal[Float] operator[SEP] identifier[c_n] operator[=] literal[Float] operator[SEP] identifier[d_n] operator[=] Other[1] operator[/] identifier[d_n] operator[SEP] identifier[delta] operator[=] identifier[c_n] operator[*] identifier[d_n] operator[SEP] identifier[f_n] operator[*=] identifier[delta] operator[SEP] identifier[d_0] operator[=] identifier[d_n] operator[SEP] identifier[c_0] operator[=] identifier[c_n] operator[SEP]
}
Keyword[return] identifier[f_n] operator[SEP]
}
|
private static void removeInverseEdge(final OrientBaseGraph graph, final ODocument iVertex, final String iFieldName,
final OIdentifiable iVertexToRemove, final OIdentifiable currentRecord, final boolean useVertexFieldsForEdgeLabels,
final boolean autoScaleEdgeType, boolean forceReload) {
final ODocument r = getDocument(currentRecord, forceReload);
if (r == null)
return;
final String inverseFieldName = OrientVertex.getInverseConnectionFieldName(iFieldName, useVertexFieldsForEdgeLabels);
OImmutableClass immutableClass = ODocumentInternal.getImmutableSchemaClass(r);
OClass klass = ODocumentInternal.getImmutableSchemaClass(r);
if (klass == null) {
graph.getDatabase().getMetadata().reload();
klass = graph.getDatabase().getMetadata().getSchema().getClass(inverseFieldName);
if (klass == null) {
OLogManager.instance().warn(null, "Removing edge, schema class not found for " + r);
return;
}
}
if (klass.isVertexType()) {
// DIRECT VERTEX
removeEdges(graph, r, inverseFieldName, iVertex, false, useVertexFieldsForEdgeLabels, autoScaleEdgeType, forceReload);
r.save();
} else if (klass.isEdgeType()) {
// EDGE, REMOVE THE EDGE
final OIdentifiable otherVertex = OrientEdge
.getConnection(r, OrientVertex.getConnectionDirection(inverseFieldName, useVertexFieldsForEdgeLabels));
if (otherVertex != null) {
if (iVertexToRemove == null || otherVertex.equals(iVertexToRemove)) {
final int maxRetries = graph.getMaxRetries();
for (int retry = 0; retry < maxRetries; ++retry) {
try {
final ODocument otherVertexRecord = getDocument(otherVertex, forceReload);
// BIDIRECTIONAL EDGE
removeEdges(graph, otherVertexRecord, inverseFieldName, (OIdentifiable) currentRecord, false,
useVertexFieldsForEdgeLabels, autoScaleEdgeType, forceReload);
if (otherVertexRecord != null)
otherVertexRecord.save();
break;
} catch (ONeedRetryException e) {
// RETRY
}
}
}
}
}
} | class class_name[name] begin[{]
method[removeInverseEdge, return_type[void], modifier[private static], parameter[graph, iVertex, iFieldName, iVertexToRemove, currentRecord, useVertexFieldsForEdgeLabels, autoScaleEdgeType, forceReload]] begin[{]
local_variable[type[ODocument], r]
if[binary_operation[member[.r], ==, literal[null]]] begin[{]
return[None]
else begin[{]
None
end[}]
local_variable[type[String], inverseFieldName]
local_variable[type[OImmutableClass], immutableClass]
local_variable[type[OClass], klass]
if[binary_operation[member[.klass], ==, literal[null]]] begin[{]
call[graph.getDatabase, parameter[]]
assign[member[.klass], call[graph.getDatabase, parameter[]]]
if[binary_operation[member[.klass], ==, literal[null]]] begin[{]
call[OLogManager.instance, parameter[]]
return[None]
else begin[{]
None
end[}]
else begin[{]
None
end[}]
if[call[klass.isVertexType, parameter[]]] begin[{]
call[.removeEdges, parameter[member[.graph], member[.r], member[.inverseFieldName], member[.iVertex], literal[false], member[.useVertexFieldsForEdgeLabels], member[.autoScaleEdgeType], member[.forceReload]]]
call[r.save, parameter[]]
else begin[{]
if[call[klass.isEdgeType, parameter[]]] begin[{]
local_variable[type[OIdentifiable], otherVertex]
if[binary_operation[member[.otherVertex], !=, literal[null]]] begin[{]
if[binary_operation[binary_operation[member[.iVertexToRemove], ==, literal[null]], ||, call[otherVertex.equals, parameter[member[.iVertexToRemove]]]]] begin[{]
local_variable[type[int], maxRetries]
ForStatement(body=BlockStatement(label=None, statements=[TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=otherVertex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=forceReload, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getDocument, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=otherVertexRecord)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=ODocument, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=graph, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=otherVertexRecord, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=inverseFieldName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Cast(expression=MemberReference(member=currentRecord, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=OIdentifiable, sub_type=None)), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), MemberReference(member=useVertexFieldsForEdgeLabels, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=autoScaleEdgeType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=forceReload, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=removeEdges, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=otherVertexRecord, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[], member=save, postfix_operators=[], prefix_operators=[], qualifier=otherVertexRecord, selectors=[], type_arguments=None), label=None)), BreakStatement(goto=None, label=None)], catches=[CatchClause(block=[], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['ONeedRetryException']))], finally_block=None, label=None, resources=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=retry, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=maxRetries, 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=retry)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=retry, postfix_operators=[], prefix_operators=['++'], qualifier=, selectors=[])]), label=None)
else begin[{]
None
end[}]
else begin[{]
None
end[}]
else begin[{]
None
end[}]
end[}]
end[}]
END[}] | Keyword[private] Keyword[static] Keyword[void] identifier[removeInverseEdge] operator[SEP] Keyword[final] identifier[OrientBaseGraph] identifier[graph] , Keyword[final] identifier[ODocument] identifier[iVertex] , Keyword[final] identifier[String] identifier[iFieldName] , Keyword[final] identifier[OIdentifiable] identifier[iVertexToRemove] , Keyword[final] identifier[OIdentifiable] identifier[currentRecord] , Keyword[final] Keyword[boolean] identifier[useVertexFieldsForEdgeLabels] , Keyword[final] Keyword[boolean] identifier[autoScaleEdgeType] , Keyword[boolean] identifier[forceReload] operator[SEP] {
Keyword[final] identifier[ODocument] identifier[r] operator[=] identifier[getDocument] operator[SEP] identifier[currentRecord] , identifier[forceReload] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[r] operator[==] Other[null] operator[SEP] Keyword[return] operator[SEP] Keyword[final] identifier[String] identifier[inverseFieldName] operator[=] identifier[OrientVertex] operator[SEP] identifier[getInverseConnectionFieldName] operator[SEP] identifier[iFieldName] , identifier[useVertexFieldsForEdgeLabels] operator[SEP] operator[SEP] identifier[OImmutableClass] identifier[immutableClass] operator[=] identifier[ODocumentInternal] operator[SEP] identifier[getImmutableSchemaClass] operator[SEP] identifier[r] operator[SEP] operator[SEP] identifier[OClass] identifier[klass] operator[=] identifier[ODocumentInternal] operator[SEP] identifier[getImmutableSchemaClass] operator[SEP] identifier[r] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[klass] operator[==] Other[null] operator[SEP] {
identifier[graph] operator[SEP] identifier[getDatabase] operator[SEP] operator[SEP] operator[SEP] identifier[getMetadata] operator[SEP] operator[SEP] operator[SEP] identifier[reload] operator[SEP] operator[SEP] operator[SEP] identifier[klass] operator[=] identifier[graph] operator[SEP] identifier[getDatabase] operator[SEP] operator[SEP] operator[SEP] identifier[getMetadata] operator[SEP] operator[SEP] operator[SEP] identifier[getSchema] operator[SEP] operator[SEP] operator[SEP] identifier[getClass] operator[SEP] identifier[inverseFieldName] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[klass] operator[==] Other[null] operator[SEP] {
identifier[OLogManager] operator[SEP] identifier[instance] operator[SEP] operator[SEP] operator[SEP] identifier[warn] operator[SEP] Other[null] , literal[String] operator[+] identifier[r] operator[SEP] operator[SEP] Keyword[return] operator[SEP]
}
}
Keyword[if] operator[SEP] identifier[klass] operator[SEP] identifier[isVertexType] operator[SEP] operator[SEP] operator[SEP] {
identifier[removeEdges] operator[SEP] identifier[graph] , identifier[r] , identifier[inverseFieldName] , identifier[iVertex] , literal[boolean] , identifier[useVertexFieldsForEdgeLabels] , identifier[autoScaleEdgeType] , identifier[forceReload] operator[SEP] operator[SEP] identifier[r] operator[SEP] identifier[save] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[klass] operator[SEP] identifier[isEdgeType] operator[SEP] operator[SEP] operator[SEP] {
Keyword[final] identifier[OIdentifiable] identifier[otherVertex] operator[=] identifier[OrientEdge] operator[SEP] identifier[getConnection] operator[SEP] identifier[r] , identifier[OrientVertex] operator[SEP] identifier[getConnectionDirection] operator[SEP] identifier[inverseFieldName] , identifier[useVertexFieldsForEdgeLabels] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[otherVertex] operator[!=] Other[null] operator[SEP] {
Keyword[if] operator[SEP] identifier[iVertexToRemove] operator[==] Other[null] operator[||] identifier[otherVertex] operator[SEP] identifier[equals] operator[SEP] identifier[iVertexToRemove] operator[SEP] operator[SEP] {
Keyword[final] Keyword[int] identifier[maxRetries] operator[=] identifier[graph] operator[SEP] identifier[getMaxRetries] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[retry] operator[=] Other[0] operator[SEP] identifier[retry] operator[<] identifier[maxRetries] operator[SEP] operator[++] identifier[retry] operator[SEP] {
Keyword[try] {
Keyword[final] identifier[ODocument] identifier[otherVertexRecord] operator[=] identifier[getDocument] operator[SEP] identifier[otherVertex] , identifier[forceReload] operator[SEP] operator[SEP] identifier[removeEdges] operator[SEP] identifier[graph] , identifier[otherVertexRecord] , identifier[inverseFieldName] , operator[SEP] identifier[OIdentifiable] operator[SEP] identifier[currentRecord] , literal[boolean] , identifier[useVertexFieldsForEdgeLabels] , identifier[autoScaleEdgeType] , identifier[forceReload] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[otherVertexRecord] operator[!=] Other[null] operator[SEP] identifier[otherVertexRecord] operator[SEP] identifier[save] operator[SEP] operator[SEP] operator[SEP] Keyword[break] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[ONeedRetryException] identifier[e] operator[SEP] {
}
}
}
}
}
}
|
public Observable<ConnectionMonitorResultInner> beginCreateOrUpdateAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName, ConnectionMonitorInner parameters) {
return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, networkWatcherName, connectionMonitorName, parameters).map(new Func1<ServiceResponse<ConnectionMonitorResultInner>, ConnectionMonitorResultInner>() {
@Override
public ConnectionMonitorResultInner call(ServiceResponse<ConnectionMonitorResultInner> response) {
return response.body();
}
});
} | class class_name[name] begin[{]
method[beginCreateOrUpdateAsync, return_type[type[Observable]], modifier[public], parameter[resourceGroupName, networkWatcherName, connectionMonitorName, parameters]] begin[{]
return[call[.beginCreateOrUpdateWithServiceResponseAsync, parameter[member[.resourceGroupName], member[.networkWatcherName], member[.connectionMonitorName], member[.parameters]]]]
end[}]
END[}] | Keyword[public] identifier[Observable] operator[<] identifier[ConnectionMonitorResultInner] operator[>] identifier[beginCreateOrUpdateAsync] operator[SEP] identifier[String] identifier[resourceGroupName] , identifier[String] identifier[networkWatcherName] , identifier[String] identifier[connectionMonitorName] , identifier[ConnectionMonitorInner] identifier[parameters] operator[SEP] {
Keyword[return] identifier[beginCreateOrUpdateWithServiceResponseAsync] operator[SEP] identifier[resourceGroupName] , identifier[networkWatcherName] , identifier[connectionMonitorName] , identifier[parameters] operator[SEP] operator[SEP] identifier[map] operator[SEP] Keyword[new] identifier[Func1] operator[<] identifier[ServiceResponse] operator[<] identifier[ConnectionMonitorResultInner] operator[>] , identifier[ConnectionMonitorResultInner] operator[>] operator[SEP] operator[SEP] {
annotation[@] identifier[Override] Keyword[public] identifier[ConnectionMonitorResultInner] identifier[call] operator[SEP] identifier[ServiceResponse] operator[<] identifier[ConnectionMonitorResultInner] operator[>] identifier[response] operator[SEP] {
Keyword[return] identifier[response] operator[SEP] identifier[body] operator[SEP] operator[SEP] operator[SEP]
}
} operator[SEP] operator[SEP]
}
|
private void reportList(List collected, boolean doReport) {
int size = collected.size();
// now loop through all collected resources
m_report.println(
Messages.get().container(Messages.RPT_NUM_PAGES_1, new Integer(size)),
I_CmsReport.FORMAT_HEADLINE);
if (doReport) {
int count = 1;
Iterator i = collected.iterator();
while (i.hasNext()) {
String resName = (String)i.next();
m_report.print(
org.opencms.report.Messages.get().container(
org.opencms.report.Messages.RPT_SUCCESSION_2,
String.valueOf(count++),
String.valueOf(size)),
I_CmsReport.FORMAT_NOTE);
m_report.println(Messages.get().container(Messages.RPT_PROCESS_1, resName), I_CmsReport.FORMAT_NOTE);
}
}
m_report.println(Messages.get().container(Messages.RPT_MERGE_PAGES_END_0), I_CmsReport.FORMAT_HEADLINE);
} | class class_name[name] begin[{]
method[reportList, return_type[void], modifier[private], parameter[collected, doReport]] begin[{]
local_variable[type[int], size]
call[m_report.println, parameter[call[Messages.get, parameter[]], member[I_CmsReport.FORMAT_HEADLINE]]]
if[member[.doReport]] begin[{]
local_variable[type[int], count]
local_variable[type[Iterator], i]
while[call[i.hasNext, parameter[]]] begin[{]
local_variable[type[String], resName]
call[m_report.print, parameter[call[org.opencms.report.Messages.get, parameter[]], member[I_CmsReport.FORMAT_NOTE]]]
call[m_report.println, parameter[call[Messages.get, parameter[]], member[I_CmsReport.FORMAT_NOTE]]]
end[}]
else begin[{]
None
end[}]
call[m_report.println, parameter[call[Messages.get, parameter[]], member[I_CmsReport.FORMAT_HEADLINE]]]
end[}]
END[}] | Keyword[private] Keyword[void] identifier[reportList] operator[SEP] identifier[List] identifier[collected] , Keyword[boolean] identifier[doReport] operator[SEP] {
Keyword[int] identifier[size] operator[=] identifier[collected] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] identifier[m_report] operator[SEP] identifier[println] operator[SEP] identifier[Messages] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[container] operator[SEP] identifier[Messages] operator[SEP] identifier[RPT_NUM_PAGES_1] , Keyword[new] identifier[Integer] operator[SEP] identifier[size] operator[SEP] operator[SEP] , identifier[I_CmsReport] operator[SEP] identifier[FORMAT_HEADLINE] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[doReport] operator[SEP] {
Keyword[int] identifier[count] operator[=] Other[1] operator[SEP] identifier[Iterator] identifier[i] operator[=] identifier[collected] 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] {
identifier[String] identifier[resName] operator[=] operator[SEP] identifier[String] operator[SEP] identifier[i] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] identifier[m_report] operator[SEP] identifier[print] operator[SEP] identifier[org] operator[SEP] identifier[opencms] operator[SEP] identifier[report] operator[SEP] identifier[Messages] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[container] operator[SEP] identifier[org] operator[SEP] identifier[opencms] operator[SEP] identifier[report] operator[SEP] identifier[Messages] operator[SEP] identifier[RPT_SUCCESSION_2] , identifier[String] operator[SEP] identifier[valueOf] operator[SEP] identifier[count] operator[++] operator[SEP] , identifier[String] operator[SEP] identifier[valueOf] operator[SEP] identifier[size] operator[SEP] operator[SEP] , identifier[I_CmsReport] operator[SEP] identifier[FORMAT_NOTE] operator[SEP] operator[SEP] identifier[m_report] operator[SEP] identifier[println] operator[SEP] identifier[Messages] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[container] operator[SEP] identifier[Messages] operator[SEP] identifier[RPT_PROCESS_1] , identifier[resName] operator[SEP] , identifier[I_CmsReport] operator[SEP] identifier[FORMAT_NOTE] operator[SEP] operator[SEP]
}
}
identifier[m_report] operator[SEP] identifier[println] operator[SEP] identifier[Messages] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[container] operator[SEP] identifier[Messages] operator[SEP] identifier[RPT_MERGE_PAGES_END_0] operator[SEP] , identifier[I_CmsReport] operator[SEP] identifier[FORMAT_HEADLINE] operator[SEP] operator[SEP]
}
|
@Nonnull
public static <T> LOiToLongFunction<T> oiToLongFunctionFrom(Consumer<LOiToLongFunctionBuilder<T>> buildingFunction) {
LOiToLongFunctionBuilder builder = new LOiToLongFunctionBuilder();
buildingFunction.accept(builder);
return builder.build();
} | class class_name[name] begin[{]
method[oiToLongFunctionFrom, return_type[type[LOiToLongFunction]], modifier[public static], parameter[buildingFunction]] begin[{]
local_variable[type[LOiToLongFunctionBuilder], builder]
call[buildingFunction.accept, parameter[member[.builder]]]
return[call[builder.build, parameter[]]]
end[}]
END[}] | annotation[@] identifier[Nonnull] Keyword[public] Keyword[static] operator[<] identifier[T] operator[>] identifier[LOiToLongFunction] operator[<] identifier[T] operator[>] identifier[oiToLongFunctionFrom] operator[SEP] identifier[Consumer] operator[<] identifier[LOiToLongFunctionBuilder] operator[<] identifier[T] operator[>] operator[>] identifier[buildingFunction] operator[SEP] {
identifier[LOiToLongFunctionBuilder] identifier[builder] operator[=] Keyword[new] identifier[LOiToLongFunctionBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[buildingFunction] operator[SEP] identifier[accept] operator[SEP] identifier[builder] operator[SEP] operator[SEP] Keyword[return] identifier[builder] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP]
}
|
public <V> V getColumnValue(T instance, String columnName,
Class<V> valueClass) {
Field field = fields.get(columnName);
if (field == null) {
throw new IllegalArgumentException("Column not found: "
+ columnName);
}
try {
return valueClass.cast(field.get(instance));
} catch (IllegalAccessException e) {
throw new RuntimeException(e); // should never get here
}
} | class class_name[name] begin[{]
method[getColumnValue, return_type[type[V]], modifier[public], parameter[instance, columnName, valueClass]] begin[{]
local_variable[type[Field], field]
if[binary_operation[member[.field], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Column not found: "), operandr=MemberReference(member=columnName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None)
else begin[{]
None
end[}]
TryStatement(block=[ReturnStatement(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=instance, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=field, selectors=[], type_arguments=None)], member=cast, postfix_operators=[], prefix_operators=[], qualifier=valueClass, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=RuntimeException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IllegalAccessException']))], finally_block=None, label=None, resources=None)
end[}]
END[}] | Keyword[public] operator[<] identifier[V] operator[>] identifier[V] identifier[getColumnValue] operator[SEP] identifier[T] identifier[instance] , identifier[String] identifier[columnName] , identifier[Class] operator[<] identifier[V] operator[>] identifier[valueClass] operator[SEP] {
identifier[Field] identifier[field] operator[=] identifier[fields] operator[SEP] identifier[get] operator[SEP] identifier[columnName] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[field] operator[==] Other[null] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[+] identifier[columnName] operator[SEP] operator[SEP]
}
Keyword[try] {
Keyword[return] identifier[valueClass] operator[SEP] identifier[cast] operator[SEP] identifier[field] operator[SEP] identifier[get] operator[SEP] identifier[instance] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[IllegalAccessException] identifier[e] operator[SEP] {
Keyword[throw] Keyword[new] identifier[RuntimeException] operator[SEP] identifier[e] operator[SEP] operator[SEP]
}
}
|
public boolean save(DataOutputStream out)
{
try
{
out.writeInt(size);
for (int i = 0; i < size; i++)
{
out.writeInt(base[i]);
out.writeInt(check[i]);
}
}
catch (Exception e)
{
return false;
}
return true;
} | class class_name[name] begin[{]
method[save, return_type[type[boolean]], modifier[public], parameter[out]] begin[{]
TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=size, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=writeInt, postfix_operators=[], prefix_operators=[], qualifier=out, selectors=[], type_arguments=None), label=None), ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=base, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])], member=writeInt, postfix_operators=[], prefix_operators=[], qualifier=out, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=check, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])], member=writeInt, postfix_operators=[], prefix_operators=[], qualifier=out, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=size, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)], catches=[CatchClause(block=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None)
return[literal[true]]
end[}]
END[}] | Keyword[public] Keyword[boolean] identifier[save] operator[SEP] identifier[DataOutputStream] identifier[out] operator[SEP] {
Keyword[try] {
identifier[out] operator[SEP] identifier[writeInt] operator[SEP] identifier[size] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[size] operator[SEP] identifier[i] operator[++] operator[SEP] {
identifier[out] operator[SEP] identifier[writeInt] operator[SEP] identifier[base] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP] identifier[out] operator[SEP] identifier[writeInt] operator[SEP] identifier[check] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] {
Keyword[return] literal[boolean] operator[SEP]
}
Keyword[return] literal[boolean] operator[SEP]
}
|
public final ControlBrowseEnd createNewControlBrowseEnd() throws MessageCreateFailedException {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "createNewControlBrowseEnd");
ControlBrowseEnd msg = null;
try {
msg = new ControlBrowseEndImpl(MfpConstants.CONSTRUCTOR_NO_OP);
}
catch (MessageDecodeFailedException e) {
/* No need to FFDC this as JsMsgObject will already have done so */
// No FFDC code needed
throw new MessageCreateFailedException(e);
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "createNewControlBrowseEnd");
return msg;
} | class class_name[name] begin[{]
method[createNewControlBrowseEnd, return_type[type[ControlBrowseEnd]], modifier[final public], parameter[]] begin[{]
if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{]
call[SibTr.entry, parameter[member[.tc], literal["createNewControlBrowseEnd"]]]
else begin[{]
None
end[}]
local_variable[type[ControlBrowseEnd], msg]
TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=msg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[MemberReference(member=CONSTRUCTOR_NO_OP, postfix_operators=[], prefix_operators=[], qualifier=MfpConstants, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ControlBrowseEndImpl, sub_type=None))), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=MessageCreateFailedException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['MessageDecodeFailedException']))], finally_block=None, label=None, resources=None)
if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{]
call[SibTr.exit, parameter[member[.tc], literal["createNewControlBrowseEnd"]]]
else begin[{]
None
end[}]
return[member[.msg]]
end[}]
END[}] | Keyword[public] Keyword[final] identifier[ControlBrowseEnd] identifier[createNewControlBrowseEnd] operator[SEP] operator[SEP] Keyword[throws] identifier[MessageCreateFailedException] {
Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[entry] operator[SEP] identifier[tc] , literal[String] operator[SEP] operator[SEP] identifier[ControlBrowseEnd] identifier[msg] operator[=] Other[null] operator[SEP] Keyword[try] {
identifier[msg] operator[=] Keyword[new] identifier[ControlBrowseEndImpl] operator[SEP] identifier[MfpConstants] operator[SEP] identifier[CONSTRUCTOR_NO_OP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[MessageDecodeFailedException] identifier[e] operator[SEP] {
Keyword[throw] Keyword[new] identifier[MessageCreateFailedException] operator[SEP] identifier[e] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[exit] operator[SEP] identifier[tc] , literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[msg] operator[SEP]
}
|
public void suspend() throws SuspendException
{
latcher.set(new CountDownLatch(1));
isSuspended.set(true);
if (workingThreads.get() > 0)
{
synchronized (workingThreads)
{
while (workingThreads.get() > 0)
{
try
{
workingThreads.wait();
}
catch (InterruptedException e)
{
if (log.isTraceEnabled())
{
log.trace(e.getMessage(), e);
}
}
}
}
}
closeAndKeepWaitingThreads(false);
} | class class_name[name] begin[{]
method[suspend, return_type[void], modifier[public], parameter[]] begin[{]
call[latcher.set, parameter[ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=CountDownLatch, sub_type=None))]]
call[isSuspended.set, parameter[literal[true]]]
if[binary_operation[call[workingThreads.get, parameter[]], >, literal[0]]] begin[{]
SYNCHRONIZED[member[.workingThreads]] BEGIN[{]
while[binary_operation[call[workingThreads.get, parameter[]], >, literal[0]]] begin[{]
TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=wait, postfix_operators=[], prefix_operators=[], qualifier=workingThreads, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[IfStatement(condition=MethodInvocation(arguments=[], member=isTraceEnabled, postfix_operators=[], prefix_operators=[], qualifier=log, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=trace, postfix_operators=[], prefix_operators=[], qualifier=log, 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)
end[}]
END[}]
else begin[{]
None
end[}]
call[.closeAndKeepWaitingThreads, parameter[literal[false]]]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[suspend] operator[SEP] operator[SEP] Keyword[throws] identifier[SuspendException] {
identifier[latcher] operator[SEP] identifier[set] operator[SEP] Keyword[new] identifier[CountDownLatch] operator[SEP] Other[1] operator[SEP] operator[SEP] operator[SEP] identifier[isSuspended] operator[SEP] identifier[set] operator[SEP] literal[boolean] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[workingThreads] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] {
Keyword[synchronized] operator[SEP] identifier[workingThreads] operator[SEP] {
Keyword[while] operator[SEP] identifier[workingThreads] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] {
Keyword[try] {
identifier[workingThreads] operator[SEP] identifier[wait] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[InterruptedException] identifier[e] operator[SEP] {
Keyword[if] operator[SEP] identifier[log] operator[SEP] identifier[isTraceEnabled] operator[SEP] operator[SEP] operator[SEP] {
identifier[log] operator[SEP] identifier[trace] operator[SEP] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP]
}
}
}
}
}
identifier[closeAndKeepWaitingThreads] operator[SEP] literal[boolean] operator[SEP] operator[SEP]
}
|
public static Element toElement(final String aFilePath, final boolean aBool) throws FileNotFoundException,
ParserConfigurationException {
return toElement(aFilePath, WILDCARD, aBool);
} | class class_name[name] begin[{]
method[toElement, return_type[type[Element]], modifier[public static], parameter[aFilePath, aBool]] begin[{]
return[call[.toElement, parameter[member[.aFilePath], member[.WILDCARD], member[.aBool]]]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[Element] identifier[toElement] operator[SEP] Keyword[final] identifier[String] identifier[aFilePath] , Keyword[final] Keyword[boolean] identifier[aBool] operator[SEP] Keyword[throws] identifier[FileNotFoundException] , identifier[ParserConfigurationException] {
Keyword[return] identifier[toElement] operator[SEP] identifier[aFilePath] , identifier[WILDCARD] , identifier[aBool] operator[SEP] operator[SEP]
}
|
@Override
public BtrpOperand go(BtrPlaceTree parent) {
String cname = getText();
if (catalog == null) {
return ignoreError("No constraints available");
}
SatConstraintBuilder b = catalog.getConstraint(cname);
if (b == null) {
ignoreError("Unknown constraint '" + cname + "'");
}
//Get the params
int i = 0;
boolean discrete = false;
if (">>".equals(getChild(0).getText())) {
i = 1;
discrete = true;
}
List<BtrpOperand> params = new ArrayList<>();
for (; i < getChildCount(); i++) {
params.add(getChild(i).go(this));
}
if (b != null) {
List<? extends SatConstraint> constraints = b.buildConstraint(this, params);
for (SatConstraint c : constraints) {
if (c != null) {
if (discrete) {
if (!c.setContinuous(false)) {
return ignoreError("Discrete restriction is not supported by constraint '" + cname + "'");
}
} else {
//force the continuous mode, if available
c.setContinuous(true);
}
script.addConstraint(c);
}
}
}
return IgnorableOperand.getInstance();
} | class class_name[name] begin[{]
method[go, return_type[type[BtrpOperand]], modifier[public], parameter[parent]] begin[{]
local_variable[type[String], cname]
if[binary_operation[member[.catalog], ==, literal[null]]] begin[{]
return[call[.ignoreError, parameter[literal["No constraints available"]]]]
else begin[{]
None
end[}]
local_variable[type[SatConstraintBuilder], b]
if[binary_operation[member[.b], ==, literal[null]]] begin[{]
call[.ignoreError, parameter[binary_operation[binary_operation[literal["Unknown constraint '"], +, member[.cname]], +, literal["'"]]]]
else begin[{]
None
end[}]
local_variable[type[int], i]
local_variable[type[boolean], discrete]
if[literal[">>"]] begin[{]
assign[member[.i], literal[1]]
assign[member[.discrete], literal[true]]
else begin[{]
None
end[}]
local_variable[type[List], params]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getChild, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[])], member=go, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=params, 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=, selectors=[], type_arguments=None), operator=<), init=None, update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
if[binary_operation[member[.b], !=, literal[null]]] begin[{]
local_variable[type[List], constraints]
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=MemberReference(member=discrete, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], member=setContinuous, postfix_operators=[], prefix_operators=[], qualifier=c, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)], member=setContinuous, postfix_operators=[], prefix_operators=['!'], qualifier=c, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Discrete restriction is not supported by constraint '"), operandr=MemberReference(member=cname, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="'"), operator=+)], member=ignoreError, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]))])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addConstraint, postfix_operators=[], prefix_operators=[], qualifier=script, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=constraints, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=c)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=SatConstraint, sub_type=None))), label=None)
else begin[{]
None
end[}]
return[call[IgnorableOperand.getInstance, parameter[]]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] identifier[BtrpOperand] identifier[go] operator[SEP] identifier[BtrPlaceTree] identifier[parent] operator[SEP] {
identifier[String] identifier[cname] operator[=] identifier[getText] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[catalog] operator[==] Other[null] operator[SEP] {
Keyword[return] identifier[ignoreError] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
identifier[SatConstraintBuilder] identifier[b] operator[=] identifier[catalog] operator[SEP] identifier[getConstraint] operator[SEP] identifier[cname] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[b] operator[==] Other[null] operator[SEP] {
identifier[ignoreError] operator[SEP] literal[String] operator[+] identifier[cname] operator[+] literal[String] operator[SEP] operator[SEP]
}
Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] Keyword[boolean] identifier[discrete] operator[=] literal[boolean] operator[SEP] Keyword[if] operator[SEP] literal[String] operator[SEP] identifier[equals] operator[SEP] identifier[getChild] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[getText] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
identifier[i] operator[=] Other[1] operator[SEP] identifier[discrete] operator[=] literal[boolean] operator[SEP]
}
identifier[List] operator[<] identifier[BtrpOperand] operator[>] identifier[params] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] operator[SEP] identifier[i] operator[<] identifier[getChildCount] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[++] operator[SEP] {
identifier[params] operator[SEP] identifier[add] operator[SEP] identifier[getChild] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[go] operator[SEP] Keyword[this] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[b] operator[!=] Other[null] operator[SEP] {
identifier[List] operator[<] operator[?] Keyword[extends] identifier[SatConstraint] operator[>] identifier[constraints] operator[=] identifier[b] operator[SEP] identifier[buildConstraint] operator[SEP] Keyword[this] , identifier[params] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[SatConstraint] identifier[c] operator[:] identifier[constraints] operator[SEP] {
Keyword[if] operator[SEP] identifier[c] operator[!=] Other[null] operator[SEP] {
Keyword[if] operator[SEP] identifier[discrete] operator[SEP] {
Keyword[if] operator[SEP] operator[!] identifier[c] operator[SEP] identifier[setContinuous] operator[SEP] literal[boolean] operator[SEP] operator[SEP] {
Keyword[return] identifier[ignoreError] operator[SEP] literal[String] operator[+] identifier[cname] operator[+] literal[String] operator[SEP] operator[SEP]
}
}
Keyword[else] {
identifier[c] operator[SEP] identifier[setContinuous] operator[SEP] literal[boolean] operator[SEP] operator[SEP]
}
identifier[script] operator[SEP] identifier[addConstraint] operator[SEP] identifier[c] operator[SEP] operator[SEP]
}
}
}
Keyword[return] identifier[IgnorableOperand] operator[SEP] identifier[getInstance] operator[SEP] operator[SEP] operator[SEP]
}
|
public String equivalence(final Namespace sourceNamespace,
final String sourceValue, final Namespace targetNamespace)
throws EquivalencerException {
if (sourceNamespace == null) {
throw new InvalidArgument("sourceNamespace", sourceNamespace);
}
if (noLength(sourceValue)) {
throw new InvalidArgument("sourceValue", sourceValue);
}
if (targetNamespace == null) {
throw new InvalidArgument("targetNamespace", targetNamespace);
}
loadEquivalencingEngine();
// convert namespace and value to parameter (common model).
final Parameter sp = new Parameter(sourceNamespace, sourceValue);
try {
Parameter parameter = this.paramEquivalencer.findEquivalence(sp,
targetNamespace);
return parameter == null ? null : parameter.getValue();
} catch (InvalidArgument e) {
//TODO change exception when paramEquivalencer is changed
return null;
} catch (Exception e) {
final String fmt = "Unable to find equivalences for '%s'";
final String msg = format(fmt, sp.toBELShortForm());
throw new EquivalencerException(msg, e);
}
} | class class_name[name] begin[{]
method[equivalence, return_type[type[String]], modifier[public], parameter[sourceNamespace, sourceValue, targetNamespace]] begin[{]
if[binary_operation[member[.sourceNamespace], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="sourceNamespace"), MemberReference(member=sourceNamespace, 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=InvalidArgument, sub_type=None)), label=None)
else begin[{]
None
end[}]
if[call[.noLength, parameter[member[.sourceValue]]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="sourceValue"), MemberReference(member=sourceValue, 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=InvalidArgument, sub_type=None)), label=None)
else begin[{]
None
end[}]
if[binary_operation[member[.targetNamespace], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="targetNamespace"), MemberReference(member=targetNamespace, 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=InvalidArgument, sub_type=None)), label=None)
else begin[{]
None
end[}]
call[.loadEquivalencingEngine, parameter[]]
local_variable[type[Parameter], sp]
TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=paramEquivalencer, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[MemberReference(member=sp, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=targetNamespace, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=findEquivalence, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), name=parameter)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Parameter, sub_type=None)), ReturnStatement(expression=TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=parameter, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), if_false=MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=parameter, selectors=[], type_arguments=None), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)), label=None)], catches=[CatchClause(block=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['InvalidArgument'])), CatchClause(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unable to find equivalences for '%s'"), name=fmt)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=fmt, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=toBELShortForm, postfix_operators=[], prefix_operators=[], qualifier=sp, selectors=[], type_arguments=None)], member=format, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=msg)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=msg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=EquivalencerException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None)
end[}]
END[}] | Keyword[public] identifier[String] identifier[equivalence] operator[SEP] Keyword[final] identifier[Namespace] identifier[sourceNamespace] , Keyword[final] identifier[String] identifier[sourceValue] , Keyword[final] identifier[Namespace] identifier[targetNamespace] operator[SEP] Keyword[throws] identifier[EquivalencerException] {
Keyword[if] operator[SEP] identifier[sourceNamespace] operator[==] Other[null] operator[SEP] {
Keyword[throw] Keyword[new] identifier[InvalidArgument] operator[SEP] literal[String] , identifier[sourceNamespace] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[noLength] operator[SEP] identifier[sourceValue] operator[SEP] operator[SEP] {
Keyword[throw] Keyword[new] identifier[InvalidArgument] operator[SEP] literal[String] , identifier[sourceValue] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[targetNamespace] operator[==] Other[null] operator[SEP] {
Keyword[throw] Keyword[new] identifier[InvalidArgument] operator[SEP] literal[String] , identifier[targetNamespace] operator[SEP] operator[SEP]
}
identifier[loadEquivalencingEngine] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[Parameter] identifier[sp] operator[=] Keyword[new] identifier[Parameter] operator[SEP] identifier[sourceNamespace] , identifier[sourceValue] operator[SEP] operator[SEP] Keyword[try] {
identifier[Parameter] identifier[parameter] operator[=] Keyword[this] operator[SEP] identifier[paramEquivalencer] operator[SEP] identifier[findEquivalence] operator[SEP] identifier[sp] , identifier[targetNamespace] operator[SEP] operator[SEP] Keyword[return] identifier[parameter] operator[==] Other[null] operator[?] Other[null] operator[:] identifier[parameter] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[InvalidArgument] identifier[e] operator[SEP] {
Keyword[return] Other[null] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] {
Keyword[final] identifier[String] identifier[fmt] operator[=] literal[String] operator[SEP] Keyword[final] identifier[String] identifier[msg] operator[=] identifier[format] operator[SEP] identifier[fmt] , identifier[sp] operator[SEP] identifier[toBELShortForm] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[EquivalencerException] operator[SEP] identifier[msg] , identifier[e] operator[SEP] operator[SEP]
}
}
|
@Override
public boolean isNonWorkingDay(final E date) {
if (date != null && (holidayCalendar.getEarlyBoundary() != null || holidayCalendar.getLateBoundary() != null)) {
checkBoundary(date);
}
return isWeekend(date) || holidayCalendar.isHoliday(date);
} | class class_name[name] begin[{]
method[isNonWorkingDay, return_type[type[boolean]], modifier[public], parameter[date]] begin[{]
if[binary_operation[binary_operation[member[.date], !=, literal[null]], &&, binary_operation[binary_operation[call[holidayCalendar.getEarlyBoundary, parameter[]], !=, literal[null]], ||, binary_operation[call[holidayCalendar.getLateBoundary, parameter[]], !=, literal[null]]]]] begin[{]
call[.checkBoundary, parameter[member[.date]]]
else begin[{]
None
end[}]
return[binary_operation[call[.isWeekend, parameter[member[.date]]], ||, call[holidayCalendar.isHoliday, parameter[member[.date]]]]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] Keyword[boolean] identifier[isNonWorkingDay] operator[SEP] Keyword[final] identifier[E] identifier[date] operator[SEP] {
Keyword[if] operator[SEP] identifier[date] operator[!=] Other[null] operator[&&] operator[SEP] identifier[holidayCalendar] operator[SEP] identifier[getEarlyBoundary] operator[SEP] operator[SEP] operator[!=] Other[null] operator[||] identifier[holidayCalendar] operator[SEP] identifier[getLateBoundary] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] operator[SEP] {
identifier[checkBoundary] operator[SEP] identifier[date] operator[SEP] operator[SEP]
}
Keyword[return] identifier[isWeekend] operator[SEP] identifier[date] operator[SEP] operator[||] identifier[holidayCalendar] operator[SEP] identifier[isHoliday] operator[SEP] identifier[date] operator[SEP] operator[SEP]
}
|
public void asyncCommit(CommitListener commitListener) throws IllegalStateException,
SecurityException {
if (doTraceLogs) {
logger.trace("asyncCommit( commitListener = "+commitListener+" )");
}
try {
final SleeTransaction sleeTransaction = getSleeTransaction();
if (sleeTransaction == null) {
throw new IllegalStateException("no transaction");
}
else {
sleeTransaction.asyncCommit(commitListener);
}
} catch (SystemException e) {
if (commitListener != null) {
commitListener.systemException(e);
}
}
} | class class_name[name] begin[{]
method[asyncCommit, return_type[void], modifier[public], parameter[commitListener]] begin[{]
if[member[.doTraceLogs]] begin[{]
call[logger.trace, parameter[binary_operation[binary_operation[literal["asyncCommit( commitListener = "], +, member[.commitListener]], +, literal[" )"]]]]
else begin[{]
None
end[}]
TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getSleeTransaction, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=sleeTransaction)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=SleeTransaction, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=sleeTransaction, 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=[MemberReference(member=commitListener, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=asyncCommit, postfix_operators=[], prefix_operators=[], qualifier=sleeTransaction, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="no transaction")], 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)]))], catches=[CatchClause(block=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=commitListener, 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=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=systemException, postfix_operators=[], prefix_operators=[], qualifier=commitListener, selectors=[], type_arguments=None), label=None)]))], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['SystemException']))], finally_block=None, label=None, resources=None)
end[}]
END[}] | Keyword[public] Keyword[void] identifier[asyncCommit] operator[SEP] identifier[CommitListener] identifier[commitListener] operator[SEP] Keyword[throws] identifier[IllegalStateException] , identifier[SecurityException] {
Keyword[if] operator[SEP] identifier[doTraceLogs] operator[SEP] {
identifier[logger] operator[SEP] identifier[trace] operator[SEP] literal[String] operator[+] identifier[commitListener] operator[+] literal[String] operator[SEP] operator[SEP]
}
Keyword[try] {
Keyword[final] identifier[SleeTransaction] identifier[sleeTransaction] operator[=] identifier[getSleeTransaction] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[sleeTransaction] operator[==] Other[null] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[sleeTransaction] operator[SEP] identifier[asyncCommit] operator[SEP] identifier[commitListener] operator[SEP] operator[SEP]
}
}
Keyword[catch] operator[SEP] identifier[SystemException] identifier[e] operator[SEP] {
Keyword[if] operator[SEP] identifier[commitListener] operator[!=] Other[null] operator[SEP] {
identifier[commitListener] operator[SEP] identifier[systemException] operator[SEP] identifier[e] operator[SEP] operator[SEP]
}
}
}
|
@Override
public boolean isEnabled(String name, Locale locale) {
CmsXmlHtmlValue value = (CmsXmlHtmlValue)getValue(name, locale);
if (value != null) {
Element element = value.getElement();
Attribute enabled = element.attribute(ATTRIBUTE_ENABLED);
return ((enabled == null) || Boolean.valueOf(enabled.getValue()).booleanValue());
}
return false;
} | class class_name[name] begin[{]
method[isEnabled, return_type[type[boolean]], modifier[public], parameter[name, locale]] begin[{]
local_variable[type[CmsXmlHtmlValue], value]
if[binary_operation[member[.value], !=, literal[null]]] begin[{]
local_variable[type[Element], element]
local_variable[type[Attribute], enabled]
return[binary_operation[binary_operation[member[.enabled], ==, literal[null]], ||, call[Boolean.valueOf, parameter[call[enabled.getValue, parameter[]]]]]]
else begin[{]
None
end[}]
return[literal[false]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] Keyword[boolean] identifier[isEnabled] operator[SEP] identifier[String] identifier[name] , identifier[Locale] identifier[locale] operator[SEP] {
identifier[CmsXmlHtmlValue] identifier[value] operator[=] operator[SEP] identifier[CmsXmlHtmlValue] operator[SEP] identifier[getValue] operator[SEP] identifier[name] , identifier[locale] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[value] operator[!=] Other[null] operator[SEP] {
identifier[Element] identifier[element] operator[=] identifier[value] operator[SEP] identifier[getElement] operator[SEP] operator[SEP] operator[SEP] identifier[Attribute] identifier[enabled] operator[=] identifier[element] operator[SEP] identifier[attribute] operator[SEP] identifier[ATTRIBUTE_ENABLED] operator[SEP] operator[SEP] Keyword[return] operator[SEP] operator[SEP] identifier[enabled] operator[==] Other[null] operator[SEP] operator[||] identifier[Boolean] operator[SEP] identifier[valueOf] operator[SEP] identifier[enabled] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[booleanValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] literal[boolean] operator[SEP]
}
|
private void reportRetry(String importerName, String procName) {
StatsInfo statsInfo = getStatsInfo(importerName, procName);
statsInfo.m_retryCount.incrementAndGet();
} | class class_name[name] begin[{]
method[reportRetry, return_type[void], modifier[private], parameter[importerName, procName]] begin[{]
local_variable[type[StatsInfo], statsInfo]
call[statsInfo.m_retryCount.incrementAndGet, parameter[]]
end[}]
END[}] | Keyword[private] Keyword[void] identifier[reportRetry] operator[SEP] identifier[String] identifier[importerName] , identifier[String] identifier[procName] operator[SEP] {
identifier[StatsInfo] identifier[statsInfo] operator[=] identifier[getStatsInfo] operator[SEP] identifier[importerName] , identifier[procName] operator[SEP] operator[SEP] identifier[statsInfo] operator[SEP] identifier[m_retryCount] operator[SEP] identifier[incrementAndGet] operator[SEP] operator[SEP] operator[SEP]
}
|
public <T extends Model> T setDouble(String attributeName, Object value) {
Converter<Object, Double> converter = modelRegistryLocal.converterForValue(attributeName, value, Double.class);
return setRaw(attributeName, converter != null ? converter.convert(value) : Convert.toDouble(value));
} | class class_name[name] begin[{]
method[setDouble, return_type[type[T]], modifier[public], parameter[attributeName, value]] begin[{]
local_variable[type[Converter], converter]
return[call[.setRaw, parameter[member[.attributeName], TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=converter, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), if_false=MethodInvocation(arguments=[MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=toDouble, postfix_operators=[], prefix_operators=[], qualifier=Convert, selectors=[], type_arguments=None), if_true=MethodInvocation(arguments=[MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=convert, postfix_operators=[], prefix_operators=[], qualifier=converter, selectors=[], type_arguments=None))]]]
end[}]
END[}] | Keyword[public] operator[<] identifier[T] Keyword[extends] identifier[Model] operator[>] identifier[T] identifier[setDouble] operator[SEP] identifier[String] identifier[attributeName] , identifier[Object] identifier[value] operator[SEP] {
identifier[Converter] operator[<] identifier[Object] , identifier[Double] operator[>] identifier[converter] operator[=] identifier[modelRegistryLocal] operator[SEP] identifier[converterForValue] operator[SEP] identifier[attributeName] , identifier[value] , identifier[Double] operator[SEP] Keyword[class] operator[SEP] operator[SEP] Keyword[return] identifier[setRaw] operator[SEP] identifier[attributeName] , identifier[converter] operator[!=] Other[null] operator[?] identifier[converter] operator[SEP] identifier[convert] operator[SEP] identifier[value] operator[SEP] operator[:] identifier[Convert] operator[SEP] identifier[toDouble] operator[SEP] identifier[value] operator[SEP] operator[SEP] operator[SEP]
}
|
public void rollback(Xid xid) throws XAException
{
if (pad)
xid = convertXid(xid);
xaResource.rollback(xid);
} | class class_name[name] begin[{]
method[rollback, return_type[void], modifier[public], parameter[xid]] begin[{]
if[member[.pad]] begin[{]
assign[member[.xid], call[.convertXid, parameter[member[.xid]]]]
else begin[{]
None
end[}]
call[xaResource.rollback, parameter[member[.xid]]]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[rollback] operator[SEP] identifier[Xid] identifier[xid] operator[SEP] Keyword[throws] identifier[XAException] {
Keyword[if] operator[SEP] identifier[pad] operator[SEP] identifier[xid] operator[=] identifier[convertXid] operator[SEP] identifier[xid] operator[SEP] operator[SEP] identifier[xaResource] operator[SEP] identifier[rollback] operator[SEP] identifier[xid] operator[SEP] operator[SEP]
}
|
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case AfplibPackage.OBJECT_STRUCTURED_FIELD_OFFSET__SF_OFF:
return SF_OFF_EDEFAULT == null ? sfOff != null : !SF_OFF_EDEFAULT.equals(sfOff);
case AfplibPackage.OBJECT_STRUCTURED_FIELD_OFFSET__SF_OFF_HI:
return SF_OFF_HI_EDEFAULT == null ? sfOffHi != null : !SF_OFF_HI_EDEFAULT.equals(sfOffHi);
}
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=OBJECT_STRUCTURED_FIELD_OFFSET__SF_OFF, postfix_operators=[], prefix_operators=[], qualifier=AfplibPackage, selectors=[])], statements=[ReturnStatement(expression=TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=SF_OFF_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=sfOff, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equals, postfix_operators=[], prefix_operators=['!'], qualifier=SF_OFF_EDEFAULT, selectors=[], type_arguments=None), if_true=BinaryOperation(operandl=MemberReference(member=sfOff, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=)), label=None)]), SwitchStatementCase(case=[MemberReference(member=OBJECT_STRUCTURED_FIELD_OFFSET__SF_OFF_HI, postfix_operators=[], prefix_operators=[], qualifier=AfplibPackage, selectors=[])], statements=[ReturnStatement(expression=TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=SF_OFF_HI_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=sfOffHi, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equals, postfix_operators=[], prefix_operators=['!'], qualifier=SF_OFF_HI_EDEFAULT, selectors=[], type_arguments=None), if_true=BinaryOperation(operandl=MemberReference(member=sfOffHi, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), 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[OBJECT_STRUCTURED_FIELD_OFFSET__SF_OFF] operator[:] Keyword[return] identifier[SF_OFF_EDEFAULT] operator[==] Other[null] operator[?] identifier[sfOff] operator[!=] Other[null] operator[:] operator[!] identifier[SF_OFF_EDEFAULT] operator[SEP] identifier[equals] operator[SEP] identifier[sfOff] operator[SEP] operator[SEP] Keyword[case] identifier[AfplibPackage] operator[SEP] identifier[OBJECT_STRUCTURED_FIELD_OFFSET__SF_OFF_HI] operator[:] Keyword[return] identifier[SF_OFF_HI_EDEFAULT] operator[==] Other[null] operator[?] identifier[sfOffHi] operator[!=] Other[null] operator[:] operator[!] identifier[SF_OFF_HI_EDEFAULT] operator[SEP] identifier[equals] operator[SEP] identifier[sfOffHi] operator[SEP] operator[SEP]
}
Keyword[return] Keyword[super] operator[SEP] identifier[eIsSet] operator[SEP] identifier[featureID] operator[SEP] operator[SEP]
}
|
public void apply(int[] target)
{
//use DoubleList view b/d we are only using set ops, so we wont run into an issue of re-allocating the array
apply(IntList.view(target, target.length), new IntList(target.length));
} | class class_name[name] begin[{]
method[apply, return_type[void], modifier[public], parameter[target]] begin[{]
call[.apply, parameter[call[IntList.view, parameter[member[.target], member[target.length]]], ClassCreator(arguments=[MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=target, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IntList, sub_type=None))]]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[apply] operator[SEP] Keyword[int] operator[SEP] operator[SEP] identifier[target] operator[SEP] {
identifier[apply] operator[SEP] identifier[IntList] operator[SEP] identifier[view] operator[SEP] identifier[target] , identifier[target] operator[SEP] identifier[length] operator[SEP] , Keyword[new] identifier[IntList] operator[SEP] identifier[target] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP]
}
|
public static void main(String[] args) throws IOException {
if (args.length != 1) {
System.out.println("There should be an argument: path to a jar.");
System.exit(0);
}
String jarInput = args[0];
extract(new File(jarInput), new File("/tmp/junit-ekstazi-agent.jar"),
new String[] { Names.EKSTAZI_PACKAGE_BIN }, new String[] {});
for (String name : extractClassNames("/tmp/junit-ekstazi-agent.jar")) {
System.out.println(name);
}
} | class class_name[name] begin[{]
method[main, return_type[void], modifier[public static], parameter[args]] begin[{]
if[binary_operation[member[args.length], !=, literal[1]]] begin[{]
call[System.out.println, parameter[literal["There should be an argument: path to a jar."]]]
call[System.exit, parameter[literal[0]]]
else begin[{]
None
end[}]
local_variable[type[String], jarInput]
call[.extract, parameter[ClassCreator(arguments=[MemberReference(member=jarInput, 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)), ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="/tmp/junit-ekstazi-agent.jar")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=File, sub_type=None)), ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MemberReference(member=EKSTAZI_PACKAGE_BIN, postfix_operators=[], prefix_operators=[], qualifier=Names, selectors=[])]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=String, sub_type=None)), ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=String, sub_type=None))]]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=println, postfix_operators=[], prefix_operators=[], qualifier=System.out, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="/tmp/junit-ekstazi-agent.jar")], member=extractClassNames, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=name)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None)
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[void] identifier[main] operator[SEP] identifier[String] operator[SEP] operator[SEP] identifier[args] operator[SEP] Keyword[throws] identifier[IOException] {
Keyword[if] operator[SEP] identifier[args] operator[SEP] identifier[length] operator[!=] Other[1] operator[SEP] {
identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[println] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[exit] operator[SEP] Other[0] operator[SEP] operator[SEP]
}
identifier[String] identifier[jarInput] operator[=] identifier[args] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[extract] operator[SEP] Keyword[new] identifier[File] operator[SEP] identifier[jarInput] operator[SEP] , Keyword[new] identifier[File] operator[SEP] literal[String] operator[SEP] , Keyword[new] identifier[String] operator[SEP] operator[SEP] {
identifier[Names] operator[SEP] identifier[EKSTAZI_PACKAGE_BIN]
} , Keyword[new] identifier[String] operator[SEP] operator[SEP] {
} operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[String] identifier[name] operator[:] identifier[extractClassNames] operator[SEP] literal[String] operator[SEP] operator[SEP] {
identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[println] operator[SEP] identifier[name] operator[SEP] operator[SEP]
}
}
|
private Drawable getIcon(@ColorRes int colorId) {
Drawable icon = ContextCompat.getDrawable(this, R.drawable.ic_place_white_24dp);
if (icon == null) {
throw new NullPointerException();
}
icon = DrawableCompat.wrap(icon);
DrawableCompat.setTint(icon, ContextCompat.getColor(this, colorId));
return icon;
} | class class_name[name] begin[{]
method[getIcon, return_type[type[Drawable]], modifier[private], parameter[colorId]] begin[{]
local_variable[type[Drawable], icon]
if[binary_operation[member[.icon], ==, 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[}]
assign[member[.icon], call[DrawableCompat.wrap, parameter[member[.icon]]]]
call[DrawableCompat.setTint, parameter[member[.icon], call[ContextCompat.getColor, parameter[THIS[], member[.colorId]]]]]
return[member[.icon]]
end[}]
END[}] | Keyword[private] identifier[Drawable] identifier[getIcon] operator[SEP] annotation[@] identifier[ColorRes] Keyword[int] identifier[colorId] operator[SEP] {
identifier[Drawable] identifier[icon] operator[=] identifier[ContextCompat] operator[SEP] identifier[getDrawable] operator[SEP] Keyword[this] , identifier[R] operator[SEP] identifier[drawable] operator[SEP] identifier[ic_place_white_24dp] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[icon] operator[==] Other[null] operator[SEP] {
Keyword[throw] Keyword[new] identifier[NullPointerException] operator[SEP] operator[SEP] operator[SEP]
}
identifier[icon] operator[=] identifier[DrawableCompat] operator[SEP] identifier[wrap] operator[SEP] identifier[icon] operator[SEP] operator[SEP] identifier[DrawableCompat] operator[SEP] identifier[setTint] operator[SEP] identifier[icon] , identifier[ContextCompat] operator[SEP] identifier[getColor] operator[SEP] Keyword[this] , identifier[colorId] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[icon] operator[SEP]
}
|
public static ValueAuditGenerator create(Config config, ValueAuditRuntimeMetadata runtimeAuditMetadata) {
ColumnProjectionPolicy columnProjectionPolicy = DefaultColumnProjectionPolicyFactory.getInstance().create(
config.getConfig(COLUMN_PROJECTION_CONFIG_SCOPE),runtimeAuditMetadata.getTableMetadata());
RowSelectionPolicy rowSelectionPolicy = DefaultRowSelectionPolicyFactory.getInstance().create(
config.getConfig(ROW_SELECTION_CONFIG_SCOPE), runtimeAuditMetadata.getTableMetadata(), columnProjectionPolicy);
AuditSink auditSink = DefaultAuditSinkFactory.getInstance().create(
config.getConfig(AUDIT_SINK_CONFIG_SCOPE), runtimeAuditMetadata);
return new ValueAuditGenerator(columnProjectionPolicy, rowSelectionPolicy, auditSink);
} | class class_name[name] begin[{]
method[create, return_type[type[ValueAuditGenerator]], modifier[public static], parameter[config, runtimeAuditMetadata]] begin[{]
local_variable[type[ColumnProjectionPolicy], columnProjectionPolicy]
local_variable[type[RowSelectionPolicy], rowSelectionPolicy]
local_variable[type[AuditSink], auditSink]
return[ClassCreator(arguments=[MemberReference(member=columnProjectionPolicy, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=rowSelectionPolicy, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=auditSink, 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=ValueAuditGenerator, sub_type=None))]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[ValueAuditGenerator] identifier[create] operator[SEP] identifier[Config] identifier[config] , identifier[ValueAuditRuntimeMetadata] identifier[runtimeAuditMetadata] operator[SEP] {
identifier[ColumnProjectionPolicy] identifier[columnProjectionPolicy] operator[=] identifier[DefaultColumnProjectionPolicyFactory] operator[SEP] identifier[getInstance] operator[SEP] operator[SEP] operator[SEP] identifier[create] operator[SEP] identifier[config] operator[SEP] identifier[getConfig] operator[SEP] identifier[COLUMN_PROJECTION_CONFIG_SCOPE] operator[SEP] , identifier[runtimeAuditMetadata] operator[SEP] identifier[getTableMetadata] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[RowSelectionPolicy] identifier[rowSelectionPolicy] operator[=] identifier[DefaultRowSelectionPolicyFactory] operator[SEP] identifier[getInstance] operator[SEP] operator[SEP] operator[SEP] identifier[create] operator[SEP] identifier[config] operator[SEP] identifier[getConfig] operator[SEP] identifier[ROW_SELECTION_CONFIG_SCOPE] operator[SEP] , identifier[runtimeAuditMetadata] operator[SEP] identifier[getTableMetadata] operator[SEP] operator[SEP] , identifier[columnProjectionPolicy] operator[SEP] operator[SEP] identifier[AuditSink] identifier[auditSink] operator[=] identifier[DefaultAuditSinkFactory] operator[SEP] identifier[getInstance] operator[SEP] operator[SEP] operator[SEP] identifier[create] operator[SEP] identifier[config] operator[SEP] identifier[getConfig] operator[SEP] identifier[AUDIT_SINK_CONFIG_SCOPE] operator[SEP] , identifier[runtimeAuditMetadata] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[ValueAuditGenerator] operator[SEP] identifier[columnProjectionPolicy] , identifier[rowSelectionPolicy] , identifier[auditSink] operator[SEP] operator[SEP]
}
|
public void marshall(ResourceTargetDefinition resourceTargetDefinition, ProtocolMarshaller protocolMarshaller) {
if (resourceTargetDefinition == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(resourceTargetDefinition.getAttribute(), ATTRIBUTE_BINDING);
protocolMarshaller.marshall(resourceTargetDefinition.getName(), NAME_BINDING);
protocolMarshaller.marshall(resourceTargetDefinition.getRequiresRecreation(), REQUIRESRECREATION_BINDING);
} catch (Exception e) {
throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);
}
} | class class_name[name] begin[{]
method[marshall, return_type[void], modifier[public], parameter[resourceTargetDefinition, protocolMarshaller]] begin[{]
if[binary_operation[member[.resourceTargetDefinition], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Invalid argument passed to marshall(...)")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SdkClientException, sub_type=None)), label=None)
else begin[{]
None
end[}]
TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getAttribute, postfix_operators=[], prefix_operators=[], qualifier=resourceTargetDefinition, selectors=[], type_arguments=None), MemberReference(member=ATTRIBUTE_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=resourceTargetDefinition, selectors=[], type_arguments=None), MemberReference(member=NAME_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getRequiresRecreation, postfix_operators=[], prefix_operators=[], qualifier=resourceTargetDefinition, selectors=[], type_arguments=None), MemberReference(member=REQUIRESRECREATION_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unable to marshall request to JSON: "), operandr=MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), operator=+), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SdkClientException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None)
end[}]
END[}] | Keyword[public] Keyword[void] identifier[marshall] operator[SEP] identifier[ResourceTargetDefinition] identifier[resourceTargetDefinition] , identifier[ProtocolMarshaller] identifier[protocolMarshaller] operator[SEP] {
Keyword[if] operator[SEP] identifier[resourceTargetDefinition] operator[==] Other[null] operator[SEP] {
Keyword[throw] Keyword[new] identifier[SdkClientException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[try] {
identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[resourceTargetDefinition] operator[SEP] identifier[getAttribute] operator[SEP] operator[SEP] , identifier[ATTRIBUTE_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[resourceTargetDefinition] operator[SEP] identifier[getName] operator[SEP] operator[SEP] , identifier[NAME_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[resourceTargetDefinition] operator[SEP] identifier[getRequiresRecreation] operator[SEP] operator[SEP] , identifier[REQUIRESRECREATION_BINDING] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] {
Keyword[throw] Keyword[new] identifier[SdkClientException] operator[SEP] literal[String] operator[+] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP]
}
}
|
public static AnnotationAttributes fromMap(Map<String, Object> map) {
if (map == null) {
return null;
}
if (map instanceof AnnotationAttributes) {
return (AnnotationAttributes) map;
}
return new AnnotationAttributes(map);
} | class class_name[name] begin[{]
method[fromMap, return_type[type[AnnotationAttributes]], modifier[public static], parameter[map]] begin[{]
if[binary_operation[member[.map], ==, literal[null]]] begin[{]
return[literal[null]]
else begin[{]
None
end[}]
if[binary_operation[member[.map], instanceof, type[AnnotationAttributes]]] begin[{]
return[Cast(expression=MemberReference(member=map, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=AnnotationAttributes, sub_type=None))]
else begin[{]
None
end[}]
return[ClassCreator(arguments=[MemberReference(member=map, 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=AnnotationAttributes, sub_type=None))]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[AnnotationAttributes] identifier[fromMap] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] identifier[map] operator[SEP] {
Keyword[if] operator[SEP] identifier[map] operator[==] Other[null] operator[SEP] {
Keyword[return] Other[null] operator[SEP]
}
Keyword[if] operator[SEP] identifier[map] Keyword[instanceof] identifier[AnnotationAttributes] operator[SEP] {
Keyword[return] operator[SEP] identifier[AnnotationAttributes] operator[SEP] identifier[map] operator[SEP]
}
Keyword[return] Keyword[new] identifier[AnnotationAttributes] operator[SEP] identifier[map] operator[SEP] operator[SEP]
}
|
public static void throwCompensationEvent(List<CompensateEventSubscriptionEntity> eventSubscriptions, DelegateExecution execution, boolean async) {
ExecutionEntityManager executionEntityManager = Context.getCommandContext().getExecutionEntityManager();
// first spawn the compensating executions
for (EventSubscriptionEntity eventSubscription : eventSubscriptions) {
ExecutionEntity compensatingExecution = null;
// check whether compensating execution is already created (which is the case when compensating an embedded subprocess,
// where the compensating execution is created when leaving the subprocess and holds snapshot data).
if (eventSubscription.getConfiguration() != null) {
compensatingExecution = executionEntityManager.findById(eventSubscription.getConfiguration());
compensatingExecution.setParent(compensatingExecution.getProcessInstance());
compensatingExecution.setEventScope(false);
} else {
compensatingExecution = executionEntityManager.createChildExecution((ExecutionEntity) execution);
eventSubscription.setConfiguration(compensatingExecution.getId());
}
}
// signal compensation events in reverse order of their 'created' timestamp
Collections.sort(eventSubscriptions, new Comparator<EventSubscriptionEntity>() {
public int compare(EventSubscriptionEntity o1, EventSubscriptionEntity o2) {
return o2.getCreated().compareTo(o1.getCreated());
}
});
for (CompensateEventSubscriptionEntity compensateEventSubscriptionEntity : eventSubscriptions) {
Context.getCommandContext().getEventSubscriptionEntityManager().eventReceived(compensateEventSubscriptionEntity, null, async);
}
} | class class_name[name] begin[{]
method[throwCompensationEvent, return_type[void], modifier[public static], parameter[eventSubscriptions, execution, async]] begin[{]
local_variable[type[ExecutionEntityManager], executionEntityManager]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), name=compensatingExecution)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ExecutionEntity, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getConfiguration, postfix_operators=[], prefix_operators=[], qualifier=eventSubscription, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=compensatingExecution, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[Cast(expression=MemberReference(member=execution, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=ExecutionEntity, sub_type=None))], member=createChildExecution, postfix_operators=[], prefix_operators=[], qualifier=executionEntityManager, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getId, postfix_operators=[], prefix_operators=[], qualifier=compensatingExecution, selectors=[], type_arguments=None)], member=setConfiguration, postfix_operators=[], prefix_operators=[], qualifier=eventSubscription, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=compensatingExecution, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getConfiguration, postfix_operators=[], prefix_operators=[], qualifier=eventSubscription, selectors=[], type_arguments=None)], member=findById, postfix_operators=[], prefix_operators=[], qualifier=executionEntityManager, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getProcessInstance, postfix_operators=[], prefix_operators=[], qualifier=compensatingExecution, selectors=[], type_arguments=None)], member=setParent, postfix_operators=[], prefix_operators=[], qualifier=compensatingExecution, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)], member=setEventScope, postfix_operators=[], prefix_operators=[], qualifier=compensatingExecution, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=eventSubscriptions, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=eventSubscription)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=EventSubscriptionEntity, sub_type=None))), label=None)
call[Collections.sort, parameter[member[.eventSubscriptions], ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[], body=[ReturnStatement(expression=MethodInvocation(arguments=[], member=getCreated, postfix_operators=[], prefix_operators=[], qualifier=o2, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getCreated, postfix_operators=[], prefix_operators=[], qualifier=o1, selectors=[], type_arguments=None)], member=compareTo, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=compare, parameters=[FormalParameter(annotations=[], modifiers=set(), name=o1, type=ReferenceType(arguments=None, dimensions=[], name=EventSubscriptionEntity, sub_type=None), varargs=False), FormalParameter(annotations=[], modifiers=set(), name=o2, type=ReferenceType(arguments=None, dimensions=[], name=EventSubscriptionEntity, sub_type=None), varargs=False)], return_type=BasicType(dimensions=[], name=int), 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=EventSubscriptionEntity, sub_type=None))], dimensions=None, name=Comparator, sub_type=None))]]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=getCommandContext, postfix_operators=[], prefix_operators=[], qualifier=Context, selectors=[MethodInvocation(arguments=[], member=getEventSubscriptionEntityManager, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=compensateEventSubscriptionEntity, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), MemberReference(member=async, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=eventReceived, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=eventSubscriptions, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=compensateEventSubscriptionEntity)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=CompensateEventSubscriptionEntity, sub_type=None))), label=None)
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[void] identifier[throwCompensationEvent] operator[SEP] identifier[List] operator[<] identifier[CompensateEventSubscriptionEntity] operator[>] identifier[eventSubscriptions] , identifier[DelegateExecution] identifier[execution] , Keyword[boolean] identifier[async] operator[SEP] {
identifier[ExecutionEntityManager] identifier[executionEntityManager] operator[=] identifier[Context] operator[SEP] identifier[getCommandContext] operator[SEP] operator[SEP] operator[SEP] identifier[getExecutionEntityManager] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[EventSubscriptionEntity] identifier[eventSubscription] operator[:] identifier[eventSubscriptions] operator[SEP] {
identifier[ExecutionEntity] identifier[compensatingExecution] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[eventSubscription] operator[SEP] identifier[getConfiguration] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] {
identifier[compensatingExecution] operator[=] identifier[executionEntityManager] operator[SEP] identifier[findById] operator[SEP] identifier[eventSubscription] operator[SEP] identifier[getConfiguration] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[compensatingExecution] operator[SEP] identifier[setParent] operator[SEP] identifier[compensatingExecution] operator[SEP] identifier[getProcessInstance] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[compensatingExecution] operator[SEP] identifier[setEventScope] operator[SEP] literal[boolean] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[compensatingExecution] operator[=] identifier[executionEntityManager] operator[SEP] identifier[createChildExecution] operator[SEP] operator[SEP] identifier[ExecutionEntity] operator[SEP] identifier[execution] operator[SEP] operator[SEP] identifier[eventSubscription] operator[SEP] identifier[setConfiguration] operator[SEP] identifier[compensatingExecution] operator[SEP] identifier[getId] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
}
identifier[Collections] operator[SEP] identifier[sort] operator[SEP] identifier[eventSubscriptions] , Keyword[new] identifier[Comparator] operator[<] identifier[EventSubscriptionEntity] operator[>] operator[SEP] operator[SEP] {
Keyword[public] Keyword[int] identifier[compare] operator[SEP] identifier[EventSubscriptionEntity] identifier[o1] , identifier[EventSubscriptionEntity] identifier[o2] operator[SEP] {
Keyword[return] identifier[o2] operator[SEP] identifier[getCreated] operator[SEP] operator[SEP] operator[SEP] identifier[compareTo] operator[SEP] identifier[o1] operator[SEP] identifier[getCreated] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
} operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[CompensateEventSubscriptionEntity] identifier[compensateEventSubscriptionEntity] operator[:] identifier[eventSubscriptions] operator[SEP] {
identifier[Context] operator[SEP] identifier[getCommandContext] operator[SEP] operator[SEP] operator[SEP] identifier[getEventSubscriptionEntityManager] operator[SEP] operator[SEP] operator[SEP] identifier[eventReceived] operator[SEP] identifier[compensateEventSubscriptionEntity] , Other[null] , identifier[async] operator[SEP] operator[SEP]
}
}
|
public String getStringSerialization(int[] fieldToKeep) {
if (fieldToKeep == null || fieldToKeep.length == 0)
return getStringSerialization();
StringBuffer buffer = new StringBuffer();
buffer.append(this.getClass().getSimpleName()).append("\t");
buffer.append(this.label);
buffer.append("\t").append(tokensPerField.length);
for (int fieldNum = 0; fieldNum < tokensPerField.length; fieldNum++) {
double tokperf = tokensPerField[fieldNum];
if (java.util.Arrays.binarySearch(fieldToKeep, fieldNum) != -1)
buffer.append("\t").append(tokperf);
else
buffer.append("\t").append("0.0");
}
for (int i = 0; i < indices.length; i++) {
int fieldNum = this.indexToField[i];
if (java.util.Arrays.binarySearch(fieldToKeep, fieldNum) != -1)
buffer.append("\t").append(indices[i]).append(":").append(
freqs[i]).append(":").append(this.indexToField[i]);
}
buffer.append("\n");
return buffer.toString();
} | class class_name[name] begin[{]
method[getStringSerialization, return_type[type[String]], modifier[public], parameter[fieldToKeep]] begin[{]
if[binary_operation[binary_operation[member[.fieldToKeep], ==, literal[null]], ||, binary_operation[member[fieldToKeep.length], ==, literal[0]]]] begin[{]
return[call[.getStringSerialization, parameter[]]]
else begin[{]
None
end[}]
local_variable[type[StringBuffer], buffer]
call[buffer.append, parameter[THIS[call[None.getClass, parameter[]]call[None.getSimpleName, parameter[]]]]]
call[buffer.append, parameter[THIS[member[None.label]]]]
call[buffer.append, parameter[literal["\t"]]]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=tokensPerField, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=fieldNum, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), name=tokperf)], modifiers=set(), type=BasicType(dimensions=[], name=double)), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=fieldToKeep, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=fieldNum, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=binarySearch, postfix_operators=[], prefix_operators=[], qualifier=java.util.Arrays, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=1), operator=!=), else_statement=StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\t")], member=append, postfix_operators=[], prefix_operators=[], qualifier=buffer, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="0.0")], member=append, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None), label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\t")], member=append, postfix_operators=[], prefix_operators=[], qualifier=buffer, selectors=[MethodInvocation(arguments=[MemberReference(member=tokperf, 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=fieldNum, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=tokensPerField, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=fieldNum)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=fieldNum, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=indexToField, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), name=fieldNum)], modifiers=set(), type=BasicType(dimensions=[], name=int)), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=fieldToKeep, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=fieldNum, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=binarySearch, postfix_operators=[], prefix_operators=[], qualifier=java.util.Arrays, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=1), operator=!=), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\t")], member=append, postfix_operators=[], prefix_operators=[], qualifier=buffer, selectors=[MethodInvocation(arguments=[MemberReference(member=indices, 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), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=":")], member=append, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=freqs, 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), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=":")], member=append, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=indexToField, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), 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=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=indices, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
call[buffer.append, parameter[literal["\n"]]]
return[call[buffer.toString, parameter[]]]
end[}]
END[}] | Keyword[public] identifier[String] identifier[getStringSerialization] operator[SEP] Keyword[int] operator[SEP] operator[SEP] identifier[fieldToKeep] operator[SEP] {
Keyword[if] operator[SEP] identifier[fieldToKeep] operator[==] Other[null] operator[||] identifier[fieldToKeep] operator[SEP] identifier[length] operator[==] Other[0] operator[SEP] Keyword[return] identifier[getStringSerialization] operator[SEP] operator[SEP] operator[SEP] identifier[StringBuffer] identifier[buffer] operator[=] Keyword[new] identifier[StringBuffer] operator[SEP] operator[SEP] operator[SEP] identifier[buffer] operator[SEP] identifier[append] operator[SEP] Keyword[this] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] identifier[getSimpleName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[buffer] operator[SEP] identifier[append] operator[SEP] Keyword[this] operator[SEP] identifier[label] operator[SEP] operator[SEP] identifier[buffer] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[tokensPerField] operator[SEP] identifier[length] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[fieldNum] operator[=] Other[0] operator[SEP] identifier[fieldNum] operator[<] identifier[tokensPerField] operator[SEP] identifier[length] operator[SEP] identifier[fieldNum] operator[++] operator[SEP] {
Keyword[double] identifier[tokperf] operator[=] identifier[tokensPerField] operator[SEP] identifier[fieldNum] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[Arrays] operator[SEP] identifier[binarySearch] operator[SEP] identifier[fieldToKeep] , identifier[fieldNum] operator[SEP] operator[!=] operator[-] Other[1] operator[SEP] identifier[buffer] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[tokperf] operator[SEP] operator[SEP] Keyword[else] identifier[buffer] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[indices] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] {
Keyword[int] identifier[fieldNum] operator[=] Keyword[this] operator[SEP] identifier[indexToField] operator[SEP] identifier[i] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[Arrays] operator[SEP] identifier[binarySearch] operator[SEP] identifier[fieldToKeep] , identifier[fieldNum] operator[SEP] operator[!=] operator[-] Other[1] operator[SEP] identifier[buffer] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[indices] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[freqs] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] Keyword[this] operator[SEP] identifier[indexToField] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP]
}
identifier[buffer] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[buffer] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP]
}
|
@Override
public void requestStartupUpdates(String from,
byte []tableKey,
int podIndex,
long deltaTime,
Result<Boolean> cont)
{
if (log.isLoggable(Level.FINEST)) {
log.finest("CacheRequestUpdates " + from + " shard=" + podIndex
+ " delta=" + deltaTime);
}
// ChampCloudManager cloudManager = ChampCloudManager.create();
//ServiceManagerAmp rampManager = AmpSystem.getCurrentManager();
//String address = "champ://" + from + ClusterServiceKraken.UID;
//ClusterServiceKraken peerService = rampManager.lookup(address).as(ClusterServiceKraken.class);
// ArrayList<CacheData> entryList = null;
long accessTime = CurrentTime.currentTime() + deltaTime;
// int count = 0;
TablePod tablePod = _clientKraken.getTable(tableKey);
if (tablePod == null) {
// This server does not have any information about the table.
if (log.isLoggable(Level.FINEST)) {
log.finest(L.l("{0} is an unknown table key ({1})",
Hex.toShortHex(tableKey),
BartenderSystem.getCurrentSelfServer()));
}
cont.ok(true);
return;
}
tablePod.getUpdatesFromLocal(podIndex, accessTime, cont);
// new ResultUpdate(peerService, cont));
// start reciprocating update request
// tablePod.startRequestUpdates();
} | class class_name[name] begin[{]
method[requestStartupUpdates, return_type[void], modifier[public], parameter[from, tableKey, podIndex, deltaTime, cont]] begin[{]
if[call[log.isLoggable, parameter[member[Level.FINEST]]]] begin[{]
call[log.finest, parameter[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[literal["CacheRequestUpdates "], +, member[.from]], +, literal[" shard="]], +, member[.podIndex]], +, literal[" delta="]], +, member[.deltaTime]]]]
else begin[{]
None
end[}]
local_variable[type[long], accessTime]
local_variable[type[TablePod], tablePod]
if[binary_operation[member[.tablePod], ==, literal[null]]] begin[{]
if[call[log.isLoggable, parameter[member[Level.FINEST]]]] begin[{]
call[log.finest, parameter[call[L.l, parameter[literal["{0} is an unknown table key ({1})"], call[Hex.toShortHex, parameter[member[.tableKey]]], call[BartenderSystem.getCurrentSelfServer, parameter[]]]]]]
else begin[{]
None
end[}]
call[cont.ok, parameter[literal[true]]]
return[None]
else begin[{]
None
end[}]
call[tablePod.getUpdatesFromLocal, parameter[member[.podIndex], member[.accessTime], member[.cont]]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[requestStartupUpdates] operator[SEP] identifier[String] identifier[from] , Keyword[byte] operator[SEP] operator[SEP] identifier[tableKey] , Keyword[int] identifier[podIndex] , Keyword[long] identifier[deltaTime] , identifier[Result] operator[<] identifier[Boolean] operator[>] identifier[cont] operator[SEP] {
Keyword[if] operator[SEP] identifier[log] operator[SEP] identifier[isLoggable] operator[SEP] identifier[Level] operator[SEP] identifier[FINEST] operator[SEP] operator[SEP] {
identifier[log] operator[SEP] identifier[finest] operator[SEP] literal[String] operator[+] identifier[from] operator[+] literal[String] operator[+] identifier[podIndex] operator[+] literal[String] operator[+] identifier[deltaTime] operator[SEP] operator[SEP]
}
Keyword[long] identifier[accessTime] operator[=] identifier[CurrentTime] operator[SEP] identifier[currentTime] operator[SEP] operator[SEP] operator[+] identifier[deltaTime] operator[SEP] identifier[TablePod] identifier[tablePod] operator[=] identifier[_clientKraken] operator[SEP] identifier[getTable] operator[SEP] identifier[tableKey] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[tablePod] operator[==] Other[null] operator[SEP] {
Keyword[if] operator[SEP] identifier[log] operator[SEP] identifier[isLoggable] operator[SEP] identifier[Level] operator[SEP] identifier[FINEST] operator[SEP] operator[SEP] {
identifier[log] operator[SEP] identifier[finest] operator[SEP] identifier[L] operator[SEP] identifier[l] operator[SEP] literal[String] , identifier[Hex] operator[SEP] identifier[toShortHex] operator[SEP] identifier[tableKey] operator[SEP] , identifier[BartenderSystem] operator[SEP] identifier[getCurrentSelfServer] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
identifier[cont] operator[SEP] identifier[ok] operator[SEP] literal[boolean] operator[SEP] operator[SEP] Keyword[return] operator[SEP]
}
identifier[tablePod] operator[SEP] identifier[getUpdatesFromLocal] operator[SEP] identifier[podIndex] , identifier[accessTime] , identifier[cont] operator[SEP] operator[SEP]
}
|
@Override
public RestItem addItem(Request request,
String repositoryName,
String workspaceName,
String path,
String requestBody) throws RepositoryException {
JsonNode requestBodyJSON = stringToJSONObject(requestBody);
String parentAbsPath = parentPath(path);
String newNodeName = newNodeName(path);
Session session = getSession(request, repositoryName, workspaceName);
Node parentNode = (Node) session.getItem(parentAbsPath);
Node newNode = addNode(parentNode, newNodeName, requestBodyJSON);
session.save();
RestItem restNewNode = createRestItem(request, 0, session, newNode);
return restNewNode;
} | class class_name[name] begin[{]
method[addItem, return_type[type[RestItem]], modifier[public], parameter[request, repositoryName, workspaceName, path, requestBody]] begin[{]
local_variable[type[JsonNode], requestBodyJSON]
local_variable[type[String], parentAbsPath]
local_variable[type[String], newNodeName]
local_variable[type[Session], session]
local_variable[type[Node], parentNode]
local_variable[type[Node], newNode]
call[session.save, parameter[]]
local_variable[type[RestItem], restNewNode]
return[member[.restNewNode]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] identifier[RestItem] identifier[addItem] operator[SEP] identifier[Request] identifier[request] , identifier[String] identifier[repositoryName] , identifier[String] identifier[workspaceName] , identifier[String] identifier[path] , identifier[String] identifier[requestBody] operator[SEP] Keyword[throws] identifier[RepositoryException] {
identifier[JsonNode] identifier[requestBodyJSON] operator[=] identifier[stringToJSONObject] operator[SEP] identifier[requestBody] operator[SEP] operator[SEP] identifier[String] identifier[parentAbsPath] operator[=] identifier[parentPath] operator[SEP] identifier[path] operator[SEP] operator[SEP] identifier[String] identifier[newNodeName] operator[=] identifier[newNodeName] operator[SEP] identifier[path] operator[SEP] operator[SEP] identifier[Session] identifier[session] operator[=] identifier[getSession] operator[SEP] identifier[request] , identifier[repositoryName] , identifier[workspaceName] operator[SEP] operator[SEP] identifier[Node] identifier[parentNode] operator[=] operator[SEP] identifier[Node] operator[SEP] identifier[session] operator[SEP] identifier[getItem] operator[SEP] identifier[parentAbsPath] operator[SEP] operator[SEP] identifier[Node] identifier[newNode] operator[=] identifier[addNode] operator[SEP] identifier[parentNode] , identifier[newNodeName] , identifier[requestBodyJSON] operator[SEP] operator[SEP] identifier[session] operator[SEP] identifier[save] operator[SEP] operator[SEP] operator[SEP] identifier[RestItem] identifier[restNewNode] operator[=] identifier[createRestItem] operator[SEP] identifier[request] , Other[0] , identifier[session] , identifier[newNode] operator[SEP] operator[SEP] Keyword[return] identifier[restNewNode] operator[SEP]
}
|
int match(byte [] text, int textLen, byte [][] escapeSequences) {
int i, j;
int escN;
int hits = 0;
int misses = 0;
int shifts = 0;
int quality;
scanInput:
for (i=0; i<textLen; i++) {
if (text[i] == 0x1b) {
checkEscapes:
for (escN=0; escN<escapeSequences.length; escN++) {
byte [] seq = escapeSequences[escN];
if ((textLen - i) < seq.length) {
continue checkEscapes;
}
for (j=1; j<seq.length; j++) {
if (seq[j] != text[i+j]) {
continue checkEscapes;
}
}
hits++;
i += seq.length-1;
continue scanInput;
}
misses++;
}
if (text[i] == 0x0e || text[i] == 0x0f) {
// Shift in/out
shifts++;
}
}
if (hits == 0) {
return 0;
}
//
// Initial quality is based on relative proportion of recongized vs.
// unrecognized escape sequences.
// All good: quality = 100;
// half or less good: quality = 0;
// linear inbetween.
quality = (100*hits - 100*misses) / (hits + misses);
// Back off quality if there were too few escape sequences seen.
// Include shifts in this computation, so that KR does not get penalized
// for having only a single Escape sequence, but many shifts.
if (hits+shifts < 5) {
quality -= (5-(hits+shifts))*10;
}
if (quality < 0) {
quality = 0;
}
return quality;
} | class class_name[name] begin[{]
method[match, return_type[type[int]], modifier[default], parameter[text, textLen, escapeSequences]] begin[{]
local_variable[type[int], i]
local_variable[type[int], escN]
local_variable[type[int], hits]
local_variable[type[int], misses]
local_variable[type[int], shifts]
local_variable[type[int], quality]
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=text, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0x1b), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=escapeSequences, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=escN, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), name=seq)], modifiers=set(), type=BasicType(dimensions=[None], name=byte)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=textLen, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=-), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=seq, selectors=[]), operator=<), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ContinueStatement(goto=checkEscapes, label=None)])), ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=seq, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operandr=MemberReference(member=text, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+))]), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ContinueStatement(goto=checkEscapes, label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=seq, 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=1))], update=[MemberReference(member=j, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None), StatementExpression(expression=MemberReference(member=hits, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=BinaryOperation(operandl=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=seq, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-)), label=None), ContinueStatement(goto=scanInput, label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=escN, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=escapeSequences, selectors=[]), operator=<), init=[Assignment(expressionl=MemberReference(member=escN, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))], update=[MemberReference(member=escN, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=checkEscapes), StatementExpression(expression=MemberReference(member=misses, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]), label=None)])), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=text, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0x0e), operator===), operandr=BinaryOperation(operandl=MemberReference(member=text, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0x0f), operator===), operator=||), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MemberReference(member=shifts, 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=textLen, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=[Assignment(expressionl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))], update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=scanInput)
if[binary_operation[member[.hits], ==, literal[0]]] begin[{]
return[literal[0]]
else begin[{]
None
end[}]
assign[member[.quality], binary_operation[binary_operation[binary_operation[literal[100], *, member[.hits]], -, binary_operation[literal[100], *, member[.misses]]], /, binary_operation[member[.hits], +, member[.misses]]]]
if[binary_operation[binary_operation[member[.hits], +, member[.shifts]], <, literal[5]]] begin[{]
assign[member[.quality], binary_operation[binary_operation[literal[5], -, binary_operation[member[.hits], +, member[.shifts]]], *, literal[10]]]
else begin[{]
None
end[}]
if[binary_operation[member[.quality], <, literal[0]]] begin[{]
assign[member[.quality], literal[0]]
else begin[{]
None
end[}]
return[member[.quality]]
end[}]
END[}] | Keyword[int] identifier[match] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[text] , Keyword[int] identifier[textLen] , Keyword[byte] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[escapeSequences] operator[SEP] {
Keyword[int] identifier[i] , identifier[j] operator[SEP] Keyword[int] identifier[escN] operator[SEP] Keyword[int] identifier[hits] operator[=] Other[0] operator[SEP] Keyword[int] identifier[misses] operator[=] Other[0] operator[SEP] Keyword[int] identifier[shifts] operator[=] Other[0] operator[SEP] Keyword[int] identifier[quality] operator[SEP] identifier[scanInput] operator[:] Keyword[for] operator[SEP] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[textLen] operator[SEP] identifier[i] operator[++] operator[SEP] {
Keyword[if] operator[SEP] identifier[text] operator[SEP] identifier[i] operator[SEP] operator[==] literal[Integer] operator[SEP] {
identifier[checkEscapes] operator[:] Keyword[for] operator[SEP] identifier[escN] operator[=] Other[0] operator[SEP] identifier[escN] operator[<] identifier[escapeSequences] operator[SEP] identifier[length] operator[SEP] identifier[escN] operator[++] operator[SEP] {
Keyword[byte] operator[SEP] operator[SEP] identifier[seq] operator[=] identifier[escapeSequences] operator[SEP] identifier[escN] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[SEP] identifier[textLen] operator[-] identifier[i] operator[SEP] operator[<] identifier[seq] operator[SEP] identifier[length] operator[SEP] {
Keyword[continue] identifier[checkEscapes] operator[SEP]
}
Keyword[for] operator[SEP] identifier[j] operator[=] Other[1] operator[SEP] identifier[j] operator[<] identifier[seq] operator[SEP] identifier[length] operator[SEP] identifier[j] operator[++] operator[SEP] {
Keyword[if] operator[SEP] identifier[seq] operator[SEP] identifier[j] operator[SEP] operator[!=] identifier[text] operator[SEP] identifier[i] operator[+] identifier[j] operator[SEP] operator[SEP] {
Keyword[continue] identifier[checkEscapes] operator[SEP]
}
}
identifier[hits] operator[++] operator[SEP] identifier[i] operator[+=] identifier[seq] operator[SEP] identifier[length] operator[-] Other[1] operator[SEP] Keyword[continue] identifier[scanInput] operator[SEP]
}
identifier[misses] operator[++] operator[SEP]
}
Keyword[if] operator[SEP] identifier[text] operator[SEP] identifier[i] operator[SEP] operator[==] literal[Integer] operator[||] identifier[text] operator[SEP] identifier[i] operator[SEP] operator[==] literal[Integer] operator[SEP] {
identifier[shifts] operator[++] operator[SEP]
}
}
Keyword[if] operator[SEP] identifier[hits] operator[==] Other[0] operator[SEP] {
Keyword[return] Other[0] operator[SEP]
}
identifier[quality] operator[=] operator[SEP] Other[100] operator[*] identifier[hits] operator[-] Other[100] operator[*] identifier[misses] operator[SEP] operator[/] operator[SEP] identifier[hits] operator[+] identifier[misses] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[hits] operator[+] identifier[shifts] operator[<] Other[5] operator[SEP] {
identifier[quality] operator[-=] operator[SEP] Other[5] operator[-] operator[SEP] identifier[hits] operator[+] identifier[shifts] operator[SEP] operator[SEP] operator[*] Other[10] operator[SEP]
}
Keyword[if] operator[SEP] identifier[quality] operator[<] Other[0] operator[SEP] {
identifier[quality] operator[=] Other[0] operator[SEP]
}
Keyword[return] identifier[quality] operator[SEP]
}
|
@Override public boolean onSingleTapConfirmed(final MotionEvent event, final MapView mapView){
Projection pj = mapView.getProjection();
GeoPoint eventPos = (GeoPoint)pj.fromPixels((int)event.getX(), (int)event.getY());
boolean tapped = contains(event);
if (tapped) {
if (mOnClickListener == null) {
return onClickDefault(this, mapView, eventPos);
} else {
return mOnClickListener.onClick(this, mapView, eventPos);
}
} else
return tapped;
} | class class_name[name] begin[{]
method[onSingleTapConfirmed, return_type[type[boolean]], modifier[public], parameter[event, mapView]] begin[{]
local_variable[type[Projection], pj]
local_variable[type[GeoPoint], eventPos]
local_variable[type[boolean], tapped]
if[member[.tapped]] begin[{]
if[binary_operation[member[.mOnClickListener], ==, literal[null]]] begin[{]
return[call[.onClickDefault, parameter[THIS[], member[.mapView], member[.eventPos]]]]
else begin[{]
return[call[mOnClickListener.onClick, parameter[THIS[], member[.mapView], member[.eventPos]]]]
end[}]
else begin[{]
return[member[.tapped]]
end[}]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] Keyword[boolean] identifier[onSingleTapConfirmed] operator[SEP] Keyword[final] identifier[MotionEvent] identifier[event] , Keyword[final] identifier[MapView] identifier[mapView] operator[SEP] {
identifier[Projection] identifier[pj] operator[=] identifier[mapView] operator[SEP] identifier[getProjection] operator[SEP] operator[SEP] operator[SEP] identifier[GeoPoint] identifier[eventPos] operator[=] operator[SEP] identifier[GeoPoint] operator[SEP] identifier[pj] operator[SEP] identifier[fromPixels] operator[SEP] operator[SEP] Keyword[int] operator[SEP] identifier[event] operator[SEP] identifier[getX] operator[SEP] operator[SEP] , operator[SEP] Keyword[int] operator[SEP] identifier[event] operator[SEP] identifier[getY] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[boolean] identifier[tapped] operator[=] identifier[contains] operator[SEP] identifier[event] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[tapped] operator[SEP] {
Keyword[if] operator[SEP] identifier[mOnClickListener] operator[==] Other[null] operator[SEP] {
Keyword[return] identifier[onClickDefault] operator[SEP] Keyword[this] , identifier[mapView] , identifier[eventPos] operator[SEP] operator[SEP]
}
Keyword[else] {
Keyword[return] identifier[mOnClickListener] operator[SEP] identifier[onClick] operator[SEP] Keyword[this] , identifier[mapView] , identifier[eventPos] operator[SEP] operator[SEP]
}
}
Keyword[else] Keyword[return] identifier[tapped] operator[SEP]
}
|
private void copy(AlluxioURI srcPath, AlluxioURI dstPath, boolean recursive)
throws AlluxioException, IOException {
URIStatus srcStatus = mFileSystem.getStatus(srcPath);
URIStatus dstStatus = null;
try {
dstStatus = mFileSystem.getStatus(dstPath);
} catch (FileDoesNotExistException e) {
// if the destination does not exist, it will be created
}
if (!srcStatus.isFolder()) {
if (dstStatus != null && dstStatus.isFolder()) {
dstPath = new AlluxioURI(PathUtils.concatPath(dstPath.getPath(), srcPath.getName()));
}
copyFile(srcPath, dstPath);
} else {
if (!recursive) {
throw new IOException(
srcPath.getPath() + " is a directory, to copy it please use \"cp -R <src> <dst>\"");
}
List<URIStatus> statuses;
statuses = mFileSystem.listStatus(srcPath);
if (dstStatus != null) {
if (!dstStatus.isFolder()) {
throw new InvalidPathException(ExceptionMessage.DESTINATION_CANNOT_BE_FILE.getMessage());
}
// if copying a directory to an existing directory, the copied directory will become a
// subdirectory of the destination
if (srcStatus.isFolder()) {
dstPath = new AlluxioURI(PathUtils.concatPath(dstPath.getPath(), srcPath.getName()));
mFileSystem.createDirectory(dstPath);
System.out.println("Created directory: " + dstPath);
}
}
if (dstStatus == null) {
mFileSystem.createDirectory(dstPath);
System.out.println("Created directory: " + dstPath);
}
preserveAttributes(srcPath, dstPath);
List<String> errorMessages = new ArrayList<>();
for (URIStatus status : statuses) {
try {
copy(new AlluxioURI(srcPath.getScheme(), srcPath.getAuthority(), status.getPath()),
new AlluxioURI(dstPath.getScheme(), dstPath.getAuthority(),
PathUtils.concatPath(dstPath.getPath(), status.getName())), recursive);
} catch (IOException e) {
errorMessages.add(e.getMessage());
}
}
if (errorMessages.size() != 0) {
throw new IOException(Joiner.on('\n').join(errorMessages));
}
}
} | class class_name[name] begin[{]
method[copy, return_type[void], modifier[private], parameter[srcPath, dstPath, recursive]] begin[{]
local_variable[type[URIStatus], srcStatus]
local_variable[type[URIStatus], dstStatus]
TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=dstStatus, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=dstPath, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getStatus, postfix_operators=[], prefix_operators=[], qualifier=mFileSystem, selectors=[], type_arguments=None)), label=None)], catches=[CatchClause(block=[], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['FileDoesNotExistException']))], finally_block=None, label=None, resources=None)
if[call[srcStatus.isFolder, parameter[]]] begin[{]
if[binary_operation[binary_operation[member[.dstStatus], !=, literal[null]], &&, call[dstStatus.isFolder, parameter[]]]] begin[{]
assign[member[.dstPath], ClassCreator(arguments=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getPath, postfix_operators=[], prefix_operators=[], qualifier=dstPath, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=srcPath, selectors=[], type_arguments=None)], member=concatPath, postfix_operators=[], prefix_operators=[], qualifier=PathUtils, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=AlluxioURI, sub_type=None))]
else begin[{]
None
end[}]
call[.copyFile, parameter[member[.srcPath], member[.dstPath]]]
else begin[{]
if[member[.recursive]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=MethodInvocation(arguments=[], member=getPath, postfix_operators=[], prefix_operators=[], qualifier=srcPath, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" is a directory, to copy it please use \"cp -R <src> <dst>\""), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IOException, sub_type=None)), label=None)
else begin[{]
None
end[}]
local_variable[type[List], statuses]
assign[member[.statuses], call[mFileSystem.listStatus, parameter[member[.srcPath]]]]
if[binary_operation[member[.dstStatus], !=, literal[null]]] begin[{]
if[call[dstStatus.isFolder, parameter[]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=ExceptionMessage.DESTINATION_CANNOT_BE_FILE, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=InvalidPathException, sub_type=None)), label=None)
else begin[{]
None
end[}]
if[call[srcStatus.isFolder, parameter[]]] begin[{]
assign[member[.dstPath], ClassCreator(arguments=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getPath, postfix_operators=[], prefix_operators=[], qualifier=dstPath, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=srcPath, selectors=[], type_arguments=None)], member=concatPath, postfix_operators=[], prefix_operators=[], qualifier=PathUtils, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=AlluxioURI, sub_type=None))]
call[mFileSystem.createDirectory, parameter[member[.dstPath]]]
call[System.out.println, parameter[binary_operation[literal["Created directory: "], +, member[.dstPath]]]]
else begin[{]
None
end[}]
else begin[{]
None
end[}]
if[binary_operation[member[.dstStatus], ==, literal[null]]] begin[{]
call[mFileSystem.createDirectory, parameter[member[.dstPath]]]
call[System.out.println, parameter[binary_operation[literal["Created directory: "], +, member[.dstPath]]]]
else begin[{]
None
end[}]
call[.preserveAttributes, parameter[member[.srcPath], member[.dstPath]]]
local_variable[type[List], errorMessages]
ForStatement(body=BlockStatement(label=None, statements=[TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[ClassCreator(arguments=[MethodInvocation(arguments=[], member=getScheme, postfix_operators=[], prefix_operators=[], qualifier=srcPath, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getAuthority, postfix_operators=[], prefix_operators=[], qualifier=srcPath, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getPath, postfix_operators=[], prefix_operators=[], qualifier=status, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=AlluxioURI, sub_type=None)), ClassCreator(arguments=[MethodInvocation(arguments=[], member=getScheme, postfix_operators=[], prefix_operators=[], qualifier=dstPath, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getAuthority, postfix_operators=[], prefix_operators=[], qualifier=dstPath, selectors=[], type_arguments=None), MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getPath, postfix_operators=[], prefix_operators=[], qualifier=dstPath, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=status, selectors=[], type_arguments=None)], member=concatPath, postfix_operators=[], prefix_operators=[], qualifier=PathUtils, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=AlluxioURI, sub_type=None)), MemberReference(member=recursive, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=copy, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=errorMessages, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IOException']))], finally_block=None, label=None, resources=None)]), control=EnhancedForControl(iterable=MemberReference(member=statuses, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=status)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=URIStatus, sub_type=None))), label=None)
if[binary_operation[call[errorMessages.size, parameter[]], !=, literal[0]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='\n')], member=on, postfix_operators=[], prefix_operators=[], qualifier=Joiner, selectors=[MethodInvocation(arguments=[MemberReference(member=errorMessages, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=join, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IOException, sub_type=None)), label=None)
else begin[{]
None
end[}]
end[}]
end[}]
END[}] | Keyword[private] Keyword[void] identifier[copy] operator[SEP] identifier[AlluxioURI] identifier[srcPath] , identifier[AlluxioURI] identifier[dstPath] , Keyword[boolean] identifier[recursive] operator[SEP] Keyword[throws] identifier[AlluxioException] , identifier[IOException] {
identifier[URIStatus] identifier[srcStatus] operator[=] identifier[mFileSystem] operator[SEP] identifier[getStatus] operator[SEP] identifier[srcPath] operator[SEP] operator[SEP] identifier[URIStatus] identifier[dstStatus] operator[=] Other[null] operator[SEP] Keyword[try] {
identifier[dstStatus] operator[=] identifier[mFileSystem] operator[SEP] identifier[getStatus] operator[SEP] identifier[dstPath] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[FileDoesNotExistException] identifier[e] operator[SEP] {
}
Keyword[if] operator[SEP] operator[!] identifier[srcStatus] operator[SEP] identifier[isFolder] operator[SEP] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[dstStatus] operator[!=] Other[null] operator[&&] identifier[dstStatus] operator[SEP] identifier[isFolder] operator[SEP] operator[SEP] operator[SEP] {
identifier[dstPath] operator[=] Keyword[new] identifier[AlluxioURI] operator[SEP] identifier[PathUtils] operator[SEP] identifier[concatPath] operator[SEP] identifier[dstPath] operator[SEP] identifier[getPath] operator[SEP] operator[SEP] , identifier[srcPath] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
identifier[copyFile] operator[SEP] identifier[srcPath] , identifier[dstPath] operator[SEP] operator[SEP]
}
Keyword[else] {
Keyword[if] operator[SEP] operator[!] identifier[recursive] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IOException] operator[SEP] identifier[srcPath] operator[SEP] identifier[getPath] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP]
}
identifier[List] operator[<] identifier[URIStatus] operator[>] identifier[statuses] operator[SEP] identifier[statuses] operator[=] identifier[mFileSystem] operator[SEP] identifier[listStatus] operator[SEP] identifier[srcPath] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[dstStatus] operator[!=] Other[null] operator[SEP] {
Keyword[if] operator[SEP] operator[!] identifier[dstStatus] operator[SEP] identifier[isFolder] operator[SEP] operator[SEP] operator[SEP] {
Keyword[throw] Keyword[new] identifier[InvalidPathException] operator[SEP] identifier[ExceptionMessage] operator[SEP] identifier[DESTINATION_CANNOT_BE_FILE] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[srcStatus] operator[SEP] identifier[isFolder] operator[SEP] operator[SEP] operator[SEP] {
identifier[dstPath] operator[=] Keyword[new] identifier[AlluxioURI] operator[SEP] identifier[PathUtils] operator[SEP] identifier[concatPath] operator[SEP] identifier[dstPath] operator[SEP] identifier[getPath] operator[SEP] operator[SEP] , identifier[srcPath] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[mFileSystem] operator[SEP] identifier[createDirectory] operator[SEP] identifier[dstPath] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[println] operator[SEP] literal[String] operator[+] identifier[dstPath] operator[SEP] operator[SEP]
}
}
Keyword[if] operator[SEP] identifier[dstStatus] operator[==] Other[null] operator[SEP] {
identifier[mFileSystem] operator[SEP] identifier[createDirectory] operator[SEP] identifier[dstPath] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[println] operator[SEP] literal[String] operator[+] identifier[dstPath] operator[SEP] operator[SEP]
}
identifier[preserveAttributes] operator[SEP] identifier[srcPath] , identifier[dstPath] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[String] operator[>] identifier[errorMessages] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[URIStatus] identifier[status] operator[:] identifier[statuses] operator[SEP] {
Keyword[try] {
identifier[copy] operator[SEP] Keyword[new] identifier[AlluxioURI] operator[SEP] identifier[srcPath] operator[SEP] identifier[getScheme] operator[SEP] operator[SEP] , identifier[srcPath] operator[SEP] identifier[getAuthority] operator[SEP] operator[SEP] , identifier[status] operator[SEP] identifier[getPath] operator[SEP] operator[SEP] operator[SEP] , Keyword[new] identifier[AlluxioURI] operator[SEP] identifier[dstPath] operator[SEP] identifier[getScheme] operator[SEP] operator[SEP] , identifier[dstPath] operator[SEP] identifier[getAuthority] operator[SEP] operator[SEP] , identifier[PathUtils] operator[SEP] identifier[concatPath] operator[SEP] identifier[dstPath] operator[SEP] identifier[getPath] operator[SEP] operator[SEP] , identifier[status] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] , identifier[recursive] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[IOException] identifier[e] operator[SEP] {
identifier[errorMessages] operator[SEP] identifier[add] operator[SEP] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[if] operator[SEP] identifier[errorMessages] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[!=] Other[0] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IOException] operator[SEP] identifier[Joiner] operator[SEP] identifier[on] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[join] operator[SEP] identifier[errorMessages] operator[SEP] operator[SEP] operator[SEP]
}
}
}
|
private synchronized void requestEvaluator(final int numToRequest) {
if (numToRequest <= 0) {
throw new IllegalArgumentException("The number of evaluator request should be a positive integer");
}
nRequestedEval += numToRequest;
requestor.newRequest()
.setMemory(32)
.setNumber(numToRequest)
.submit();
} | class class_name[name] begin[{]
method[requestEvaluator, return_type[void], modifier[synchronized private], parameter[numToRequest]] begin[{]
if[binary_operation[member[.numToRequest], <=, literal[0]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="The number of evaluator request should be a positive integer")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None)
else begin[{]
None
end[}]
assign[member[.nRequestedEval], member[.numToRequest]]
call[requestor.newRequest, parameter[]]
end[}]
END[}] | Keyword[private] Keyword[synchronized] Keyword[void] identifier[requestEvaluator] operator[SEP] Keyword[final] Keyword[int] identifier[numToRequest] operator[SEP] {
Keyword[if] operator[SEP] identifier[numToRequest] operator[<=] Other[0] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
identifier[nRequestedEval] operator[+=] identifier[numToRequest] operator[SEP] identifier[requestor] operator[SEP] identifier[newRequest] operator[SEP] operator[SEP] operator[SEP] identifier[setMemory] operator[SEP] Other[32] operator[SEP] operator[SEP] identifier[setNumber] operator[SEP] identifier[numToRequest] operator[SEP] operator[SEP] identifier[submit] operator[SEP] operator[SEP] operator[SEP]
}
|
protected IPortletEntity unwrapEntity(IPortletEntity portletEntity) {
if (portletEntity instanceof TransientPortletEntity) {
return ((TransientPortletEntity) portletEntity).getDelegatePortletEntity();
}
return portletEntity;
} | class class_name[name] begin[{]
method[unwrapEntity, return_type[type[IPortletEntity]], modifier[protected], parameter[portletEntity]] begin[{]
if[binary_operation[member[.portletEntity], instanceof, type[TransientPortletEntity]]] begin[{]
return[Cast(expression=MemberReference(member=portletEntity, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=TransientPortletEntity, sub_type=None))]
else begin[{]
None
end[}]
return[member[.portletEntity]]
end[}]
END[}] | Keyword[protected] identifier[IPortletEntity] identifier[unwrapEntity] operator[SEP] identifier[IPortletEntity] identifier[portletEntity] operator[SEP] {
Keyword[if] operator[SEP] identifier[portletEntity] Keyword[instanceof] identifier[TransientPortletEntity] operator[SEP] {
Keyword[return] operator[SEP] operator[SEP] identifier[TransientPortletEntity] operator[SEP] identifier[portletEntity] operator[SEP] operator[SEP] identifier[getDelegatePortletEntity] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] identifier[portletEntity] operator[SEP]
}
|
private void executeResult() throws Exception {
result = createResult();
String timerKey = "executeResult: " + getResultCode();
try {
UtilTimerStack.push(timerKey);
if (result != null) {
result.execute(this);
} else if (resultCode != null && !Action.NONE.equals(resultCode)) {
throw new ConfigurationException("No result defined for action " + getAction().getClass().getName()
+ " and result " + getResultCode(), proxy.getConfig());
} else {
if (LOG.isDebugEnabled()) {
LOG.debug("No result returned for action " + getAction().getClass().getName() + " at "
+ proxy.getConfig().getLocation());
}
}
} finally {
UtilTimerStack.pop(timerKey);
}
} | class class_name[name] begin[{]
method[executeResult, return_type[void], modifier[private], parameter[]] begin[{]
assign[member[.result], call[.createResult, parameter[]]]
local_variable[type[String], timerKey]
TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=timerKey, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=push, postfix_operators=[], prefix_operators=[], qualifier=UtilTimerStack, selectors=[], type_arguments=None), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=resultCode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operandr=MethodInvocation(arguments=[MemberReference(member=resultCode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equals, postfix_operators=[], prefix_operators=['!'], qualifier=Action.NONE, selectors=[], type_arguments=None), operator=&&), else_statement=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[], member=isDebugEnabled, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="No result returned for action "), operandr=MethodInvocation(arguments=[], member=getAction, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[], member=getClass, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), 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=" at "), operator=+), operandr=MethodInvocation(arguments=[], member=getConfig, postfix_operators=[], prefix_operators=[], qualifier=proxy, selectors=[MethodInvocation(arguments=[], member=getLocation, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operator=+)], member=debug, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), label=None)]))]), label=None, then_statement=BlockStatement(label=None, statements=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="No result defined for action "), operandr=MethodInvocation(arguments=[], member=getAction, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[], member=getClass, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), 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=" and result "), operator=+), operandr=MethodInvocation(arguments=[], member=getResultCode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), operator=+), MethodInvocation(arguments=[], member=getConfig, postfix_operators=[], prefix_operators=[], qualifier=proxy, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ConfigurationException, sub_type=None)), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[])], member=execute, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[], type_arguments=None), label=None)]))], catches=None, finally_block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=timerKey, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=pop, postfix_operators=[], prefix_operators=[], qualifier=UtilTimerStack, selectors=[], type_arguments=None), label=None)], label=None, resources=None)
end[}]
END[}] | Keyword[private] Keyword[void] identifier[executeResult] operator[SEP] operator[SEP] Keyword[throws] identifier[Exception] {
identifier[result] operator[=] identifier[createResult] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[timerKey] operator[=] literal[String] operator[+] identifier[getResultCode] operator[SEP] operator[SEP] operator[SEP] Keyword[try] {
identifier[UtilTimerStack] operator[SEP] identifier[push] operator[SEP] identifier[timerKey] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[result] operator[!=] Other[null] operator[SEP] {
identifier[result] operator[SEP] identifier[execute] operator[SEP] Keyword[this] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[resultCode] operator[!=] Other[null] operator[&&] operator[!] identifier[Action] operator[SEP] identifier[NONE] operator[SEP] identifier[equals] operator[SEP] identifier[resultCode] operator[SEP] operator[SEP] {
Keyword[throw] Keyword[new] identifier[ConfigurationException] operator[SEP] literal[String] operator[+] identifier[getAction] operator[SEP] operator[SEP] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[getResultCode] operator[SEP] operator[SEP] , identifier[proxy] operator[SEP] identifier[getConfig] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] {
Keyword[if] operator[SEP] identifier[LOG] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] {
identifier[LOG] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[+] identifier[getAction] operator[SEP] operator[SEP] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[proxy] operator[SEP] identifier[getConfig] operator[SEP] operator[SEP] operator[SEP] identifier[getLocation] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
}
}
Keyword[finally] {
identifier[UtilTimerStack] operator[SEP] identifier[pop] operator[SEP] identifier[timerKey] operator[SEP] operator[SEP]
}
}
|
@Nullable
@SuppressWarnings("unchecked")
protected <T extends JavaElement> ActiveElements<T> popIfActive() {
return (ActiveElements<T>) (!activations.isEmpty() && activations.peek().depth == depth ? activations.pop() :
null);
} | class class_name[name] begin[{]
method[popIfActive, return_type[type[ActiveElements]], modifier[protected], parameter[]] begin[{]
return[Cast(expression=TernaryExpression(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=isEmpty, postfix_operators=[], prefix_operators=['!'], qualifier=activations, selectors=[], type_arguments=None), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[], member=peek, postfix_operators=[], prefix_operators=[], qualifier=activations, selectors=[MemberReference(member=depth, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)], type_arguments=None), operandr=MemberReference(member=depth, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), operator=&&), if_false=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), if_true=MethodInvocation(arguments=[], member=pop, postfix_operators=[], prefix_operators=[], qualifier=activations, selectors=[], type_arguments=None)), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None))], dimensions=[], name=ActiveElements, sub_type=None))]
end[}]
END[}] | annotation[@] identifier[Nullable] annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] Keyword[protected] operator[<] identifier[T] Keyword[extends] identifier[JavaElement] operator[>] identifier[ActiveElements] operator[<] identifier[T] operator[>] identifier[popIfActive] operator[SEP] operator[SEP] {
Keyword[return] operator[SEP] identifier[ActiveElements] operator[<] identifier[T] operator[>] operator[SEP] operator[SEP] operator[!] identifier[activations] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[&&] identifier[activations] operator[SEP] identifier[peek] operator[SEP] operator[SEP] operator[SEP] identifier[depth] operator[==] identifier[depth] operator[?] identifier[activations] operator[SEP] identifier[pop] operator[SEP] operator[SEP] operator[:] Other[null] operator[SEP] operator[SEP]
}
|
public static List<AnnotationData> extractValidationAnnotationData(
Annotation[] annotations, Set<String> allowedPackages ) {
List<AnnotationData> annotationsList = new ArrayList<>();
for ( Annotation annotation : annotations ) {
AnnotationData annotationData = new AnnotationData( annotation, allowedPackages );
if ( annotationData.isAllowed() ) {
annotationsList.add( annotationData );
}
}
return annotationsList;
} | class class_name[name] begin[{]
method[extractValidationAnnotationData, return_type[type[List]], modifier[public static], parameter[annotations, allowedPackages]] begin[{]
local_variable[type[List], annotationsList]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MemberReference(member=annotation, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=allowedPackages, 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=AnnotationData, sub_type=None)), name=annotationData)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=AnnotationData, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[], member=isAllowed, postfix_operators=[], prefix_operators=[], qualifier=annotationData, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=annotationData, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=annotationsList, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=annotations, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=annotation)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Annotation, sub_type=None))), label=None)
return[member[.annotationsList]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[List] operator[<] identifier[AnnotationData] operator[>] identifier[extractValidationAnnotationData] operator[SEP] identifier[Annotation] operator[SEP] operator[SEP] identifier[annotations] , identifier[Set] operator[<] identifier[String] operator[>] identifier[allowedPackages] operator[SEP] {
identifier[List] operator[<] identifier[AnnotationData] operator[>] identifier[annotationsList] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Annotation] identifier[annotation] operator[:] identifier[annotations] operator[SEP] {
identifier[AnnotationData] identifier[annotationData] operator[=] Keyword[new] identifier[AnnotationData] operator[SEP] identifier[annotation] , identifier[allowedPackages] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[annotationData] operator[SEP] identifier[isAllowed] operator[SEP] operator[SEP] operator[SEP] {
identifier[annotationsList] operator[SEP] identifier[add] operator[SEP] identifier[annotationData] operator[SEP] operator[SEP]
}
}
Keyword[return] identifier[annotationsList] operator[SEP]
}
|
private static boolean hasPartitionConfig(
@Nullable Integer maxRowsPerSegment,
@Nullable UserCompactTuningConfig tuningConfig
)
{
return maxRowsPerSegment != null || (tuningConfig != null && tuningConfig.getMaxTotalRows() != null);
} | class class_name[name] begin[{]
method[hasPartitionConfig, return_type[type[boolean]], modifier[private static], parameter[maxRowsPerSegment, tuningConfig]] begin[{]
return[binary_operation[binary_operation[member[.maxRowsPerSegment], !=, literal[null]], ||, binary_operation[binary_operation[member[.tuningConfig], !=, literal[null]], &&, binary_operation[call[tuningConfig.getMaxTotalRows, parameter[]], !=, literal[null]]]]]
end[}]
END[}] | Keyword[private] Keyword[static] Keyword[boolean] identifier[hasPartitionConfig] operator[SEP] annotation[@] identifier[Nullable] identifier[Integer] identifier[maxRowsPerSegment] , annotation[@] identifier[Nullable] identifier[UserCompactTuningConfig] identifier[tuningConfig] operator[SEP] {
Keyword[return] identifier[maxRowsPerSegment] operator[!=] Other[null] operator[||] operator[SEP] identifier[tuningConfig] operator[!=] Other[null] operator[&&] identifier[tuningConfig] operator[SEP] identifier[getMaxTotalRows] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] operator[SEP]
}
|
public void putDateField(String name, long date)
{
if (_dateBuffer==null)
{
_dateBuffer=new StringBuffer(32);
_calendar=new HttpCal();
}
_dateBuffer.setLength(0);
_calendar.setTimeInMillis(date);
formatDate(_dateBuffer, _calendar, false);
put(name, _dateBuffer.toString());
} | class class_name[name] begin[{]
method[putDateField, return_type[void], modifier[public], parameter[name, date]] begin[{]
if[binary_operation[member[._dateBuffer], ==, literal[null]]] begin[{]
assign[member[._dateBuffer], ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=32)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=StringBuffer, sub_type=None))]
assign[member[._calendar], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=HttpCal, sub_type=None))]
else begin[{]
None
end[}]
call[_dateBuffer.setLength, parameter[literal[0]]]
call[_calendar.setTimeInMillis, parameter[member[.date]]]
call[.formatDate, parameter[member[._dateBuffer], member[._calendar], literal[false]]]
call[.put, parameter[member[.name], call[_dateBuffer.toString, parameter[]]]]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[putDateField] operator[SEP] identifier[String] identifier[name] , Keyword[long] identifier[date] operator[SEP] {
Keyword[if] operator[SEP] identifier[_dateBuffer] operator[==] Other[null] operator[SEP] {
identifier[_dateBuffer] operator[=] Keyword[new] identifier[StringBuffer] operator[SEP] Other[32] operator[SEP] operator[SEP] identifier[_calendar] operator[=] Keyword[new] identifier[HttpCal] operator[SEP] operator[SEP] operator[SEP]
}
identifier[_dateBuffer] operator[SEP] identifier[setLength] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[_calendar] operator[SEP] identifier[setTimeInMillis] operator[SEP] identifier[date] operator[SEP] operator[SEP] identifier[formatDate] operator[SEP] identifier[_dateBuffer] , identifier[_calendar] , literal[boolean] operator[SEP] operator[SEP] identifier[put] operator[SEP] identifier[name] , identifier[_dateBuffer] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
protected Map<String, String> getTableComments(DatabaseConfig config) throws SQLException {
ResultSet rs = dbMetadataUtils.getDatabaseMetaData().getTables(config.getCatalog(), config.getSchemaPattern(), config.getTableNamePattern(), null);
Map<String, String> answer = new HashMap<String, String>();
while (rs.next()) {
answer.put(rs.getString("TABLE_NAME"), rs.getString("REMARKS"));
}
closeResultSet(rs);
return answer;
} | class class_name[name] begin[{]
method[getTableComments, return_type[type[Map]], modifier[protected], parameter[config]] begin[{]
local_variable[type[ResultSet], rs]
local_variable[type[Map], answer]
while[call[rs.next, parameter[]]] begin[{]
call[answer.put, parameter[call[rs.getString, parameter[literal["TABLE_NAME"]]], call[rs.getString, parameter[literal["REMARKS"]]]]]
end[}]
call[.closeResultSet, parameter[member[.rs]]]
return[member[.answer]]
end[}]
END[}] | Keyword[protected] identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[getTableComments] operator[SEP] identifier[DatabaseConfig] identifier[config] operator[SEP] Keyword[throws] identifier[SQLException] {
identifier[ResultSet] identifier[rs] operator[=] identifier[dbMetadataUtils] operator[SEP] identifier[getDatabaseMetaData] operator[SEP] operator[SEP] operator[SEP] identifier[getTables] operator[SEP] identifier[config] operator[SEP] identifier[getCatalog] operator[SEP] operator[SEP] , identifier[config] operator[SEP] identifier[getSchemaPattern] operator[SEP] operator[SEP] , identifier[config] operator[SEP] identifier[getTableNamePattern] operator[SEP] operator[SEP] , Other[null] operator[SEP] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[answer] operator[=] Keyword[new] identifier[HashMap] operator[<] identifier[String] , identifier[String] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[rs] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] {
identifier[answer] operator[SEP] identifier[put] operator[SEP] identifier[rs] operator[SEP] identifier[getString] operator[SEP] literal[String] operator[SEP] , identifier[rs] operator[SEP] identifier[getString] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP]
}
identifier[closeResultSet] operator[SEP] identifier[rs] operator[SEP] operator[SEP] Keyword[return] identifier[answer] operator[SEP]
}
|
public AccessControlTranslation withOwner(OwnerOverride owner) {
setOwner(owner == null ? null : owner.toString());
return this;
} | class class_name[name] begin[{]
method[withOwner, return_type[type[AccessControlTranslation]], modifier[public], parameter[owner]] begin[{]
call[.setOwner, parameter[TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=owner, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), if_false=MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=owner, selectors=[], type_arguments=None), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null))]]
return[THIS[]]
end[}]
END[}] | Keyword[public] identifier[AccessControlTranslation] identifier[withOwner] operator[SEP] identifier[OwnerOverride] identifier[owner] operator[SEP] {
identifier[setOwner] operator[SEP] identifier[owner] operator[==] Other[null] operator[?] Other[null] operator[:] identifier[owner] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] Keyword[this] operator[SEP]
}
|
private boolean replaceFilePathsWithBytes(ModelNode request) throws CommandFormatException, IOException {
boolean didReplacement = false;
ModelNode opDesc = new ModelNode();
opDesc.get("address").set(request.get("address"));
opDesc.get("operation").set("read-operation-description");
final String opName = request.get("operation").asString();
opDesc.get("name").set(opName);
ModelNode response = execute(opDesc, false).getResponseNode();
if (response.hasDefined("result", "request-properties")) {
final ModelNode requestProps = response.get("result", "request-properties");
for (Property prop : requestProps.asPropertyList()) {
ModelNode typeDesc = prop.getValue().get("type");
if (typeDesc.getType() == ModelType.TYPE && typeDesc.asType() == ModelType.BYTES
&& request.hasDefined(prop.getName())) {
String filePath = request.get(prop.getName()).asString();
File localFile = new File(filePath);
if (!localFile.exists())
continue;
try {
request.get(prop.getName()).set(Util.readBytes(localFile));
didReplacement = true;
} catch (OperationFormatException e) {
throw new CommandFormatException(e);
}
}
}
}
return didReplacement;
} | class class_name[name] begin[{]
method[replaceFilePathsWithBytes, return_type[type[boolean]], modifier[private], parameter[request]] begin[{]
local_variable[type[boolean], didReplacement]
local_variable[type[ModelNode], opDesc]
call[opDesc.get, parameter[literal["address"]]]
call[opDesc.get, parameter[literal["operation"]]]
local_variable[type[String], opName]
call[opDesc.get, parameter[literal["name"]]]
local_variable[type[ModelNode], response]
if[call[response.hasDefined, parameter[literal["result"], literal["request-properties"]]]] begin[{]
local_variable[type[ModelNode], requestProps]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=prop, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="type")], member=get, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=typeDesc)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ModelNode, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getType, postfix_operators=[], prefix_operators=[], qualifier=typeDesc, selectors=[], type_arguments=None), operandr=MemberReference(member=TYPE, postfix_operators=[], prefix_operators=[], qualifier=ModelType, selectors=[]), operator===), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[], member=asType, postfix_operators=[], prefix_operators=[], qualifier=typeDesc, selectors=[], type_arguments=None), operandr=MemberReference(member=BYTES, postfix_operators=[], prefix_operators=[], qualifier=ModelType, selectors=[]), operator===), operator=&&), operandr=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=prop, selectors=[], type_arguments=None)], member=hasDefined, postfix_operators=[], prefix_operators=[], qualifier=request, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=prop, selectors=[], type_arguments=None)], member=get, postfix_operators=[], prefix_operators=[], qualifier=request, selectors=[MethodInvocation(arguments=[], member=asString, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=filePath)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MemberReference(member=filePath, 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=localFile)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=File, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[], member=exists, postfix_operators=[], prefix_operators=['!'], qualifier=localFile, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=ContinueStatement(goto=None, label=None)), TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=prop, selectors=[], type_arguments=None)], member=get, postfix_operators=[], prefix_operators=[], qualifier=request, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=localFile, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=readBytes, postfix_operators=[], prefix_operators=[], qualifier=Util, selectors=[], type_arguments=None)], member=set, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=didReplacement, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=CommandFormatException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['OperationFormatException']))], finally_block=None, label=None, resources=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=asPropertyList, postfix_operators=[], prefix_operators=[], qualifier=requestProps, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=prop)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Property, sub_type=None))), label=None)
else begin[{]
None
end[}]
return[member[.didReplacement]]
end[}]
END[}] | Keyword[private] Keyword[boolean] identifier[replaceFilePathsWithBytes] operator[SEP] identifier[ModelNode] identifier[request] operator[SEP] Keyword[throws] identifier[CommandFormatException] , identifier[IOException] {
Keyword[boolean] identifier[didReplacement] operator[=] literal[boolean] operator[SEP] identifier[ModelNode] identifier[opDesc] operator[=] Keyword[new] identifier[ModelNode] operator[SEP] operator[SEP] operator[SEP] identifier[opDesc] operator[SEP] identifier[get] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[set] operator[SEP] identifier[request] operator[SEP] identifier[get] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[opDesc] operator[SEP] identifier[get] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[set] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[final] identifier[String] identifier[opName] operator[=] identifier[request] operator[SEP] identifier[get] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[asString] operator[SEP] operator[SEP] operator[SEP] identifier[opDesc] operator[SEP] identifier[get] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[set] operator[SEP] identifier[opName] operator[SEP] operator[SEP] identifier[ModelNode] identifier[response] operator[=] identifier[execute] operator[SEP] identifier[opDesc] , literal[boolean] operator[SEP] operator[SEP] identifier[getResponseNode] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[response] operator[SEP] identifier[hasDefined] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] {
Keyword[final] identifier[ModelNode] identifier[requestProps] operator[=] identifier[response] operator[SEP] identifier[get] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Property] identifier[prop] operator[:] identifier[requestProps] operator[SEP] identifier[asPropertyList] operator[SEP] operator[SEP] operator[SEP] {
identifier[ModelNode] identifier[typeDesc] operator[=] identifier[prop] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[typeDesc] operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[==] identifier[ModelType] operator[SEP] identifier[TYPE] operator[&&] identifier[typeDesc] operator[SEP] identifier[asType] operator[SEP] operator[SEP] operator[==] identifier[ModelType] operator[SEP] identifier[BYTES] operator[&&] identifier[request] operator[SEP] identifier[hasDefined] operator[SEP] identifier[prop] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
identifier[String] identifier[filePath] operator[=] identifier[request] operator[SEP] identifier[get] operator[SEP] identifier[prop] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[asString] operator[SEP] operator[SEP] operator[SEP] identifier[File] identifier[localFile] operator[=] Keyword[new] identifier[File] operator[SEP] identifier[filePath] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[localFile] operator[SEP] identifier[exists] operator[SEP] operator[SEP] operator[SEP] Keyword[continue] operator[SEP] Keyword[try] {
identifier[request] operator[SEP] identifier[get] operator[SEP] identifier[prop] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[set] operator[SEP] identifier[Util] operator[SEP] identifier[readBytes] operator[SEP] identifier[localFile] operator[SEP] operator[SEP] operator[SEP] identifier[didReplacement] operator[=] literal[boolean] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[OperationFormatException] identifier[e] operator[SEP] {
Keyword[throw] Keyword[new] identifier[CommandFormatException] operator[SEP] identifier[e] operator[SEP] operator[SEP]
}
}
}
}
Keyword[return] identifier[didReplacement] operator[SEP]
}
|
public DTDElement define(Location loc, StructValidator val,
int allowedContent)
{
verifyUndefined();
if (allowedContent == XMLValidator.CONTENT_ALLOW_UNDEFINED) { // sanity check
ExceptionUtil.throwInternal("trying to use CONTENT_ALLOW_UNDEFINED via define()");
}
DTDElement elem = new DTDElement(loc, mName, val, allowedContent,
mNsAware, mXml11);
// Ok, need to copy state collected so far:
elem.mAttrMap = mAttrMap;
elem.mSpecAttrList = mSpecAttrList;
elem.mAnyFixed = mAnyFixed;
elem.mValidateAttrs = mValidateAttrs;
elem.mAnyDefaults = mAnyDefaults;
elem.mIdAttr = mIdAttr;
elem.mNotationAttr = mNotationAttr;
elem.mNsDefaults = mNsDefaults;
return elem;
} | class class_name[name] begin[{]
method[define, return_type[type[DTDElement]], modifier[public], parameter[loc, val, allowedContent]] begin[{]
call[.verifyUndefined, parameter[]]
if[binary_operation[member[.allowedContent], ==, member[XMLValidator.CONTENT_ALLOW_UNDEFINED]]] begin[{]
call[ExceptionUtil.throwInternal, parameter[literal["trying to use CONTENT_ALLOW_UNDEFINED via define()"]]]
else begin[{]
None
end[}]
local_variable[type[DTDElement], elem]
assign[member[elem.mAttrMap], member[.mAttrMap]]
assign[member[elem.mSpecAttrList], member[.mSpecAttrList]]
assign[member[elem.mAnyFixed], member[.mAnyFixed]]
assign[member[elem.mValidateAttrs], member[.mValidateAttrs]]
assign[member[elem.mAnyDefaults], member[.mAnyDefaults]]
assign[member[elem.mIdAttr], member[.mIdAttr]]
assign[member[elem.mNotationAttr], member[.mNotationAttr]]
assign[member[elem.mNsDefaults], member[.mNsDefaults]]
return[member[.elem]]
end[}]
END[}] | Keyword[public] identifier[DTDElement] identifier[define] operator[SEP] identifier[Location] identifier[loc] , identifier[StructValidator] identifier[val] , Keyword[int] identifier[allowedContent] operator[SEP] {
identifier[verifyUndefined] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[allowedContent] operator[==] identifier[XMLValidator] operator[SEP] identifier[CONTENT_ALLOW_UNDEFINED] operator[SEP] {
identifier[ExceptionUtil] operator[SEP] identifier[throwInternal] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
identifier[DTDElement] identifier[elem] operator[=] Keyword[new] identifier[DTDElement] operator[SEP] identifier[loc] , identifier[mName] , identifier[val] , identifier[allowedContent] , identifier[mNsAware] , identifier[mXml11] operator[SEP] operator[SEP] identifier[elem] operator[SEP] identifier[mAttrMap] operator[=] identifier[mAttrMap] operator[SEP] identifier[elem] operator[SEP] identifier[mSpecAttrList] operator[=] identifier[mSpecAttrList] operator[SEP] identifier[elem] operator[SEP] identifier[mAnyFixed] operator[=] identifier[mAnyFixed] operator[SEP] identifier[elem] operator[SEP] identifier[mValidateAttrs] operator[=] identifier[mValidateAttrs] operator[SEP] identifier[elem] operator[SEP] identifier[mAnyDefaults] operator[=] identifier[mAnyDefaults] operator[SEP] identifier[elem] operator[SEP] identifier[mIdAttr] operator[=] identifier[mIdAttr] operator[SEP] identifier[elem] operator[SEP] identifier[mNotationAttr] operator[=] identifier[mNotationAttr] operator[SEP] identifier[elem] operator[SEP] identifier[mNsDefaults] operator[=] identifier[mNsDefaults] operator[SEP] Keyword[return] identifier[elem] operator[SEP]
}
|
@Override
public <T> List<T> fromJsonArray(String json, Class<T> componentClass) {
return parser.get().parseList(componentClass, json);
} | class class_name[name] begin[{]
method[fromJsonArray, return_type[type[List]], modifier[public], parameter[json, componentClass]] begin[{]
return[call[parser.get, parameter[]]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] operator[<] identifier[T] operator[>] identifier[List] operator[<] identifier[T] operator[>] identifier[fromJsonArray] operator[SEP] identifier[String] identifier[json] , identifier[Class] operator[<] identifier[T] operator[>] identifier[componentClass] operator[SEP] {
Keyword[return] identifier[parser] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[parseList] operator[SEP] identifier[componentClass] , identifier[json] operator[SEP] operator[SEP]
}
|
public NettyServerBuilder bossEventLoopGroup(EventLoopGroup group) {
if (group != null) {
return bossEventLoopGroupPool(new FixedObjectPool<>(group));
}
return bossEventLoopGroupPool(DEFAULT_BOSS_EVENT_LOOP_GROUP_POOL);
} | class class_name[name] begin[{]
method[bossEventLoopGroup, return_type[type[NettyServerBuilder]], modifier[public], parameter[group]] begin[{]
if[binary_operation[member[.group], !=, literal[null]]] begin[{]
return[call[.bossEventLoopGroupPool, parameter[ClassCreator(arguments=[MemberReference(member=group, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=FixedObjectPool, sub_type=None))]]]
else begin[{]
None
end[}]
return[call[.bossEventLoopGroupPool, parameter[member[.DEFAULT_BOSS_EVENT_LOOP_GROUP_POOL]]]]
end[}]
END[}] | Keyword[public] identifier[NettyServerBuilder] identifier[bossEventLoopGroup] operator[SEP] identifier[EventLoopGroup] identifier[group] operator[SEP] {
Keyword[if] operator[SEP] identifier[group] operator[!=] Other[null] operator[SEP] {
Keyword[return] identifier[bossEventLoopGroupPool] operator[SEP] Keyword[new] identifier[FixedObjectPool] operator[<] operator[>] operator[SEP] identifier[group] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] identifier[bossEventLoopGroupPool] operator[SEP] identifier[DEFAULT_BOSS_EVENT_LOOP_GROUP_POOL] operator[SEP] operator[SEP]
}
|
protected String calculatePropertyName(String propertyName) {
String lastAlias = getLastAlias();
if (lastAlias != null) {
return lastAlias +'.'+propertyName;
}
return propertyName;
} | class class_name[name] begin[{]
method[calculatePropertyName, return_type[type[String]], modifier[protected], parameter[propertyName]] begin[{]
local_variable[type[String], lastAlias]
if[binary_operation[member[.lastAlias], !=, literal[null]]] begin[{]
return[binary_operation[binary_operation[member[.lastAlias], +, literal['.']], +, member[.propertyName]]]
else begin[{]
None
end[}]
return[member[.propertyName]]
end[}]
END[}] | Keyword[protected] identifier[String] identifier[calculatePropertyName] operator[SEP] identifier[String] identifier[propertyName] operator[SEP] {
identifier[String] identifier[lastAlias] operator[=] identifier[getLastAlias] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[lastAlias] operator[!=] Other[null] operator[SEP] {
Keyword[return] identifier[lastAlias] operator[+] literal[String] operator[+] identifier[propertyName] operator[SEP]
}
Keyword[return] identifier[propertyName] operator[SEP]
}
|
protected void configureCurseWords (String curseWords)
{
StringTokenizer st = new StringTokenizer(curseWords);
int numWords = st.countTokens();
_matchers = new Matcher[numWords];
_replacements = new String[numWords];
_vernacular = new String[numWords];
_comicLength = new int[numWords];
for (int ii=0; ii < numWords; ii++) {
String mapping = st.nextToken();
StringTokenizer st2 = new StringTokenizer(mapping, "=");
if (st2.countTokens() != 2) {
log.warning("Something looks wrong in the x.cursewords properties (" +
mapping + "), skipping.");
continue;
}
String curse = st2.nextToken();
String s = "";
String p = "";
if (curse.startsWith("*")) {
curse = curse.substring(1);
p += "([\\p{L}\\p{Digit}]*)";
s += "$1";
} else {
p += "()";
}
s += " ";
p += " ";
if (curse.endsWith("*")) {
curse = curse.substring(0, curse.length() - 1);
p += "([\\p{L}\\p{Digit}]*)";
s += "$3";
}
String pattern = "\\b" + p.replace(" ", "(" + curse + ")") + "\\b";
Pattern pat = Pattern.compile(pattern, Pattern.CASE_INSENSITIVE | Pattern.UNICODE_CASE);
_matchers[ii] = pat.matcher("");
_replacements[ii] = s;
_vernacular[ii] = st2.nextToken().replace('_', ' ');
_comicLength[ii] = curse.codePointCount(0, curse.length());
}
} | class class_name[name] begin[{]
method[configureCurseWords, return_type[void], modifier[protected], parameter[curseWords]] begin[{]
local_variable[type[StringTokenizer], st]
local_variable[type[int], numWords]
assign[member[._matchers], ArrayCreator(dimensions=[MemberReference(member=numWords, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Matcher, sub_type=None))]
assign[member[._replacements], ArrayCreator(dimensions=[MemberReference(member=numWords, 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))]
assign[member[._vernacular], ArrayCreator(dimensions=[MemberReference(member=numWords, 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))]
assign[member[._comicLength], ArrayCreator(dimensions=[MemberReference(member=numWords, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=None, name=int))]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=nextToken, postfix_operators=[], prefix_operators=[], qualifier=st, selectors=[], type_arguments=None), name=mapping)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MemberReference(member=mapping, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="=")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=StringTokenizer, sub_type=None)), name=st2)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=StringTokenizer, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=countTokens, postfix_operators=[], prefix_operators=[], qualifier=st2, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Something looks wrong in the x.cursewords properties ("), operandr=MemberReference(member=mapping, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="), skipping."), operator=+)], member=warning, postfix_operators=[], prefix_operators=[], qualifier=log, selectors=[], type_arguments=None), label=None), ContinueStatement(goto=None, label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=nextToken, postfix_operators=[], prefix_operators=[], qualifier=st2, selectors=[], type_arguments=None), name=curse)], 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=s)], 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=p)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="*")], member=startsWith, postfix_operators=[], prefix_operators=[], qualifier=curse, selectors=[], type_arguments=None), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=p, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="()")), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=curse, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], member=substring, postfix_operators=[], prefix_operators=[], qualifier=curse, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=p, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="([\\p{L}\\p{Digit}]*)")), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=s, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="$1")), label=None)])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=s, 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=p, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" ")), label=None), IfStatement(condition=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="*")], member=endsWith, postfix_operators=[], prefix_operators=[], qualifier=curse, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=curse, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), BinaryOperation(operandl=MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=curse, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-)], member=substring, postfix_operators=[], prefix_operators=[], qualifier=curse, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=p, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="([\\p{L}\\p{Digit}]*)")), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=s, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="$3")), label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\\b"), operandr=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" "), BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="("), operandr=MemberReference(member=curse, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=")"), operator=+)], member=replace, postfix_operators=[], prefix_operators=[], qualifier=p, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\\b"), operator=+), name=pattern)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=pattern, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=MemberReference(member=CASE_INSENSITIVE, postfix_operators=[], prefix_operators=[], qualifier=Pattern, selectors=[]), operandr=MemberReference(member=UNICODE_CASE, postfix_operators=[], prefix_operators=[], qualifier=Pattern, selectors=[]), operator=|)], member=compile, postfix_operators=[], prefix_operators=[], qualifier=Pattern, selectors=[], type_arguments=None), name=pat)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Pattern, sub_type=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=_matchers, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=ii, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="")], member=matcher, postfix_operators=[], prefix_operators=[], qualifier=pat, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=_replacements, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=ii, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MemberReference(member=s, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=_vernacular, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=ii, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MethodInvocation(arguments=[], member=nextToken, postfix_operators=[], prefix_operators=[], qualifier=st2, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='_'), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=' ')], member=replace, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=_comicLength, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=ii, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=curse, selectors=[], type_arguments=None)], member=codePointCount, postfix_operators=[], prefix_operators=[], qualifier=curse, selectors=[], type_arguments=None)), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=ii, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=numWords, 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=ii)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=ii, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
end[}]
END[}] | Keyword[protected] Keyword[void] identifier[configureCurseWords] operator[SEP] identifier[String] identifier[curseWords] operator[SEP] {
identifier[StringTokenizer] identifier[st] operator[=] Keyword[new] identifier[StringTokenizer] operator[SEP] identifier[curseWords] operator[SEP] operator[SEP] Keyword[int] identifier[numWords] operator[=] identifier[st] operator[SEP] identifier[countTokens] operator[SEP] operator[SEP] operator[SEP] identifier[_matchers] operator[=] Keyword[new] identifier[Matcher] operator[SEP] identifier[numWords] operator[SEP] operator[SEP] identifier[_replacements] operator[=] Keyword[new] identifier[String] operator[SEP] identifier[numWords] operator[SEP] operator[SEP] identifier[_vernacular] operator[=] Keyword[new] identifier[String] operator[SEP] identifier[numWords] operator[SEP] operator[SEP] identifier[_comicLength] operator[=] Keyword[new] Keyword[int] operator[SEP] identifier[numWords] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[ii] operator[=] Other[0] operator[SEP] identifier[ii] operator[<] identifier[numWords] operator[SEP] identifier[ii] operator[++] operator[SEP] {
identifier[String] identifier[mapping] operator[=] identifier[st] operator[SEP] identifier[nextToken] operator[SEP] operator[SEP] operator[SEP] identifier[StringTokenizer] identifier[st2] operator[=] Keyword[new] identifier[StringTokenizer] operator[SEP] identifier[mapping] , literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[st2] operator[SEP] identifier[countTokens] operator[SEP] operator[SEP] operator[!=] Other[2] operator[SEP] {
identifier[log] operator[SEP] identifier[warning] operator[SEP] literal[String] operator[+] identifier[mapping] operator[+] literal[String] operator[SEP] operator[SEP] Keyword[continue] operator[SEP]
}
identifier[String] identifier[curse] operator[=] identifier[st2] operator[SEP] identifier[nextToken] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[s] operator[=] literal[String] operator[SEP] identifier[String] identifier[p] operator[=] literal[String] operator[SEP] Keyword[if] operator[SEP] identifier[curse] operator[SEP] identifier[startsWith] operator[SEP] literal[String] operator[SEP] operator[SEP] {
identifier[curse] operator[=] identifier[curse] operator[SEP] identifier[substring] operator[SEP] Other[1] operator[SEP] operator[SEP] identifier[p] operator[+=] literal[String] operator[SEP] identifier[s] operator[+=] literal[String] operator[SEP]
}
Keyword[else] {
identifier[p] operator[+=] literal[String] operator[SEP]
}
identifier[s] operator[+=] literal[String] operator[SEP] identifier[p] operator[+=] literal[String] operator[SEP] Keyword[if] operator[SEP] identifier[curse] operator[SEP] identifier[endsWith] operator[SEP] literal[String] operator[SEP] operator[SEP] {
identifier[curse] operator[=] identifier[curse] operator[SEP] identifier[substring] operator[SEP] Other[0] , identifier[curse] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[-] Other[1] operator[SEP] operator[SEP] identifier[p] operator[+=] literal[String] operator[SEP] identifier[s] operator[+=] literal[String] operator[SEP]
}
identifier[String] identifier[pattern] operator[=] literal[String] operator[+] identifier[p] operator[SEP] identifier[replace] operator[SEP] literal[String] , literal[String] operator[+] identifier[curse] operator[+] literal[String] operator[SEP] operator[+] literal[String] operator[SEP] identifier[Pattern] identifier[pat] operator[=] identifier[Pattern] operator[SEP] identifier[compile] operator[SEP] identifier[pattern] , identifier[Pattern] operator[SEP] identifier[CASE_INSENSITIVE] operator[|] identifier[Pattern] operator[SEP] identifier[UNICODE_CASE] operator[SEP] operator[SEP] identifier[_matchers] operator[SEP] identifier[ii] operator[SEP] operator[=] identifier[pat] operator[SEP] identifier[matcher] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[_replacements] operator[SEP] identifier[ii] operator[SEP] operator[=] identifier[s] operator[SEP] identifier[_vernacular] operator[SEP] identifier[ii] operator[SEP] operator[=] identifier[st2] operator[SEP] identifier[nextToken] operator[SEP] operator[SEP] operator[SEP] identifier[replace] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[_comicLength] operator[SEP] identifier[ii] operator[SEP] operator[=] identifier[curse] operator[SEP] identifier[codePointCount] operator[SEP] Other[0] , identifier[curse] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
}
|
public ProcessedInput processInput(String originalSql, Map<String, Object> params) {
ProcessedInput processedInput = getProcessedInputsFromCache(originalSql);
String preProcessedSql = null;
if (processedInput.getParsedSql() == null) {
// removing comments and text blocks
preProcessedSql = removeBlocks(originalSql);
// parsing sql(without comments and text blocks)
processedInput = parseSqlString(preProcessedSql, processedInput);
// saving generated processed input into cache
putProcessedInputToCache(processedInput);
}
AssertUtils.assertNotNull(processedInput.getParsedSql());
// set sql parameter values if not null
if (params != null) {
processedInput.fillParameterValues(params);
}
return processedInput;
} | class class_name[name] begin[{]
method[processInput, return_type[type[ProcessedInput]], modifier[public], parameter[originalSql, params]] begin[{]
local_variable[type[ProcessedInput], processedInput]
local_variable[type[String], preProcessedSql]
if[binary_operation[call[processedInput.getParsedSql, parameter[]], ==, literal[null]]] begin[{]
assign[member[.preProcessedSql], call[.removeBlocks, parameter[member[.originalSql]]]]
assign[member[.processedInput], call[.parseSqlString, parameter[member[.preProcessedSql], member[.processedInput]]]]
call[.putProcessedInputToCache, parameter[member[.processedInput]]]
else begin[{]
None
end[}]
call[AssertUtils.assertNotNull, parameter[call[processedInput.getParsedSql, parameter[]]]]
if[binary_operation[member[.params], !=, literal[null]]] begin[{]
call[processedInput.fillParameterValues, parameter[member[.params]]]
else begin[{]
None
end[}]
return[member[.processedInput]]
end[}]
END[}] | Keyword[public] identifier[ProcessedInput] identifier[processInput] operator[SEP] identifier[String] identifier[originalSql] , identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] identifier[params] operator[SEP] {
identifier[ProcessedInput] identifier[processedInput] operator[=] identifier[getProcessedInputsFromCache] operator[SEP] identifier[originalSql] operator[SEP] operator[SEP] identifier[String] identifier[preProcessedSql] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[processedInput] operator[SEP] identifier[getParsedSql] operator[SEP] operator[SEP] operator[==] Other[null] operator[SEP] {
identifier[preProcessedSql] operator[=] identifier[removeBlocks] operator[SEP] identifier[originalSql] operator[SEP] operator[SEP] identifier[processedInput] operator[=] identifier[parseSqlString] operator[SEP] identifier[preProcessedSql] , identifier[processedInput] operator[SEP] operator[SEP] identifier[putProcessedInputToCache] operator[SEP] identifier[processedInput] operator[SEP] operator[SEP]
}
identifier[AssertUtils] operator[SEP] identifier[assertNotNull] operator[SEP] identifier[processedInput] operator[SEP] identifier[getParsedSql] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[params] operator[!=] Other[null] operator[SEP] {
identifier[processedInput] operator[SEP] identifier[fillParameterValues] operator[SEP] identifier[params] operator[SEP] operator[SEP]
}
Keyword[return] identifier[processedInput] operator[SEP]
}
|
void initAccessDeniedHandler(BeanDefinition invalidSessionStrategy,
BeanMetadataElement defaultDeniedHandler) {
BeanMetadataElement accessDeniedHandler = createAccessDeniedHandler(
invalidSessionStrategy, defaultDeniedHandler);
this.csrfFilter.getPropertyValues().addPropertyValue("accessDeniedHandler",
accessDeniedHandler);
} | class class_name[name] begin[{]
method[initAccessDeniedHandler, return_type[void], modifier[default], parameter[invalidSessionStrategy, defaultDeniedHandler]] begin[{]
local_variable[type[BeanMetadataElement], accessDeniedHandler]
THIS[member[None.csrfFilter]call[None.getPropertyValues, parameter[]]call[None.addPropertyValue, parameter[literal["accessDeniedHandler"], member[.accessDeniedHandler]]]]
end[}]
END[}] | Keyword[void] identifier[initAccessDeniedHandler] operator[SEP] identifier[BeanDefinition] identifier[invalidSessionStrategy] , identifier[BeanMetadataElement] identifier[defaultDeniedHandler] operator[SEP] {
identifier[BeanMetadataElement] identifier[accessDeniedHandler] operator[=] identifier[createAccessDeniedHandler] operator[SEP] identifier[invalidSessionStrategy] , identifier[defaultDeniedHandler] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[csrfFilter] operator[SEP] identifier[getPropertyValues] operator[SEP] operator[SEP] operator[SEP] identifier[addPropertyValue] operator[SEP] literal[String] , identifier[accessDeniedHandler] operator[SEP] operator[SEP]
}
|
private void findDistributions(int occur, Integer[] candidate, List<Integer[]> distributions, int level) {
if (level != candidate.length) {
for (int i = 0; i < 2; i++) {
candidate[level] = i;
int sum = 0;
for (int x = 0; x < candidate.length; x++)
sum += candidate[x];
if (sum == occur) {
distributions.add(candidate.clone());
} else {
findDistributions(occur, candidate, distributions, level + 1);
}
}
}
} | class class_name[name] begin[{]
method[findDistributions, return_type[void], modifier[private], parameter[occur, candidate, distributions, level]] begin[{]
if[binary_operation[member[.level], !=, member[candidate.length]]] begin[{]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=candidate, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=level, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=sum)], modifiers=set(), type=BasicType(dimensions=[], name=int)), ForStatement(body=StatementExpression(expression=Assignment(expressionl=MemberReference(member=sum, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=MemberReference(member=candidate, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])), label=None), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=candidate, 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), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=sum, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=occur, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=occur, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=candidate, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=distributions, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=MemberReference(member=level, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+)], member=findDistributions, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=clone, postfix_operators=[], prefix_operators=[], qualifier=candidate, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=distributions, selectors=[], type_arguments=None), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), 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[{]
None
end[}]
end[}]
END[}] | Keyword[private] Keyword[void] identifier[findDistributions] operator[SEP] Keyword[int] identifier[occur] , identifier[Integer] operator[SEP] operator[SEP] identifier[candidate] , identifier[List] operator[<] identifier[Integer] operator[SEP] operator[SEP] operator[>] identifier[distributions] , Keyword[int] identifier[level] operator[SEP] {
Keyword[if] operator[SEP] identifier[level] operator[!=] identifier[candidate] operator[SEP] identifier[length] operator[SEP] {
Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] Other[2] operator[SEP] identifier[i] operator[++] operator[SEP] {
identifier[candidate] operator[SEP] identifier[level] operator[SEP] operator[=] identifier[i] operator[SEP] Keyword[int] identifier[sum] operator[=] Other[0] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[x] operator[=] Other[0] operator[SEP] identifier[x] operator[<] identifier[candidate] operator[SEP] identifier[length] operator[SEP] identifier[x] operator[++] operator[SEP] identifier[sum] operator[+=] identifier[candidate] operator[SEP] identifier[x] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[sum] operator[==] identifier[occur] operator[SEP] {
identifier[distributions] operator[SEP] identifier[add] operator[SEP] identifier[candidate] operator[SEP] identifier[clone] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[findDistributions] operator[SEP] identifier[occur] , identifier[candidate] , identifier[distributions] , identifier[level] operator[+] Other[1] operator[SEP] operator[SEP]
}
}
}
}
|
public static xen_sf_storagecentervpx_image[] get_filtered(nitro_service service, String filter) throws Exception
{
xen_sf_storagecentervpx_image obj = new xen_sf_storagecentervpx_image();
options option = new options();
option.set_filter(filter);
xen_sf_storagecentervpx_image[] response = (xen_sf_storagecentervpx_image[]) obj.getfiltered(service, option);
return response;
} | class class_name[name] begin[{]
method[get_filtered, return_type[type[xen_sf_storagecentervpx_image]], modifier[public static], parameter[service, filter]] begin[{]
local_variable[type[xen_sf_storagecentervpx_image], obj]
local_variable[type[options], option]
call[option.set_filter, parameter[member[.filter]]]
local_variable[type[xen_sf_storagecentervpx_image], response]
return[member[.response]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[xen_sf_storagecentervpx_image] operator[SEP] operator[SEP] identifier[get_filtered] operator[SEP] identifier[nitro_service] identifier[service] , identifier[String] identifier[filter] operator[SEP] Keyword[throws] identifier[Exception] {
identifier[xen_sf_storagecentervpx_image] identifier[obj] operator[=] Keyword[new] identifier[xen_sf_storagecentervpx_image] operator[SEP] operator[SEP] operator[SEP] identifier[options] identifier[option] operator[=] Keyword[new] identifier[options] operator[SEP] operator[SEP] operator[SEP] identifier[option] operator[SEP] identifier[set_filter] operator[SEP] identifier[filter] operator[SEP] operator[SEP] identifier[xen_sf_storagecentervpx_image] operator[SEP] operator[SEP] identifier[response] operator[=] operator[SEP] identifier[xen_sf_storagecentervpx_image] operator[SEP] operator[SEP] operator[SEP] identifier[obj] operator[SEP] identifier[getfiltered] operator[SEP] identifier[service] , identifier[option] operator[SEP] operator[SEP] Keyword[return] identifier[response] operator[SEP]
}
|
private static boolean isAssignable(final Type type, final TypeVariable<?> toTypeVariable,
final Map<TypeVariable<?>, Type> typeVarAssigns) {
if (type == null) {
return true;
}
// only a null type can be assigned to null type which
// would have cause the previous to return true
if (toTypeVariable == null) {
return false;
}
// all types are assignable to themselves
if (toTypeVariable.equals(type)) {
return true;
}
if (type instanceof TypeVariable<?>) {
// a type variable is assignable to another type variable, if
// and only if the former is the latter, extends the latter, or
// is otherwise a descendant of the latter.
final Type[] bounds = getImplicitBounds((TypeVariable<?>) type);
for (final Type bound : bounds) {
if (isAssignable(bound, toTypeVariable, typeVarAssigns)) {
return true;
}
}
}
if (type instanceof Class<?> || type instanceof ParameterizedType
|| type instanceof GenericArrayType || type instanceof WildcardType) {
return false;
}
throw new IllegalStateException("found an unhandled type: " + type);
} | class class_name[name] begin[{]
method[isAssignable, return_type[type[boolean]], modifier[private static], parameter[type, toTypeVariable, typeVarAssigns]] begin[{]
if[binary_operation[member[.type], ==, literal[null]]] begin[{]
return[literal[true]]
else begin[{]
None
end[}]
if[binary_operation[member[.toTypeVariable], ==, literal[null]]] begin[{]
return[literal[false]]
else begin[{]
None
end[}]
if[call[toTypeVariable.equals, parameter[member[.type]]]] begin[{]
return[literal[true]]
else begin[{]
None
end[}]
if[binary_operation[member[.type], instanceof, type[TypeVariable]]] begin[{]
local_variable[type[Type], bounds]
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=bound, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=toTypeVariable, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=typeVarAssigns, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isAssignable, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=bounds, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=bound)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=Type, sub_type=None))), label=None)
else begin[{]
None
end[}]
if[binary_operation[binary_operation[binary_operation[binary_operation[member[.type], instanceof, type[Class]], ||, binary_operation[member[.type], instanceof, type[ParameterizedType]]], ||, binary_operation[member[.type], instanceof, type[GenericArrayType]]], ||, binary_operation[member[.type], instanceof, type[WildcardType]]]] begin[{]
return[literal[false]]
else begin[{]
None
end[}]
ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="found an unhandled type: "), operandr=MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalStateException, sub_type=None)), label=None)
end[}]
END[}] | Keyword[private] Keyword[static] Keyword[boolean] identifier[isAssignable] operator[SEP] Keyword[final] identifier[Type] identifier[type] , Keyword[final] identifier[TypeVariable] operator[<] operator[?] operator[>] identifier[toTypeVariable] , Keyword[final] identifier[Map] operator[<] identifier[TypeVariable] operator[<] operator[?] operator[>] , identifier[Type] operator[>] identifier[typeVarAssigns] operator[SEP] {
Keyword[if] operator[SEP] identifier[type] operator[==] Other[null] operator[SEP] {
Keyword[return] literal[boolean] operator[SEP]
}
Keyword[if] operator[SEP] identifier[toTypeVariable] operator[==] Other[null] operator[SEP] {
Keyword[return] literal[boolean] operator[SEP]
}
Keyword[if] operator[SEP] identifier[toTypeVariable] operator[SEP] identifier[equals] operator[SEP] identifier[type] operator[SEP] operator[SEP] {
Keyword[return] literal[boolean] operator[SEP]
}
Keyword[if] operator[SEP] identifier[type] Keyword[instanceof] identifier[TypeVariable] operator[<] operator[?] operator[>] operator[SEP] {
Keyword[final] identifier[Type] operator[SEP] operator[SEP] identifier[bounds] operator[=] identifier[getImplicitBounds] operator[SEP] operator[SEP] identifier[TypeVariable] operator[<] operator[?] operator[>] operator[SEP] identifier[type] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[final] identifier[Type] identifier[bound] operator[:] identifier[bounds] operator[SEP] {
Keyword[if] operator[SEP] identifier[isAssignable] operator[SEP] identifier[bound] , identifier[toTypeVariable] , identifier[typeVarAssigns] operator[SEP] operator[SEP] {
Keyword[return] literal[boolean] operator[SEP]
}
}
}
Keyword[if] operator[SEP] identifier[type] Keyword[instanceof] identifier[Class] operator[<] operator[?] operator[>] operator[||] identifier[type] Keyword[instanceof] identifier[ParameterizedType] operator[||] identifier[type] Keyword[instanceof] identifier[GenericArrayType] operator[||] identifier[type] Keyword[instanceof] identifier[WildcardType] operator[SEP] {
Keyword[return] literal[boolean] operator[SEP]
}
Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] literal[String] operator[+] identifier[type] operator[SEP] operator[SEP]
}
|
@Override
public KVStore putValue(String key, Object val) {
put(key, ValueObject.of(val));
return this;
} | class class_name[name] begin[{]
method[putValue, return_type[type[KVStore]], modifier[public], parameter[key, val]] begin[{]
call[.put, parameter[member[.key], call[ValueObject.of, parameter[member[.val]]]]]
return[THIS[]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] identifier[KVStore] identifier[putValue] operator[SEP] identifier[String] identifier[key] , identifier[Object] identifier[val] operator[SEP] {
identifier[put] operator[SEP] identifier[key] , identifier[ValueObject] operator[SEP] identifier[of] operator[SEP] identifier[val] operator[SEP] operator[SEP] operator[SEP] Keyword[return] Keyword[this] operator[SEP]
}
|
private String gotExtractedValue(String string) {
if (!isEmpty(value_extract_regex)) {
Pattern pattern = Pattern.compile(value_extract_regex);
Matcher ma = pattern.matcher(string);
String result = "";
while (ma.find()) {
result += ma.group(0);
}
return result;
}
return string;
} | class class_name[name] begin[{]
method[gotExtractedValue, return_type[type[String]], modifier[private], parameter[string]] begin[{]
if[call[.isEmpty, parameter[member[.value_extract_regex]]]] begin[{]
local_variable[type[Pattern], pattern]
local_variable[type[Matcher], ma]
local_variable[type[String], result]
while[call[ma.find, parameter[]]] begin[{]
assign[member[.result], call[ma.group, parameter[literal[0]]]]
end[}]
return[member[.result]]
else begin[{]
None
end[}]
return[member[.string]]
end[}]
END[}] | Keyword[private] identifier[String] identifier[gotExtractedValue] operator[SEP] identifier[String] identifier[string] operator[SEP] {
Keyword[if] operator[SEP] operator[!] identifier[isEmpty] operator[SEP] identifier[value_extract_regex] operator[SEP] operator[SEP] {
identifier[Pattern] identifier[pattern] operator[=] identifier[Pattern] operator[SEP] identifier[compile] operator[SEP] identifier[value_extract_regex] operator[SEP] operator[SEP] identifier[Matcher] identifier[ma] operator[=] identifier[pattern] operator[SEP] identifier[matcher] operator[SEP] identifier[string] operator[SEP] operator[SEP] identifier[String] identifier[result] operator[=] literal[String] operator[SEP] Keyword[while] operator[SEP] identifier[ma] operator[SEP] identifier[find] operator[SEP] operator[SEP] operator[SEP] {
identifier[result] operator[+=] identifier[ma] operator[SEP] identifier[group] operator[SEP] Other[0] operator[SEP] operator[SEP]
}
Keyword[return] identifier[result] operator[SEP]
}
Keyword[return] identifier[string] operator[SEP]
}
|
public void update(LGraphObject lGraphObj)
{
if (lGraphObj instanceof CoSEGraph)
{
return;
}
LNode lNode = (LNode)lGraphObj;
this.glyph.getBbox().setX((float) lNode.getLeft());
this.glyph.getBbox().setY((float) lNode.getTop());
this.placeStateAndInfoGlyphs();
} | class class_name[name] begin[{]
method[update, return_type[void], modifier[public], parameter[lGraphObj]] begin[{]
if[binary_operation[member[.lGraphObj], instanceof, type[CoSEGraph]]] begin[{]
return[None]
else begin[{]
None
end[}]
local_variable[type[LNode], lNode]
THIS[member[None.glyph]call[None.getBbox, parameter[]]call[None.setX, parameter[Cast(expression=MethodInvocation(arguments=[], member=getLeft, postfix_operators=[], prefix_operators=[], qualifier=lNode, selectors=[], type_arguments=None), type=BasicType(dimensions=[], name=float))]]]
THIS[member[None.glyph]call[None.getBbox, parameter[]]call[None.setY, parameter[Cast(expression=MethodInvocation(arguments=[], member=getTop, postfix_operators=[], prefix_operators=[], qualifier=lNode, selectors=[], type_arguments=None), type=BasicType(dimensions=[], name=float))]]]
THIS[call[None.placeStateAndInfoGlyphs, parameter[]]]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[update] operator[SEP] identifier[LGraphObject] identifier[lGraphObj] operator[SEP] {
Keyword[if] operator[SEP] identifier[lGraphObj] Keyword[instanceof] identifier[CoSEGraph] operator[SEP] {
Keyword[return] operator[SEP]
}
identifier[LNode] identifier[lNode] operator[=] operator[SEP] identifier[LNode] operator[SEP] identifier[lGraphObj] operator[SEP] Keyword[this] operator[SEP] identifier[glyph] operator[SEP] identifier[getBbox] operator[SEP] operator[SEP] operator[SEP] identifier[setX] operator[SEP] operator[SEP] Keyword[float] operator[SEP] identifier[lNode] operator[SEP] identifier[getLeft] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[glyph] operator[SEP] identifier[getBbox] operator[SEP] operator[SEP] operator[SEP] identifier[setY] operator[SEP] operator[SEP] Keyword[float] operator[SEP] identifier[lNode] operator[SEP] identifier[getTop] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[placeStateAndInfoGlyphs] operator[SEP] operator[SEP] operator[SEP]
}
|
public static <T> Class<T> toClass(CtClass ctClass) throws CannotCompileException {
return toClass(ctClass, ClassLoadingUtil.class.getClassLoader(), null);
} | class class_name[name] begin[{]
method[toClass, return_type[type[Class]], modifier[public static], parameter[ctClass]] begin[{]
return[call[.toClass, parameter[member[.ctClass], ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[], member=getClassLoader, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=ClassLoadingUtil, sub_type=None)), literal[null]]]]
end[}]
END[}] | Keyword[public] Keyword[static] operator[<] identifier[T] operator[>] identifier[Class] operator[<] identifier[T] operator[>] identifier[toClass] operator[SEP] identifier[CtClass] identifier[ctClass] operator[SEP] Keyword[throws] identifier[CannotCompileException] {
Keyword[return] identifier[toClass] operator[SEP] identifier[ctClass] , identifier[ClassLoadingUtil] operator[SEP] Keyword[class] operator[SEP] identifier[getClassLoader] operator[SEP] operator[SEP] , Other[null] operator[SEP] operator[SEP]
}
|
public static nsmemory_stats[] get(nitro_service service) throws Exception{
nsmemory_stats obj = new nsmemory_stats();
nsmemory_stats[] response = (nsmemory_stats[])obj.stat_resources(service);
return response;
} | class class_name[name] begin[{]
method[get, return_type[type[nsmemory_stats]], modifier[public static], parameter[service]] begin[{]
local_variable[type[nsmemory_stats], obj]
local_variable[type[nsmemory_stats], response]
return[member[.response]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[nsmemory_stats] operator[SEP] operator[SEP] identifier[get] operator[SEP] identifier[nitro_service] identifier[service] operator[SEP] Keyword[throws] identifier[Exception] {
identifier[nsmemory_stats] identifier[obj] operator[=] Keyword[new] identifier[nsmemory_stats] operator[SEP] operator[SEP] operator[SEP] identifier[nsmemory_stats] operator[SEP] operator[SEP] identifier[response] operator[=] operator[SEP] identifier[nsmemory_stats] operator[SEP] operator[SEP] operator[SEP] identifier[obj] operator[SEP] identifier[stat_resources] operator[SEP] identifier[service] operator[SEP] operator[SEP] Keyword[return] identifier[response] operator[SEP]
}
|
public static String requireNotEmpty(final String str) throws NullPointerException, IllegalArgumentException {
if (str.length() == 0) {
throw new IllegalArgumentException();
}
return str;
} | class class_name[name] begin[{]
method[requireNotEmpty, return_type[type[String]], modifier[public static], parameter[str]] begin[{]
if[binary_operation[call[str.length, parameter[]], ==, literal[0]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None)
else begin[{]
None
end[}]
return[member[.str]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[String] identifier[requireNotEmpty] operator[SEP] Keyword[final] identifier[String] identifier[str] operator[SEP] Keyword[throws] identifier[NullPointerException] , identifier[IllegalArgumentException] {
Keyword[if] operator[SEP] identifier[str] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[==] Other[0] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] identifier[str] operator[SEP]
}
|
public static boolean beforeNow(String date, String format, DateUnit dateUnit) {
logger.debug("指定日期为:{}", date);
return calc(new Date(), parse(date, format), dateUnit) > 0;
} | class class_name[name] begin[{]
method[beforeNow, return_type[type[boolean]], modifier[public static], parameter[date, format, dateUnit]] begin[{]
call[logger.debug, parameter[literal["指定日期为:{}"], member[.date]]]
return[binary_operation[call[.calc, parameter[ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Date, sub_type=None)), call[.parse, parameter[member[.date], member[.format]]], member[.dateUnit]]], >, literal[0]]]
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[boolean] identifier[beforeNow] operator[SEP] identifier[String] identifier[date] , identifier[String] identifier[format] , identifier[DateUnit] identifier[dateUnit] operator[SEP] {
identifier[logger] operator[SEP] identifier[debug] operator[SEP] literal[String] , identifier[date] operator[SEP] operator[SEP] Keyword[return] identifier[calc] operator[SEP] Keyword[new] identifier[Date] operator[SEP] operator[SEP] , identifier[parse] operator[SEP] identifier[date] , identifier[format] operator[SEP] , identifier[dateUnit] operator[SEP] operator[>] Other[0] operator[SEP]
}
|
public String getHashForLine(int line) {
if (line > 0 && line <= hashes.size()) {
return Strings.nullToEmpty(hashes.get(line - 1));
}
return "";
} | class class_name[name] begin[{]
method[getHashForLine, return_type[type[String]], modifier[public], parameter[line]] begin[{]
if[binary_operation[binary_operation[member[.line], >, literal[0]], &&, binary_operation[member[.line], <=, call[hashes.size, parameter[]]]]] begin[{]
return[call[Strings.nullToEmpty, parameter[call[hashes.get, parameter[binary_operation[member[.line], -, literal[1]]]]]]]
else begin[{]
None
end[}]
return[literal[""]]
end[}]
END[}] | Keyword[public] identifier[String] identifier[getHashForLine] operator[SEP] Keyword[int] identifier[line] operator[SEP] {
Keyword[if] operator[SEP] identifier[line] operator[>] Other[0] operator[&&] identifier[line] operator[<=] identifier[hashes] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] {
Keyword[return] identifier[Strings] operator[SEP] identifier[nullToEmpty] operator[SEP] identifier[hashes] operator[SEP] identifier[get] operator[SEP] identifier[line] operator[-] Other[1] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] literal[String] operator[SEP]
}
|
public boolean isStopped() {
if (! stopped && this.spiderParam.getMaxDuration() > 0) {
// Check to see if the scan has exceeded the specified maxDuration
if (TimeUnit.MILLISECONDS.toMinutes(System.currentTimeMillis() - this.timeStarted) >
this.spiderParam.getMaxDuration()) {
log.info("Spidering process has exceeded maxDuration of " + this.spiderParam.getMaxDuration() + " minute(s)");
this.complete();
}
}
return stopped;
} | class class_name[name] begin[{]
method[isStopped, return_type[type[boolean]], modifier[public], parameter[]] begin[{]
if[binary_operation[member[.stopped], &&, binary_operation[THIS[member[None.spiderParam]call[None.getMaxDuration, parameter[]]], >, literal[0]]]] begin[{]
if[binary_operation[call[TimeUnit.MILLISECONDS.toMinutes, parameter[binary_operation[call[System.currentTimeMillis, parameter[]], -, THIS[member[None.timeStarted]]]]], >, THIS[member[None.spiderParam]call[None.getMaxDuration, parameter[]]]]] begin[{]
call[log.info, parameter[binary_operation[binary_operation[literal["Spidering process has exceeded maxDuration of "], +, THIS[member[None.spiderParam]call[None.getMaxDuration, parameter[]]]], +, literal[" minute(s)"]]]]
THIS[call[None.complete, parameter[]]]
else begin[{]
None
end[}]
else begin[{]
None
end[}]
return[member[.stopped]]
end[}]
END[}] | Keyword[public] Keyword[boolean] identifier[isStopped] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] operator[!] identifier[stopped] operator[&&] Keyword[this] operator[SEP] identifier[spiderParam] operator[SEP] identifier[getMaxDuration] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] {
Keyword[if] operator[SEP] identifier[TimeUnit] operator[SEP] identifier[MILLISECONDS] operator[SEP] identifier[toMinutes] operator[SEP] identifier[System] operator[SEP] identifier[currentTimeMillis] operator[SEP] operator[SEP] operator[-] Keyword[this] operator[SEP] identifier[timeStarted] operator[SEP] operator[>] Keyword[this] operator[SEP] identifier[spiderParam] operator[SEP] identifier[getMaxDuration] operator[SEP] operator[SEP] operator[SEP] {
identifier[log] operator[SEP] identifier[info] operator[SEP] literal[String] operator[+] Keyword[this] operator[SEP] identifier[spiderParam] operator[SEP] identifier[getMaxDuration] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[complete] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[return] identifier[stopped] operator[SEP]
}
|
public GVRMesh loadMesh(GVRAndroidResource androidResource,
EnumSet<GVRImportSettings> settings)
{
GVRMesh mesh = mMeshCache.get(androidResource);
if (mesh == null)
{
try
{
GVRSceneObject model = loadModel(androidResource, settings, true, null);
mesh = findMesh(model);
if (mesh != null)
{
mMeshCache.put(androidResource, mesh);
}
else
{
throw new IOException("No mesh found in model " + androidResource.getResourcePath());
}
}
catch (IOException ex)
{
mContext.getEventManager().sendEvent(this, IAssetEvents.class,
"onModelError", new Object[] { mContext, ex.getMessage(),
androidResource.getResourcePath()});
return null;
}
}
return mesh;
} | class class_name[name] begin[{]
method[loadMesh, return_type[type[GVRMesh]], modifier[public], parameter[androidResource, settings]] begin[{]
local_variable[type[GVRMesh], mesh]
if[binary_operation[member[.mesh], ==, literal[null]]] begin[{]
TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=androidResource, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=settings, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], member=loadModel, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=model)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=GVRSceneObject, sub_type=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=mesh, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=model, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=findMesh, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=mesh, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=BlockStatement(label=None, statements=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="No mesh found in model "), operandr=MethodInvocation(arguments=[], member=getResourcePath, postfix_operators=[], prefix_operators=[], qualifier=androidResource, 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=IOException, sub_type=None)), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=androidResource, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=mesh, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=put, postfix_operators=[], prefix_operators=[], qualifier=mMeshCache, selectors=[], type_arguments=None), label=None)]))], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=getEventManager, postfix_operators=[], prefix_operators=[], qualifier=mContext, selectors=[MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IAssetEvents, sub_type=None)), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="onModelError"), ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MemberReference(member=mContext, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=ex, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getResourcePath, postfix_operators=[], prefix_operators=[], qualifier=androidResource, selectors=[], type_arguments=None)]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Object, sub_type=None))], member=sendEvent, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None), ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ex, types=['IOException']))], finally_block=None, label=None, resources=None)
else begin[{]
None
end[}]
return[member[.mesh]]
end[}]
END[}] | Keyword[public] identifier[GVRMesh] identifier[loadMesh] operator[SEP] identifier[GVRAndroidResource] identifier[androidResource] , identifier[EnumSet] operator[<] identifier[GVRImportSettings] operator[>] identifier[settings] operator[SEP] {
identifier[GVRMesh] identifier[mesh] operator[=] identifier[mMeshCache] operator[SEP] identifier[get] operator[SEP] identifier[androidResource] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[mesh] operator[==] Other[null] operator[SEP] {
Keyword[try] {
identifier[GVRSceneObject] identifier[model] operator[=] identifier[loadModel] operator[SEP] identifier[androidResource] , identifier[settings] , literal[boolean] , Other[null] operator[SEP] operator[SEP] identifier[mesh] operator[=] identifier[findMesh] operator[SEP] identifier[model] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[mesh] operator[!=] Other[null] operator[SEP] {
identifier[mMeshCache] operator[SEP] identifier[put] operator[SEP] identifier[androidResource] , identifier[mesh] operator[SEP] operator[SEP]
}
Keyword[else] {
Keyword[throw] Keyword[new] identifier[IOException] operator[SEP] literal[String] operator[+] identifier[androidResource] operator[SEP] identifier[getResourcePath] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[catch] operator[SEP] identifier[IOException] identifier[ex] operator[SEP] {
identifier[mContext] operator[SEP] identifier[getEventManager] operator[SEP] operator[SEP] operator[SEP] identifier[sendEvent] operator[SEP] Keyword[this] , identifier[IAssetEvents] operator[SEP] Keyword[class] , literal[String] , Keyword[new] identifier[Object] operator[SEP] operator[SEP] {
identifier[mContext] , identifier[ex] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[androidResource] operator[SEP] identifier[getResourcePath] operator[SEP] operator[SEP]
} operator[SEP] operator[SEP] Keyword[return] Other[null] operator[SEP]
}
}
Keyword[return] identifier[mesh] operator[SEP]
}
|
public static long toLongValue(Object o) throws PageException {
if (o instanceof Boolean) return ((((Boolean) o).booleanValue()) ? 1L : 0L);
else if (o instanceof Number) return (((Number) o).longValue());
else if (o instanceof CharSequence) {
String str = o.toString();
try {
return Long.parseLong(str);
}
catch (NumberFormatException nfe) {
return (long) toDoubleValue(str);
}
}
else if (o instanceof Character) return (((Character) o).charValue());
else if (o instanceof Castable) return (long) ((Castable) o).castToDoubleValue();
else if (o instanceof ObjectWrap) return toLongValue(((ObjectWrap) o).getEmbededObject());
throw new CasterException(o, "long");
} | class class_name[name] begin[{]
method[toLongValue, return_type[type[long]], modifier[public static], parameter[o]] begin[{]
if[binary_operation[member[.o], instanceof, type[Boolean]]] begin[{]
return[TernaryExpression(condition=Cast(expression=MemberReference(member=o, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Boolean, sub_type=None)), if_false=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0L), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1L))]
else begin[{]
if[binary_operation[member[.o], instanceof, type[Number]]] begin[{]
return[Cast(expression=MemberReference(member=o, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Number, sub_type=None))]
else begin[{]
if[binary_operation[member[.o], instanceof, type[CharSequence]]] begin[{]
local_variable[type[String], str]
TryStatement(block=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=str, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=parseLong, postfix_operators=[], prefix_operators=[], qualifier=Long, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ReturnStatement(expression=Cast(expression=MethodInvocation(arguments=[MemberReference(member=str, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=toDoubleValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), type=BasicType(dimensions=[], name=long)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=nfe, types=['NumberFormatException']))], finally_block=None, label=None, resources=None)
else begin[{]
if[binary_operation[member[.o], instanceof, type[Character]]] begin[{]
return[Cast(expression=MemberReference(member=o, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Character, sub_type=None))]
else begin[{]
if[binary_operation[member[.o], instanceof, type[Castable]]] begin[{]
return[Cast(expression=Cast(expression=MemberReference(member=o, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Castable, sub_type=None)), type=BasicType(dimensions=[], name=long))]
else begin[{]
if[binary_operation[member[.o], instanceof, type[ObjectWrap]]] begin[{]
return[call[.toLongValue, parameter[Cast(expression=MemberReference(member=o, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=ObjectWrap, sub_type=None))]]]
else begin[{]
None
end[}]
end[}]
end[}]
end[}]
end[}]
end[}]
ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=o, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="long")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=CasterException, sub_type=None)), label=None)
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[long] identifier[toLongValue] operator[SEP] identifier[Object] identifier[o] operator[SEP] Keyword[throws] identifier[PageException] {
Keyword[if] operator[SEP] identifier[o] Keyword[instanceof] identifier[Boolean] operator[SEP] Keyword[return] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[Boolean] operator[SEP] identifier[o] operator[SEP] operator[SEP] identifier[booleanValue] operator[SEP] operator[SEP] operator[SEP] operator[?] Other[1L] operator[:] Other[0L] operator[SEP] operator[SEP] Keyword[else] Keyword[if] operator[SEP] identifier[o] Keyword[instanceof] identifier[Number] operator[SEP] Keyword[return] operator[SEP] operator[SEP] operator[SEP] identifier[Number] operator[SEP] identifier[o] operator[SEP] operator[SEP] identifier[longValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[else] Keyword[if] operator[SEP] identifier[o] Keyword[instanceof] identifier[CharSequence] operator[SEP] {
identifier[String] identifier[str] operator[=] identifier[o] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] Keyword[try] {
Keyword[return] identifier[Long] operator[SEP] identifier[parseLong] operator[SEP] identifier[str] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[NumberFormatException] identifier[nfe] operator[SEP] {
Keyword[return] operator[SEP] Keyword[long] operator[SEP] identifier[toDoubleValue] operator[SEP] identifier[str] operator[SEP] operator[SEP]
}
}
Keyword[else] Keyword[if] operator[SEP] identifier[o] Keyword[instanceof] identifier[Character] operator[SEP] Keyword[return] operator[SEP] operator[SEP] operator[SEP] identifier[Character] operator[SEP] identifier[o] operator[SEP] operator[SEP] identifier[charValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[else] Keyword[if] operator[SEP] identifier[o] Keyword[instanceof] identifier[Castable] operator[SEP] Keyword[return] operator[SEP] Keyword[long] operator[SEP] operator[SEP] operator[SEP] identifier[Castable] operator[SEP] identifier[o] operator[SEP] operator[SEP] identifier[castToDoubleValue] operator[SEP] operator[SEP] operator[SEP] Keyword[else] Keyword[if] operator[SEP] identifier[o] Keyword[instanceof] identifier[ObjectWrap] operator[SEP] Keyword[return] identifier[toLongValue] operator[SEP] operator[SEP] operator[SEP] identifier[ObjectWrap] operator[SEP] identifier[o] operator[SEP] operator[SEP] identifier[getEmbededObject] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[CasterException] operator[SEP] identifier[o] , literal[String] operator[SEP] operator[SEP]
}
|
public com.google.api.ads.adwords.axis.v201809.rm.UserList[] getUserLists() {
return userLists;
} | class class_name[name] begin[{]
method[getUserLists, return_type[type[com]], modifier[public], parameter[]] begin[{]
return[member[.userLists]]
end[}]
END[}] | Keyword[public] identifier[com] operator[SEP] identifier[google] operator[SEP] identifier[api] operator[SEP] identifier[ads] operator[SEP] identifier[adwords] operator[SEP] identifier[axis] operator[SEP] identifier[v201809] operator[SEP] identifier[rm] operator[SEP] identifier[UserList] operator[SEP] operator[SEP] identifier[getUserLists] operator[SEP] operator[SEP] {
Keyword[return] identifier[userLists] operator[SEP]
}
|
public static <T extends Tree> Matcher<T> isPrimitiveOrBoxedPrimitiveType() {
return new Matcher<T>() {
@Override
public boolean matches(Tree t, VisitorState state) {
Type type = getType(t);
return type != null && state.getTypes().unboxedTypeOrType(type).isPrimitive();
}
};
} | class class_name[name] begin[{]
method[isPrimitiveOrBoxedPrimitiveType, return_type[type[Matcher]], modifier[public static], parameter[]] begin[{]
return[ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=t, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=type)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Type, sub_type=None)), ReturnStatement(expression=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operandr=MethodInvocation(arguments=[], member=getTypes, postfix_operators=[], prefix_operators=[], qualifier=state, selectors=[MethodInvocation(arguments=[MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=unboxedTypeOrType, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=isPrimitive, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operator=&&), label=None)], documentation=None, modifiers={'public'}, name=matches, parameters=[FormalParameter(annotations=[], modifiers=set(), name=t, type=ReferenceType(arguments=None, dimensions=[], name=Tree, sub_type=None), varargs=False), FormalParameter(annotations=[], modifiers=set(), name=state, type=ReferenceType(arguments=None, dimensions=[], name=VisitorState, sub_type=None), varargs=False)], return_type=BasicType(dimensions=[], name=boolean), 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=T, sub_type=None))], dimensions=None, name=Matcher, sub_type=None))]
end[}]
END[}] | Keyword[public] Keyword[static] operator[<] identifier[T] Keyword[extends] identifier[Tree] operator[>] identifier[Matcher] operator[<] identifier[T] operator[>] identifier[isPrimitiveOrBoxedPrimitiveType] operator[SEP] operator[SEP] {
Keyword[return] Keyword[new] identifier[Matcher] operator[<] identifier[T] operator[>] operator[SEP] operator[SEP] {
annotation[@] identifier[Override] Keyword[public] Keyword[boolean] identifier[matches] operator[SEP] identifier[Tree] identifier[t] , identifier[VisitorState] identifier[state] operator[SEP] {
identifier[Type] identifier[type] operator[=] identifier[getType] operator[SEP] identifier[t] operator[SEP] operator[SEP] Keyword[return] identifier[type] operator[!=] Other[null] operator[&&] identifier[state] operator[SEP] identifier[getTypes] operator[SEP] operator[SEP] operator[SEP] identifier[unboxedTypeOrType] operator[SEP] identifier[type] operator[SEP] operator[SEP] identifier[isPrimitive] operator[SEP] operator[SEP] operator[SEP]
}
} operator[SEP]
}
|
public void putAll(Map<String, Object> map) {
for (Map.Entry<String, Object> entry : map.entrySet())
objectMap.put(entry.getKey(), entry.getValue());
} | class class_name[name] begin[{]
method[putAll, return_type[void], modifier[public], parameter[map]] begin[{]
ForStatement(body=StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getKey, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None)], member=put, postfix_operators=[], prefix_operators=[], qualifier=objectMap, selectors=[], type_arguments=None), label=None), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=entrySet, postfix_operators=[], prefix_operators=[], qualifier=map, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=entry)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Map, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))], dimensions=None, name=Entry, sub_type=None)))), label=None)
end[}]
END[}] | Keyword[public] Keyword[void] identifier[putAll] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] identifier[map] operator[SEP] {
Keyword[for] operator[SEP] identifier[Map] operator[SEP] identifier[Entry] operator[<] identifier[String] , identifier[Object] operator[>] identifier[entry] operator[:] identifier[map] operator[SEP] identifier[entrySet] operator[SEP] operator[SEP] operator[SEP] identifier[objectMap] operator[SEP] identifier[put] operator[SEP] identifier[entry] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] , identifier[entry] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
public void deleteAllLocal() {
if (localCache != null) {
try {
localCache.deleteAll();
} catch (Exception e) {
throw e instanceof CacheException ? (CacheException) e : new CacheException(e);
}
}
} | class class_name[name] begin[{]
method[deleteAllLocal, return_type[void], modifier[public], parameter[]] begin[{]
if[binary_operation[member[.localCache], !=, literal[null]]] begin[{]
TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=deleteAll, postfix_operators=[], prefix_operators=[], qualifier=localCache, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=CacheException, sub_type=None), operator=instanceof), if_false=ClassCreator(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=CacheException, sub_type=None)), if_true=Cast(expression=MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=CacheException, sub_type=None))), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None)
else begin[{]
None
end[}]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[deleteAllLocal] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[localCache] operator[!=] Other[null] operator[SEP] {
Keyword[try] {
identifier[localCache] operator[SEP] identifier[deleteAll] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] {
Keyword[throw] identifier[e] Keyword[instanceof] identifier[CacheException] operator[?] operator[SEP] identifier[CacheException] operator[SEP] identifier[e] operator[:] Keyword[new] identifier[CacheException] operator[SEP] identifier[e] operator[SEP] operator[SEP]
}
}
}
|
private static XColor assembleXcolor(final XSSFColor bcolor,
final double preTint, final int lumOff, final int lumMod,
final int alphaInt) {
if (bcolor == null) {
return null;
}
double tint = preTint;
if (Double.compare(tint, 0) == 0) {
// no preTint
if (lumOff > 0) {
tint = lumOff / MILLION_NUMBERS;
} else {
if (lumMod > 0) {
tint = -1 * (lumMod / MILLION_NUMBERS);
}
}
}
bcolor.setTint(tint);
double alpha = 0;
if (alphaInt > 0) {
alpha = alphaInt / MILLION_NUMBERS;
}
return new XColor(bcolor, alpha);
} | class class_name[name] begin[{]
method[assembleXcolor, return_type[type[XColor]], modifier[private static], parameter[bcolor, preTint, lumOff, lumMod, alphaInt]] begin[{]
if[binary_operation[member[.bcolor], ==, literal[null]]] begin[{]
return[literal[null]]
else begin[{]
None
end[}]
local_variable[type[double], tint]
if[binary_operation[call[Double.compare, parameter[member[.tint], literal[0]]], ==, literal[0]]] begin[{]
if[binary_operation[member[.lumOff], >, literal[0]]] begin[{]
assign[member[.tint], binary_operation[member[.lumOff], /, member[.MILLION_NUMBERS]]]
else begin[{]
if[binary_operation[member[.lumMod], >, literal[0]]] begin[{]
assign[member[.tint], binary_operation[literal[1], *, binary_operation[member[.lumMod], /, member[.MILLION_NUMBERS]]]]
else begin[{]
None
end[}]
end[}]
else begin[{]
None
end[}]
call[bcolor.setTint, parameter[member[.tint]]]
local_variable[type[double], alpha]
if[binary_operation[member[.alphaInt], >, literal[0]]] begin[{]
assign[member[.alpha], binary_operation[member[.alphaInt], /, member[.MILLION_NUMBERS]]]
else begin[{]
None
end[}]
return[ClassCreator(arguments=[MemberReference(member=bcolor, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=alpha, 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=XColor, sub_type=None))]
end[}]
END[}] | Keyword[private] Keyword[static] identifier[XColor] identifier[assembleXcolor] operator[SEP] Keyword[final] identifier[XSSFColor] identifier[bcolor] , Keyword[final] Keyword[double] identifier[preTint] , Keyword[final] Keyword[int] identifier[lumOff] , Keyword[final] Keyword[int] identifier[lumMod] , Keyword[final] Keyword[int] identifier[alphaInt] operator[SEP] {
Keyword[if] operator[SEP] identifier[bcolor] operator[==] Other[null] operator[SEP] {
Keyword[return] Other[null] operator[SEP]
}
Keyword[double] identifier[tint] operator[=] identifier[preTint] operator[SEP] Keyword[if] operator[SEP] identifier[Double] operator[SEP] identifier[compare] operator[SEP] identifier[tint] , Other[0] operator[SEP] operator[==] Other[0] operator[SEP] {
Keyword[if] operator[SEP] identifier[lumOff] operator[>] Other[0] operator[SEP] {
identifier[tint] operator[=] identifier[lumOff] operator[/] identifier[MILLION_NUMBERS] operator[SEP]
}
Keyword[else] {
Keyword[if] operator[SEP] identifier[lumMod] operator[>] Other[0] operator[SEP] {
identifier[tint] operator[=] operator[-] Other[1] operator[*] operator[SEP] identifier[lumMod] operator[/] identifier[MILLION_NUMBERS] operator[SEP] operator[SEP]
}
}
}
identifier[bcolor] operator[SEP] identifier[setTint] operator[SEP] identifier[tint] operator[SEP] operator[SEP] Keyword[double] identifier[alpha] operator[=] Other[0] operator[SEP] Keyword[if] operator[SEP] identifier[alphaInt] operator[>] Other[0] operator[SEP] {
identifier[alpha] operator[=] identifier[alphaInt] operator[/] identifier[MILLION_NUMBERS] operator[SEP]
}
Keyword[return] Keyword[new] identifier[XColor] operator[SEP] identifier[bcolor] , identifier[alpha] operator[SEP] operator[SEP]
}
|
final void decodeRemovalReentryProtection(ChannelHandlerContext ctx, ByteBuf in, List<Object> out)
throws Exception {
decodeState = STATE_CALLING_CHILD_DECODE;
try {
decode(ctx, in, out);
} finally {
boolean removePending = decodeState == STATE_HANDLER_REMOVED_PENDING;
decodeState = STATE_INIT;
if (removePending) {
handlerRemoved(ctx);
}
}
} | class class_name[name] begin[{]
method[decodeRemovalReentryProtection, return_type[void], modifier[final], parameter[ctx, in, out]] begin[{]
assign[member[.decodeState], member[.STATE_CALLING_CHILD_DECODE]]
TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=ctx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=in, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=out, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=decode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], catches=None, finally_block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=MemberReference(member=decodeState, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=STATE_HANDLER_REMOVED_PENDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), name=removePending)], modifiers=set(), type=BasicType(dimensions=[], name=boolean)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=decodeState, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=STATE_INIT, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), IfStatement(condition=MemberReference(member=removePending, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=ctx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=handlerRemoved, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]))], label=None, resources=None)
end[}]
END[}] | Keyword[final] Keyword[void] identifier[decodeRemovalReentryProtection] operator[SEP] identifier[ChannelHandlerContext] identifier[ctx] , identifier[ByteBuf] identifier[in] , identifier[List] operator[<] identifier[Object] operator[>] identifier[out] operator[SEP] Keyword[throws] identifier[Exception] {
identifier[decodeState] operator[=] identifier[STATE_CALLING_CHILD_DECODE] operator[SEP] Keyword[try] {
identifier[decode] operator[SEP] identifier[ctx] , identifier[in] , identifier[out] operator[SEP] operator[SEP]
}
Keyword[finally] {
Keyword[boolean] identifier[removePending] operator[=] identifier[decodeState] operator[==] identifier[STATE_HANDLER_REMOVED_PENDING] operator[SEP] identifier[decodeState] operator[=] identifier[STATE_INIT] operator[SEP] Keyword[if] operator[SEP] identifier[removePending] operator[SEP] {
identifier[handlerRemoved] operator[SEP] identifier[ctx] operator[SEP] operator[SEP]
}
}
}
|
@Override
public void removeByCommerceNotificationTemplateId(
long commerceNotificationTemplateId) {
for (CommerceNotificationQueueEntry commerceNotificationQueueEntry : findByCommerceNotificationTemplateId(
commerceNotificationTemplateId, QueryUtil.ALL_POS,
QueryUtil.ALL_POS, null)) {
remove(commerceNotificationQueueEntry);
}
} | class class_name[name] begin[{]
method[removeByCommerceNotificationTemplateId, return_type[void], modifier[public], parameter[commerceNotificationTemplateId]] begin[{]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=commerceNotificationQueueEntry, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=remove, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[MemberReference(member=commerceNotificationTemplateId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=ALL_POS, postfix_operators=[], prefix_operators=[], qualifier=QueryUtil, selectors=[]), MemberReference(member=ALL_POS, postfix_operators=[], prefix_operators=[], qualifier=QueryUtil, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], member=findByCommerceNotificationTemplateId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=commerceNotificationQueueEntry)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=CommerceNotificationQueueEntry, sub_type=None))), label=None)
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[removeByCommerceNotificationTemplateId] operator[SEP] Keyword[long] identifier[commerceNotificationTemplateId] operator[SEP] {
Keyword[for] operator[SEP] identifier[CommerceNotificationQueueEntry] identifier[commerceNotificationQueueEntry] operator[:] identifier[findByCommerceNotificationTemplateId] operator[SEP] identifier[commerceNotificationTemplateId] , identifier[QueryUtil] operator[SEP] identifier[ALL_POS] , identifier[QueryUtil] operator[SEP] identifier[ALL_POS] , Other[null] operator[SEP] operator[SEP] {
identifier[remove] operator[SEP] identifier[commerceNotificationQueueEntry] operator[SEP] operator[SEP]
}
}
|
@Override
public NextJourney execute(OptionalThing<VirtualForm> form) {
final ActionHook hook = prepareActionHook();
try {
final ActionResponse before = processHookBefore(hook);
if (before.isDefined()) { // e.g. login required
return reflect(before);
} else { // mainly here
return transactionalExecute(form, hook); // #to_action
}
} catch (RuntimeException e) {
final ActionResponse monologue = tellExceptionMonologue(hook, e);
return reflect(monologue);
} catch (Error e) {
redCardableAssist.translateToHotdeployErrorIfPossible(e);
throw e;
} finally {
processHookFinally(hook);
prepareTransactionMemoriesIfExists();
}
} | class class_name[name] begin[{]
method[execute, return_type[type[NextJourney]], modifier[public], parameter[form]] begin[{]
local_variable[type[ActionHook], hook]
TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=hook, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=processHookBefore, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=before)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=ActionResponse, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[], member=isDefined, postfix_operators=[], prefix_operators=[], qualifier=before, selectors=[], type_arguments=None), else_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=form, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=hook, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=transactionalExecute, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=before, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=reflect, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]))], catches=[CatchClause(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=hook, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=tellExceptionMonologue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=monologue)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=ActionResponse, sub_type=None)), ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=monologue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=reflect, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['RuntimeException'])), CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=translateToHotdeployErrorIfPossible, postfix_operators=[], prefix_operators=[], qualifier=redCardableAssist, selectors=[], type_arguments=None), label=None), ThrowStatement(expression=MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Error']))], finally_block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=hook, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=processHookFinally, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=prepareTransactionMemoriesIfExists, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], label=None, resources=None)
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] identifier[NextJourney] identifier[execute] operator[SEP] identifier[OptionalThing] operator[<] identifier[VirtualForm] operator[>] identifier[form] operator[SEP] {
Keyword[final] identifier[ActionHook] identifier[hook] operator[=] identifier[prepareActionHook] operator[SEP] operator[SEP] operator[SEP] Keyword[try] {
Keyword[final] identifier[ActionResponse] identifier[before] operator[=] identifier[processHookBefore] operator[SEP] identifier[hook] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[before] operator[SEP] identifier[isDefined] operator[SEP] operator[SEP] operator[SEP] {
Keyword[return] identifier[reflect] operator[SEP] identifier[before] operator[SEP] operator[SEP]
}
Keyword[else] {
Keyword[return] identifier[transactionalExecute] operator[SEP] identifier[form] , identifier[hook] operator[SEP] operator[SEP]
}
}
Keyword[catch] operator[SEP] identifier[RuntimeException] identifier[e] operator[SEP] {
Keyword[final] identifier[ActionResponse] identifier[monologue] operator[=] identifier[tellExceptionMonologue] operator[SEP] identifier[hook] , identifier[e] operator[SEP] operator[SEP] Keyword[return] identifier[reflect] operator[SEP] identifier[monologue] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Error] identifier[e] operator[SEP] {
identifier[redCardableAssist] operator[SEP] identifier[translateToHotdeployErrorIfPossible] operator[SEP] identifier[e] operator[SEP] operator[SEP] Keyword[throw] identifier[e] operator[SEP]
}
Keyword[finally] {
identifier[processHookFinally] operator[SEP] identifier[hook] operator[SEP] operator[SEP] identifier[prepareTransactionMemoriesIfExists] operator[SEP] operator[SEP] operator[SEP]
}
}
|
public void rotate(Vector3D axis, double angle, Point3D pivot) {
Quaternion q = new Quaternion();
q.setAxisAngle(axis, angle);
rotate(q, pivot);
} | class class_name[name] begin[{]
method[rotate, return_type[void], modifier[public], parameter[axis, angle, pivot]] begin[{]
local_variable[type[Quaternion], q]
call[q.setAxisAngle, parameter[member[.axis], member[.angle]]]
call[.rotate, parameter[member[.q], member[.pivot]]]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[rotate] operator[SEP] identifier[Vector3D] identifier[axis] , Keyword[double] identifier[angle] , identifier[Point3D] identifier[pivot] operator[SEP] {
identifier[Quaternion] identifier[q] operator[=] Keyword[new] identifier[Quaternion] operator[SEP] operator[SEP] operator[SEP] identifier[q] operator[SEP] identifier[setAxisAngle] operator[SEP] identifier[axis] , identifier[angle] operator[SEP] operator[SEP] identifier[rotate] operator[SEP] identifier[q] , identifier[pivot] operator[SEP] operator[SEP]
}
|
public static String toLegacyType(String keyword, String value) {
String legacyType = KeyTypeData.toLegacyType(keyword, value, null, null);
if (legacyType == null) {
// Checks if the specified locale type is well-formed with the legacy locale syntax.
//
// Note:
// Neither ICU nor LDML/CLDR provides the definition of keyword syntax.
// However, a type should not contain '=' obviously. For now, all existing
// types are using ASCII alphabetic letters with a few symbol letters. We won't
// add any new type that is not compatible with the BCP 47 syntax except timezone
// IDs. For now, we assume a valid type start with [0-9a-zA-Z], but may contain
// '-' '_' '/' in the middle.
if (value.matches("[0-9a-zA-Z]+([_/\\-][0-9a-zA-Z]+)*")) {
legacyType = AsciiUtil.toLowerString(value);
}
}
return legacyType;
} | class class_name[name] begin[{]
method[toLegacyType, return_type[type[String]], modifier[public static], parameter[keyword, value]] begin[{]
local_variable[type[String], legacyType]
if[binary_operation[member[.legacyType], ==, literal[null]]] begin[{]
if[call[value.matches, parameter[literal["[0-9a-zA-Z]+([_/\\-][0-9a-zA-Z]+)*"]]]] begin[{]
assign[member[.legacyType], call[AsciiUtil.toLowerString, parameter[member[.value]]]]
else begin[{]
None
end[}]
else begin[{]
None
end[}]
return[member[.legacyType]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[String] identifier[toLegacyType] operator[SEP] identifier[String] identifier[keyword] , identifier[String] identifier[value] operator[SEP] {
identifier[String] identifier[legacyType] operator[=] identifier[KeyTypeData] operator[SEP] identifier[toLegacyType] operator[SEP] identifier[keyword] , identifier[value] , Other[null] , Other[null] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[legacyType] operator[==] Other[null] operator[SEP] {
Keyword[if] operator[SEP] identifier[value] operator[SEP] identifier[matches] operator[SEP] literal[String] operator[SEP] operator[SEP] {
identifier[legacyType] operator[=] identifier[AsciiUtil] operator[SEP] identifier[toLowerString] operator[SEP] identifier[value] operator[SEP] operator[SEP]
}
}
Keyword[return] identifier[legacyType] operator[SEP]
}
|
public static int requiredIntAttribute(final XMLStreamReader reader, final String localName)
throws XMLStreamException {
return requiredIntAttribute(reader, null, localName);
} | class class_name[name] begin[{]
method[requiredIntAttribute, return_type[type[int]], modifier[public static], parameter[reader, localName]] begin[{]
return[call[.requiredIntAttribute, parameter[member[.reader], literal[null], member[.localName]]]]
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[int] identifier[requiredIntAttribute] operator[SEP] Keyword[final] identifier[XMLStreamReader] identifier[reader] , Keyword[final] identifier[String] identifier[localName] operator[SEP] Keyword[throws] identifier[XMLStreamException] {
Keyword[return] identifier[requiredIntAttribute] operator[SEP] identifier[reader] , Other[null] , identifier[localName] operator[SEP] operator[SEP]
}
|
public static ComputationGraph restoreComputationGraph(@NonNull String path, boolean loadUpdater)
throws IOException {
return restoreComputationGraph(new File(path), loadUpdater);
} | class class_name[name] begin[{]
method[restoreComputationGraph, return_type[type[ComputationGraph]], modifier[public static], parameter[path, loadUpdater]] begin[{]
return[call[.restoreComputationGraph, parameter[ClassCreator(arguments=[MemberReference(member=path, 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)), member[.loadUpdater]]]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[ComputationGraph] identifier[restoreComputationGraph] operator[SEP] annotation[@] identifier[NonNull] identifier[String] identifier[path] , Keyword[boolean] identifier[loadUpdater] operator[SEP] Keyword[throws] identifier[IOException] {
Keyword[return] identifier[restoreComputationGraph] operator[SEP] Keyword[new] identifier[File] operator[SEP] identifier[path] operator[SEP] , identifier[loadUpdater] operator[SEP] operator[SEP]
}
|
Expr and() {
Expr expr = equalNotEqual();
for (Tok tok=peek(); tok.sym==Sym.AND; tok=peek()) {
move();
expr = new Logic(Sym.AND, expr, equalNotEqual(), location);
}
return expr;
} | class class_name[name] begin[{]
method[and, return_type[type[Expr]], modifier[default], parameter[]] begin[{]
local_variable[type[Expr], expr]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=move, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=expr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[MemberReference(member=AND, postfix_operators=[], prefix_operators=[], qualifier=Sym, selectors=[]), MemberReference(member=expr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=equalNotEqual, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), MemberReference(member=location, 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=Logic, sub_type=None))), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=sym, postfix_operators=[], prefix_operators=[], qualifier=tok, selectors=[]), operandr=MemberReference(member=AND, postfix_operators=[], prefix_operators=[], qualifier=Sym, selectors=[]), operator===), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=MethodInvocation(arguments=[], member=peek, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=tok)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Tok, sub_type=None)), update=[Assignment(expressionl=MemberReference(member=tok, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=peek, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None))]), label=None)
return[member[.expr]]
end[}]
END[}] | identifier[Expr] identifier[and] operator[SEP] operator[SEP] {
identifier[Expr] identifier[expr] operator[=] identifier[equalNotEqual] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Tok] identifier[tok] operator[=] identifier[peek] operator[SEP] operator[SEP] operator[SEP] identifier[tok] operator[SEP] identifier[sym] operator[==] identifier[Sym] operator[SEP] identifier[AND] operator[SEP] identifier[tok] operator[=] identifier[peek] operator[SEP] operator[SEP] operator[SEP] {
identifier[move] operator[SEP] operator[SEP] operator[SEP] identifier[expr] operator[=] Keyword[new] identifier[Logic] operator[SEP] identifier[Sym] operator[SEP] identifier[AND] , identifier[expr] , identifier[equalNotEqual] operator[SEP] operator[SEP] , identifier[location] operator[SEP] operator[SEP]
}
Keyword[return] identifier[expr] operator[SEP]
}
|
public void createService(String domainProviderName, boolean force, Map<String, String> attributes) {
// check if a domain has been chosen
if (domainProviderName == null || domainProviderName.isEmpty()) {
domainProviderName = selectDomainProvider();
}
// get domain provider Id
String domainProviderId = "";
List<DomainProvider> domainProvider = getDomainProvider();
for (DomainProvider provider : domainProvider) {
if (provider.getName().getString(Locale.getDefault()).equals(domainProviderName)) {
domainProviderId = provider.getId();
}
}
// get the connector which should be created
ConnectorProvider connectorProvider =
getConnectorToCreate(domainProviderId, attributes.get(ServiceCommands.CONNECTOR_TYPE));
String id;
if (attributes.isEmpty() || !attributes.containsKey(org.osgi.framework.Constants.SERVICE_PID)) {
OutputStreamFormater.printValue("Please enter an ID");
id = readUserInput();
} else {
id = attributes.get(org.osgi.framework.Constants.SERVICE_PID);
}
ServiceDescriptor descriptor = connectorProvider.getDescriptor();
OutputStreamFormater.printValue(String.format("Please enter the attributes for %s, keep empty for default",
descriptor.getName().getString(Locale.getDefault())));
// get attributes for connector
Map<String, String> attributeMap = getConnectorAttributes(descriptor.getAttributes(), attributes);
Map<String, Object> properties = new HashMap<String, Object>();
ConnectorDescription connectorDescription =
new ConnectorDescription(domainProviderId, connectorProvider.getId(), attributeMap, properties);
if (force) {
if (id != null && !id.isEmpty()) {
serviceManager.forceCreateWithId(id, connectorDescription);
} else {
serviceManager.forceCreate(connectorDescription);
}
OutputStreamFormater.printValue("Connector successfully created");
} else {
OutputStreamFormater.printValue("Do you want to create the connector with the following attributes:", "");
OutputStreamFormater.printValue("Connector ID", id);
for (String key : attributeMap.keySet()) {
OutputStreamFormater.printValue(key, attributeMap.get(key));
}
OutputStreamFormater.printValue("Create connector: (Y/n)");
if (!readUserInput().equalsIgnoreCase("n")) {
try {
if (id != null && !id.isEmpty()) {
serviceManager.createWithId(id, connectorDescription);
} else {
serviceManager.create(connectorDescription);
}
OutputStreamFormater.printValue("Connector successfully created");
} catch (RuntimeException e) {
e.printStackTrace();
OutputStreamFormater.printValue("Connector validation failed, creation aborted");
}
} else {
OutputStreamFormater.printValue("Creation aborted");
}
}
} | class class_name[name] begin[{]
method[createService, return_type[void], modifier[public], parameter[domainProviderName, force, attributes]] begin[{]
if[binary_operation[binary_operation[member[.domainProviderName], ==, literal[null]], ||, call[domainProviderName.isEmpty, parameter[]]]] begin[{]
assign[member[.domainProviderName], call[.selectDomainProvider, parameter[]]]
else begin[{]
None
end[}]
local_variable[type[String], domainProviderId]
local_variable[type[List], domainProvider]
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=provider, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getDefault, postfix_operators=[], prefix_operators=[], qualifier=Locale, selectors=[], type_arguments=None)], member=getString, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=domainProviderName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=domainProviderId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=getId, postfix_operators=[], prefix_operators=[], qualifier=provider, selectors=[], type_arguments=None)), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=domainProvider, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=provider)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=DomainProvider, sub_type=None))), label=None)
local_variable[type[ConnectorProvider], connectorProvider]
local_variable[type[String], id]
if[binary_operation[call[attributes.isEmpty, parameter[]], ||, call[attributes.containsKey, parameter[member[org.osgi.framework.Constants.SERVICE_PID]]]]] begin[{]
call[OutputStreamFormater.printValue, parameter[literal["Please enter an ID"]]]
assign[member[.id], call[.readUserInput, parameter[]]]
else begin[{]
assign[member[.id], call[attributes.get, parameter[member[org.osgi.framework.Constants.SERVICE_PID]]]]
end[}]
local_variable[type[ServiceDescriptor], descriptor]
call[OutputStreamFormater.printValue, parameter[call[String.format, parameter[literal["Please enter the attributes for %s, keep empty for default"], call[descriptor.getName, parameter[]]]]]]
local_variable[type[Map], attributeMap]
local_variable[type[Map], properties]
local_variable[type[ConnectorDescription], connectorDescription]
if[member[.force]] begin[{]
if[binary_operation[binary_operation[member[.id], !=, literal[null]], &&, call[id.isEmpty, parameter[]]]] begin[{]
call[serviceManager.forceCreateWithId, parameter[member[.id], member[.connectorDescription]]]
else begin[{]
call[serviceManager.forceCreate, parameter[member[.connectorDescription]]]
end[}]
call[OutputStreamFormater.printValue, parameter[literal["Connector successfully created"]]]
else begin[{]
call[OutputStreamFormater.printValue, parameter[literal["Do you want to create the connector with the following attributes:"], literal[""]]]
call[OutputStreamFormater.printValue, parameter[literal["Connector ID"], member[.id]]]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=attributeMap, selectors=[], type_arguments=None)], member=printValue, postfix_operators=[], prefix_operators=[], qualifier=OutputStreamFormater, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=keySet, postfix_operators=[], prefix_operators=[], qualifier=attributeMap, 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)
call[OutputStreamFormater.printValue, parameter[literal["Create connector: (Y/n)"]]]
if[call[.readUserInput, parameter[]]] begin[{]
TryStatement(block=[IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=id, 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=id, selectors=[], type_arguments=None), operator=&&), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=connectorDescription, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=create, postfix_operators=[], prefix_operators=[], qualifier=serviceManager, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=id, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=connectorDescription, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=createWithId, postfix_operators=[], prefix_operators=[], qualifier=serviceManager, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Connector successfully created")], member=printValue, postfix_operators=[], prefix_operators=[], qualifier=OutputStreamFormater, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=printStackTrace, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Connector validation failed, creation aborted")], member=printValue, postfix_operators=[], prefix_operators=[], qualifier=OutputStreamFormater, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['RuntimeException']))], finally_block=None, label=None, resources=None)
else begin[{]
call[OutputStreamFormater.printValue, parameter[literal["Creation aborted"]]]
end[}]
end[}]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[createService] operator[SEP] identifier[String] identifier[domainProviderName] , Keyword[boolean] identifier[force] , identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[attributes] operator[SEP] {
Keyword[if] operator[SEP] identifier[domainProviderName] operator[==] Other[null] operator[||] identifier[domainProviderName] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] {
identifier[domainProviderName] operator[=] identifier[selectDomainProvider] operator[SEP] operator[SEP] operator[SEP]
}
identifier[String] identifier[domainProviderId] operator[=] literal[String] operator[SEP] identifier[List] operator[<] identifier[DomainProvider] operator[>] identifier[domainProvider] operator[=] identifier[getDomainProvider] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[DomainProvider] identifier[provider] operator[:] identifier[domainProvider] operator[SEP] {
Keyword[if] operator[SEP] identifier[provider] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] identifier[getString] operator[SEP] identifier[Locale] operator[SEP] identifier[getDefault] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[domainProviderName] operator[SEP] operator[SEP] {
identifier[domainProviderId] operator[=] identifier[provider] operator[SEP] identifier[getId] operator[SEP] operator[SEP] operator[SEP]
}
}
identifier[ConnectorProvider] identifier[connectorProvider] operator[=] identifier[getConnectorToCreate] operator[SEP] identifier[domainProviderId] , identifier[attributes] operator[SEP] identifier[get] operator[SEP] identifier[ServiceCommands] operator[SEP] identifier[CONNECTOR_TYPE] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[id] operator[SEP] Keyword[if] operator[SEP] identifier[attributes] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[||] operator[!] identifier[attributes] operator[SEP] identifier[containsKey] operator[SEP] identifier[org] operator[SEP] identifier[osgi] operator[SEP] identifier[framework] operator[SEP] identifier[Constants] operator[SEP] identifier[SERVICE_PID] operator[SEP] operator[SEP] {
identifier[OutputStreamFormater] operator[SEP] identifier[printValue] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[id] operator[=] identifier[readUserInput] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[id] operator[=] identifier[attributes] operator[SEP] identifier[get] operator[SEP] identifier[org] operator[SEP] identifier[osgi] operator[SEP] identifier[framework] operator[SEP] identifier[Constants] operator[SEP] identifier[SERVICE_PID] operator[SEP] operator[SEP]
}
identifier[ServiceDescriptor] identifier[descriptor] operator[=] identifier[connectorProvider] operator[SEP] identifier[getDescriptor] operator[SEP] operator[SEP] operator[SEP] identifier[OutputStreamFormater] operator[SEP] identifier[printValue] operator[SEP] identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[descriptor] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] identifier[getString] operator[SEP] identifier[Locale] operator[SEP] identifier[getDefault] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[attributeMap] operator[=] identifier[getConnectorAttributes] operator[SEP] identifier[descriptor] operator[SEP] identifier[getAttributes] operator[SEP] operator[SEP] , identifier[attributes] operator[SEP] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] identifier[properties] operator[=] Keyword[new] identifier[HashMap] operator[<] identifier[String] , identifier[Object] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[ConnectorDescription] identifier[connectorDescription] operator[=] Keyword[new] identifier[ConnectorDescription] operator[SEP] identifier[domainProviderId] , identifier[connectorProvider] operator[SEP] identifier[getId] operator[SEP] operator[SEP] , identifier[attributeMap] , identifier[properties] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[force] operator[SEP] {
Keyword[if] operator[SEP] identifier[id] operator[!=] Other[null] operator[&&] operator[!] identifier[id] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] {
identifier[serviceManager] operator[SEP] identifier[forceCreateWithId] operator[SEP] identifier[id] , identifier[connectorDescription] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[serviceManager] operator[SEP] identifier[forceCreate] operator[SEP] identifier[connectorDescription] operator[SEP] operator[SEP]
}
identifier[OutputStreamFormater] operator[SEP] identifier[printValue] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[OutputStreamFormater] operator[SEP] identifier[printValue] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[OutputStreamFormater] operator[SEP] identifier[printValue] operator[SEP] literal[String] , identifier[id] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[String] identifier[key] operator[:] identifier[attributeMap] operator[SEP] identifier[keySet] operator[SEP] operator[SEP] operator[SEP] {
identifier[OutputStreamFormater] operator[SEP] identifier[printValue] operator[SEP] identifier[key] , identifier[attributeMap] operator[SEP] identifier[get] operator[SEP] identifier[key] operator[SEP] operator[SEP] operator[SEP]
}
identifier[OutputStreamFormater] operator[SEP] identifier[printValue] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[readUserInput] operator[SEP] operator[SEP] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] literal[String] operator[SEP] operator[SEP] {
Keyword[try] {
Keyword[if] operator[SEP] identifier[id] operator[!=] Other[null] operator[&&] operator[!] identifier[id] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] {
identifier[serviceManager] operator[SEP] identifier[createWithId] operator[SEP] identifier[id] , identifier[connectorDescription] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[serviceManager] operator[SEP] identifier[create] operator[SEP] identifier[connectorDescription] operator[SEP] operator[SEP]
}
identifier[OutputStreamFormater] operator[SEP] identifier[printValue] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[RuntimeException] identifier[e] operator[SEP] {
identifier[e] operator[SEP] identifier[printStackTrace] operator[SEP] operator[SEP] operator[SEP] identifier[OutputStreamFormater] operator[SEP] identifier[printValue] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
}
Keyword[else] {
identifier[OutputStreamFormater] operator[SEP] identifier[printValue] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
}
}
|
@Pure
protected Injector getInjector() {
if (this.builderInjector == null) {
ImportManager importManager = this.importManagerProvider.get();
this.builderInjector = createOverridingInjector(this.originalInjector, new CodeBuilderModule(importManager));
}
return builderInjector;
} | class class_name[name] begin[{]
method[getInjector, return_type[type[Injector]], modifier[protected], parameter[]] begin[{]
if[binary_operation[THIS[member[None.builderInjector]], ==, literal[null]]] begin[{]
local_variable[type[ImportManager], importManager]
assign[THIS[member[None.builderInjector]], call[.createOverridingInjector, parameter[THIS[member[None.originalInjector]], ClassCreator(arguments=[MemberReference(member=importManager, 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=CodeBuilderModule, sub_type=None))]]]
else begin[{]
None
end[}]
return[member[.builderInjector]]
end[}]
END[}] | annotation[@] identifier[Pure] Keyword[protected] identifier[Injector] identifier[getInjector] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[builderInjector] operator[==] Other[null] operator[SEP] {
identifier[ImportManager] identifier[importManager] operator[=] Keyword[this] operator[SEP] identifier[importManagerProvider] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[builderInjector] operator[=] identifier[createOverridingInjector] operator[SEP] Keyword[this] operator[SEP] identifier[originalInjector] , Keyword[new] identifier[CodeBuilderModule] operator[SEP] identifier[importManager] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] identifier[builderInjector] operator[SEP]
}
|
@Override
public void releaseInstance(Message m, Object o) {
//Liberty Change for CXF Begain
//if not managed by CDI or EJB, then call preDestory by ourself.
//otherwise, perDestory has already been called by CDI/EJB
JaxRsFactoryBeanCustomizer beanCustomizer = null;
if (o != null)
{
Bus bus = m.getExchange().getBus();
beanCustomizer = InjectionRuntimeContextHelper.findBeanCustomizer(o.getClass(), bus);
}
if (beanCustomizer == null)
{
InjectionUtils.invokeLifeCycleMethod(o, preDestroyMethod);
}
//Liberty Change for CXF End
} | class class_name[name] begin[{]
method[releaseInstance, return_type[void], modifier[public], parameter[m, o]] begin[{]
local_variable[type[JaxRsFactoryBeanCustomizer], beanCustomizer]
if[binary_operation[member[.o], !=, literal[null]]] begin[{]
local_variable[type[Bus], bus]
assign[member[.beanCustomizer], call[InjectionRuntimeContextHelper.findBeanCustomizer, parameter[call[o.getClass, parameter[]], member[.bus]]]]
else begin[{]
None
end[}]
if[binary_operation[member[.beanCustomizer], ==, literal[null]]] begin[{]
call[InjectionUtils.invokeLifeCycleMethod, parameter[member[.o], member[.preDestroyMethod]]]
else begin[{]
None
end[}]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[releaseInstance] operator[SEP] identifier[Message] identifier[m] , identifier[Object] identifier[o] operator[SEP] {
identifier[JaxRsFactoryBeanCustomizer] identifier[beanCustomizer] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[o] operator[!=] Other[null] operator[SEP] {
identifier[Bus] identifier[bus] operator[=] identifier[m] operator[SEP] identifier[getExchange] operator[SEP] operator[SEP] operator[SEP] identifier[getBus] operator[SEP] operator[SEP] operator[SEP] identifier[beanCustomizer] operator[=] identifier[InjectionRuntimeContextHelper] operator[SEP] identifier[findBeanCustomizer] operator[SEP] identifier[o] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] , identifier[bus] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[beanCustomizer] operator[==] Other[null] operator[SEP] {
identifier[InjectionUtils] operator[SEP] identifier[invokeLifeCycleMethod] operator[SEP] identifier[o] , identifier[preDestroyMethod] operator[SEP] operator[SEP]
}
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.