code stringlengths 63 466k | code_sememe stringlengths 141 3.79M | token_type stringlengths 274 1.23M |
|---|---|---|
@Override
public Namespace convert(XBELNamespace source) {
if (source == null) return null;
String prefix = source.getPrefix();
String resourceLocation = source.getResourceLocation();
Namespace dest = new Namespace(prefix, resourceLocation);
return dest;
} | class class_name[name] begin[{]
method[convert, return_type[type[Namespace]], modifier[public], parameter[source]] begin[{]
if[binary_operation[member[.source], ==, literal[null]]] begin[{]
return[literal[null]]
else begin[{]
None
end[}]
local_variable[type[String], prefix]
local_variable[type[String], resourceLocation]
local_variable[type[Namespace], dest]
return[member[.dest]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] identifier[Namespace] identifier[convert] operator[SEP] identifier[XBELNamespace] identifier[source] operator[SEP] {
Keyword[if] operator[SEP] identifier[source] operator[==] Other[null] operator[SEP] Keyword[return] Other[null] operator[SEP] identifier[String] identifier[prefix] operator[=] identifier[source] operator[SEP] identifier[getPrefix] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[resourceLocation] operator[=] identifier[source] operator[SEP] identifier[getResourceLocation] operator[SEP] operator[SEP] operator[SEP] identifier[Namespace] identifier[dest] operator[=] Keyword[new] identifier[Namespace] operator[SEP] identifier[prefix] , identifier[resourceLocation] operator[SEP] operator[SEP] Keyword[return] identifier[dest] operator[SEP]
}
|
public void spawnThread(DukeController controller, int check_interval) {
this.controller = controller;
timer = mgr.schedule(this, 0, check_interval * 1000); // convert to ms
} | class class_name[name] begin[{]
method[spawnThread, return_type[void], modifier[public], parameter[controller, check_interval]] begin[{]
assign[THIS[member[None.controller]], member[.controller]]
assign[member[.timer], call[mgr.schedule, parameter[THIS[], literal[0], binary_operation[member[.check_interval], *, literal[1000]]]]]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[spawnThread] operator[SEP] identifier[DukeController] identifier[controller] , Keyword[int] identifier[check_interval] operator[SEP] {
Keyword[this] operator[SEP] identifier[controller] operator[=] identifier[controller] operator[SEP] identifier[timer] operator[=] identifier[mgr] operator[SEP] identifier[schedule] operator[SEP] Keyword[this] , Other[0] , identifier[check_interval] operator[*] Other[1000] operator[SEP] operator[SEP]
}
|
public void sendStanza(IQ iq) throws NotConnectedException, InterruptedException {
if (iq instanceof Jingle) {
sendFormattedJingle((Jingle) iq);
} else {
getConnection().sendStanza(iq);
}
} | class class_name[name] begin[{]
method[sendStanza, return_type[void], modifier[public], parameter[iq]] begin[{]
if[binary_operation[member[.iq], instanceof, type[Jingle]]] begin[{]
call[.sendFormattedJingle, parameter[Cast(expression=MemberReference(member=iq, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Jingle, sub_type=None))]]
else begin[{]
call[.getConnection, parameter[]]
end[}]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[sendStanza] operator[SEP] identifier[IQ] identifier[iq] operator[SEP] Keyword[throws] identifier[NotConnectedException] , identifier[InterruptedException] {
Keyword[if] operator[SEP] identifier[iq] Keyword[instanceof] identifier[Jingle] operator[SEP] {
identifier[sendFormattedJingle] operator[SEP] operator[SEP] identifier[Jingle] operator[SEP] identifier[iq] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[getConnection] operator[SEP] operator[SEP] operator[SEP] identifier[sendStanza] operator[SEP] identifier[iq] operator[SEP] operator[SEP]
}
}
|
public static void writeMapToXML(final Map<URI, Set<URI>> m, final File outputFile) throws IOException {
if (m == null) {
return;
}
final Properties prop = new Properties();
for (final Map.Entry<URI, Set<URI>> entry: m.entrySet()) {
final URI key = entry.getKey();
final String value = StringUtils.join(entry.getValue(), COMMA);
prop.setProperty(key.getPath(), value);
}
try (OutputStream os = new FileOutputStream(outputFile)) {
prop.storeToXML(os, null);
} catch (final IOException e) {
throw new IOException("Failed to write subject scheme graph: " + e.getMessage(), e);
}
} | class class_name[name] begin[{]
method[writeMapToXML, return_type[void], modifier[public static], parameter[m, outputFile]] begin[{]
if[binary_operation[member[.m], ==, literal[null]]] begin[{]
return[None]
else begin[{]
None
end[}]
local_variable[type[Properties], prop]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getKey, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None), name=key)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=URI, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None), MemberReference(member=COMMA, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=join, postfix_operators=[], prefix_operators=[], qualifier=StringUtils, selectors=[], type_arguments=None), name=value)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getPath, postfix_operators=[], prefix_operators=[], qualifier=key, selectors=[], type_arguments=None), MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setProperty, postfix_operators=[], prefix_operators=[], qualifier=prop, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=entrySet, postfix_operators=[], prefix_operators=[], qualifier=m, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=entry)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=Map, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=URI, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=URI, sub_type=None))], dimensions=[], name=Set, sub_type=None))], dimensions=None, name=Entry, sub_type=None)))), label=None)
TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=os, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], member=storeToXML, postfix_operators=[], prefix_operators=[], qualifier=prop, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Failed to write subject scheme graph: "), 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=IOException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IOException']))], finally_block=None, label=None, resources=[TryResource(annotations=[], modifiers=set(), name=os, type=ReferenceType(arguments=None, dimensions=[], name=OutputStream, sub_type=None), value=ClassCreator(arguments=[MemberReference(member=outputFile, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=FileOutputStream, sub_type=None)))])
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[void] identifier[writeMapToXML] operator[SEP] Keyword[final] identifier[Map] operator[<] identifier[URI] , identifier[Set] operator[<] identifier[URI] operator[>] operator[>] identifier[m] , Keyword[final] identifier[File] identifier[outputFile] operator[SEP] Keyword[throws] identifier[IOException] {
Keyword[if] operator[SEP] identifier[m] operator[==] Other[null] operator[SEP] {
Keyword[return] operator[SEP]
}
Keyword[final] identifier[Properties] identifier[prop] operator[=] Keyword[new] identifier[Properties] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[final] identifier[Map] operator[SEP] identifier[Entry] operator[<] identifier[URI] , identifier[Set] operator[<] identifier[URI] operator[>] operator[>] identifier[entry] operator[:] identifier[m] operator[SEP] identifier[entrySet] operator[SEP] operator[SEP] operator[SEP] {
Keyword[final] identifier[URI] identifier[key] operator[=] identifier[entry] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[String] identifier[value] operator[=] identifier[StringUtils] operator[SEP] identifier[join] operator[SEP] identifier[entry] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] , identifier[COMMA] operator[SEP] operator[SEP] identifier[prop] operator[SEP] identifier[setProperty] operator[SEP] identifier[key] operator[SEP] identifier[getPath] operator[SEP] operator[SEP] , identifier[value] operator[SEP] operator[SEP]
}
Keyword[try] operator[SEP] identifier[OutputStream] identifier[os] operator[=] Keyword[new] identifier[FileOutputStream] operator[SEP] identifier[outputFile] operator[SEP] operator[SEP] {
identifier[prop] operator[SEP] identifier[storeToXML] operator[SEP] identifier[os] , Other[null] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] Keyword[final] identifier[IOException] identifier[e] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IOException] operator[SEP] literal[String] operator[+] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP]
}
}
|
public void hideMenuButton(final boolean animate) {
if (!isMenuButtonHidden() && !mIsMenuButtonAnimationRunning) {
mIsMenuButtonAnimationRunning = true;
if (isOpened()) {
close(animate);
mUiHandler.postDelayed(new Runnable() {
@Override
public void run() {
hideMenuButtonWithImage(animate);
}
}, mAnimationDelayPerItem * mButtonsCount);
} else {
hideMenuButtonWithImage(animate);
}
}
} | class class_name[name] begin[{]
method[hideMenuButton, return_type[void], modifier[public], parameter[animate]] begin[{]
if[binary_operation[call[.isMenuButtonHidden, parameter[]], &&, member[.mIsMenuButtonAnimationRunning]]] begin[{]
assign[member[.mIsMenuButtonAnimationRunning], literal[true]]
if[call[.isOpened, parameter[]]] begin[{]
call[.close, parameter[member[.animate]]]
call[mUiHandler.postDelayed, parameter[ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=animate, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=hideMenuButtonWithImage, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=run, parameters=[], return_type=None, throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Runnable, sub_type=None)), binary_operation[member[.mAnimationDelayPerItem], *, member[.mButtonsCount]]]]
else begin[{]
call[.hideMenuButtonWithImage, parameter[member[.animate]]]
end[}]
else begin[{]
None
end[}]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[hideMenuButton] operator[SEP] Keyword[final] Keyword[boolean] identifier[animate] operator[SEP] {
Keyword[if] operator[SEP] operator[!] identifier[isMenuButtonHidden] operator[SEP] operator[SEP] operator[&&] operator[!] identifier[mIsMenuButtonAnimationRunning] operator[SEP] {
identifier[mIsMenuButtonAnimationRunning] operator[=] literal[boolean] operator[SEP] Keyword[if] operator[SEP] identifier[isOpened] operator[SEP] operator[SEP] operator[SEP] {
identifier[close] operator[SEP] identifier[animate] operator[SEP] operator[SEP] identifier[mUiHandler] operator[SEP] identifier[postDelayed] operator[SEP] Keyword[new] identifier[Runnable] operator[SEP] operator[SEP] {
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[run] operator[SEP] operator[SEP] {
identifier[hideMenuButtonWithImage] operator[SEP] identifier[animate] operator[SEP] operator[SEP]
}
} , identifier[mAnimationDelayPerItem] operator[*] identifier[mButtonsCount] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[hideMenuButtonWithImage] operator[SEP] identifier[animate] operator[SEP] operator[SEP]
}
}
}
|
public void start(boolean deliverImmediately)
throws SIConnectionDroppedException, SISessionUnavailableException,
SIConnectionUnavailableException, SIConnectionLostException,
SIResourceException, SIErrorException, SIErrorException {
final String methodName = "start";
if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled()) {
SibTr.entry(this, TRACE, methodName, Boolean
.valueOf(deliverImmediately));
}
checkValid();
_delegate.start(deliverImmediately);
if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled()) {
SibTr.exit(this, TRACE, methodName);
}
} | class class_name[name] begin[{]
method[start, return_type[void], modifier[public], parameter[deliverImmediately]] begin[{]
local_variable[type[String], methodName]
if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[TRACE.isEntryEnabled, parameter[]]]] begin[{]
call[SibTr.entry, parameter[THIS[], member[.TRACE], member[.methodName], call[Boolean.valueOf, parameter[member[.deliverImmediately]]]]]
else begin[{]
None
end[}]
call[.checkValid, parameter[]]
call[_delegate.start, parameter[member[.deliverImmediately]]]
if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[TRACE.isEntryEnabled, parameter[]]]] begin[{]
call[SibTr.exit, parameter[THIS[], member[.TRACE], member[.methodName]]]
else begin[{]
None
end[}]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[start] operator[SEP] Keyword[boolean] identifier[deliverImmediately] operator[SEP] Keyword[throws] identifier[SIConnectionDroppedException] , identifier[SISessionUnavailableException] , identifier[SIConnectionUnavailableException] , identifier[SIConnectionLostException] , identifier[SIResourceException] , identifier[SIErrorException] , identifier[SIErrorException] {
Keyword[final] identifier[String] identifier[methodName] operator[=] literal[String] operator[SEP] Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[TRACE] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] {
identifier[SibTr] operator[SEP] identifier[entry] operator[SEP] Keyword[this] , identifier[TRACE] , identifier[methodName] , identifier[Boolean] operator[SEP] identifier[valueOf] operator[SEP] identifier[deliverImmediately] operator[SEP] operator[SEP] operator[SEP]
}
identifier[checkValid] operator[SEP] operator[SEP] operator[SEP] identifier[_delegate] operator[SEP] identifier[start] operator[SEP] identifier[deliverImmediately] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[TRACE] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] {
identifier[SibTr] operator[SEP] identifier[exit] operator[SEP] Keyword[this] , identifier[TRACE] , identifier[methodName] operator[SEP] operator[SEP]
}
}
|
public void setBudget(com.google.api.ads.admanager.axis.v201811.Money budget) {
this.budget = budget;
} | class class_name[name] begin[{]
method[setBudget, return_type[void], modifier[public], parameter[budget]] begin[{]
assign[THIS[member[None.budget]], member[.budget]]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[setBudget] operator[SEP] identifier[com] operator[SEP] identifier[google] operator[SEP] identifier[api] operator[SEP] identifier[ads] operator[SEP] identifier[admanager] operator[SEP] identifier[axis] operator[SEP] identifier[v201811] operator[SEP] identifier[Money] identifier[budget] operator[SEP] {
Keyword[this] operator[SEP] identifier[budget] operator[=] identifier[budget] operator[SEP]
}
|
@Override
@Nonnull
public String getLabel() {
ASTVisitor labelFixingVisitor = getCustomLabelVisitor();
if (labelFixingVisitor instanceof CustomLabelVisitor) {
if (customizedLabel == null) {
String labelReplacement = findLabelReplacement(labelFixingVisitor);
customizedLabel = label.replace(BugResolution.PLACEHOLDER_STRING, labelReplacement);
}
return customizedLabel;
}
return label;
} | class class_name[name] begin[{]
method[getLabel, return_type[type[String]], modifier[public], parameter[]] begin[{]
local_variable[type[ASTVisitor], labelFixingVisitor]
if[binary_operation[member[.labelFixingVisitor], instanceof, type[CustomLabelVisitor]]] begin[{]
if[binary_operation[member[.customizedLabel], ==, literal[null]]] begin[{]
local_variable[type[String], labelReplacement]
assign[member[.customizedLabel], call[label.replace, parameter[member[BugResolution.PLACEHOLDER_STRING], member[.labelReplacement]]]]
else begin[{]
None
end[}]
return[member[.customizedLabel]]
else begin[{]
None
end[}]
return[member[.label]]
end[}]
END[}] | annotation[@] identifier[Override] annotation[@] identifier[Nonnull] Keyword[public] identifier[String] identifier[getLabel] operator[SEP] operator[SEP] {
identifier[ASTVisitor] identifier[labelFixingVisitor] operator[=] identifier[getCustomLabelVisitor] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[labelFixingVisitor] Keyword[instanceof] identifier[CustomLabelVisitor] operator[SEP] {
Keyword[if] operator[SEP] identifier[customizedLabel] operator[==] Other[null] operator[SEP] {
identifier[String] identifier[labelReplacement] operator[=] identifier[findLabelReplacement] operator[SEP] identifier[labelFixingVisitor] operator[SEP] operator[SEP] identifier[customizedLabel] operator[=] identifier[label] operator[SEP] identifier[replace] operator[SEP] identifier[BugResolution] operator[SEP] identifier[PLACEHOLDER_STRING] , identifier[labelReplacement] operator[SEP] operator[SEP]
}
Keyword[return] identifier[customizedLabel] operator[SEP]
}
Keyword[return] identifier[label] operator[SEP]
}
|
private static long skipToEOF(final ImageInputStream stream) throws IOException {
long length = stream.length();
if (length > 0) {
// Known length, skip there and we're done.
stream.seek(length);
}
else {
// Otherwise, seek to EOF the hard way.
// First, store stream position...
long pos = stream.getStreamPosition();
// ...skip 1k blocks until we're passed EOF...
while (stream.skipBytes(1024L) > 0) {
if (stream.read() == -1) {
break;
}
pos = stream.getStreamPosition();
}
// ...go back to last known pos...
stream.seek(pos);
// ...finally seek until EOF one byte at a time. Done.
while (stream.read() != -1) {
}
}
return stream.getStreamPosition();
} | class class_name[name] begin[{]
method[skipToEOF, return_type[type[long]], modifier[private static], parameter[stream]] begin[{]
local_variable[type[long], length]
if[binary_operation[member[.length], >, literal[0]]] begin[{]
call[stream.seek, parameter[member[.length]]]
else begin[{]
local_variable[type[long], pos]
while[binary_operation[call[stream.skipBytes, parameter[literal[1024L]]], >, literal[0]]] begin[{]
if[binary_operation[call[stream.read, parameter[]], ==, literal[1]]] begin[{]
BreakStatement(goto=None, label=None)
else begin[{]
None
end[}]
assign[member[.pos], call[stream.getStreamPosition, parameter[]]]
end[}]
call[stream.seek, parameter[member[.pos]]]
while[binary_operation[call[stream.read, parameter[]], !=, literal[1]]] begin[{]
end[}]
end[}]
return[call[stream.getStreamPosition, parameter[]]]
end[}]
END[}] | Keyword[private] Keyword[static] Keyword[long] identifier[skipToEOF] operator[SEP] Keyword[final] identifier[ImageInputStream] identifier[stream] operator[SEP] Keyword[throws] identifier[IOException] {
Keyword[long] identifier[length] operator[=] identifier[stream] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[length] operator[>] Other[0] operator[SEP] {
identifier[stream] operator[SEP] identifier[seek] operator[SEP] identifier[length] operator[SEP] operator[SEP]
}
Keyword[else] {
Keyword[long] identifier[pos] operator[=] identifier[stream] operator[SEP] identifier[getStreamPosition] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[stream] operator[SEP] identifier[skipBytes] operator[SEP] Other[1024L] operator[SEP] operator[>] Other[0] operator[SEP] {
Keyword[if] operator[SEP] identifier[stream] operator[SEP] identifier[read] operator[SEP] operator[SEP] operator[==] operator[-] Other[1] operator[SEP] {
Keyword[break] operator[SEP]
}
identifier[pos] operator[=] identifier[stream] operator[SEP] identifier[getStreamPosition] operator[SEP] operator[SEP] operator[SEP]
}
identifier[stream] operator[SEP] identifier[seek] operator[SEP] identifier[pos] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[stream] operator[SEP] identifier[read] operator[SEP] operator[SEP] operator[!=] operator[-] Other[1] operator[SEP] {
}
}
Keyword[return] identifier[stream] operator[SEP] identifier[getStreamPosition] operator[SEP] operator[SEP] operator[SEP]
}
|
public static void serialize(final File file, final ClassHierarchy classHierarchy) throws IOException {
final ClassHierarchyProto.Node node = serializeNode(classHierarchy.getNamespace());
try (final FileOutputStream output = new FileOutputStream(file)) {
try (final DataOutputStream dos = new DataOutputStream(output)) {
node.writeTo(dos);
}
}
} | class class_name[name] begin[{]
method[serialize, return_type[void], modifier[public static], parameter[file, classHierarchy]] begin[{]
local_variable[type[ClassHierarchyProto], node]
TryStatement(block=[TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=dos, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=writeTo, postfix_operators=[], prefix_operators=[], qualifier=node, selectors=[], type_arguments=None), label=None)], catches=None, finally_block=None, label=None, resources=[TryResource(annotations=[], modifiers={'final'}, name=dos, type=ReferenceType(arguments=None, dimensions=[], name=DataOutputStream, sub_type=None), value=ClassCreator(arguments=[MemberReference(member=output, 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=DataOutputStream, sub_type=None)))])], catches=None, finally_block=None, label=None, resources=[TryResource(annotations=[], modifiers={'final'}, name=output, type=ReferenceType(arguments=None, dimensions=[], name=FileOutputStream, sub_type=None), value=ClassCreator(arguments=[MemberReference(member=file, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=FileOutputStream, sub_type=None)))])
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[void] identifier[serialize] operator[SEP] Keyword[final] identifier[File] identifier[file] , Keyword[final] identifier[ClassHierarchy] identifier[classHierarchy] operator[SEP] Keyword[throws] identifier[IOException] {
Keyword[final] identifier[ClassHierarchyProto] operator[SEP] identifier[Node] identifier[node] operator[=] identifier[serializeNode] operator[SEP] identifier[classHierarchy] operator[SEP] identifier[getNamespace] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[try] operator[SEP] Keyword[final] identifier[FileOutputStream] identifier[output] operator[=] Keyword[new] identifier[FileOutputStream] operator[SEP] identifier[file] operator[SEP] operator[SEP] {
Keyword[try] operator[SEP] Keyword[final] identifier[DataOutputStream] identifier[dos] operator[=] Keyword[new] identifier[DataOutputStream] operator[SEP] identifier[output] operator[SEP] operator[SEP] {
identifier[node] operator[SEP] identifier[writeTo] operator[SEP] identifier[dos] operator[SEP] operator[SEP]
}
}
}
|
private final void getFormFields(Node parent, Map<String, String> formfields) {
String method = "getFormFields(Node parent, Map formfields)";
if (logger.isDebugEnabled()) {
logger.debug(enter(method));
}
NodeList children = parent.getChildNodes();
for (int i = 0; i < children.getLength(); i++) {
Node child = children.item(i);
String tag = child.getNodeName();
if ("input".equalsIgnoreCase(tag)) {
NamedNodeMap attributes = child.getAttributes();
Node typeNode = attributes.getNamedItem("type");
String type = typeNode.getNodeValue();
Node nameNode = attributes.getNamedItem("name");
String name = nameNode.getNodeValue();
Node valueNode = attributes.getNamedItem("value");
String value = "";
if (valueNode != null) {
value = valueNode.getNodeValue();
}
if ("hidden".equalsIgnoreCase(type) && value != null) {
if (logger.isDebugEnabled()) {
logger.debug(format("capturing hidden fields", name, value));
}
formfields.put(name, value);
}
}
getFormFields(child, formfields);
}
if (logger.isDebugEnabled()) {
logger.debug(exit(method));
}
} | class class_name[name] begin[{]
method[getFormFields, return_type[void], modifier[final private], parameter[parent, formfields]] begin[{]
local_variable[type[String], method]
if[call[logger.isDebugEnabled, parameter[]]] begin[{]
call[logger.debug, parameter[call[.enter, parameter[member[.method]]]]]
else begin[{]
None
end[}]
local_variable[type[NodeList], children]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=item, postfix_operators=[], prefix_operators=[], qualifier=children, selectors=[], type_arguments=None), name=child)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Node, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getNodeName, postfix_operators=[], prefix_operators=[], qualifier=child, selectors=[], type_arguments=None), name=tag)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=tag, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equalsIgnoreCase, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], value="input"), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getAttributes, postfix_operators=[], prefix_operators=[], qualifier=child, selectors=[], type_arguments=None), name=attributes)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=NamedNodeMap, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="type")], member=getNamedItem, postfix_operators=[], prefix_operators=[], qualifier=attributes, selectors=[], type_arguments=None), name=typeNode)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Node, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getNodeValue, postfix_operators=[], prefix_operators=[], qualifier=typeNode, selectors=[], type_arguments=None), name=type)], 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="name")], member=getNamedItem, postfix_operators=[], prefix_operators=[], qualifier=attributes, selectors=[], type_arguments=None), name=nameNode)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Node, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getNodeValue, postfix_operators=[], prefix_operators=[], qualifier=nameNode, selectors=[], type_arguments=None), name=name)], 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="value")], member=getNamedItem, postfix_operators=[], prefix_operators=[], qualifier=attributes, selectors=[], type_arguments=None), name=valueNode)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Node, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=""), name=value)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=valueNode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=getNodeValue, postfix_operators=[], prefix_operators=[], qualifier=valueNode, selectors=[], type_arguments=None)), label=None)])), IfStatement(condition=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equalsIgnoreCase, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], value="hidden"), operandr=BinaryOperation(operandl=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[], member=isDebugEnabled, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="capturing hidden fields"), MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=format, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=debug, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=put, postfix_operators=[], prefix_operators=[], qualifier=formfields, selectors=[], type_arguments=None), label=None)]))])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=child, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=formfields, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getFormFields, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=getLength, postfix_operators=[], prefix_operators=[], qualifier=children, selectors=[], type_arguments=None), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
if[call[logger.isDebugEnabled, parameter[]]] begin[{]
call[logger.debug, parameter[call[.exit, parameter[member[.method]]]]]
else begin[{]
None
end[}]
end[}]
END[}] | Keyword[private] Keyword[final] Keyword[void] identifier[getFormFields] operator[SEP] identifier[Node] identifier[parent] , identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[formfields] operator[SEP] {
identifier[String] identifier[method] operator[=] literal[String] operator[SEP] Keyword[if] operator[SEP] identifier[logger] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] {
identifier[logger] operator[SEP] identifier[debug] operator[SEP] identifier[enter] operator[SEP] identifier[method] operator[SEP] operator[SEP] operator[SEP]
}
identifier[NodeList] identifier[children] operator[=] identifier[parent] operator[SEP] identifier[getChildNodes] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[children] operator[SEP] identifier[getLength] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[++] operator[SEP] {
identifier[Node] identifier[child] operator[=] identifier[children] operator[SEP] identifier[item] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[String] identifier[tag] operator[=] identifier[child] operator[SEP] identifier[getNodeName] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] literal[String] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] identifier[tag] operator[SEP] operator[SEP] {
identifier[NamedNodeMap] identifier[attributes] operator[=] identifier[child] operator[SEP] identifier[getAttributes] operator[SEP] operator[SEP] operator[SEP] identifier[Node] identifier[typeNode] operator[=] identifier[attributes] operator[SEP] identifier[getNamedItem] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[String] identifier[type] operator[=] identifier[typeNode] operator[SEP] identifier[getNodeValue] operator[SEP] operator[SEP] operator[SEP] identifier[Node] identifier[nameNode] operator[=] identifier[attributes] operator[SEP] identifier[getNamedItem] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[String] identifier[name] operator[=] identifier[nameNode] operator[SEP] identifier[getNodeValue] operator[SEP] operator[SEP] operator[SEP] identifier[Node] identifier[valueNode] operator[=] identifier[attributes] operator[SEP] identifier[getNamedItem] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[String] identifier[value] operator[=] literal[String] operator[SEP] Keyword[if] operator[SEP] identifier[valueNode] operator[!=] Other[null] operator[SEP] {
identifier[value] operator[=] identifier[valueNode] operator[SEP] identifier[getNodeValue] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] literal[String] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] identifier[type] operator[SEP] operator[&&] identifier[value] operator[!=] Other[null] operator[SEP] {
Keyword[if] operator[SEP] identifier[logger] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] {
identifier[logger] operator[SEP] identifier[debug] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[name] , identifier[value] operator[SEP] operator[SEP] operator[SEP]
}
identifier[formfields] operator[SEP] identifier[put] operator[SEP] identifier[name] , identifier[value] operator[SEP] operator[SEP]
}
}
identifier[getFormFields] operator[SEP] identifier[child] , identifier[formfields] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[logger] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] {
identifier[logger] operator[SEP] identifier[debug] operator[SEP] identifier[exit] operator[SEP] identifier[method] operator[SEP] operator[SEP] operator[SEP]
}
}
|
public void marshall(UpdateGlobalSettingsRequest updateGlobalSettingsRequest, ProtocolMarshaller protocolMarshaller) {
if (updateGlobalSettingsRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(updateGlobalSettingsRequest.getBusinessCalling(), BUSINESSCALLING_BINDING);
protocolMarshaller.marshall(updateGlobalSettingsRequest.getVoiceConnector(), VOICECONNECTOR_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[updateGlobalSettingsRequest, protocolMarshaller]] begin[{]
if[binary_operation[member[.updateGlobalSettingsRequest], ==, 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=getBusinessCalling, postfix_operators=[], prefix_operators=[], qualifier=updateGlobalSettingsRequest, selectors=[], type_arguments=None), MemberReference(member=BUSINESSCALLING_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=getVoiceConnector, postfix_operators=[], prefix_operators=[], qualifier=updateGlobalSettingsRequest, selectors=[], type_arguments=None), MemberReference(member=VOICECONNECTOR_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[UpdateGlobalSettingsRequest] identifier[updateGlobalSettingsRequest] , identifier[ProtocolMarshaller] identifier[protocolMarshaller] operator[SEP] {
Keyword[if] operator[SEP] identifier[updateGlobalSettingsRequest] 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[updateGlobalSettingsRequest] operator[SEP] identifier[getBusinessCalling] operator[SEP] operator[SEP] , identifier[BUSINESSCALLING_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[updateGlobalSettingsRequest] operator[SEP] identifier[getVoiceConnector] operator[SEP] operator[SEP] , identifier[VOICECONNECTOR_BINDING] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] {
Keyword[throw] Keyword[new] identifier[SdkClientException] operator[SEP] literal[String] operator[+] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP]
}
}
|
public void close() throws IOException {
if(r != null) {
r = null;
ogg.close();
ogg = null;
}
if(w != null) {
w.bufferPacket(info.write(), true);
w.bufferPacket(tags.write(), false);
long lastGranule = 0;
for(SpeexAudioData vd : writtenPackets) {
// Update the granule position as we go
if(vd.getGranulePosition() >= 0 &&
lastGranule != vd.getGranulePosition()) {
w.flush();
lastGranule = vd.getGranulePosition();
w.setGranulePosition(lastGranule);
}
// Write the data, flushing if needed
w.bufferPacket(vd.write());
if(w.getSizePendingFlush() > 16384) {
w.flush();
}
}
w.close();
w = null;
ogg.close();
ogg = null;
}
} | class class_name[name] begin[{]
method[close, return_type[void], modifier[public], parameter[]] begin[{]
if[binary_operation[member[.r], !=, literal[null]]] begin[{]
assign[member[.r], literal[null]]
call[ogg.close, parameter[]]
assign[member[.ogg], literal[null]]
else begin[{]
None
end[}]
if[binary_operation[member[.w], !=, literal[null]]] begin[{]
call[w.bufferPacket, parameter[call[info.write, parameter[]], literal[true]]]
call[w.bufferPacket, parameter[call[tags.write, parameter[]], literal[false]]]
local_variable[type[long], lastGranule]
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getGranulePosition, postfix_operators=[], prefix_operators=[], qualifier=vd, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>=), operandr=BinaryOperation(operandl=MemberReference(member=lastGranule, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=getGranulePosition, postfix_operators=[], prefix_operators=[], qualifier=vd, selectors=[], type_arguments=None), operator=!=), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=flush, postfix_operators=[], prefix_operators=[], qualifier=w, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=lastGranule, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=getGranulePosition, postfix_operators=[], prefix_operators=[], qualifier=vd, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=lastGranule, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setGranulePosition, postfix_operators=[], prefix_operators=[], qualifier=w, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=write, postfix_operators=[], prefix_operators=[], qualifier=vd, selectors=[], type_arguments=None)], member=bufferPacket, postfix_operators=[], prefix_operators=[], qualifier=w, selectors=[], type_arguments=None), label=None), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getSizePendingFlush, postfix_operators=[], prefix_operators=[], qualifier=w, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=16384), operator=>), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=flush, postfix_operators=[], prefix_operators=[], qualifier=w, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=writtenPackets, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=vd)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=SpeexAudioData, sub_type=None))), label=None)
call[w.close, parameter[]]
assign[member[.w], literal[null]]
call[ogg.close, parameter[]]
assign[member[.ogg], literal[null]]
else begin[{]
None
end[}]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[close] operator[SEP] operator[SEP] Keyword[throws] identifier[IOException] {
Keyword[if] operator[SEP] identifier[r] operator[!=] Other[null] operator[SEP] {
identifier[r] operator[=] Other[null] operator[SEP] identifier[ogg] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP] identifier[ogg] operator[=] Other[null] operator[SEP]
}
Keyword[if] operator[SEP] identifier[w] operator[!=] Other[null] operator[SEP] {
identifier[w] operator[SEP] identifier[bufferPacket] operator[SEP] identifier[info] operator[SEP] identifier[write] operator[SEP] operator[SEP] , literal[boolean] operator[SEP] operator[SEP] identifier[w] operator[SEP] identifier[bufferPacket] operator[SEP] identifier[tags] operator[SEP] identifier[write] operator[SEP] operator[SEP] , literal[boolean] operator[SEP] operator[SEP] Keyword[long] identifier[lastGranule] operator[=] Other[0] operator[SEP] Keyword[for] operator[SEP] identifier[SpeexAudioData] identifier[vd] operator[:] identifier[writtenPackets] operator[SEP] {
Keyword[if] operator[SEP] identifier[vd] operator[SEP] identifier[getGranulePosition] operator[SEP] operator[SEP] operator[>=] Other[0] operator[&&] identifier[lastGranule] operator[!=] identifier[vd] operator[SEP] identifier[getGranulePosition] operator[SEP] operator[SEP] operator[SEP] {
identifier[w] operator[SEP] identifier[flush] operator[SEP] operator[SEP] operator[SEP] identifier[lastGranule] operator[=] identifier[vd] operator[SEP] identifier[getGranulePosition] operator[SEP] operator[SEP] operator[SEP] identifier[w] operator[SEP] identifier[setGranulePosition] operator[SEP] identifier[lastGranule] operator[SEP] operator[SEP]
}
identifier[w] operator[SEP] identifier[bufferPacket] operator[SEP] identifier[vd] operator[SEP] identifier[write] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[w] operator[SEP] identifier[getSizePendingFlush] operator[SEP] operator[SEP] operator[>] Other[16384] operator[SEP] {
identifier[w] operator[SEP] identifier[flush] operator[SEP] operator[SEP] operator[SEP]
}
}
identifier[w] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP] identifier[w] operator[=] Other[null] operator[SEP] identifier[ogg] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP] identifier[ogg] operator[=] Other[null] operator[SEP]
}
}
|
public SDVariable argmax(SDVariable in, int... dimensions) {
return argmax(null, in, false, dimensions);
} | class class_name[name] begin[{]
method[argmax, return_type[type[SDVariable]], modifier[public], parameter[in, dimensions]] begin[{]
return[call[.argmax, parameter[literal[null], member[.in], literal[false], member[.dimensions]]]]
end[}]
END[}] | Keyword[public] identifier[SDVariable] identifier[argmax] operator[SEP] identifier[SDVariable] identifier[in] , Keyword[int] operator[...] identifier[dimensions] operator[SEP] {
Keyword[return] identifier[argmax] operator[SEP] Other[null] , identifier[in] , literal[boolean] , identifier[dimensions] operator[SEP] operator[SEP]
}
|
public Observable<LogsInner> listLogsAsync(String resourceGroupName, String containerGroupName, String containerName) {
return listLogsWithServiceResponseAsync(resourceGroupName, containerGroupName, containerName).map(new Func1<ServiceResponse<LogsInner>, LogsInner>() {
@Override
public LogsInner call(ServiceResponse<LogsInner> response) {
return response.body();
}
});
} | class class_name[name] begin[{]
method[listLogsAsync, return_type[type[Observable]], modifier[public], parameter[resourceGroupName, containerGroupName, containerName]] begin[{]
return[call[.listLogsWithServiceResponseAsync, parameter[member[.resourceGroupName], member[.containerGroupName], member[.containerName]]]]
end[}]
END[}] | Keyword[public] identifier[Observable] operator[<] identifier[LogsInner] operator[>] identifier[listLogsAsync] operator[SEP] identifier[String] identifier[resourceGroupName] , identifier[String] identifier[containerGroupName] , identifier[String] identifier[containerName] operator[SEP] {
Keyword[return] identifier[listLogsWithServiceResponseAsync] operator[SEP] identifier[resourceGroupName] , identifier[containerGroupName] , identifier[containerName] operator[SEP] operator[SEP] identifier[map] operator[SEP] Keyword[new] identifier[Func1] operator[<] identifier[ServiceResponse] operator[<] identifier[LogsInner] operator[>] , identifier[LogsInner] operator[>] operator[SEP] operator[SEP] {
annotation[@] identifier[Override] Keyword[public] identifier[LogsInner] identifier[call] operator[SEP] identifier[ServiceResponse] operator[<] identifier[LogsInner] operator[>] identifier[response] operator[SEP] {
Keyword[return] identifier[response] operator[SEP] identifier[body] operator[SEP] operator[SEP] operator[SEP]
}
} operator[SEP] operator[SEP]
}
|
public void stop()
{
wsQuotaManagers.clear();
globalQuotaManager.unregisterRepositoryQuotaManager(rName);
repository.removeWorkspaceManagingListener(this);
pushTask.halt();
} | class class_name[name] begin[{]
method[stop, return_type[void], modifier[public], parameter[]] begin[{]
call[wsQuotaManagers.clear, parameter[]]
call[globalQuotaManager.unregisterRepositoryQuotaManager, parameter[member[.rName]]]
call[repository.removeWorkspaceManagingListener, parameter[THIS[]]]
call[pushTask.halt, parameter[]]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[stop] operator[SEP] operator[SEP] {
identifier[wsQuotaManagers] operator[SEP] identifier[clear] operator[SEP] operator[SEP] operator[SEP] identifier[globalQuotaManager] operator[SEP] identifier[unregisterRepositoryQuotaManager] operator[SEP] identifier[rName] operator[SEP] operator[SEP] identifier[repository] operator[SEP] identifier[removeWorkspaceManagingListener] operator[SEP] Keyword[this] operator[SEP] operator[SEP] identifier[pushTask] operator[SEP] identifier[halt] operator[SEP] operator[SEP] operator[SEP]
}
|
public static Color getColorProperty(String key, boolean required) {
Color value = null;
String redProperty = key + JavaPropertyConstants.PROPERTY_DIVIDER
+ JavaPropertyConstants.COLOR_RED;
String greenProperty = key + JavaPropertyConstants.PROPERTY_DIVIDER
+ JavaPropertyConstants.COLOR_GREEN;
String blueProperty = key + JavaPropertyConstants.PROPERTY_DIVIDER
+ JavaPropertyConstants.COLOR_BLUE;
String alphaProperty = key + JavaPropertyConstants.PROPERTY_DIVIDER
+ JavaPropertyConstants.COLOR_ALPHA;
Integer red = getIntegerProperty(redProperty, required);
Integer green = getIntegerProperty(greenProperty, required);
Integer blue = getIntegerProperty(blueProperty, required);
Integer alpha = getIntegerProperty(alphaProperty, required);
if (red != null && green != null && blue != null && alpha != null) {
value = new Color(red, green, blue, alpha);
}
return value;
} | class class_name[name] begin[{]
method[getColorProperty, return_type[type[Color]], modifier[public static], parameter[key, required]] begin[{]
local_variable[type[Color], value]
local_variable[type[String], redProperty]
local_variable[type[String], greenProperty]
local_variable[type[String], blueProperty]
local_variable[type[String], alphaProperty]
local_variable[type[Integer], red]
local_variable[type[Integer], green]
local_variable[type[Integer], blue]
local_variable[type[Integer], alpha]
if[binary_operation[binary_operation[binary_operation[binary_operation[member[.red], !=, literal[null]], &&, binary_operation[member[.green], !=, literal[null]]], &&, binary_operation[member[.blue], !=, literal[null]]], &&, binary_operation[member[.alpha], !=, literal[null]]]] begin[{]
assign[member[.value], ClassCreator(arguments=[MemberReference(member=red, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=green, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=blue, 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=Color, sub_type=None))]
else begin[{]
None
end[}]
return[member[.value]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[Color] identifier[getColorProperty] operator[SEP] identifier[String] identifier[key] , Keyword[boolean] identifier[required] operator[SEP] {
identifier[Color] identifier[value] operator[=] Other[null] operator[SEP] identifier[String] identifier[redProperty] operator[=] identifier[key] operator[+] identifier[JavaPropertyConstants] operator[SEP] identifier[PROPERTY_DIVIDER] operator[+] identifier[JavaPropertyConstants] operator[SEP] identifier[COLOR_RED] operator[SEP] identifier[String] identifier[greenProperty] operator[=] identifier[key] operator[+] identifier[JavaPropertyConstants] operator[SEP] identifier[PROPERTY_DIVIDER] operator[+] identifier[JavaPropertyConstants] operator[SEP] identifier[COLOR_GREEN] operator[SEP] identifier[String] identifier[blueProperty] operator[=] identifier[key] operator[+] identifier[JavaPropertyConstants] operator[SEP] identifier[PROPERTY_DIVIDER] operator[+] identifier[JavaPropertyConstants] operator[SEP] identifier[COLOR_BLUE] operator[SEP] identifier[String] identifier[alphaProperty] operator[=] identifier[key] operator[+] identifier[JavaPropertyConstants] operator[SEP] identifier[PROPERTY_DIVIDER] operator[+] identifier[JavaPropertyConstants] operator[SEP] identifier[COLOR_ALPHA] operator[SEP] identifier[Integer] identifier[red] operator[=] identifier[getIntegerProperty] operator[SEP] identifier[redProperty] , identifier[required] operator[SEP] operator[SEP] identifier[Integer] identifier[green] operator[=] identifier[getIntegerProperty] operator[SEP] identifier[greenProperty] , identifier[required] operator[SEP] operator[SEP] identifier[Integer] identifier[blue] operator[=] identifier[getIntegerProperty] operator[SEP] identifier[blueProperty] , identifier[required] operator[SEP] operator[SEP] identifier[Integer] identifier[alpha] operator[=] identifier[getIntegerProperty] operator[SEP] identifier[alphaProperty] , identifier[required] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[red] operator[!=] Other[null] operator[&&] identifier[green] operator[!=] Other[null] operator[&&] identifier[blue] operator[!=] Other[null] operator[&&] identifier[alpha] operator[!=] Other[null] operator[SEP] {
identifier[value] operator[=] Keyword[new] identifier[Color] operator[SEP] identifier[red] , identifier[green] , identifier[blue] , identifier[alpha] operator[SEP] operator[SEP]
}
Keyword[return] identifier[value] operator[SEP]
}
|
public static <T> T newInstance(String className, Class<?> parameterType,Object initarg)
throws SetupException
{
try
{
return newInstance(Class.forName(className),parameterType,initarg);
}
catch (ClassNotFoundException e)
{
throw new SetupException(e);
}
} | class class_name[name] begin[{]
method[newInstance, return_type[type[T]], modifier[public static], parameter[className, parameterType, initarg]] begin[{]
TryStatement(block=[ReturnStatement(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=className, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=forName, postfix_operators=[], prefix_operators=[], qualifier=Class, selectors=[], type_arguments=None), MemberReference(member=parameterType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=initarg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=newInstance, postfix_operators=[], prefix_operators=[], qualifier=, 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=SetupException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['ClassNotFoundException']))], finally_block=None, label=None, resources=None)
end[}]
END[}] | Keyword[public] Keyword[static] operator[<] identifier[T] operator[>] identifier[T] identifier[newInstance] operator[SEP] identifier[String] identifier[className] , identifier[Class] operator[<] operator[?] operator[>] identifier[parameterType] , identifier[Object] identifier[initarg] operator[SEP] Keyword[throws] identifier[SetupException] {
Keyword[try] {
Keyword[return] identifier[newInstance] operator[SEP] identifier[Class] operator[SEP] identifier[forName] operator[SEP] identifier[className] operator[SEP] , identifier[parameterType] , identifier[initarg] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[ClassNotFoundException] identifier[e] operator[SEP] {
Keyword[throw] Keyword[new] identifier[SetupException] operator[SEP] identifier[e] operator[SEP] operator[SEP]
}
}
|
@Override
public boolean preVisit(PlanNode node) {
// check if we have visited this node before. in non-tree graphs, this happens
if (this.vertices.containsKey(node) || this.chainedTasks.containsKey(node) || this.iterations.containsKey(node)) {
// return false to prevent further descend
return false;
}
// the vertex to be created for the current node
final JobVertex vertex;
try {
if (node instanceof SinkPlanNode) {
vertex = createDataSinkVertex((SinkPlanNode) node);
}
else if (node instanceof SourcePlanNode) {
vertex = createDataSourceVertex((SourcePlanNode) node);
}
else if (node instanceof BulkIterationPlanNode) {
BulkIterationPlanNode iterationNode = (BulkIterationPlanNode) node;
// for the bulk iteration, we skip creating anything for now. we create the graph
// for the step function in the post visit.
// check that the root of the step function has the same parallelism as the iteration.
// because the tail must have the same parallelism as the head, we can only merge the last
// operator with the tail, if they have the same parallelism. not merging is currently not
// implemented
PlanNode root = iterationNode.getRootOfStepFunction();
if (root.getParallelism() != node.getParallelism())
{
throw new CompilerException("Error: The final operator of the step " +
"function has a different parallelism than the iteration operator itself.");
}
IterationDescriptor descr = new IterationDescriptor(iterationNode, this.iterationIdEnumerator++);
this.iterations.put(iterationNode, descr);
vertex = null;
}
else if (node instanceof WorksetIterationPlanNode) {
WorksetIterationPlanNode iterationNode = (WorksetIterationPlanNode) node;
// we have the same constraints as for the bulk iteration
PlanNode nextWorkSet = iterationNode.getNextWorkSetPlanNode();
PlanNode solutionSetDelta = iterationNode.getSolutionSetDeltaPlanNode();
if (nextWorkSet.getParallelism() != node.getParallelism())
{
throw new CompilerException("It is currently not supported that the final operator of the step " +
"function has a different parallelism than the iteration operator itself.");
}
if (solutionSetDelta.getParallelism() != node.getParallelism())
{
throw new CompilerException("It is currently not supported that the final operator of the step " +
"function has a different parallelism than the iteration operator itself.");
}
IterationDescriptor descr = new IterationDescriptor(iterationNode, this.iterationIdEnumerator++);
this.iterations.put(iterationNode, descr);
vertex = null;
}
else if (node instanceof SingleInputPlanNode) {
vertex = createSingleInputVertex((SingleInputPlanNode) node);
}
else if (node instanceof DualInputPlanNode) {
vertex = createDualInputVertex((DualInputPlanNode) node);
}
else if (node instanceof NAryUnionPlanNode) {
// skip the union for now
vertex = null;
}
else if (node instanceof BulkPartialSolutionPlanNode) {
// create a head node (or not, if it is merged into its successor)
vertex = createBulkIterationHead((BulkPartialSolutionPlanNode) node);
}
else if (node instanceof SolutionSetPlanNode) {
// this represents an access into the solution set index.
// we do not create a vertex for the solution set here (we create the head at the workset place holder)
// we adjust the joins / cogroups that go into the solution set here
for (Channel c : node.getOutgoingChannels()) {
DualInputPlanNode target = (DualInputPlanNode) c.getTarget();
JobVertex accessingVertex = this.vertices.get(target);
TaskConfig conf = new TaskConfig(accessingVertex.getConfiguration());
int inputNum = c == target.getInput1() ? 0 : c == target.getInput2() ? 1 : -1;
// sanity checks
if (inputNum == -1) {
throw new CompilerException();
}
// adjust the driver
if (conf.getDriver().equals(JoinDriver.class)) {
conf.setDriver(inputNum == 0 ? JoinWithSolutionSetFirstDriver.class : JoinWithSolutionSetSecondDriver.class);
}
else if (conf.getDriver().equals(CoGroupDriver.class)) {
conf.setDriver(inputNum == 0 ? CoGroupWithSolutionSetFirstDriver.class : CoGroupWithSolutionSetSecondDriver.class);
}
else {
throw new CompilerException("Found join with solution set using incompatible operator (only Join/CoGroup are valid).");
}
}
// make sure we do not visit this node again. for that, we add a 'already seen' entry into one of the sets
this.chainedTasks.put(node, ALREADY_VISITED_PLACEHOLDER);
vertex = null;
}
else if (node instanceof WorksetPlanNode) {
// create the iteration head here
vertex = createWorksetIterationHead((WorksetPlanNode) node);
}
else {
throw new CompilerException("Unrecognized node type: " + node.getClass().getName());
}
}
catch (Exception e) {
throw new CompilerException("Error translating node '" + node + "': " + e.getMessage(), e);
}
// check if a vertex was created, or if it was chained or skipped
if (vertex != null) {
// set parallelism
int pd = node.getParallelism();
vertex.setParallelism(pd);
vertex.setMaxParallelism(pd);
vertex.setSlotSharingGroup(sharingGroup);
// check whether this vertex is part of an iteration step function
if (this.currentIteration != null) {
// check that the task has the same parallelism as the iteration as such
PlanNode iterationNode = (PlanNode) this.currentIteration;
if (iterationNode.getParallelism() < pd) {
throw new CompilerException("Error: All functions that are part of an iteration must have the same, or a lower, parallelism than the iteration operator.");
}
// store the id of the iterations the step functions participate in
IterationDescriptor descr = this.iterations.get(this.currentIteration);
new TaskConfig(vertex.getConfiguration()).setIterationId(descr.getId());
}
// store in the map
this.vertices.put(node, vertex);
}
// returning true causes deeper descend
return true;
} | class class_name[name] begin[{]
method[preVisit, return_type[type[boolean]], modifier[public], parameter[node]] begin[{]
if[binary_operation[binary_operation[THIS[member[None.vertices]call[None.containsKey, parameter[member[.node]]]], ||, THIS[member[None.chainedTasks]call[None.containsKey, parameter[member[.node]]]]], ||, THIS[member[None.iterations]call[None.containsKey, parameter[member[.node]]]]]] begin[{]
return[literal[false]]
else begin[{]
None
end[}]
local_variable[type[JobVertex], vertex]
TryStatement(block=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=node, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=SinkPlanNode, sub_type=None), operator=instanceof), else_statement=IfStatement(condition=BinaryOperation(operandl=MemberReference(member=node, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=SourcePlanNode, sub_type=None), operator=instanceof), else_statement=IfStatement(condition=BinaryOperation(operandl=MemberReference(member=node, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=BulkIterationPlanNode, sub_type=None), operator=instanceof), else_statement=IfStatement(condition=BinaryOperation(operandl=MemberReference(member=node, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=WorksetIterationPlanNode, sub_type=None), operator=instanceof), else_statement=IfStatement(condition=BinaryOperation(operandl=MemberReference(member=node, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=SingleInputPlanNode, sub_type=None), operator=instanceof), else_statement=IfStatement(condition=BinaryOperation(operandl=MemberReference(member=node, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=DualInputPlanNode, sub_type=None), operator=instanceof), else_statement=IfStatement(condition=BinaryOperation(operandl=MemberReference(member=node, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=NAryUnionPlanNode, sub_type=None), operator=instanceof), else_statement=IfStatement(condition=BinaryOperation(operandl=MemberReference(member=node, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=BulkPartialSolutionPlanNode, sub_type=None), operator=instanceof), else_statement=IfStatement(condition=BinaryOperation(operandl=MemberReference(member=node, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=SolutionSetPlanNode, sub_type=None), operator=instanceof), else_statement=IfStatement(condition=BinaryOperation(operandl=MemberReference(member=node, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=WorksetPlanNode, sub_type=None), operator=instanceof), else_statement=BlockStatement(label=None, statements=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unrecognized node type: "), operandr=MethodInvocation(arguments=[], member=getClass, postfix_operators=[], prefix_operators=[], qualifier=node, selectors=[MethodInvocation(arguments=[], member=getName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=CompilerException, sub_type=None)), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=vertex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[Cast(expression=MemberReference(member=node, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=WorksetPlanNode, sub_type=None))], member=createWorksetIterationHead, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MethodInvocation(arguments=[], member=getTarget, postfix_operators=[], prefix_operators=[], qualifier=c, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=DualInputPlanNode, sub_type=None)), name=target)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=DualInputPlanNode, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=vertices, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[MemberReference(member=target, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), name=accessingVertex)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=JobVertex, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MethodInvocation(arguments=[], member=getConfiguration, postfix_operators=[], prefix_operators=[], qualifier=accessingVertex, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=TaskConfig, sub_type=None)), name=conf)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=TaskConfig, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=getInput1, postfix_operators=[], prefix_operators=[], qualifier=target, selectors=[], type_arguments=None), operator===), if_false=TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=getInput2, postfix_operators=[], prefix_operators=[], qualifier=target, selectors=[], type_arguments=None), operator===), if_false=Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=1), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)), name=inputNum)], modifiers=set(), type=BasicType(dimensions=[], name=int)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=inputNum, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=1), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ThrowStatement(expression=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=CompilerException, sub_type=None)), label=None)])), IfStatement(condition=MethodInvocation(arguments=[], member=getDriver, postfix_operators=[], prefix_operators=[], qualifier=conf, selectors=[MethodInvocation(arguments=[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=JoinDriver, sub_type=None))], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), else_statement=IfStatement(condition=MethodInvocation(arguments=[], member=getDriver, postfix_operators=[], prefix_operators=[], qualifier=conf, selectors=[MethodInvocation(arguments=[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=CoGroupDriver, sub_type=None))], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), else_statement=BlockStatement(label=None, statements=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Found join with solution set using incompatible operator (only Join/CoGroup are valid).")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=CompilerException, sub_type=None)), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=inputNum, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator===), if_false=ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=CoGroupWithSolutionSetSecondDriver, sub_type=None)), if_true=ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=CoGroupWithSolutionSetFirstDriver, sub_type=None)))], member=setDriver, postfix_operators=[], prefix_operators=[], qualifier=conf, selectors=[], type_arguments=None), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=inputNum, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator===), if_false=ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=JoinWithSolutionSetSecondDriver, sub_type=None)), if_true=ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=JoinWithSolutionSetFirstDriver, sub_type=None)))], member=setDriver, postfix_operators=[], prefix_operators=[], qualifier=conf, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getOutgoingChannels, postfix_operators=[], prefix_operators=[], qualifier=node, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=c)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Channel, sub_type=None))), label=None), StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=chainedTasks, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[MemberReference(member=node, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=ALREADY_VISITED_PLACEHOLDER, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=put, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=vertex, 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=Assignment(expressionl=MemberReference(member=vertex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[Cast(expression=MemberReference(member=node, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=BulkPartialSolutionPlanNode, sub_type=None))], member=createBulkIterationHead, 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=vertex, 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=Assignment(expressionl=MemberReference(member=vertex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[Cast(expression=MemberReference(member=node, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=DualInputPlanNode, sub_type=None))], member=createDualInputVertex, 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=vertex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[Cast(expression=MemberReference(member=node, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=SingleInputPlanNode, sub_type=None))], member=createSingleInputVertex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MemberReference(member=node, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=WorksetIterationPlanNode, sub_type=None)), name=iterationNode)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=WorksetIterationPlanNode, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getNextWorkSetPlanNode, postfix_operators=[], prefix_operators=[], qualifier=iterationNode, selectors=[], type_arguments=None), name=nextWorkSet)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=PlanNode, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getSolutionSetDeltaPlanNode, postfix_operators=[], prefix_operators=[], qualifier=iterationNode, selectors=[], type_arguments=None), name=solutionSetDelta)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=PlanNode, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getParallelism, postfix_operators=[], prefix_operators=[], qualifier=nextWorkSet, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[], member=getParallelism, postfix_operators=[], prefix_operators=[], qualifier=node, selectors=[], type_arguments=None), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="It is currently not supported that the final operator of the step "), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="function has a different parallelism than the iteration operator itself."), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=CompilerException, sub_type=None)), label=None)])), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getParallelism, postfix_operators=[], prefix_operators=[], qualifier=solutionSetDelta, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[], member=getParallelism, postfix_operators=[], prefix_operators=[], qualifier=node, selectors=[], type_arguments=None), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="It is currently not supported that the final operator of the step "), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="function has a different parallelism than the iteration operator itself."), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=CompilerException, sub_type=None)), label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MemberReference(member=iterationNode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), This(postfix_operators=['++'], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=iterationIdEnumerator, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IterationDescriptor, sub_type=None)), name=descr)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=IterationDescriptor, sub_type=None)), StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=iterations, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[MemberReference(member=iterationNode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=descr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=put, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=vertex, 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=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MemberReference(member=node, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=BulkIterationPlanNode, sub_type=None)), name=iterationNode)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=BulkIterationPlanNode, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getRootOfStepFunction, postfix_operators=[], prefix_operators=[], qualifier=iterationNode, selectors=[], type_arguments=None), name=root)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=PlanNode, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getParallelism, postfix_operators=[], prefix_operators=[], qualifier=root, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[], member=getParallelism, postfix_operators=[], prefix_operators=[], qualifier=node, selectors=[], type_arguments=None), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Error: The final operator of the step "), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="function has a different parallelism than the iteration operator itself."), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=CompilerException, sub_type=None)), label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MemberReference(member=iterationNode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), This(postfix_operators=['++'], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=iterationIdEnumerator, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IterationDescriptor, sub_type=None)), name=descr)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=IterationDescriptor, sub_type=None)), StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=iterations, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[MemberReference(member=iterationNode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=descr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=put, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=vertex, 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=Assignment(expressionl=MemberReference(member=vertex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[Cast(expression=MemberReference(member=node, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=SourcePlanNode, sub_type=None))], member=createDataSourceVertex, 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=vertex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[Cast(expression=MemberReference(member=node, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=SinkPlanNode, sub_type=None))], member=createDataSinkVertex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None)]))], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Error translating node '"), operandr=MemberReference(member=node, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="': "), operator=+), 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=CompilerException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None)
if[binary_operation[member[.vertex], !=, literal[null]]] begin[{]
local_variable[type[int], pd]
call[vertex.setParallelism, parameter[member[.pd]]]
call[vertex.setMaxParallelism, parameter[member[.pd]]]
call[vertex.setSlotSharingGroup, parameter[member[.sharingGroup]]]
if[binary_operation[THIS[member[None.currentIteration]], !=, literal[null]]] begin[{]
local_variable[type[PlanNode], iterationNode]
if[binary_operation[call[iterationNode.getParallelism, parameter[]], <, member[.pd]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Error: All functions that are part of an iteration must have the same, or a lower, parallelism than the iteration operator.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=CompilerException, sub_type=None)), label=None)
else begin[{]
None
end[}]
local_variable[type[IterationDescriptor], descr]
ClassCreator(arguments=[MethodInvocation(arguments=[], member=getConfiguration, postfix_operators=[], prefix_operators=[], qualifier=vertex, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getId, postfix_operators=[], prefix_operators=[], qualifier=descr, selectors=[], type_arguments=None)], member=setIterationId, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=TaskConfig, sub_type=None))
else begin[{]
None
end[}]
THIS[member[None.vertices]call[None.put, parameter[member[.node], member[.vertex]]]]
else begin[{]
None
end[}]
return[literal[true]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] Keyword[boolean] identifier[preVisit] operator[SEP] identifier[PlanNode] identifier[node] operator[SEP] {
Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[vertices] operator[SEP] identifier[containsKey] operator[SEP] identifier[node] operator[SEP] operator[||] Keyword[this] operator[SEP] identifier[chainedTasks] operator[SEP] identifier[containsKey] operator[SEP] identifier[node] operator[SEP] operator[||] Keyword[this] operator[SEP] identifier[iterations] operator[SEP] identifier[containsKey] operator[SEP] identifier[node] operator[SEP] operator[SEP] {
Keyword[return] literal[boolean] operator[SEP]
}
Keyword[final] identifier[JobVertex] identifier[vertex] operator[SEP] Keyword[try] {
Keyword[if] operator[SEP] identifier[node] Keyword[instanceof] identifier[SinkPlanNode] operator[SEP] {
identifier[vertex] operator[=] identifier[createDataSinkVertex] operator[SEP] operator[SEP] identifier[SinkPlanNode] operator[SEP] identifier[node] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[node] Keyword[instanceof] identifier[SourcePlanNode] operator[SEP] {
identifier[vertex] operator[=] identifier[createDataSourceVertex] operator[SEP] operator[SEP] identifier[SourcePlanNode] operator[SEP] identifier[node] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[node] Keyword[instanceof] identifier[BulkIterationPlanNode] operator[SEP] {
identifier[BulkIterationPlanNode] identifier[iterationNode] operator[=] operator[SEP] identifier[BulkIterationPlanNode] operator[SEP] identifier[node] operator[SEP] identifier[PlanNode] identifier[root] operator[=] identifier[iterationNode] operator[SEP] identifier[getRootOfStepFunction] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[root] operator[SEP] identifier[getParallelism] operator[SEP] operator[SEP] operator[!=] identifier[node] operator[SEP] identifier[getParallelism] operator[SEP] operator[SEP] operator[SEP] {
Keyword[throw] Keyword[new] identifier[CompilerException] operator[SEP] literal[String] operator[+] literal[String] operator[SEP] operator[SEP]
}
identifier[IterationDescriptor] identifier[descr] operator[=] Keyword[new] identifier[IterationDescriptor] operator[SEP] identifier[iterationNode] , Keyword[this] operator[SEP] identifier[iterationIdEnumerator] operator[++] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[iterations] operator[SEP] identifier[put] operator[SEP] identifier[iterationNode] , identifier[descr] operator[SEP] operator[SEP] identifier[vertex] operator[=] Other[null] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[node] Keyword[instanceof] identifier[WorksetIterationPlanNode] operator[SEP] {
identifier[WorksetIterationPlanNode] identifier[iterationNode] operator[=] operator[SEP] identifier[WorksetIterationPlanNode] operator[SEP] identifier[node] operator[SEP] identifier[PlanNode] identifier[nextWorkSet] operator[=] identifier[iterationNode] operator[SEP] identifier[getNextWorkSetPlanNode] operator[SEP] operator[SEP] operator[SEP] identifier[PlanNode] identifier[solutionSetDelta] operator[=] identifier[iterationNode] operator[SEP] identifier[getSolutionSetDeltaPlanNode] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[nextWorkSet] operator[SEP] identifier[getParallelism] operator[SEP] operator[SEP] operator[!=] identifier[node] operator[SEP] identifier[getParallelism] operator[SEP] operator[SEP] operator[SEP] {
Keyword[throw] Keyword[new] identifier[CompilerException] operator[SEP] literal[String] operator[+] literal[String] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[solutionSetDelta] operator[SEP] identifier[getParallelism] operator[SEP] operator[SEP] operator[!=] identifier[node] operator[SEP] identifier[getParallelism] operator[SEP] operator[SEP] operator[SEP] {
Keyword[throw] Keyword[new] identifier[CompilerException] operator[SEP] literal[String] operator[+] literal[String] operator[SEP] operator[SEP]
}
identifier[IterationDescriptor] identifier[descr] operator[=] Keyword[new] identifier[IterationDescriptor] operator[SEP] identifier[iterationNode] , Keyword[this] operator[SEP] identifier[iterationIdEnumerator] operator[++] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[iterations] operator[SEP] identifier[put] operator[SEP] identifier[iterationNode] , identifier[descr] operator[SEP] operator[SEP] identifier[vertex] operator[=] Other[null] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[node] Keyword[instanceof] identifier[SingleInputPlanNode] operator[SEP] {
identifier[vertex] operator[=] identifier[createSingleInputVertex] operator[SEP] operator[SEP] identifier[SingleInputPlanNode] operator[SEP] identifier[node] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[node] Keyword[instanceof] identifier[DualInputPlanNode] operator[SEP] {
identifier[vertex] operator[=] identifier[createDualInputVertex] operator[SEP] operator[SEP] identifier[DualInputPlanNode] operator[SEP] identifier[node] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[node] Keyword[instanceof] identifier[NAryUnionPlanNode] operator[SEP] {
identifier[vertex] operator[=] Other[null] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[node] Keyword[instanceof] identifier[BulkPartialSolutionPlanNode] operator[SEP] {
identifier[vertex] operator[=] identifier[createBulkIterationHead] operator[SEP] operator[SEP] identifier[BulkPartialSolutionPlanNode] operator[SEP] identifier[node] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[node] Keyword[instanceof] identifier[SolutionSetPlanNode] operator[SEP] {
Keyword[for] operator[SEP] identifier[Channel] identifier[c] operator[:] identifier[node] operator[SEP] identifier[getOutgoingChannels] operator[SEP] operator[SEP] operator[SEP] {
identifier[DualInputPlanNode] identifier[target] operator[=] operator[SEP] identifier[DualInputPlanNode] operator[SEP] identifier[c] operator[SEP] identifier[getTarget] operator[SEP] operator[SEP] operator[SEP] identifier[JobVertex] identifier[accessingVertex] operator[=] Keyword[this] operator[SEP] identifier[vertices] operator[SEP] identifier[get] operator[SEP] identifier[target] operator[SEP] operator[SEP] identifier[TaskConfig] identifier[conf] operator[=] Keyword[new] identifier[TaskConfig] operator[SEP] identifier[accessingVertex] operator[SEP] identifier[getConfiguration] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[inputNum] operator[=] identifier[c] operator[==] identifier[target] operator[SEP] identifier[getInput1] operator[SEP] operator[SEP] operator[?] Other[0] operator[:] identifier[c] operator[==] identifier[target] operator[SEP] identifier[getInput2] operator[SEP] operator[SEP] operator[?] Other[1] operator[:] operator[-] Other[1] operator[SEP] Keyword[if] operator[SEP] identifier[inputNum] operator[==] operator[-] Other[1] operator[SEP] {
Keyword[throw] Keyword[new] identifier[CompilerException] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[conf] operator[SEP] identifier[getDriver] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[JoinDriver] operator[SEP] Keyword[class] operator[SEP] operator[SEP] {
identifier[conf] operator[SEP] identifier[setDriver] operator[SEP] identifier[inputNum] operator[==] Other[0] operator[?] identifier[JoinWithSolutionSetFirstDriver] operator[SEP] Keyword[class] operator[:] identifier[JoinWithSolutionSetSecondDriver] operator[SEP] Keyword[class] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[conf] operator[SEP] identifier[getDriver] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[CoGroupDriver] operator[SEP] Keyword[class] operator[SEP] operator[SEP] {
identifier[conf] operator[SEP] identifier[setDriver] operator[SEP] identifier[inputNum] operator[==] Other[0] operator[?] identifier[CoGroupWithSolutionSetFirstDriver] operator[SEP] Keyword[class] operator[:] identifier[CoGroupWithSolutionSetSecondDriver] operator[SEP] Keyword[class] operator[SEP] operator[SEP]
}
Keyword[else] {
Keyword[throw] Keyword[new] identifier[CompilerException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
}
Keyword[this] operator[SEP] identifier[chainedTasks] operator[SEP] identifier[put] operator[SEP] identifier[node] , identifier[ALREADY_VISITED_PLACEHOLDER] operator[SEP] operator[SEP] identifier[vertex] operator[=] Other[null] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[node] Keyword[instanceof] identifier[WorksetPlanNode] operator[SEP] {
identifier[vertex] operator[=] identifier[createWorksetIterationHead] operator[SEP] operator[SEP] identifier[WorksetPlanNode] operator[SEP] identifier[node] operator[SEP] operator[SEP]
}
Keyword[else] {
Keyword[throw] Keyword[new] identifier[CompilerException] operator[SEP] literal[String] operator[+] identifier[node] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] {
Keyword[throw] Keyword[new] identifier[CompilerException] operator[SEP] literal[String] operator[+] identifier[node] operator[+] literal[String] operator[+] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[vertex] operator[!=] Other[null] operator[SEP] {
Keyword[int] identifier[pd] operator[=] identifier[node] operator[SEP] identifier[getParallelism] operator[SEP] operator[SEP] operator[SEP] identifier[vertex] operator[SEP] identifier[setParallelism] operator[SEP] identifier[pd] operator[SEP] operator[SEP] identifier[vertex] operator[SEP] identifier[setMaxParallelism] operator[SEP] identifier[pd] operator[SEP] operator[SEP] identifier[vertex] operator[SEP] identifier[setSlotSharingGroup] operator[SEP] identifier[sharingGroup] operator[SEP] operator[SEP] Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[currentIteration] operator[!=] Other[null] operator[SEP] {
identifier[PlanNode] identifier[iterationNode] operator[=] operator[SEP] identifier[PlanNode] operator[SEP] Keyword[this] operator[SEP] identifier[currentIteration] operator[SEP] Keyword[if] operator[SEP] identifier[iterationNode] operator[SEP] identifier[getParallelism] operator[SEP] operator[SEP] operator[<] identifier[pd] operator[SEP] {
Keyword[throw] Keyword[new] identifier[CompilerException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
identifier[IterationDescriptor] identifier[descr] operator[=] Keyword[this] operator[SEP] identifier[iterations] operator[SEP] identifier[get] operator[SEP] Keyword[this] operator[SEP] identifier[currentIteration] operator[SEP] operator[SEP] Keyword[new] identifier[TaskConfig] operator[SEP] identifier[vertex] operator[SEP] identifier[getConfiguration] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[setIterationId] operator[SEP] identifier[descr] operator[SEP] identifier[getId] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[this] operator[SEP] identifier[vertices] operator[SEP] identifier[put] operator[SEP] identifier[node] , identifier[vertex] operator[SEP] operator[SEP]
}
Keyword[return] literal[boolean] operator[SEP]
}
|
public void marshall(DeleteUserDefinedFunctionRequest deleteUserDefinedFunctionRequest, ProtocolMarshaller protocolMarshaller) {
if (deleteUserDefinedFunctionRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(deleteUserDefinedFunctionRequest.getCatalogId(), CATALOGID_BINDING);
protocolMarshaller.marshall(deleteUserDefinedFunctionRequest.getDatabaseName(), DATABASENAME_BINDING);
protocolMarshaller.marshall(deleteUserDefinedFunctionRequest.getFunctionName(), FUNCTIONNAME_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[deleteUserDefinedFunctionRequest, protocolMarshaller]] begin[{]
if[binary_operation[member[.deleteUserDefinedFunctionRequest], ==, 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=getCatalogId, postfix_operators=[], prefix_operators=[], qualifier=deleteUserDefinedFunctionRequest, selectors=[], type_arguments=None), MemberReference(member=CATALOGID_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=getDatabaseName, postfix_operators=[], prefix_operators=[], qualifier=deleteUserDefinedFunctionRequest, selectors=[], type_arguments=None), MemberReference(member=DATABASENAME_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=getFunctionName, postfix_operators=[], prefix_operators=[], qualifier=deleteUserDefinedFunctionRequest, selectors=[], type_arguments=None), MemberReference(member=FUNCTIONNAME_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[DeleteUserDefinedFunctionRequest] identifier[deleteUserDefinedFunctionRequest] , identifier[ProtocolMarshaller] identifier[protocolMarshaller] operator[SEP] {
Keyword[if] operator[SEP] identifier[deleteUserDefinedFunctionRequest] 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[deleteUserDefinedFunctionRequest] operator[SEP] identifier[getCatalogId] operator[SEP] operator[SEP] , identifier[CATALOGID_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[deleteUserDefinedFunctionRequest] operator[SEP] identifier[getDatabaseName] operator[SEP] operator[SEP] , identifier[DATABASENAME_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[deleteUserDefinedFunctionRequest] operator[SEP] identifier[getFunctionName] operator[SEP] operator[SEP] , identifier[FUNCTIONNAME_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]
}
}
|
protected Catalog newCatalog() {
String catalogClass = this.getClass().getName();
try {
Catalog c = (Catalog) (Class.forName(catalogClass).newInstance());
c.setCatalogManager(catalogManager);
copyReaders(c);
return c;
} catch (ClassNotFoundException cnfe) {
catalogManager.debug.message(1, "Class Not Found Exception: " + catalogClass);
} catch (IllegalAccessException iae) {
catalogManager.debug.message(1, "Illegal Access Exception: " + catalogClass);
} catch (InstantiationException ie) {
catalogManager.debug.message(1, "Instantiation Exception: " + catalogClass);
} catch (ClassCastException cce) {
catalogManager.debug.message(1, "Class Cast Exception: " + catalogClass);
} catch (Exception e) {
catalogManager.debug.message(1, "Other Exception: " + catalogClass);
}
Catalog c = new Catalog();
c.setCatalogManager(catalogManager);
copyReaders(c);
return c;
} | class class_name[name] begin[{]
method[newCatalog, return_type[type[Catalog]], modifier[protected], parameter[]] begin[{]
local_variable[type[String], catalogClass]
TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MethodInvocation(arguments=[MemberReference(member=catalogClass, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=forName, postfix_operators=[], prefix_operators=[], qualifier=Class, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=Catalog, sub_type=None)), name=c)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Catalog, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=catalogManager, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setCatalogManager, postfix_operators=[], prefix_operators=[], qualifier=c, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=copyReaders, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Class Not Found Exception: "), operandr=MemberReference(member=catalogClass, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=message, postfix_operators=[], prefix_operators=[], qualifier=catalogManager.debug, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=cnfe, types=['ClassNotFoundException'])), CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Illegal Access Exception: "), operandr=MemberReference(member=catalogClass, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=message, postfix_operators=[], prefix_operators=[], qualifier=catalogManager.debug, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=iae, types=['IllegalAccessException'])), CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Instantiation Exception: "), operandr=MemberReference(member=catalogClass, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=message, postfix_operators=[], prefix_operators=[], qualifier=catalogManager.debug, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ie, types=['InstantiationException'])), CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Class Cast Exception: "), operandr=MemberReference(member=catalogClass, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=message, postfix_operators=[], prefix_operators=[], qualifier=catalogManager.debug, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=cce, types=['ClassCastException'])), CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Other Exception: "), operandr=MemberReference(member=catalogClass, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=message, postfix_operators=[], prefix_operators=[], qualifier=catalogManager.debug, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None)
local_variable[type[Catalog], c]
call[c.setCatalogManager, parameter[member[.catalogManager]]]
call[.copyReaders, parameter[member[.c]]]
return[member[.c]]
end[}]
END[}] | Keyword[protected] identifier[Catalog] identifier[newCatalog] operator[SEP] operator[SEP] {
identifier[String] identifier[catalogClass] operator[=] Keyword[this] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] Keyword[try] {
identifier[Catalog] identifier[c] operator[=] operator[SEP] identifier[Catalog] operator[SEP] operator[SEP] identifier[Class] operator[SEP] identifier[forName] operator[SEP] identifier[catalogClass] operator[SEP] operator[SEP] identifier[newInstance] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[c] operator[SEP] identifier[setCatalogManager] operator[SEP] identifier[catalogManager] operator[SEP] operator[SEP] identifier[copyReaders] operator[SEP] identifier[c] operator[SEP] operator[SEP] Keyword[return] identifier[c] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[ClassNotFoundException] identifier[cnfe] operator[SEP] {
identifier[catalogManager] operator[SEP] identifier[debug] operator[SEP] identifier[message] operator[SEP] Other[1] , literal[String] operator[+] identifier[catalogClass] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[IllegalAccessException] identifier[iae] operator[SEP] {
identifier[catalogManager] operator[SEP] identifier[debug] operator[SEP] identifier[message] operator[SEP] Other[1] , literal[String] operator[+] identifier[catalogClass] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[InstantiationException] identifier[ie] operator[SEP] {
identifier[catalogManager] operator[SEP] identifier[debug] operator[SEP] identifier[message] operator[SEP] Other[1] , literal[String] operator[+] identifier[catalogClass] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[ClassCastException] identifier[cce] operator[SEP] {
identifier[catalogManager] operator[SEP] identifier[debug] operator[SEP] identifier[message] operator[SEP] Other[1] , literal[String] operator[+] identifier[catalogClass] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] {
identifier[catalogManager] operator[SEP] identifier[debug] operator[SEP] identifier[message] operator[SEP] Other[1] , literal[String] operator[+] identifier[catalogClass] operator[SEP] operator[SEP]
}
identifier[Catalog] identifier[c] operator[=] Keyword[new] identifier[Catalog] operator[SEP] operator[SEP] operator[SEP] identifier[c] operator[SEP] identifier[setCatalogManager] operator[SEP] identifier[catalogManager] operator[SEP] operator[SEP] identifier[copyReaders] operator[SEP] identifier[c] operator[SEP] operator[SEP] Keyword[return] identifier[c] operator[SEP]
}
|
public List<String> getRootChildren() {
List<String> children = new ArrayList<String>();
try {
children = zk.getChildren("/", false);
} catch (KeeperException e) {
LOGGER.error(e.toString());
} catch (InterruptedException e) {
LOGGER.error(e.toString());
}
return children;
} | class class_name[name] begin[{]
method[getRootChildren, return_type[type[List]], modifier[public], parameter[]] begin[{]
local_variable[type[List], children]
TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=children, 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=false)], member=getChildren, postfix_operators=[], prefix_operators=[], qualifier=zk, selectors=[], type_arguments=None)), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None)], member=error, postfix_operators=[], prefix_operators=[], qualifier=LOGGER, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['KeeperException'])), CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None)], member=error, postfix_operators=[], prefix_operators=[], qualifier=LOGGER, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['InterruptedException']))], finally_block=None, label=None, resources=None)
return[member[.children]]
end[}]
END[}] | Keyword[public] identifier[List] operator[<] identifier[String] operator[>] identifier[getRootChildren] operator[SEP] operator[SEP] {
identifier[List] operator[<] identifier[String] operator[>] identifier[children] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[String] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[try] {
identifier[children] operator[=] identifier[zk] operator[SEP] identifier[getChildren] operator[SEP] literal[String] , literal[boolean] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[KeeperException] identifier[e] operator[SEP] {
identifier[LOGGER] operator[SEP] identifier[error] operator[SEP] identifier[e] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[InterruptedException] identifier[e] operator[SEP] {
identifier[LOGGER] operator[SEP] identifier[error] operator[SEP] identifier[e] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] identifier[children] operator[SEP]
}
|
public static String checkNotEmpty(String arg, @Nullable Object errorMessage) {
boolean empty = Strings.isNullOrEmpty(arg) || CharMatcher.whitespace().matchesAllOf(arg);
checkArgument(!empty, errorMessage);
return arg;
} | class class_name[name] begin[{]
method[checkNotEmpty, return_type[type[String]], modifier[public static], parameter[arg, errorMessage]] begin[{]
local_variable[type[boolean], empty]
call[.checkArgument, parameter[member[.empty], member[.errorMessage]]]
return[member[.arg]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[String] identifier[checkNotEmpty] operator[SEP] identifier[String] identifier[arg] , annotation[@] identifier[Nullable] identifier[Object] identifier[errorMessage] operator[SEP] {
Keyword[boolean] identifier[empty] operator[=] identifier[Strings] operator[SEP] identifier[isNullOrEmpty] operator[SEP] identifier[arg] operator[SEP] operator[||] identifier[CharMatcher] operator[SEP] identifier[whitespace] operator[SEP] operator[SEP] operator[SEP] identifier[matchesAllOf] operator[SEP] identifier[arg] operator[SEP] operator[SEP] identifier[checkArgument] operator[SEP] operator[!] identifier[empty] , identifier[errorMessage] operator[SEP] operator[SEP] Keyword[return] identifier[arg] operator[SEP]
}
|
public static Boolean getBoolean(Config config, String path) {
try {
return config.getBoolean(path) ? Boolean.TRUE : Boolean.FALSE;
} catch (ConfigException.Missing | ConfigException.WrongType e) {
if (e instanceof ConfigException.WrongType) {
LOGGER.warn(e.getMessage(), e);
}
return null;
}
} | class class_name[name] begin[{]
method[getBoolean, return_type[type[Boolean]], modifier[public static], parameter[config, path]] begin[{]
TryStatement(block=[ReturnStatement(expression=TernaryExpression(condition=MethodInvocation(arguments=[MemberReference(member=path, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getBoolean, postfix_operators=[], prefix_operators=[], qualifier=config, selectors=[], type_arguments=None), if_false=MemberReference(member=FALSE, postfix_operators=[], prefix_operators=[], qualifier=Boolean, selectors=[]), if_true=MemberReference(member=TRUE, postfix_operators=[], prefix_operators=[], qualifier=Boolean, selectors=[])), label=None)], catches=[CatchClause(block=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=ConfigException, sub_type=ReferenceType(arguments=None, dimensions=None, name=WrongType, sub_type=None)), operator=instanceof), 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=warn, postfix_operators=[], prefix_operators=[], qualifier=LOGGER, selectors=[], type_arguments=None), label=None)])), ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['ConfigException.Missing', 'ConfigException.WrongType']))], finally_block=None, label=None, resources=None)
end[}]
END[}] | Keyword[public] Keyword[static] identifier[Boolean] identifier[getBoolean] operator[SEP] identifier[Config] identifier[config] , identifier[String] identifier[path] operator[SEP] {
Keyword[try] {
Keyword[return] identifier[config] operator[SEP] identifier[getBoolean] operator[SEP] identifier[path] operator[SEP] operator[?] identifier[Boolean] operator[SEP] identifier[TRUE] operator[:] identifier[Boolean] operator[SEP] identifier[FALSE] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[ConfigException] operator[SEP] identifier[Missing] operator[|] identifier[ConfigException] operator[SEP] identifier[WrongType] identifier[e] operator[SEP] {
Keyword[if] operator[SEP] identifier[e] Keyword[instanceof] identifier[ConfigException] operator[SEP] identifier[WrongType] operator[SEP] {
identifier[LOGGER] operator[SEP] identifier[warn] operator[SEP] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP]
}
Keyword[return] Other[null] operator[SEP]
}
}
|
@Override
public CommerceAddress fetchByCommerceRegionId_First(
long commerceRegionId,
OrderByComparator<CommerceAddress> orderByComparator) {
List<CommerceAddress> list = findByCommerceRegionId(commerceRegionId,
0, 1, orderByComparator);
if (!list.isEmpty()) {
return list.get(0);
}
return null;
} | class class_name[name] begin[{]
method[fetchByCommerceRegionId_First, return_type[type[CommerceAddress]], modifier[public], parameter[commerceRegionId, orderByComparator]] begin[{]
local_variable[type[List], list]
if[call[list.isEmpty, parameter[]]] begin[{]
return[call[list.get, parameter[literal[0]]]]
else begin[{]
None
end[}]
return[literal[null]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] identifier[CommerceAddress] identifier[fetchByCommerceRegionId_First] operator[SEP] Keyword[long] identifier[commerceRegionId] , identifier[OrderByComparator] operator[<] identifier[CommerceAddress] operator[>] identifier[orderByComparator] operator[SEP] {
identifier[List] operator[<] identifier[CommerceAddress] operator[>] identifier[list] operator[=] identifier[findByCommerceRegionId] operator[SEP] identifier[commerceRegionId] , Other[0] , Other[1] , identifier[orderByComparator] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[list] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] {
Keyword[return] identifier[list] operator[SEP] identifier[get] operator[SEP] Other[0] operator[SEP] operator[SEP]
}
Keyword[return] Other[null] operator[SEP]
}
|
@Pure
public static <S> S getSreSpecificData(SRESpecificDataContainer container, Class<S> type) {
assert container != null;
return container.$getSreSpecificData(type);
} | class class_name[name] begin[{]
method[getSreSpecificData, return_type[type[S]], modifier[public static], parameter[container, type]] begin[{]
AssertStatement(condition=BinaryOperation(operandl=MemberReference(member=container, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), label=None, value=None)
return[call[container.$getSreSpecificData, parameter[member[.type]]]]
end[}]
END[}] | annotation[@] identifier[Pure] Keyword[public] Keyword[static] operator[<] identifier[S] operator[>] identifier[S] identifier[getSreSpecificData] operator[SEP] identifier[SRESpecificDataContainer] identifier[container] , identifier[Class] operator[<] identifier[S] operator[>] identifier[type] operator[SEP] {
Keyword[assert] identifier[container] operator[!=] Other[null] operator[SEP] Keyword[return] identifier[container] operator[SEP] identifier[$getSreSpecificData] operator[SEP] identifier[type] operator[SEP] operator[SEP]
}
|
public static String mapToPtPath(final String aID) {
Objects.requireNonNull(aID);
final String encodedID = encodeID(aID);
final List<String> shorties = new ArrayList<>();
int start = 0;
while (start < encodedID.length()) {
int end = start + myShortyLength;
if (end > encodedID.length()) {
end = encodedID.length();
}
shorties.add(encodedID.substring(start, end));
start = end;
}
return concat(shorties.toArray(new String[0]));
} | class class_name[name] begin[{]
method[mapToPtPath, return_type[type[String]], modifier[public static], parameter[aID]] begin[{]
call[Objects.requireNonNull, parameter[member[.aID]]]
local_variable[type[String], encodedID]
local_variable[type[List], shorties]
local_variable[type[int], start]
while[binary_operation[member[.start], <, call[encodedID.length, parameter[]]]] begin[{]
local_variable[type[int], end]
if[binary_operation[member[.end], >, call[encodedID.length, parameter[]]]] begin[{]
assign[member[.end], call[encodedID.length, parameter[]]]
else begin[{]
None
end[}]
call[shorties.add, parameter[call[encodedID.substring, parameter[member[.start], member[.end]]]]]
assign[member[.start], member[.end]]
end[}]
return[call[.concat, parameter[call[shorties.toArray, parameter[ArrayCreator(dimensions=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=String, sub_type=None))]]]]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[String] identifier[mapToPtPath] operator[SEP] Keyword[final] identifier[String] identifier[aID] operator[SEP] {
identifier[Objects] operator[SEP] identifier[requireNonNull] operator[SEP] identifier[aID] operator[SEP] operator[SEP] Keyword[final] identifier[String] identifier[encodedID] operator[=] identifier[encodeID] operator[SEP] identifier[aID] operator[SEP] operator[SEP] Keyword[final] identifier[List] operator[<] identifier[String] operator[>] identifier[shorties] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[start] operator[=] Other[0] operator[SEP] Keyword[while] operator[SEP] identifier[start] operator[<] identifier[encodedID] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] {
Keyword[int] identifier[end] operator[=] identifier[start] operator[+] identifier[myShortyLength] operator[SEP] Keyword[if] operator[SEP] identifier[end] operator[>] identifier[encodedID] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] {
identifier[end] operator[=] identifier[encodedID] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP]
}
identifier[shorties] operator[SEP] identifier[add] operator[SEP] identifier[encodedID] operator[SEP] identifier[substring] operator[SEP] identifier[start] , identifier[end] operator[SEP] operator[SEP] operator[SEP] identifier[start] operator[=] identifier[end] operator[SEP]
}
Keyword[return] identifier[concat] operator[SEP] identifier[shorties] operator[SEP] identifier[toArray] operator[SEP] Keyword[new] identifier[String] operator[SEP] Other[0] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
public JcNumber numberProperty(String name) {
JcNumber ret = new JcNumber(name, this, OPERATOR.PropertyContainer.PROPERTY_ACCESS);
QueryRecorder.recordInvocationConditional(this, "numberProperty", ret, QueryRecorder.literal(name));
return ret;
} | class class_name[name] begin[{]
method[numberProperty, return_type[type[JcNumber]], modifier[public], parameter[name]] begin[{]
local_variable[type[JcNumber], ret]
call[QueryRecorder.recordInvocationConditional, parameter[THIS[], literal["numberProperty"], member[.ret], call[QueryRecorder.literal, parameter[member[.name]]]]]
return[member[.ret]]
end[}]
END[}] | Keyword[public] identifier[JcNumber] identifier[numberProperty] operator[SEP] identifier[String] identifier[name] operator[SEP] {
identifier[JcNumber] identifier[ret] operator[=] Keyword[new] identifier[JcNumber] operator[SEP] identifier[name] , Keyword[this] , identifier[OPERATOR] operator[SEP] identifier[PropertyContainer] operator[SEP] identifier[PROPERTY_ACCESS] operator[SEP] operator[SEP] identifier[QueryRecorder] operator[SEP] identifier[recordInvocationConditional] operator[SEP] Keyword[this] , literal[String] , identifier[ret] , identifier[QueryRecorder] operator[SEP] identifier[literal] operator[SEP] identifier[name] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[ret] operator[SEP]
}
|
private Set<String> findInterfaces(String interfaceDefineString) {
String interfaceStrings = StringHelper.replaceFirst(interfaceDefineString, "implements", "");
String[] interfaces = interfaceStrings.split(",");
Set<String> stringSet = new HashSet<String>();
for (String interfaceString : interfaces) {
stringSet.add(interfaceString.trim());
}
return stringSet;
} | class class_name[name] begin[{]
method[findInterfaces, return_type[type[Set]], modifier[private], parameter[interfaceDefineString]] begin[{]
local_variable[type[String], interfaceStrings]
local_variable[type[String], interfaces]
local_variable[type[Set], stringSet]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=trim, postfix_operators=[], prefix_operators=[], qualifier=interfaceString, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=stringSet, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=interfaces, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=interfaceString)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None)
return[member[.stringSet]]
end[}]
END[}] | Keyword[private] identifier[Set] operator[<] identifier[String] operator[>] identifier[findInterfaces] operator[SEP] identifier[String] identifier[interfaceDefineString] operator[SEP] {
identifier[String] identifier[interfaceStrings] operator[=] identifier[StringHelper] operator[SEP] identifier[replaceFirst] operator[SEP] identifier[interfaceDefineString] , literal[String] , literal[String] operator[SEP] operator[SEP] identifier[String] operator[SEP] operator[SEP] identifier[interfaces] operator[=] identifier[interfaceStrings] operator[SEP] identifier[split] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[Set] operator[<] identifier[String] operator[>] identifier[stringSet] operator[=] Keyword[new] identifier[HashSet] operator[<] identifier[String] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[String] identifier[interfaceString] operator[:] identifier[interfaces] operator[SEP] {
identifier[stringSet] operator[SEP] identifier[add] operator[SEP] identifier[interfaceString] operator[SEP] identifier[trim] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] identifier[stringSet] operator[SEP]
}
|
public long getNanoTime() {
if (this.runningState == State.STOPPED || this.runningState == State.SUSPENDED) {
return this.stopTime - this.startTime;
} else if (this.runningState == State.UNSTARTED) {
return 0;
} else if (this.runningState == State.RUNNING) {
return System.nanoTime() - this.startTime;
}
throw new RuntimeException("Illegal running state has occurred.");
} | class class_name[name] begin[{]
method[getNanoTime, return_type[type[long]], modifier[public], parameter[]] begin[{]
if[binary_operation[binary_operation[THIS[member[None.runningState]], ==, member[State.STOPPED]], ||, binary_operation[THIS[member[None.runningState]], ==, member[State.SUSPENDED]]]] begin[{]
return[binary_operation[THIS[member[None.stopTime]], -, THIS[member[None.startTime]]]]
else begin[{]
if[binary_operation[THIS[member[None.runningState]], ==, member[State.UNSTARTED]]] begin[{]
return[literal[0]]
else begin[{]
if[binary_operation[THIS[member[None.runningState]], ==, member[State.RUNNING]]] begin[{]
return[binary_operation[call[System.nanoTime, parameter[]], -, THIS[member[None.startTime]]]]
else begin[{]
None
end[}]
end[}]
end[}]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Illegal running state has occurred.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=RuntimeException, sub_type=None)), label=None)
end[}]
END[}] | Keyword[public] Keyword[long] identifier[getNanoTime] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[runningState] operator[==] identifier[State] operator[SEP] identifier[STOPPED] operator[||] Keyword[this] operator[SEP] identifier[runningState] operator[==] identifier[State] operator[SEP] identifier[SUSPENDED] operator[SEP] {
Keyword[return] Keyword[this] operator[SEP] identifier[stopTime] operator[-] Keyword[this] operator[SEP] identifier[startTime] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[runningState] operator[==] identifier[State] operator[SEP] identifier[UNSTARTED] operator[SEP] {
Keyword[return] Other[0] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[runningState] operator[==] identifier[State] operator[SEP] identifier[RUNNING] operator[SEP] {
Keyword[return] identifier[System] operator[SEP] identifier[nanoTime] operator[SEP] operator[SEP] operator[-] Keyword[this] operator[SEP] identifier[startTime] operator[SEP]
}
Keyword[throw] Keyword[new] identifier[RuntimeException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
|
private static void convertElement(JsonGenerator generator, Element element, boolean isArrayItem, ElementNameConverter converter) throws IOException {
TYPE type = toTYPE(element.getAttribute("type"));
String name = element.getTagName();
if (!isArrayItem) {
generator.writeFieldName(converter.convertName(name));
}
switch (type) {
case OBJECT:
generator.writeStartObject();
convertChildren(generator, element, false, converter);
generator.writeEndObject();
break;
case ARRAY:
generator.writeStartArray();
convertChildren(generator, element, true, converter);
generator.writeEndArray();
break;
case STRING:
generator.writeString(element.getTextContent());
break;
case INT:
case FLOAT:
generator.writeNumber(new BigDecimal(element.getTextContent()));
break;
case BOOLEAN:
generator.writeBoolean(Boolean.parseBoolean(element.getTextContent()));
break;
case NULL:
generator.writeNull();
break;
}
} | class class_name[name] begin[{]
method[convertElement, return_type[void], modifier[private static], parameter[generator, element, isArrayItem, converter]] begin[{]
local_variable[type[TYPE], type]
local_variable[type[String], name]
if[member[.isArrayItem]] begin[{]
call[generator.writeFieldName, parameter[call[converter.convertName, parameter[member[.name]]]]]
else begin[{]
None
end[}]
SwitchStatement(cases=[SwitchStatementCase(case=['OBJECT'], statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=writeStartObject, postfix_operators=[], prefix_operators=[], qualifier=generator, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=generator, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=element, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), MemberReference(member=converter, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=convertChildren, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=writeEndObject, postfix_operators=[], prefix_operators=[], qualifier=generator, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=['ARRAY'], statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=writeStartArray, postfix_operators=[], prefix_operators=[], qualifier=generator, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=generator, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=element, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true), MemberReference(member=converter, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=convertChildren, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=writeEndArray, postfix_operators=[], prefix_operators=[], qualifier=generator, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=['STRING'], statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getTextContent, postfix_operators=[], prefix_operators=[], qualifier=element, selectors=[], type_arguments=None)], member=writeString, postfix_operators=[], prefix_operators=[], qualifier=generator, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=['INT', 'FLOAT'], statements=[StatementExpression(expression=MethodInvocation(arguments=[ClassCreator(arguments=[MethodInvocation(arguments=[], member=getTextContent, postfix_operators=[], prefix_operators=[], qualifier=element, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=BigDecimal, sub_type=None))], member=writeNumber, postfix_operators=[], prefix_operators=[], qualifier=generator, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=['BOOLEAN'], statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getTextContent, postfix_operators=[], prefix_operators=[], qualifier=element, selectors=[], type_arguments=None)], member=parseBoolean, postfix_operators=[], prefix_operators=[], qualifier=Boolean, selectors=[], type_arguments=None)], member=writeBoolean, postfix_operators=[], prefix_operators=[], qualifier=generator, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=['NULL'], statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=writeNull, postfix_operators=[], prefix_operators=[], qualifier=generator, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)])], expression=MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)
end[}]
END[}] | Keyword[private] Keyword[static] Keyword[void] identifier[convertElement] operator[SEP] identifier[JsonGenerator] identifier[generator] , identifier[Element] identifier[element] , Keyword[boolean] identifier[isArrayItem] , identifier[ElementNameConverter] identifier[converter] operator[SEP] Keyword[throws] identifier[IOException] {
identifier[TYPE] identifier[type] operator[=] identifier[toTYPE] operator[SEP] identifier[element] operator[SEP] identifier[getAttribute] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[name] operator[=] identifier[element] operator[SEP] identifier[getTagName] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[isArrayItem] operator[SEP] {
identifier[generator] operator[SEP] identifier[writeFieldName] operator[SEP] identifier[converter] operator[SEP] identifier[convertName] operator[SEP] identifier[name] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[switch] operator[SEP] identifier[type] operator[SEP] {
Keyword[case] identifier[OBJECT] operator[:] identifier[generator] operator[SEP] identifier[writeStartObject] operator[SEP] operator[SEP] operator[SEP] identifier[convertChildren] operator[SEP] identifier[generator] , identifier[element] , literal[boolean] , identifier[converter] operator[SEP] operator[SEP] identifier[generator] operator[SEP] identifier[writeEndObject] operator[SEP] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[ARRAY] operator[:] identifier[generator] operator[SEP] identifier[writeStartArray] operator[SEP] operator[SEP] operator[SEP] identifier[convertChildren] operator[SEP] identifier[generator] , identifier[element] , literal[boolean] , identifier[converter] operator[SEP] operator[SEP] identifier[generator] operator[SEP] identifier[writeEndArray] operator[SEP] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[STRING] operator[:] identifier[generator] operator[SEP] identifier[writeString] operator[SEP] identifier[element] operator[SEP] identifier[getTextContent] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[INT] operator[:] Keyword[case] identifier[FLOAT] operator[:] identifier[generator] operator[SEP] identifier[writeNumber] operator[SEP] Keyword[new] identifier[BigDecimal] operator[SEP] identifier[element] operator[SEP] identifier[getTextContent] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[BOOLEAN] operator[:] identifier[generator] operator[SEP] identifier[writeBoolean] operator[SEP] identifier[Boolean] operator[SEP] identifier[parseBoolean] operator[SEP] identifier[element] operator[SEP] identifier[getTextContent] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[NULL] operator[:] identifier[generator] operator[SEP] identifier[writeNull] operator[SEP] operator[SEP] operator[SEP] Keyword[break] operator[SEP]
}
}
|
@Override
public UpdateConfigurationSetReputationMetricsEnabledResult updateConfigurationSetReputationMetricsEnabled(
UpdateConfigurationSetReputationMetricsEnabledRequest request) {
request = beforeClientExecution(request);
return executeUpdateConfigurationSetReputationMetricsEnabled(request);
} | class class_name[name] begin[{]
method[updateConfigurationSetReputationMetricsEnabled, return_type[type[UpdateConfigurationSetReputationMetricsEnabledResult]], modifier[public], parameter[request]] begin[{]
assign[member[.request], call[.beforeClientExecution, parameter[member[.request]]]]
return[call[.executeUpdateConfigurationSetReputationMetricsEnabled, parameter[member[.request]]]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] identifier[UpdateConfigurationSetReputationMetricsEnabledResult] identifier[updateConfigurationSetReputationMetricsEnabled] operator[SEP] identifier[UpdateConfigurationSetReputationMetricsEnabledRequest] identifier[request] operator[SEP] {
identifier[request] operator[=] identifier[beforeClientExecution] operator[SEP] identifier[request] operator[SEP] operator[SEP] Keyword[return] identifier[executeUpdateConfigurationSetReputationMetricsEnabled] operator[SEP] identifier[request] operator[SEP] operator[SEP]
}
|
public static <T, A, B, C, D, E, F> Answer<T> toAnswer(final Answer6<T, A, B, C, D, E, F> answer) {
return new Answer<T>() {
@SuppressWarnings("unchecked")
public T answer(InvocationOnMock invocation) throws Throwable {
return answer.answer(
(A)invocation.getArgument(0),
(B)invocation.getArgument(1),
(C)invocation.getArgument(2),
(D)invocation.getArgument(3),
(E)invocation.getArgument(4),
(F)invocation.getArgument(5));
}
};
} | class class_name[name] begin[{]
method[toAnswer, return_type[type[Answer]], modifier[public static], parameter[answer]] begin[{]
return[ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[Annotation(element=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="unchecked"), name=SuppressWarnings)], body=[ReturnStatement(expression=MethodInvocation(arguments=[Cast(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], member=getArgument, postfix_operators=[], prefix_operators=[], qualifier=invocation, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=A, sub_type=None)), Cast(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], member=getArgument, postfix_operators=[], prefix_operators=[], qualifier=invocation, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=B, sub_type=None)), Cast(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2)], member=getArgument, postfix_operators=[], prefix_operators=[], qualifier=invocation, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=C, sub_type=None)), Cast(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=3)], member=getArgument, postfix_operators=[], prefix_operators=[], qualifier=invocation, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=D, sub_type=None)), Cast(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=4)], member=getArgument, postfix_operators=[], prefix_operators=[], qualifier=invocation, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=E, sub_type=None)), Cast(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=5)], member=getArgument, postfix_operators=[], prefix_operators=[], qualifier=invocation, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=F, sub_type=None))], member=answer, postfix_operators=[], prefix_operators=[], qualifier=answer, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=answer, parameters=[FormalParameter(annotations=[], modifiers=set(), name=invocation, type=ReferenceType(arguments=None, dimensions=[], name=InvocationOnMock, sub_type=None), varargs=False)], return_type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None), throws=['Throwable'], 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=Answer, sub_type=None))]
end[}]
END[}] | Keyword[public] Keyword[static] operator[<] identifier[T] , identifier[A] , identifier[B] , identifier[C] , identifier[D] , identifier[E] , identifier[F] operator[>] identifier[Answer] operator[<] identifier[T] operator[>] identifier[toAnswer] operator[SEP] Keyword[final] identifier[Answer6] operator[<] identifier[T] , identifier[A] , identifier[B] , identifier[C] , identifier[D] , identifier[E] , identifier[F] operator[>] identifier[answer] operator[SEP] {
Keyword[return] Keyword[new] identifier[Answer] operator[<] identifier[T] operator[>] operator[SEP] operator[SEP] {
annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] Keyword[public] identifier[T] identifier[answer] operator[SEP] identifier[InvocationOnMock] identifier[invocation] operator[SEP] Keyword[throws] identifier[Throwable] {
Keyword[return] identifier[answer] operator[SEP] identifier[answer] operator[SEP] operator[SEP] identifier[A] operator[SEP] identifier[invocation] operator[SEP] identifier[getArgument] operator[SEP] Other[0] operator[SEP] , operator[SEP] identifier[B] operator[SEP] identifier[invocation] operator[SEP] identifier[getArgument] operator[SEP] Other[1] operator[SEP] , operator[SEP] identifier[C] operator[SEP] identifier[invocation] operator[SEP] identifier[getArgument] operator[SEP] Other[2] operator[SEP] , operator[SEP] identifier[D] operator[SEP] identifier[invocation] operator[SEP] identifier[getArgument] operator[SEP] Other[3] operator[SEP] , operator[SEP] identifier[E] operator[SEP] identifier[invocation] operator[SEP] identifier[getArgument] operator[SEP] Other[4] operator[SEP] , operator[SEP] identifier[F] operator[SEP] identifier[invocation] operator[SEP] identifier[getArgument] operator[SEP] Other[5] operator[SEP] operator[SEP] operator[SEP]
}
} operator[SEP]
}
|
protected final PrcAccDocFullRetrieve createPutPrcAccDocFullRetrieve(
final Map<String, Object> pAddParam) throws Exception {
PrcAccDocFullRetrieve<RS, IDocWarehouse> proc =
new PrcAccDocFullRetrieve<RS, IDocWarehouse>();
proc.setSrvUseMaterialEntry(getSrvUseMaterialEntry());
@SuppressWarnings("unchecked")
IEntityProcessor<IDocWarehouse, Long> delegate =
(IEntityProcessor<IDocWarehouse, Long>)
lazyGetPrcAccDocCogsRetrieve(pAddParam);
proc.setPrcAccDocCogsRetrieve(delegate);
//assigning fully initialized object:
this.processorsMap.put(PrcAccDocFullRetrieve.class.getSimpleName(), proc);
return proc;
} | class class_name[name] begin[{]
method[createPutPrcAccDocFullRetrieve, return_type[type[PrcAccDocFullRetrieve]], modifier[final protected], parameter[pAddParam]] begin[{]
local_variable[type[PrcAccDocFullRetrieve], proc]
call[proc.setSrvUseMaterialEntry, parameter[call[.getSrvUseMaterialEntry, parameter[]]]]
local_variable[type[IEntityProcessor], delegate]
call[proc.setPrcAccDocCogsRetrieve, parameter[member[.delegate]]]
THIS[member[None.processorsMap]call[None.put, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[], member=getSimpleName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=PrcAccDocFullRetrieve, sub_type=None)), member[.proc]]]]
return[member[.proc]]
end[}]
END[}] | Keyword[protected] Keyword[final] identifier[PrcAccDocFullRetrieve] identifier[createPutPrcAccDocFullRetrieve] operator[SEP] Keyword[final] identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] identifier[pAddParam] operator[SEP] Keyword[throws] identifier[Exception] {
identifier[PrcAccDocFullRetrieve] operator[<] identifier[RS] , identifier[IDocWarehouse] operator[>] identifier[proc] operator[=] Keyword[new] identifier[PrcAccDocFullRetrieve] operator[<] identifier[RS] , identifier[IDocWarehouse] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[proc] operator[SEP] identifier[setSrvUseMaterialEntry] operator[SEP] identifier[getSrvUseMaterialEntry] operator[SEP] operator[SEP] operator[SEP] operator[SEP] annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] identifier[IEntityProcessor] operator[<] identifier[IDocWarehouse] , identifier[Long] operator[>] identifier[delegate] operator[=] operator[SEP] identifier[IEntityProcessor] operator[<] identifier[IDocWarehouse] , identifier[Long] operator[>] operator[SEP] identifier[lazyGetPrcAccDocCogsRetrieve] operator[SEP] identifier[pAddParam] operator[SEP] operator[SEP] identifier[proc] operator[SEP] identifier[setPrcAccDocCogsRetrieve] operator[SEP] identifier[delegate] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[processorsMap] operator[SEP] identifier[put] operator[SEP] identifier[PrcAccDocFullRetrieve] operator[SEP] Keyword[class] operator[SEP] identifier[getSimpleName] operator[SEP] operator[SEP] , identifier[proc] operator[SEP] operator[SEP] Keyword[return] identifier[proc] operator[SEP]
}
|
public static String buildFilePath(
String filePathFormat, @Nullable String locale, @Nullable String inputFilePath) {
String path = filePathFormat;
if (locale != null) {
path = path.replace("{LOCALE}", locale);
path = path.replace("{LOCALE_LOWER_CASE}", locale.toLowerCase().replace('-', '_'));
}
if (inputFilePath != null) {
// Compute directory and file name.
int lastSlashIndex = inputFilePath.lastIndexOf(File.separatorChar);
String directory = inputFilePath.substring(0, lastSlashIndex + 1);
String fileName = inputFilePath.substring(lastSlashIndex + 1);
// Compute file name without extension.
int lastDotIndex = fileName.lastIndexOf('.');
if (lastDotIndex == -1) {
lastDotIndex = fileName.length();
}
String fileNameNoExt = fileName.substring(0, lastDotIndex);
// Substitute placeholders.
path = path.replace("{INPUT_DIRECTORY}", directory);
path = path.replace("{INPUT_FILE_NAME}", fileName);
path = path.replace("{INPUT_FILE_NAME_NO_EXT}", fileNameNoExt);
}
// Remove redundant /'s if any placeholder representing a directory was empty.
path = path.replace("//", "/");
return path;
} | class class_name[name] begin[{]
method[buildFilePath, return_type[type[String]], modifier[public static], parameter[filePathFormat, locale, inputFilePath]] begin[{]
local_variable[type[String], path]
if[binary_operation[member[.locale], !=, literal[null]]] begin[{]
assign[member[.path], call[path.replace, parameter[literal["{LOCALE}"], member[.locale]]]]
assign[member[.path], call[path.replace, parameter[literal["{LOCALE_LOWER_CASE}"], call[locale.toLowerCase, parameter[]]]]]
else begin[{]
None
end[}]
if[binary_operation[member[.inputFilePath], !=, literal[null]]] begin[{]
local_variable[type[int], lastSlashIndex]
local_variable[type[String], directory]
local_variable[type[String], fileName]
local_variable[type[int], lastDotIndex]
if[binary_operation[member[.lastDotIndex], ==, literal[1]]] begin[{]
assign[member[.lastDotIndex], call[fileName.length, parameter[]]]
else begin[{]
None
end[}]
local_variable[type[String], fileNameNoExt]
assign[member[.path], call[path.replace, parameter[literal["{INPUT_DIRECTORY}"], member[.directory]]]]
assign[member[.path], call[path.replace, parameter[literal["{INPUT_FILE_NAME}"], member[.fileName]]]]
assign[member[.path], call[path.replace, parameter[literal["{INPUT_FILE_NAME_NO_EXT}"], member[.fileNameNoExt]]]]
else begin[{]
None
end[}]
assign[member[.path], call[path.replace, parameter[literal["//"], literal["/"]]]]
return[member[.path]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[String] identifier[buildFilePath] operator[SEP] identifier[String] identifier[filePathFormat] , annotation[@] identifier[Nullable] identifier[String] identifier[locale] , annotation[@] identifier[Nullable] identifier[String] identifier[inputFilePath] operator[SEP] {
identifier[String] identifier[path] operator[=] identifier[filePathFormat] operator[SEP] Keyword[if] operator[SEP] identifier[locale] operator[!=] Other[null] operator[SEP] {
identifier[path] operator[=] identifier[path] operator[SEP] identifier[replace] operator[SEP] literal[String] , identifier[locale] operator[SEP] operator[SEP] identifier[path] operator[=] identifier[path] operator[SEP] identifier[replace] operator[SEP] literal[String] , identifier[locale] operator[SEP] identifier[toLowerCase] operator[SEP] operator[SEP] operator[SEP] identifier[replace] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[inputFilePath] operator[!=] Other[null] operator[SEP] {
Keyword[int] identifier[lastSlashIndex] operator[=] identifier[inputFilePath] operator[SEP] identifier[lastIndexOf] operator[SEP] identifier[File] operator[SEP] identifier[separatorChar] operator[SEP] operator[SEP] identifier[String] identifier[directory] operator[=] identifier[inputFilePath] operator[SEP] identifier[substring] operator[SEP] Other[0] , identifier[lastSlashIndex] operator[+] Other[1] operator[SEP] operator[SEP] identifier[String] identifier[fileName] operator[=] identifier[inputFilePath] operator[SEP] identifier[substring] operator[SEP] identifier[lastSlashIndex] operator[+] Other[1] operator[SEP] operator[SEP] Keyword[int] identifier[lastDotIndex] operator[=] identifier[fileName] operator[SEP] identifier[lastIndexOf] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[lastDotIndex] operator[==] operator[-] Other[1] operator[SEP] {
identifier[lastDotIndex] operator[=] identifier[fileName] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP]
}
identifier[String] identifier[fileNameNoExt] operator[=] identifier[fileName] operator[SEP] identifier[substring] operator[SEP] Other[0] , identifier[lastDotIndex] operator[SEP] operator[SEP] identifier[path] operator[=] identifier[path] operator[SEP] identifier[replace] operator[SEP] literal[String] , identifier[directory] operator[SEP] operator[SEP] identifier[path] operator[=] identifier[path] operator[SEP] identifier[replace] operator[SEP] literal[String] , identifier[fileName] operator[SEP] operator[SEP] identifier[path] operator[=] identifier[path] operator[SEP] identifier[replace] operator[SEP] literal[String] , identifier[fileNameNoExt] operator[SEP] operator[SEP]
}
identifier[path] operator[=] identifier[path] operator[SEP] identifier[replace] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[path] operator[SEP]
}
|
public void incrementFeature(Assignment featureAssignment, double amount) {
if (isDense) {
statistics.incrementEntry(amount, statisticNames.assignmentToIntArray(featureAssignment));
} else {
Tensor increment = SparseTensor.singleElement(getTensorDimensions(), getTensorSizes(),
statisticNames.assignmentToIntArray(featureAssignment), amount);
statisticsTensor = statisticsTensor.elementwiseAddition(increment);
}
} | class class_name[name] begin[{]
method[incrementFeature, return_type[void], modifier[public], parameter[featureAssignment, amount]] begin[{]
if[member[.isDense]] begin[{]
call[statistics.incrementEntry, parameter[member[.amount], call[statisticNames.assignmentToIntArray, parameter[member[.featureAssignment]]]]]
else begin[{]
local_variable[type[Tensor], increment]
assign[member[.statisticsTensor], call[statisticsTensor.elementwiseAddition, parameter[member[.increment]]]]
end[}]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[incrementFeature] operator[SEP] identifier[Assignment] identifier[featureAssignment] , Keyword[double] identifier[amount] operator[SEP] {
Keyword[if] operator[SEP] identifier[isDense] operator[SEP] {
identifier[statistics] operator[SEP] identifier[incrementEntry] operator[SEP] identifier[amount] , identifier[statisticNames] operator[SEP] identifier[assignmentToIntArray] operator[SEP] identifier[featureAssignment] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[Tensor] identifier[increment] operator[=] identifier[SparseTensor] operator[SEP] identifier[singleElement] operator[SEP] identifier[getTensorDimensions] operator[SEP] operator[SEP] , identifier[getTensorSizes] operator[SEP] operator[SEP] , identifier[statisticNames] operator[SEP] identifier[assignmentToIntArray] operator[SEP] identifier[featureAssignment] operator[SEP] , identifier[amount] operator[SEP] operator[SEP] identifier[statisticsTensor] operator[=] identifier[statisticsTensor] operator[SEP] identifier[elementwiseAddition] operator[SEP] identifier[increment] operator[SEP] operator[SEP]
}
}
|
@SuppressWarnings("unchecked")
public final void loadAllClass(){
if(isLoading)
{
return;
}
isLoading=true;
classLoader = new ScriptClassLoader();
final ConcurrentHashMap<Integer, Class<? extends T>> codeMap=new ConcurrentHashMap<Integer, Class<? extends T>>();
for (Entry<String,ClassFile> entry : scriptFilePaths.entrySet())
{
ClassFile classFile = entry.getValue();
try {
Class<T> scriptClass=null;
Class<?> clazz=loadClass(classLoader, classFile);
if(clazz!=null)
{//类型转换
scriptClass=(Class<T>)clazz;
}
if(scriptClass!=null)
{
boolean isAbstract=Modifier.isAbstract(scriptClass.getModifiers());//是否是抽象类
if(isAbstract)
{//抽象类
// _log.info("loaded abstractScript:" + classFile.getFilePath());
}else
{
T script=scriptClass.newInstance();
int code=script.getMessageCode();
if(codeMap.containsKey(code))
{//如果已经存在相同code的脚步则不加载
_log.error("find Repeat code script,addingScript:"+script.getClass()+",existScript:"+codeMap.get(code));
}else
{
_log.info("**********LoadRegistClass<" + classFile.getClassName()+">**********");
codeMap.put(code,scriptClass);
_log.info("loaded codeScript,code="+code+"(0x"+Integer.toHexString(code)+"),path=" + classFile.getFilePath());
}
}
//如果相同脚步的类文件发生改变后可能code会不一致,所以即使有相同code的脚步依然要记录时间
classFile.setLastModifyTime(new File(classFile.getFilePath()).lastModified());//更新时间
}
} catch (Exception e) {
_log.error(e.getMessage(),e);
}
}
this.codeMap.putAll(codeMap);
isLoading=false;
} | class class_name[name] begin[{]
method[loadAllClass, return_type[void], modifier[final public], parameter[]] begin[{]
if[member[.isLoading]] begin[{]
return[None]
else begin[{]
None
end[}]
assign[member[.isLoading], literal[true]]
assign[member[.classLoader], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ScriptClassLoader, sub_type=None))]
local_variable[type[ConcurrentHashMap], codeMap]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None), name=classFile)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ClassFile, sub_type=None)), TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), name=scriptClass)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None))], dimensions=[], name=Class, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=classLoader, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=classFile, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=loadClass, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=clazz)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=?, type=None)], dimensions=[], name=Class, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=clazz, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=scriptClass, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Cast(expression=MemberReference(member=clazz, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None))], dimensions=[], name=Class, sub_type=None))), label=None)])), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=scriptClass, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getModifiers, postfix_operators=[], prefix_operators=[], qualifier=scriptClass, selectors=[], type_arguments=None)], member=isAbstract, postfix_operators=[], prefix_operators=[], qualifier=Modifier, selectors=[], type_arguments=None), name=isAbstract)], modifiers=set(), type=BasicType(dimensions=[], name=boolean)), IfStatement(condition=MemberReference(member=isAbstract, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=newInstance, postfix_operators=[], prefix_operators=[], qualifier=scriptClass, selectors=[], type_arguments=None), name=script)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getMessageCode, postfix_operators=[], prefix_operators=[], qualifier=script, selectors=[], type_arguments=None), name=code)], modifiers=set(), type=BasicType(dimensions=[], name=int)), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=code, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=containsKey, postfix_operators=[], prefix_operators=[], qualifier=codeMap, selectors=[], type_arguments=None), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="**********LoadRegistClass<"), operandr=MethodInvocation(arguments=[], member=getClassName, postfix_operators=[], prefix_operators=[], qualifier=classFile, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=">**********"), operator=+)], member=info, postfix_operators=[], prefix_operators=[], qualifier=_log, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=code, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=scriptClass, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=put, postfix_operators=[], prefix_operators=[], qualifier=codeMap, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="loaded codeScript,code="), operandr=MemberReference(member=code, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="(0x"), operator=+), operandr=MethodInvocation(arguments=[MemberReference(member=code, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=toHexString, postfix_operators=[], prefix_operators=[], qualifier=Integer, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="),path="), operator=+), operandr=MethodInvocation(arguments=[], member=getFilePath, postfix_operators=[], prefix_operators=[], qualifier=classFile, selectors=[], type_arguments=None), operator=+)], member=info, postfix_operators=[], prefix_operators=[], qualifier=_log, selectors=[], type_arguments=None), label=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="find Repeat code script,addingScript:"), operandr=MethodInvocation(arguments=[], member=getClass, postfix_operators=[], prefix_operators=[], qualifier=script, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=",existScript:"), operator=+), operandr=MethodInvocation(arguments=[MemberReference(member=code, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=codeMap, selectors=[], type_arguments=None), operator=+)], member=error, postfix_operators=[], prefix_operators=[], qualifier=_log, selectors=[], type_arguments=None), label=None)]))]), label=None, then_statement=BlockStatement(label=None, statements=[])), StatementExpression(expression=MethodInvocation(arguments=[ClassCreator(arguments=[MethodInvocation(arguments=[], member=getFilePath, postfix_operators=[], prefix_operators=[], qualifier=classFile, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[], member=lastModified, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=File, sub_type=None))], member=setLastModifyTime, postfix_operators=[], prefix_operators=[], qualifier=classFile, selectors=[], type_arguments=None), label=None)]))], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=_log, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=entrySet, postfix_operators=[], prefix_operators=[], qualifier=scriptFilePaths, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=entry)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=ClassFile, sub_type=None))], dimensions=[], name=Entry, sub_type=None))), label=None)
THIS[member[None.codeMap]call[None.putAll, parameter[member[.codeMap]]]]
assign[member[.isLoading], literal[false]]
end[}]
END[}] | annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] Keyword[public] Keyword[final] Keyword[void] identifier[loadAllClass] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[isLoading] operator[SEP] {
Keyword[return] operator[SEP]
}
identifier[isLoading] operator[=] literal[boolean] operator[SEP] identifier[classLoader] operator[=] Keyword[new] identifier[ScriptClassLoader] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[ConcurrentHashMap] operator[<] identifier[Integer] , identifier[Class] operator[<] operator[?] Keyword[extends] identifier[T] operator[>] operator[>] identifier[codeMap] operator[=] Keyword[new] identifier[ConcurrentHashMap] operator[<] identifier[Integer] , identifier[Class] operator[<] operator[?] Keyword[extends] identifier[T] operator[>] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Entry] operator[<] identifier[String] , identifier[ClassFile] operator[>] identifier[entry] operator[:] identifier[scriptFilePaths] operator[SEP] identifier[entrySet] operator[SEP] operator[SEP] operator[SEP] {
identifier[ClassFile] identifier[classFile] operator[=] identifier[entry] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] Keyword[try] {
identifier[Class] operator[<] identifier[T] operator[>] identifier[scriptClass] operator[=] Other[null] operator[SEP] identifier[Class] operator[<] operator[?] operator[>] identifier[clazz] operator[=] identifier[loadClass] operator[SEP] identifier[classLoader] , identifier[classFile] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[clazz] operator[!=] Other[null] operator[SEP] {
identifier[scriptClass] operator[=] operator[SEP] identifier[Class] operator[<] identifier[T] operator[>] operator[SEP] identifier[clazz] operator[SEP]
}
Keyword[if] operator[SEP] identifier[scriptClass] operator[!=] Other[null] operator[SEP] {
Keyword[boolean] identifier[isAbstract] operator[=] identifier[Modifier] operator[SEP] identifier[isAbstract] operator[SEP] identifier[scriptClass] operator[SEP] identifier[getModifiers] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[isAbstract] operator[SEP] {
}
Keyword[else] {
identifier[T] identifier[script] operator[=] identifier[scriptClass] operator[SEP] identifier[newInstance] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[code] operator[=] identifier[script] operator[SEP] identifier[getMessageCode] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[codeMap] operator[SEP] identifier[containsKey] operator[SEP] identifier[code] operator[SEP] operator[SEP] {
identifier[_log] operator[SEP] identifier[error] operator[SEP] literal[String] operator[+] identifier[script] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[codeMap] operator[SEP] identifier[get] operator[SEP] identifier[code] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[_log] operator[SEP] identifier[info] operator[SEP] literal[String] operator[+] identifier[classFile] operator[SEP] identifier[getClassName] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] identifier[codeMap] operator[SEP] identifier[put] operator[SEP] identifier[code] , identifier[scriptClass] operator[SEP] operator[SEP] identifier[_log] operator[SEP] identifier[info] operator[SEP] literal[String] operator[+] identifier[code] operator[+] literal[String] operator[+] identifier[Integer] operator[SEP] identifier[toHexString] operator[SEP] identifier[code] operator[SEP] operator[+] literal[String] operator[+] identifier[classFile] operator[SEP] identifier[getFilePath] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
}
identifier[classFile] operator[SEP] identifier[setLastModifyTime] operator[SEP] Keyword[new] identifier[File] operator[SEP] identifier[classFile] operator[SEP] identifier[getFilePath] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[lastModified] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] {
identifier[_log] operator[SEP] identifier[error] operator[SEP] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP]
}
}
Keyword[this] operator[SEP] identifier[codeMap] operator[SEP] identifier[putAll] operator[SEP] identifier[codeMap] operator[SEP] operator[SEP] identifier[isLoading] operator[=] literal[boolean] operator[SEP]
}
|
private void promote(final K name) {
transientMap.remove(name);
cache.put(name, name);
lookups += useThreshold;
} | class class_name[name] begin[{]
method[promote, return_type[void], modifier[private], parameter[name]] begin[{]
call[transientMap.remove, parameter[member[.name]]]
call[cache.put, parameter[member[.name], member[.name]]]
assign[member[.lookups], member[.useThreshold]]
end[}]
END[}] | Keyword[private] Keyword[void] identifier[promote] operator[SEP] Keyword[final] identifier[K] identifier[name] operator[SEP] {
identifier[transientMap] operator[SEP] identifier[remove] operator[SEP] identifier[name] operator[SEP] operator[SEP] identifier[cache] operator[SEP] identifier[put] operator[SEP] identifier[name] , identifier[name] operator[SEP] operator[SEP] identifier[lookups] operator[+=] identifier[useThreshold] operator[SEP]
}
|
public static int getIntSelector(SlingHttpServletRequest request, Pattern groupPattern, int defaultValue) {
String[] selectors = request.getRequestPathInfo().getSelectors();
for (String selector : selectors) {
Matcher matcher = groupPattern.matcher(selector);
if (matcher.matches()) {
try {
return Integer.parseInt(matcher.group(1));
} catch (NumberFormatException nfex) {
// ok, try next
}
}
}
return defaultValue;
} | class class_name[name] begin[{]
method[getIntSelector, return_type[type[int]], modifier[public static], parameter[request, groupPattern, defaultValue]] begin[{]
local_variable[type[String], selectors]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=selector, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=matcher, postfix_operators=[], prefix_operators=[], qualifier=groupPattern, selectors=[], type_arguments=None), name=matcher)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Matcher, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[], member=matches, postfix_operators=[], prefix_operators=[], qualifier=matcher, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[TryStatement(block=[ReturnStatement(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], member=group, postfix_operators=[], prefix_operators=[], qualifier=matcher, selectors=[], type_arguments=None)], member=parseInt, postfix_operators=[], prefix_operators=[], qualifier=Integer, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=nfex, types=['NumberFormatException']))], finally_block=None, label=None, resources=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=selectors, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=selector)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None)
return[member[.defaultValue]]
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[int] identifier[getIntSelector] operator[SEP] identifier[SlingHttpServletRequest] identifier[request] , identifier[Pattern] identifier[groupPattern] , Keyword[int] identifier[defaultValue] operator[SEP] {
identifier[String] operator[SEP] operator[SEP] identifier[selectors] operator[=] identifier[request] operator[SEP] identifier[getRequestPathInfo] operator[SEP] operator[SEP] operator[SEP] identifier[getSelectors] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[String] identifier[selector] operator[:] identifier[selectors] operator[SEP] {
identifier[Matcher] identifier[matcher] operator[=] identifier[groupPattern] operator[SEP] identifier[matcher] operator[SEP] identifier[selector] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[matcher] operator[SEP] identifier[matches] operator[SEP] operator[SEP] operator[SEP] {
Keyword[try] {
Keyword[return] identifier[Integer] operator[SEP] identifier[parseInt] operator[SEP] identifier[matcher] operator[SEP] identifier[group] operator[SEP] Other[1] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[NumberFormatException] identifier[nfex] operator[SEP] {
}
}
}
Keyword[return] identifier[defaultValue] operator[SEP]
}
|
public synchronized URL addFile(File localFile, String remoteFile) throws IOException, MalformedURLException {
return addPath(new Path(localFile.toURI()), new Path(remoteFile));
} | class class_name[name] begin[{]
method[addFile, return_type[type[URL]], modifier[synchronized public], parameter[localFile, remoteFile]] begin[{]
return[call[.addPath, parameter[ClassCreator(arguments=[MethodInvocation(arguments=[], member=toURI, postfix_operators=[], prefix_operators=[], qualifier=localFile, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Path, sub_type=None)), ClassCreator(arguments=[MemberReference(member=remoteFile, 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=Path, sub_type=None))]]]
end[}]
END[}] | Keyword[public] Keyword[synchronized] identifier[URL] identifier[addFile] operator[SEP] identifier[File] identifier[localFile] , identifier[String] identifier[remoteFile] operator[SEP] Keyword[throws] identifier[IOException] , identifier[MalformedURLException] {
Keyword[return] identifier[addPath] operator[SEP] Keyword[new] identifier[Path] operator[SEP] identifier[localFile] operator[SEP] identifier[toURI] operator[SEP] operator[SEP] operator[SEP] , Keyword[new] identifier[Path] operator[SEP] identifier[remoteFile] operator[SEP] operator[SEP] operator[SEP]
}
|
public boolean initialize(byte[] value) throws Exception
{
try
{
client.create().creatingParentContainersIfNeeded().forPath(path, value);
}
catch ( KeeperException.NodeExistsException ignore )
{
// ignore
return false;
}
return true;
} | class class_name[name] begin[{]
method[initialize, return_type[type[boolean]], modifier[public], parameter[value]] begin[{]
TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=create, postfix_operators=[], prefix_operators=[], qualifier=client, selectors=[MethodInvocation(arguments=[], member=creatingParentContainersIfNeeded, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=path, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=forPath, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), 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=ignore, types=['KeeperException.NodeExistsException']))], finally_block=None, label=None, resources=None)
return[literal[true]]
end[}]
END[}] | Keyword[public] Keyword[boolean] identifier[initialize] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[value] operator[SEP] Keyword[throws] identifier[Exception] {
Keyword[try] {
identifier[client] operator[SEP] identifier[create] operator[SEP] operator[SEP] operator[SEP] identifier[creatingParentContainersIfNeeded] operator[SEP] operator[SEP] operator[SEP] identifier[forPath] operator[SEP] identifier[path] , identifier[value] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[KeeperException] operator[SEP] identifier[NodeExistsException] identifier[ignore] operator[SEP] {
Keyword[return] literal[boolean] operator[SEP]
}
Keyword[return] literal[boolean] operator[SEP]
}
|
@Override
public ListReceiptRuleSetsResult listReceiptRuleSets(ListReceiptRuleSetsRequest request) {
request = beforeClientExecution(request);
return executeListReceiptRuleSets(request);
} | class class_name[name] begin[{]
method[listReceiptRuleSets, return_type[type[ListReceiptRuleSetsResult]], modifier[public], parameter[request]] begin[{]
assign[member[.request], call[.beforeClientExecution, parameter[member[.request]]]]
return[call[.executeListReceiptRuleSets, parameter[member[.request]]]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] identifier[ListReceiptRuleSetsResult] identifier[listReceiptRuleSets] operator[SEP] identifier[ListReceiptRuleSetsRequest] identifier[request] operator[SEP] {
identifier[request] operator[=] identifier[beforeClientExecution] operator[SEP] identifier[request] operator[SEP] operator[SEP] Keyword[return] identifier[executeListReceiptRuleSets] operator[SEP] identifier[request] operator[SEP] operator[SEP]
}
|
private void writeObject( ObjectOutputStream aStream ) throws IOException {
aStream.writeBoolean(absolute);
aStream.writeBoolean(normalized);
aStream.writeObject(Collections.unmodifiableList(new ArrayList<Path.Segment>(segments))); // make a copy!
} | class class_name[name] begin[{]
method[writeObject, return_type[void], modifier[private], parameter[aStream]] begin[{]
call[aStream.writeBoolean, parameter[member[.absolute]]]
call[aStream.writeBoolean, parameter[member[.normalized]]]
call[aStream.writeObject, parameter[call[Collections.unmodifiableList, parameter[ClassCreator(arguments=[MemberReference(member=segments, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Path, sub_type=ReferenceType(arguments=None, dimensions=None, name=Segment, sub_type=None)))], dimensions=None, name=ArrayList, sub_type=None))]]]]
end[}]
END[}] | Keyword[private] Keyword[void] identifier[writeObject] operator[SEP] identifier[ObjectOutputStream] identifier[aStream] operator[SEP] Keyword[throws] identifier[IOException] {
identifier[aStream] operator[SEP] identifier[writeBoolean] operator[SEP] identifier[absolute] operator[SEP] operator[SEP] identifier[aStream] operator[SEP] identifier[writeBoolean] operator[SEP] identifier[normalized] operator[SEP] operator[SEP] identifier[aStream] operator[SEP] identifier[writeObject] operator[SEP] identifier[Collections] operator[SEP] identifier[unmodifiableList] operator[SEP] Keyword[new] identifier[ArrayList] operator[<] identifier[Path] operator[SEP] identifier[Segment] operator[>] operator[SEP] identifier[segments] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
public long nextLong(long n) throws IllegalArgumentException {
if (n > 0) {
long bits;
long val;
do {
bits = ((long) next(31)) << 32;
bits = bits | (((long) next(32)) & 0xffffffffL);
val = bits % n;
} while (bits - val + (n - 1) < 0);
return val;
}
throw new RuntimeException("Not strictly positive: " + n);
} | class class_name[name] begin[{]
method[nextLong, return_type[type[long]], modifier[public], parameter[n]] begin[{]
if[binary_operation[member[.n], >, literal[0]]] begin[{]
local_variable[type[long], bits]
local_variable[type[long], val]
do[binary_operation[binary_operation[binary_operation[member[.bits], -, member[.val]], +, binary_operation[member[.n], -, literal[1]]], <, literal[0]]] begin[{]
assign[member[.bits], binary_operation[Cast(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=31)], member=next, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), type=BasicType(dimensions=[], name=long)), <<, literal[32]]]
assign[member[.bits], binary_operation[member[.bits], |, binary_operation[Cast(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=32)], member=next, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), type=BasicType(dimensions=[], name=long)), &, literal[0xffffffffL]]]]
assign[member[.val], binary_operation[member[.bits], %, member[.n]]]
end[}]
return[member[.val]]
else begin[{]
None
end[}]
ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Not strictly positive: "), operandr=MemberReference(member=n, 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=RuntimeException, sub_type=None)), label=None)
end[}]
END[}] | Keyword[public] Keyword[long] identifier[nextLong] operator[SEP] Keyword[long] identifier[n] operator[SEP] Keyword[throws] identifier[IllegalArgumentException] {
Keyword[if] operator[SEP] identifier[n] operator[>] Other[0] operator[SEP] {
Keyword[long] identifier[bits] operator[SEP] Keyword[long] identifier[val] operator[SEP] Keyword[do] {
identifier[bits] operator[=] operator[SEP] operator[SEP] Keyword[long] operator[SEP] identifier[next] operator[SEP] Other[31] operator[SEP] operator[SEP] operator[<<] Other[32] operator[SEP] identifier[bits] operator[=] identifier[bits] operator[|] operator[SEP] operator[SEP] operator[SEP] Keyword[long] operator[SEP] identifier[next] operator[SEP] Other[32] operator[SEP] operator[SEP] operator[&] literal[Integer] operator[SEP] operator[SEP] identifier[val] operator[=] identifier[bits] operator[%] identifier[n] operator[SEP]
}
Keyword[while] operator[SEP] identifier[bits] operator[-] identifier[val] operator[+] operator[SEP] identifier[n] operator[-] Other[1] operator[SEP] operator[<] Other[0] operator[SEP] operator[SEP] Keyword[return] identifier[val] operator[SEP]
}
Keyword[throw] Keyword[new] identifier[RuntimeException] operator[SEP] literal[String] operator[+] identifier[n] operator[SEP] operator[SEP]
}
|
public final EObject entryRuleRichStringLiteral() throws RecognitionException {
EObject current = null;
EObject iv_ruleRichStringLiteral = null;
try {
// InternalSARL.g:10814:58: (iv_ruleRichStringLiteral= ruleRichStringLiteral EOF )
// InternalSARL.g:10815:2: iv_ruleRichStringLiteral= ruleRichStringLiteral EOF
{
if ( state.backtracking==0 ) {
newCompositeNode(grammarAccess.getRichStringLiteralRule());
}
pushFollow(FOLLOW_1);
iv_ruleRichStringLiteral=ruleRichStringLiteral();
state._fsp--;
if (state.failed) return current;
if ( state.backtracking==0 ) {
current =iv_ruleRichStringLiteral;
}
match(input,EOF,FOLLOW_2); if (state.failed) return current;
}
}
catch (RecognitionException re) {
recover(input,re);
appendSkippedTokens();
}
finally {
}
return current;
} | class class_name[name] begin[{]
method[entryRuleRichStringLiteral, return_type[type[EObject]], modifier[final public], parameter[]] begin[{]
local_variable[type[EObject], current]
local_variable[type[EObject], iv_ruleRichStringLiteral]
TryStatement(block=[BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=backtracking, postfix_operators=[], prefix_operators=[], qualifier=state, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getRichStringLiteralRule, postfix_operators=[], prefix_operators=[], qualifier=grammarAccess, selectors=[], type_arguments=None)], member=newCompositeNode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=FOLLOW_1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=pushFollow, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=iv_ruleRichStringLiteral, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=ruleRichStringLiteral, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=MemberReference(member=_fsp, postfix_operators=['--'], prefix_operators=[], qualifier=state, selectors=[]), label=None), IfStatement(condition=MemberReference(member=failed, postfix_operators=[], prefix_operators=[], qualifier=state, selectors=[]), else_statement=None, label=None, then_statement=ReturnStatement(expression=MemberReference(member=current, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=backtracking, postfix_operators=[], prefix_operators=[], qualifier=state, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=current, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=iv_ruleRichStringLiteral, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=input, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=EOF, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=FOLLOW_2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=match, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), IfStatement(condition=MemberReference(member=failed, postfix_operators=[], prefix_operators=[], qualifier=state, selectors=[]), else_statement=None, label=None, then_statement=ReturnStatement(expression=MemberReference(member=current, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None))])], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=input, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=re, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=recover, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=appendSkippedTokens, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=re, types=['RecognitionException']))], finally_block=[], label=None, resources=None)
return[member[.current]]
end[}]
END[}] | Keyword[public] Keyword[final] identifier[EObject] identifier[entryRuleRichStringLiteral] operator[SEP] operator[SEP] Keyword[throws] identifier[RecognitionException] {
identifier[EObject] identifier[current] operator[=] Other[null] operator[SEP] identifier[EObject] identifier[iv_ruleRichStringLiteral] operator[=] Other[null] operator[SEP] Keyword[try] {
{
Keyword[if] operator[SEP] identifier[state] operator[SEP] identifier[backtracking] operator[==] Other[0] operator[SEP] {
identifier[newCompositeNode] operator[SEP] identifier[grammarAccess] operator[SEP] identifier[getRichStringLiteralRule] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
identifier[pushFollow] operator[SEP] identifier[FOLLOW_1] operator[SEP] operator[SEP] identifier[iv_ruleRichStringLiteral] operator[=] identifier[ruleRichStringLiteral] operator[SEP] operator[SEP] operator[SEP] identifier[state] operator[SEP] identifier[_fsp] operator[--] operator[SEP] Keyword[if] operator[SEP] identifier[state] operator[SEP] identifier[failed] operator[SEP] Keyword[return] identifier[current] operator[SEP] Keyword[if] operator[SEP] identifier[state] operator[SEP] identifier[backtracking] operator[==] Other[0] operator[SEP] {
identifier[current] operator[=] identifier[iv_ruleRichStringLiteral] operator[SEP]
}
identifier[match] operator[SEP] identifier[input] , identifier[EOF] , identifier[FOLLOW_2] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[state] operator[SEP] identifier[failed] operator[SEP] Keyword[return] identifier[current] operator[SEP]
}
}
Keyword[catch] operator[SEP] identifier[RecognitionException] identifier[re] operator[SEP] {
identifier[recover] operator[SEP] identifier[input] , identifier[re] operator[SEP] operator[SEP] identifier[appendSkippedTokens] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[finally] {
}
Keyword[return] identifier[current] operator[SEP]
}
|
private void readData(StringBuilder powerShellOutput) throws IOException {
String line;
while (null != (line = this.reader.readLine())) {
//In the case of script mode it finish when the last line is read
if (this.scriptMode) {
if (line.equals(PowerShell.END_SCRIPT_STRING)) {
break;
}
}
powerShellOutput.append(line).append(CRLF);
//When not in script mode, it exits when the command is finished
if (!this.scriptMode) {
try {
if (this.closed || !canContinueReading()) {
break;
}
} catch (InterruptedException ex) {
Logger.getLogger(PowerShellCommandProcessor.class.getName()).log(Level.SEVERE, "Error executing command and reading result", ex);
}
}
}
} | class class_name[name] begin[{]
method[readData, return_type[void], modifier[private], parameter[powerShellOutput]] begin[{]
local_variable[type[String], line]
while[binary_operation[literal[null], !=, assign[member[.line], THIS[member[None.reader]call[None.readLine, parameter[]]]]]] begin[{]
if[THIS[member[None.scriptMode]]] begin[{]
if[call[line.equals, parameter[member[PowerShell.END_SCRIPT_STRING]]]] begin[{]
BreakStatement(goto=None, label=None)
else begin[{]
None
end[}]
else begin[{]
None
end[}]
call[powerShellOutput.append, parameter[member[.line]]]
if[THIS[member[None.scriptMode]]] begin[{]
TryStatement(block=[IfStatement(condition=BinaryOperation(operandl=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=closed, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), operandr=MethodInvocation(arguments=[], member=canContinueReading, postfix_operators=[], prefix_operators=['!'], qualifier=, selectors=[], type_arguments=None), operator=||), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[BreakStatement(goto=None, label=None)]))], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[], member=getName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=PowerShellCommandProcessor, sub_type=None))], member=getLogger, postfix_operators=[], prefix_operators=[], qualifier=Logger, selectors=[MethodInvocation(arguments=[MemberReference(member=SEVERE, postfix_operators=[], prefix_operators=[], qualifier=Level, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Error executing command and reading result"), MemberReference(member=ex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=log, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ex, types=['InterruptedException']))], finally_block=None, label=None, resources=None)
else begin[{]
None
end[}]
end[}]
end[}]
END[}] | Keyword[private] Keyword[void] identifier[readData] operator[SEP] identifier[StringBuilder] identifier[powerShellOutput] operator[SEP] Keyword[throws] identifier[IOException] {
identifier[String] identifier[line] operator[SEP] Keyword[while] operator[SEP] Other[null] operator[!=] operator[SEP] identifier[line] operator[=] Keyword[this] operator[SEP] identifier[reader] operator[SEP] identifier[readLine] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[scriptMode] operator[SEP] {
Keyword[if] operator[SEP] identifier[line] operator[SEP] identifier[equals] operator[SEP] identifier[PowerShell] operator[SEP] identifier[END_SCRIPT_STRING] operator[SEP] operator[SEP] {
Keyword[break] operator[SEP]
}
}
identifier[powerShellOutput] operator[SEP] identifier[append] operator[SEP] identifier[line] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[CRLF] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] Keyword[this] operator[SEP] identifier[scriptMode] operator[SEP] {
Keyword[try] {
Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[closed] operator[||] operator[!] identifier[canContinueReading] operator[SEP] operator[SEP] operator[SEP] {
Keyword[break] operator[SEP]
}
}
Keyword[catch] operator[SEP] identifier[InterruptedException] identifier[ex] operator[SEP] {
identifier[Logger] operator[SEP] identifier[getLogger] operator[SEP] identifier[PowerShellCommandProcessor] operator[SEP] Keyword[class] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[log] operator[SEP] identifier[Level] operator[SEP] identifier[SEVERE] , literal[String] , identifier[ex] operator[SEP] operator[SEP]
}
}
}
}
|
public void set(int index, double value) {
if (isImmutable)
throw new UnsupportedOperationException(
"Cannot modify an immutable vector");
doubleVector.set(getIndex(index), value);
} | class class_name[name] begin[{]
method[set, return_type[void], modifier[public], parameter[index, value]] begin[{]
if[member[.isImmutable]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Cannot modify an immutable vector")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=UnsupportedOperationException, sub_type=None)), label=None)
else begin[{]
None
end[}]
call[doubleVector.set, parameter[call[.getIndex, parameter[member[.index]]], member[.value]]]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[set] operator[SEP] Keyword[int] identifier[index] , Keyword[double] identifier[value] operator[SEP] {
Keyword[if] operator[SEP] identifier[isImmutable] operator[SEP] Keyword[throw] Keyword[new] identifier[UnsupportedOperationException] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[doubleVector] operator[SEP] identifier[set] operator[SEP] identifier[getIndex] operator[SEP] identifier[index] operator[SEP] , identifier[value] operator[SEP] operator[SEP]
}
|
public static StringDictionary load(String path, String separator)
{
StringDictionary dictionary = new StringDictionary(separator);
if (dictionary.load(path)) return dictionary;
return null;
} | class class_name[name] begin[{]
method[load, return_type[type[StringDictionary]], modifier[public static], parameter[path, separator]] begin[{]
local_variable[type[StringDictionary], dictionary]
if[call[dictionary.load, parameter[member[.path]]]] begin[{]
return[member[.dictionary]]
else begin[{]
None
end[}]
return[literal[null]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[StringDictionary] identifier[load] operator[SEP] identifier[String] identifier[path] , identifier[String] identifier[separator] operator[SEP] {
identifier[StringDictionary] identifier[dictionary] operator[=] Keyword[new] identifier[StringDictionary] operator[SEP] identifier[separator] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[dictionary] operator[SEP] identifier[load] operator[SEP] identifier[path] operator[SEP] operator[SEP] Keyword[return] identifier[dictionary] operator[SEP] Keyword[return] Other[null] operator[SEP]
}
|
private boolean handleHeaderContentMessage() {
boolean handle_header = _handler.headerComplete();
_headerComplete = true;
boolean handle_content = _handler.contentComplete();
boolean handle_message = _handler.messageComplete();
return handle_header || handle_content || handle_message;
} | class class_name[name] begin[{]
method[handleHeaderContentMessage, return_type[type[boolean]], modifier[private], parameter[]] begin[{]
local_variable[type[boolean], handle_header]
assign[member[._headerComplete], literal[true]]
local_variable[type[boolean], handle_content]
local_variable[type[boolean], handle_message]
return[binary_operation[binary_operation[member[.handle_header], ||, member[.handle_content]], ||, member[.handle_message]]]
end[}]
END[}] | Keyword[private] Keyword[boolean] identifier[handleHeaderContentMessage] operator[SEP] operator[SEP] {
Keyword[boolean] identifier[handle_header] operator[=] identifier[_handler] operator[SEP] identifier[headerComplete] operator[SEP] operator[SEP] operator[SEP] identifier[_headerComplete] operator[=] literal[boolean] operator[SEP] Keyword[boolean] identifier[handle_content] operator[=] identifier[_handler] operator[SEP] identifier[contentComplete] operator[SEP] operator[SEP] operator[SEP] Keyword[boolean] identifier[handle_message] operator[=] identifier[_handler] operator[SEP] identifier[messageComplete] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[handle_header] operator[||] identifier[handle_content] operator[||] identifier[handle_message] operator[SEP]
}
|
private Optional<File> which(final String executableName) {
String systemPath = System.getenv("PATH");
String[] pathDirs = systemPath.split(File.pathSeparator);
Optional<File> fullyQualifiedExecutable = Optional.absent();
for(final String pathDir : pathDirs) {
File file = new File(pathDir, executableName);
if (file.isFile()) {
fullyQualifiedExecutable = Optional.of(file);
break;
}
}
return fullyQualifiedExecutable;
} | class class_name[name] begin[{]
method[which, return_type[type[Optional]], modifier[private], parameter[executableName]] begin[{]
local_variable[type[String], systemPath]
local_variable[type[String], pathDirs]
local_variable[type[Optional], fullyQualifiedExecutable]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MemberReference(member=pathDir, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=executableName, 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=file)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=File, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[], member=isFile, postfix_operators=[], prefix_operators=[], qualifier=file, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=fullyQualifiedExecutable, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=file, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=of, postfix_operators=[], prefix_operators=[], qualifier=Optional, selectors=[], type_arguments=None)), label=None), BreakStatement(goto=None, label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=pathDirs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=pathDir)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None)
return[member[.fullyQualifiedExecutable]]
end[}]
END[}] | Keyword[private] identifier[Optional] operator[<] identifier[File] operator[>] identifier[which] operator[SEP] Keyword[final] identifier[String] identifier[executableName] operator[SEP] {
identifier[String] identifier[systemPath] operator[=] identifier[System] operator[SEP] identifier[getenv] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[String] operator[SEP] operator[SEP] identifier[pathDirs] operator[=] identifier[systemPath] operator[SEP] identifier[split] operator[SEP] identifier[File] operator[SEP] identifier[pathSeparator] operator[SEP] operator[SEP] identifier[Optional] operator[<] identifier[File] operator[>] identifier[fullyQualifiedExecutable] operator[=] identifier[Optional] operator[SEP] identifier[absent] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[final] identifier[String] identifier[pathDir] operator[:] identifier[pathDirs] operator[SEP] {
identifier[File] identifier[file] operator[=] Keyword[new] identifier[File] operator[SEP] identifier[pathDir] , identifier[executableName] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[file] operator[SEP] identifier[isFile] operator[SEP] operator[SEP] operator[SEP] {
identifier[fullyQualifiedExecutable] operator[=] identifier[Optional] operator[SEP] identifier[of] operator[SEP] identifier[file] operator[SEP] operator[SEP] Keyword[break] operator[SEP]
}
}
Keyword[return] identifier[fullyQualifiedExecutable] operator[SEP]
}
|
static AxesWalker findClone(AxesWalker key, Vector cloneList)
{
if(null != cloneList)
{
// First, look for clone on list.
int n = cloneList.size();
for (int i = 0; i < n; i+=2)
{
if(key == cloneList.elementAt(i))
return (AxesWalker)cloneList.elementAt(i+1);
}
}
return null;
} | class class_name[name] begin[{]
method[findClone, return_type[type[AxesWalker]], modifier[static], parameter[key, cloneList]] begin[{]
if[binary_operation[literal[null], !=, member[.cloneList]]] begin[{]
local_variable[type[int], n]
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=elementAt, postfix_operators=[], prefix_operators=[], qualifier=cloneList, selectors=[], type_arguments=None), operator===), else_statement=None, label=None, then_statement=ReturnStatement(expression=Cast(expression=MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+)], member=elementAt, postfix_operators=[], prefix_operators=[], qualifier=cloneList, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=AxesWalker, sub_type=None)), label=None))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=n, 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=[Assignment(expressionl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2))]), label=None)
else begin[{]
None
end[}]
return[literal[null]]
end[}]
END[}] | Keyword[static] identifier[AxesWalker] identifier[findClone] operator[SEP] identifier[AxesWalker] identifier[key] , identifier[Vector] identifier[cloneList] operator[SEP] {
Keyword[if] operator[SEP] Other[null] operator[!=] identifier[cloneList] operator[SEP] {
Keyword[int] identifier[n] operator[=] identifier[cloneList] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[n] operator[SEP] identifier[i] operator[+=] Other[2] operator[SEP] {
Keyword[if] operator[SEP] identifier[key] operator[==] identifier[cloneList] operator[SEP] identifier[elementAt] operator[SEP] identifier[i] operator[SEP] operator[SEP] Keyword[return] operator[SEP] identifier[AxesWalker] operator[SEP] identifier[cloneList] operator[SEP] identifier[elementAt] operator[SEP] identifier[i] operator[+] Other[1] operator[SEP] operator[SEP]
}
}
Keyword[return] Other[null] operator[SEP]
}
|
public Order pay() throws StripeException {
return pay((Map<String, Object>) null, (RequestOptions) null);
} | class class_name[name] begin[{]
method[pay, return_type[type[Order]], modifier[public], parameter[]] begin[{]
return[call[.pay, parameter[Cast(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), 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=[], name=Map, sub_type=None)), Cast(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), type=ReferenceType(arguments=None, dimensions=[], name=RequestOptions, sub_type=None))]]]
end[}]
END[}] | Keyword[public] identifier[Order] identifier[pay] operator[SEP] operator[SEP] Keyword[throws] identifier[StripeException] {
Keyword[return] identifier[pay] operator[SEP] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] operator[SEP] Other[null] , operator[SEP] identifier[RequestOptions] operator[SEP] Other[null] operator[SEP] operator[SEP]
}
|
@Override
public synchronized void release () throws CIFSException {
long usage = this.usageCount.decrementAndGet();
if ( usage == 0 ) {
closeInternal(0L, false);
}
else if ( log.isTraceEnabled() ) {
log.trace(String.format("Release %s (%d)", this, usage));
}
} | class class_name[name] begin[{]
method[release, return_type[void], modifier[synchronized public], parameter[]] begin[{]
local_variable[type[long], usage]
if[binary_operation[member[.usage], ==, literal[0]]] begin[{]
call[.closeInternal, parameter[literal[0L], literal[false]]]
else begin[{]
if[call[log.isTraceEnabled, parameter[]]] begin[{]
call[log.trace, parameter[call[String.format, parameter[literal["Release %s (%d)"], THIS[], member[.usage]]]]]
else begin[{]
None
end[}]
end[}]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] Keyword[synchronized] Keyword[void] identifier[release] operator[SEP] operator[SEP] Keyword[throws] identifier[CIFSException] {
Keyword[long] identifier[usage] operator[=] Keyword[this] operator[SEP] identifier[usageCount] operator[SEP] identifier[decrementAndGet] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[usage] operator[==] Other[0] operator[SEP] {
identifier[closeInternal] operator[SEP] Other[0L] , literal[boolean] operator[SEP] operator[SEP]
}
Keyword[else] 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[String] operator[SEP] identifier[format] operator[SEP] literal[String] , Keyword[this] , identifier[usage] operator[SEP] operator[SEP] operator[SEP]
}
}
|
public ArrayList<String> license_worklight_new_GET(String ip, Boolean lessThan1000Users, OvhWorkLightVersionEnum version) throws IOException {
String qPath = "/order/license/worklight/new";
StringBuilder sb = path(qPath);
query(sb, "ip", ip);
query(sb, "lessThan1000Users", lessThan1000Users);
query(sb, "version", version);
String resp = exec(qPath, "GET", sb.toString(), null);
return convertTo(resp, t1);
} | class class_name[name] begin[{]
method[license_worklight_new_GET, return_type[type[ArrayList]], modifier[public], parameter[ip, lessThan1000Users, version]] begin[{]
local_variable[type[String], qPath]
local_variable[type[StringBuilder], sb]
call[.query, parameter[member[.sb], literal["ip"], member[.ip]]]
call[.query, parameter[member[.sb], literal["lessThan1000Users"], member[.lessThan1000Users]]]
call[.query, parameter[member[.sb], literal["version"], member[.version]]]
local_variable[type[String], resp]
return[call[.convertTo, parameter[member[.resp], member[.t1]]]]
end[}]
END[}] | Keyword[public] identifier[ArrayList] operator[<] identifier[String] operator[>] identifier[license_worklight_new_GET] operator[SEP] identifier[String] identifier[ip] , identifier[Boolean] identifier[lessThan1000Users] , identifier[OvhWorkLightVersionEnum] identifier[version] operator[SEP] Keyword[throws] identifier[IOException] {
identifier[String] identifier[qPath] operator[=] literal[String] operator[SEP] identifier[StringBuilder] identifier[sb] operator[=] identifier[path] operator[SEP] identifier[qPath] operator[SEP] operator[SEP] identifier[query] operator[SEP] identifier[sb] , literal[String] , identifier[ip] operator[SEP] operator[SEP] identifier[query] operator[SEP] identifier[sb] , literal[String] , identifier[lessThan1000Users] operator[SEP] operator[SEP] identifier[query] operator[SEP] identifier[sb] , literal[String] , identifier[version] operator[SEP] operator[SEP] identifier[String] identifier[resp] operator[=] identifier[exec] operator[SEP] identifier[qPath] , literal[String] , identifier[sb] operator[SEP] identifier[toString] operator[SEP] operator[SEP] , Other[null] operator[SEP] operator[SEP] Keyword[return] identifier[convertTo] operator[SEP] identifier[resp] , identifier[t1] operator[SEP] operator[SEP]
}
|
public void init(final SQLRouteResult routeResult) throws SQLException {
setSqlStatement(routeResult.getSqlStatement());
getExecuteGroups().addAll(obtainExecuteGroups(routeUnits));
} | class class_name[name] begin[{]
method[init, return_type[void], modifier[public], parameter[routeResult]] begin[{]
call[.setSqlStatement, parameter[call[routeResult.getSqlStatement, parameter[]]]]
call[.getExecuteGroups, parameter[]]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[init] operator[SEP] Keyword[final] identifier[SQLRouteResult] identifier[routeResult] operator[SEP] Keyword[throws] identifier[SQLException] {
identifier[setSqlStatement] operator[SEP] identifier[routeResult] operator[SEP] identifier[getSqlStatement] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[getExecuteGroups] operator[SEP] operator[SEP] operator[SEP] identifier[addAll] operator[SEP] identifier[obtainExecuteGroups] operator[SEP] identifier[routeUnits] operator[SEP] operator[SEP] operator[SEP]
}
|
@Override
public double doubleValue() {
if (isNaN()) {
return Double.NaN;
}
if (isInfinite()) {
if (isNegative()) {
return Double.NEGATIVE_INFINITY;
} else {
return Double.POSITIVE_INFINITY;
}
}
BigDecimal bigDecimal = bigDecimalValueNoNegativeZeroCheck();
if (hasDifferentSign(bigDecimal)) {
return -0.0d;
}
return bigDecimal.doubleValue();
} | class class_name[name] begin[{]
method[doubleValue, return_type[type[double]], modifier[public], parameter[]] begin[{]
if[call[.isNaN, parameter[]]] begin[{]
return[member[Double.NaN]]
else begin[{]
None
end[}]
if[call[.isInfinite, parameter[]]] begin[{]
if[call[.isNegative, parameter[]]] begin[{]
return[member[Double.NEGATIVE_INFINITY]]
else begin[{]
return[member[Double.POSITIVE_INFINITY]]
end[}]
else begin[{]
None
end[}]
local_variable[type[BigDecimal], bigDecimal]
if[call[.hasDifferentSign, parameter[member[.bigDecimal]]]] begin[{]
return[literal[0.0d]]
else begin[{]
None
end[}]
return[call[bigDecimal.doubleValue, parameter[]]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] Keyword[double] identifier[doubleValue] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[isNaN] operator[SEP] operator[SEP] operator[SEP] {
Keyword[return] identifier[Double] operator[SEP] identifier[NaN] operator[SEP]
}
Keyword[if] operator[SEP] identifier[isInfinite] operator[SEP] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[isNegative] operator[SEP] operator[SEP] operator[SEP] {
Keyword[return] identifier[Double] operator[SEP] identifier[NEGATIVE_INFINITY] operator[SEP]
}
Keyword[else] {
Keyword[return] identifier[Double] operator[SEP] identifier[POSITIVE_INFINITY] operator[SEP]
}
}
identifier[BigDecimal] identifier[bigDecimal] operator[=] identifier[bigDecimalValueNoNegativeZeroCheck] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[hasDifferentSign] operator[SEP] identifier[bigDecimal] operator[SEP] operator[SEP] {
Keyword[return] operator[-] literal[Float] operator[SEP]
}
Keyword[return] identifier[bigDecimal] operator[SEP] identifier[doubleValue] operator[SEP] operator[SEP] operator[SEP]
}
|
private void addRelevantPluginDependenciesToClasspath( List<Path> path )
throws MojoExecutionException
{
if ( hasCommandlineArgs() )
{
arguments = parseCommandlineArgs();
}
for ( Artifact classPathElement : this.determineRelevantPluginDependencies() )
{
getLog().debug( "Adding plugin dependency artifact: " + classPathElement.getArtifactId()
+ " to classpath" );
path.add( classPathElement.getFile().toPath() );
}
} | class class_name[name] begin[{]
method[addRelevantPluginDependenciesToClasspath, return_type[void], modifier[private], parameter[path]] begin[{]
if[call[.hasCommandlineArgs, parameter[]]] begin[{]
assign[member[.arguments], call[.parseCommandlineArgs, parameter[]]]
else begin[{]
None
end[}]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=getLog, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Adding plugin dependency artifact: "), operandr=MethodInvocation(arguments=[], member=getArtifactId, postfix_operators=[], prefix_operators=[], qualifier=classPathElement, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" to classpath"), operator=+)], member=debug, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getFile, postfix_operators=[], prefix_operators=[], qualifier=classPathElement, selectors=[MethodInvocation(arguments=[], member=toPath, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=path, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[], member=determineRelevantPluginDependencies, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=classPathElement)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Artifact, sub_type=None))), label=None)
end[}]
END[}] | Keyword[private] Keyword[void] identifier[addRelevantPluginDependenciesToClasspath] operator[SEP] identifier[List] operator[<] identifier[Path] operator[>] identifier[path] operator[SEP] Keyword[throws] identifier[MojoExecutionException] {
Keyword[if] operator[SEP] identifier[hasCommandlineArgs] operator[SEP] operator[SEP] operator[SEP] {
identifier[arguments] operator[=] identifier[parseCommandlineArgs] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[for] operator[SEP] identifier[Artifact] identifier[classPathElement] operator[:] Keyword[this] operator[SEP] identifier[determineRelevantPluginDependencies] operator[SEP] operator[SEP] operator[SEP] {
identifier[getLog] operator[SEP] operator[SEP] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[+] identifier[classPathElement] operator[SEP] identifier[getArtifactId] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] identifier[path] operator[SEP] identifier[add] operator[SEP] identifier[classPathElement] operator[SEP] identifier[getFile] operator[SEP] operator[SEP] operator[SEP] identifier[toPath] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
}
|
public final Post withAuthor(final User user) {
return new Post(id, slug, title, excerpt, content, authorId, user,
publishTimestamp, modifiedTimestamp, status, parentId,
guid, commentCount, metadata, type, mimeType, taxonomyTerms, children);
} | class class_name[name] begin[{]
method[withAuthor, return_type[type[Post]], modifier[final public], parameter[user]] begin[{]
return[ClassCreator(arguments=[MemberReference(member=id, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=slug, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=title, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=excerpt, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=content, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=authorId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=user, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=publishTimestamp, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=modifiedTimestamp, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=status, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=parentId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=guid, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=commentCount, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=metadata, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=mimeType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=taxonomyTerms, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=children, 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=Post, sub_type=None))]
end[}]
END[}] | Keyword[public] Keyword[final] identifier[Post] identifier[withAuthor] operator[SEP] Keyword[final] identifier[User] identifier[user] operator[SEP] {
Keyword[return] Keyword[new] identifier[Post] operator[SEP] identifier[id] , identifier[slug] , identifier[title] , identifier[excerpt] , identifier[content] , identifier[authorId] , identifier[user] , identifier[publishTimestamp] , identifier[modifiedTimestamp] , identifier[status] , identifier[parentId] , identifier[guid] , identifier[commentCount] , identifier[metadata] , identifier[type] , identifier[mimeType] , identifier[taxonomyTerms] , identifier[children] operator[SEP] operator[SEP]
}
|
public Observable<LongTermRetentionBackupInner> getAsync(String locationName, String longTermRetentionServerName, String longTermRetentionDatabaseName, String backupName) {
return getWithServiceResponseAsync(locationName, longTermRetentionServerName, longTermRetentionDatabaseName, backupName).map(new Func1<ServiceResponse<LongTermRetentionBackupInner>, LongTermRetentionBackupInner>() {
@Override
public LongTermRetentionBackupInner call(ServiceResponse<LongTermRetentionBackupInner> response) {
return response.body();
}
});
} | class class_name[name] begin[{]
method[getAsync, return_type[type[Observable]], modifier[public], parameter[locationName, longTermRetentionServerName, longTermRetentionDatabaseName, backupName]] begin[{]
return[call[.getWithServiceResponseAsync, parameter[member[.locationName], member[.longTermRetentionServerName], member[.longTermRetentionDatabaseName], member[.backupName]]]]
end[}]
END[}] | Keyword[public] identifier[Observable] operator[<] identifier[LongTermRetentionBackupInner] operator[>] identifier[getAsync] operator[SEP] identifier[String] identifier[locationName] , identifier[String] identifier[longTermRetentionServerName] , identifier[String] identifier[longTermRetentionDatabaseName] , identifier[String] identifier[backupName] operator[SEP] {
Keyword[return] identifier[getWithServiceResponseAsync] operator[SEP] identifier[locationName] , identifier[longTermRetentionServerName] , identifier[longTermRetentionDatabaseName] , identifier[backupName] operator[SEP] operator[SEP] identifier[map] operator[SEP] Keyword[new] identifier[Func1] operator[<] identifier[ServiceResponse] operator[<] identifier[LongTermRetentionBackupInner] operator[>] , identifier[LongTermRetentionBackupInner] operator[>] operator[SEP] operator[SEP] {
annotation[@] identifier[Override] Keyword[public] identifier[LongTermRetentionBackupInner] identifier[call] operator[SEP] identifier[ServiceResponse] operator[<] identifier[LongTermRetentionBackupInner] operator[>] identifier[response] operator[SEP] {
Keyword[return] identifier[response] operator[SEP] identifier[body] operator[SEP] operator[SEP] operator[SEP]
}
} operator[SEP] operator[SEP]
}
|
private static Matcher<UnaryTree> expressionFromUnaryTree(
final Matcher<ExpressionTree> exprMatcher) {
return new Matcher<UnaryTree>() {
@Override
public boolean matches(UnaryTree tree, VisitorState state) {
return exprMatcher.matches(tree.getExpression(), state);
}
};
} | class class_name[name] begin[{]
method[expressionFromUnaryTree, return_type[type[Matcher]], modifier[private static], parameter[exprMatcher]] begin[{]
return[ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[ReturnStatement(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getExpression, postfix_operators=[], prefix_operators=[], qualifier=tree, selectors=[], type_arguments=None), MemberReference(member=state, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=matches, postfix_operators=[], prefix_operators=[], qualifier=exprMatcher, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=matches, parameters=[FormalParameter(annotations=[], modifiers=set(), name=tree, type=ReferenceType(arguments=None, dimensions=[], name=UnaryTree, 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=UnaryTree, sub_type=None))], dimensions=None, name=Matcher, sub_type=None))]
end[}]
END[}] | Keyword[private] Keyword[static] identifier[Matcher] operator[<] identifier[UnaryTree] operator[>] identifier[expressionFromUnaryTree] operator[SEP] Keyword[final] identifier[Matcher] operator[<] identifier[ExpressionTree] operator[>] identifier[exprMatcher] operator[SEP] {
Keyword[return] Keyword[new] identifier[Matcher] operator[<] identifier[UnaryTree] operator[>] operator[SEP] operator[SEP] {
annotation[@] identifier[Override] Keyword[public] Keyword[boolean] identifier[matches] operator[SEP] identifier[UnaryTree] identifier[tree] , identifier[VisitorState] identifier[state] operator[SEP] {
Keyword[return] identifier[exprMatcher] operator[SEP] identifier[matches] operator[SEP] identifier[tree] operator[SEP] identifier[getExpression] operator[SEP] operator[SEP] , identifier[state] operator[SEP] operator[SEP]
}
} operator[SEP]
}
|
public static <T> T checkNotNull(
@Nullable final T reference,
final String eid,
final String messageFormat,
final Object... parameters
) {
if (reference == null) {
throw new EidNullPointerException(
ensureEid(eid).message(messageFormat, parameters)
);
}
return reference;
} | class class_name[name] begin[{]
method[checkNotNull, return_type[type[T]], modifier[public static], parameter[reference, eid, messageFormat, parameters]] begin[{]
if[binary_operation[member[.reference], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[MemberReference(member=eid, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=ensureEid, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[MemberReference(member=messageFormat, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=parameters, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=message, 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=EidNullPointerException, sub_type=None)), label=None)
else begin[{]
None
end[}]
return[member[.reference]]
end[}]
END[}] | Keyword[public] Keyword[static] operator[<] identifier[T] operator[>] identifier[T] identifier[checkNotNull] operator[SEP] annotation[@] identifier[Nullable] Keyword[final] identifier[T] identifier[reference] , Keyword[final] identifier[String] identifier[eid] , Keyword[final] identifier[String] identifier[messageFormat] , Keyword[final] identifier[Object] operator[...] identifier[parameters] operator[SEP] {
Keyword[if] operator[SEP] identifier[reference] operator[==] Other[null] operator[SEP] {
Keyword[throw] Keyword[new] identifier[EidNullPointerException] operator[SEP] identifier[ensureEid] operator[SEP] identifier[eid] operator[SEP] operator[SEP] identifier[message] operator[SEP] identifier[messageFormat] , identifier[parameters] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] identifier[reference] operator[SEP]
}
|
public void checkMultiSessionAllGlobalConfig(TransferSpecs transferSpecs) {
if(asperaTransferManagerConfig.isMultiSession()){
for(TransferSpec transferSpec : transferSpecs.transfer_specs) {
//If multisession defined as global use 'all' suffix, else check if a number has been specified
transferSpec.setRemote_host(updateRemoteHost(transferSpec.getRemote_host()));
}
}
} | class class_name[name] begin[{]
method[checkMultiSessionAllGlobalConfig, return_type[void], modifier[public], parameter[transferSpecs]] begin[{]
if[call[asperaTransferManagerConfig.isMultiSession, parameter[]]] begin[{]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getRemote_host, postfix_operators=[], prefix_operators=[], qualifier=transferSpec, selectors=[], type_arguments=None)], member=updateRemoteHost, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=setRemote_host, postfix_operators=[], prefix_operators=[], qualifier=transferSpec, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=transfer_specs, postfix_operators=[], prefix_operators=[], qualifier=transferSpecs, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=transferSpec)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=TransferSpec, sub_type=None))), label=None)
else begin[{]
None
end[}]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[checkMultiSessionAllGlobalConfig] operator[SEP] identifier[TransferSpecs] identifier[transferSpecs] operator[SEP] {
Keyword[if] operator[SEP] identifier[asperaTransferManagerConfig] operator[SEP] identifier[isMultiSession] operator[SEP] operator[SEP] operator[SEP] {
Keyword[for] operator[SEP] identifier[TransferSpec] identifier[transferSpec] operator[:] identifier[transferSpecs] operator[SEP] identifier[transfer_specs] operator[SEP] {
identifier[transferSpec] operator[SEP] identifier[setRemote_host] operator[SEP] identifier[updateRemoteHost] operator[SEP] identifier[transferSpec] operator[SEP] identifier[getRemote_host] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
}
}
|
public final CompletableFuture<V> start(@Nullable T arg, boolean failIfStarted) {
return start(arg, null, failIfStarted);
} | class class_name[name] begin[{]
method[start, return_type[type[CompletableFuture]], modifier[final public], parameter[arg, failIfStarted]] begin[{]
return[call[.start, parameter[member[.arg], literal[null], member[.failIfStarted]]]]
end[}]
END[}] | Keyword[public] Keyword[final] identifier[CompletableFuture] operator[<] identifier[V] operator[>] identifier[start] operator[SEP] annotation[@] identifier[Nullable] identifier[T] identifier[arg] , Keyword[boolean] identifier[failIfStarted] operator[SEP] {
Keyword[return] identifier[start] operator[SEP] identifier[arg] , Other[null] , identifier[failIfStarted] operator[SEP] operator[SEP]
}
|
void setArrayExpression(BSHArrayInitializer init) {
this.isArrayExpression = true;
if (parent instanceof BSHAssignment) {
BSHAssignment ass = (BSHAssignment) parent;
if ( null != ass.operator
&& ass.operator == ParserConstants.ASSIGN )
this.isMapExpression = true;
if ( this.isMapExpression
&& init.jjtGetParent() instanceof BSHArrayInitializer )
init.setMapInArray(true);
}
} | class class_name[name] begin[{]
method[setArrayExpression, return_type[void], modifier[default], parameter[init]] begin[{]
assign[THIS[member[None.isArrayExpression]], literal[true]]
if[binary_operation[member[.parent], instanceof, type[BSHAssignment]]] begin[{]
local_variable[type[BSHAssignment], ass]
if[binary_operation[binary_operation[literal[null], !=, member[ass.operator]], &&, binary_operation[member[ass.operator], ==, member[ParserConstants.ASSIGN]]]] begin[{]
assign[THIS[member[None.isMapExpression]], literal[true]]
else begin[{]
None
end[}]
if[binary_operation[THIS[member[None.isMapExpression]], &&, binary_operation[call[init.jjtGetParent, parameter[]], instanceof, type[BSHArrayInitializer]]]] begin[{]
call[init.setMapInArray, parameter[literal[true]]]
else begin[{]
None
end[}]
else begin[{]
None
end[}]
end[}]
END[}] | Keyword[void] identifier[setArrayExpression] operator[SEP] identifier[BSHArrayInitializer] identifier[init] operator[SEP] {
Keyword[this] operator[SEP] identifier[isArrayExpression] operator[=] literal[boolean] operator[SEP] Keyword[if] operator[SEP] identifier[parent] Keyword[instanceof] identifier[BSHAssignment] operator[SEP] {
identifier[BSHAssignment] identifier[ass] operator[=] operator[SEP] identifier[BSHAssignment] operator[SEP] identifier[parent] operator[SEP] Keyword[if] operator[SEP] Other[null] operator[!=] identifier[ass] operator[SEP] identifier[operator] operator[&&] identifier[ass] operator[SEP] identifier[operator] operator[==] identifier[ParserConstants] operator[SEP] identifier[ASSIGN] operator[SEP] Keyword[this] operator[SEP] identifier[isMapExpression] operator[=] literal[boolean] operator[SEP] Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[isMapExpression] operator[&&] identifier[init] operator[SEP] identifier[jjtGetParent] operator[SEP] operator[SEP] Keyword[instanceof] identifier[BSHArrayInitializer] operator[SEP] identifier[init] operator[SEP] identifier[setMapInArray] operator[SEP] literal[boolean] operator[SEP] operator[SEP]
}
}
|
public void setVolatile(boolean newVolatile)
{
boolean oldVolatile = volatile_;
volatile_ = newVolatile;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, TypesPackage.JVM_FIELD__VOLATILE, oldVolatile, volatile_));
} | class class_name[name] begin[{]
method[setVolatile, return_type[void], modifier[public], parameter[newVolatile]] begin[{]
local_variable[type[boolean], oldVolatile]
assign[member[.volatile_], member[.newVolatile]]
if[call[.eNotificationRequired, parameter[]]] begin[{]
call[.eNotify, parameter[ClassCreator(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), MemberReference(member=SET, postfix_operators=[], prefix_operators=[], qualifier=Notification, selectors=[]), MemberReference(member=JVM_FIELD__VOLATILE, postfix_operators=[], prefix_operators=[], qualifier=TypesPackage, selectors=[]), MemberReference(member=oldVolatile, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=volatile_, 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=ENotificationImpl, sub_type=None))]]
else begin[{]
None
end[}]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[setVolatile] operator[SEP] Keyword[boolean] identifier[newVolatile] operator[SEP] {
Keyword[boolean] identifier[oldVolatile] operator[=] identifier[volatile_] operator[SEP] identifier[volatile_] operator[=] identifier[newVolatile] operator[SEP] Keyword[if] operator[SEP] identifier[eNotificationRequired] operator[SEP] operator[SEP] operator[SEP] identifier[eNotify] operator[SEP] Keyword[new] identifier[ENotificationImpl] operator[SEP] Keyword[this] , identifier[Notification] operator[SEP] identifier[SET] , identifier[TypesPackage] operator[SEP] identifier[JVM_FIELD__VOLATILE] , identifier[oldVolatile] , identifier[volatile_] operator[SEP] operator[SEP] operator[SEP]
}
|
public void marshall(PortProbeDetail portProbeDetail, ProtocolMarshaller protocolMarshaller) {
if (portProbeDetail == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(portProbeDetail.getLocalPortDetails(), LOCALPORTDETAILS_BINDING);
protocolMarshaller.marshall(portProbeDetail.getRemoteIpDetails(), REMOTEIPDETAILS_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[portProbeDetail, protocolMarshaller]] begin[{]
if[binary_operation[member[.portProbeDetail], ==, 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=getLocalPortDetails, postfix_operators=[], prefix_operators=[], qualifier=portProbeDetail, selectors=[], type_arguments=None), MemberReference(member=LOCALPORTDETAILS_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=getRemoteIpDetails, postfix_operators=[], prefix_operators=[], qualifier=portProbeDetail, selectors=[], type_arguments=None), MemberReference(member=REMOTEIPDETAILS_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[PortProbeDetail] identifier[portProbeDetail] , identifier[ProtocolMarshaller] identifier[protocolMarshaller] operator[SEP] {
Keyword[if] operator[SEP] identifier[portProbeDetail] 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[portProbeDetail] operator[SEP] identifier[getLocalPortDetails] operator[SEP] operator[SEP] , identifier[LOCALPORTDETAILS_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[portProbeDetail] operator[SEP] identifier[getRemoteIpDetails] operator[SEP] operator[SEP] , identifier[REMOTEIPDETAILS_BINDING] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] {
Keyword[throw] Keyword[new] identifier[SdkClientException] operator[SEP] literal[String] operator[+] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP]
}
}
|
@Override
public void logMessage(LogLevel logLevel, String message, Class clazz, String methodName) {
} | class class_name[name] begin[{]
method[logMessage, return_type[void], modifier[public], parameter[logLevel, message, clazz, methodName]] begin[{]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[logMessage] operator[SEP] identifier[LogLevel] identifier[logLevel] , identifier[String] identifier[message] , identifier[Class] identifier[clazz] , identifier[String] identifier[methodName] operator[SEP] {
}
|
public static KvStateService fromConfiguration(TaskManagerServicesConfiguration taskManagerServicesConfiguration) {
KvStateRegistry kvStateRegistry = new KvStateRegistry();
QueryableStateConfiguration qsConfig = taskManagerServicesConfiguration.getQueryableStateConfig();
KvStateClientProxy kvClientProxy = null;
KvStateServer kvStateServer = null;
if (qsConfig != null) {
int numProxyServerNetworkThreads = qsConfig.numProxyServerThreads() == 0 ?
taskManagerServicesConfiguration.getNumberOfSlots() : qsConfig.numProxyServerThreads();
int numProxyServerQueryThreads = qsConfig.numProxyQueryThreads() == 0 ?
taskManagerServicesConfiguration.getNumberOfSlots() : qsConfig.numProxyQueryThreads();
kvClientProxy = QueryableStateUtils.createKvStateClientProxy(
taskManagerServicesConfiguration.getTaskManagerAddress(),
qsConfig.getProxyPortRange(),
numProxyServerNetworkThreads,
numProxyServerQueryThreads,
new DisabledKvStateRequestStats());
int numStateServerNetworkThreads = qsConfig.numStateServerThreads() == 0 ?
taskManagerServicesConfiguration.getNumberOfSlots() : qsConfig.numStateServerThreads();
int numStateServerQueryThreads = qsConfig.numStateQueryThreads() == 0 ?
taskManagerServicesConfiguration.getNumberOfSlots() : qsConfig.numStateQueryThreads();
kvStateServer = QueryableStateUtils.createKvStateServer(
taskManagerServicesConfiguration.getTaskManagerAddress(),
qsConfig.getStateServerPortRange(),
numStateServerNetworkThreads,
numStateServerQueryThreads,
kvStateRegistry,
new DisabledKvStateRequestStats());
}
return new KvStateService(kvStateRegistry, kvStateServer, kvClientProxy);
} | class class_name[name] begin[{]
method[fromConfiguration, return_type[type[KvStateService]], modifier[public static], parameter[taskManagerServicesConfiguration]] begin[{]
local_variable[type[KvStateRegistry], kvStateRegistry]
local_variable[type[QueryableStateConfiguration], qsConfig]
local_variable[type[KvStateClientProxy], kvClientProxy]
local_variable[type[KvStateServer], kvStateServer]
if[binary_operation[member[.qsConfig], !=, literal[null]]] begin[{]
local_variable[type[int], numProxyServerNetworkThreads]
local_variable[type[int], numProxyServerQueryThreads]
assign[member[.kvClientProxy], call[QueryableStateUtils.createKvStateClientProxy, parameter[call[taskManagerServicesConfiguration.getTaskManagerAddress, parameter[]], call[qsConfig.getProxyPortRange, parameter[]], member[.numProxyServerNetworkThreads], member[.numProxyServerQueryThreads], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=DisabledKvStateRequestStats, sub_type=None))]]]
local_variable[type[int], numStateServerNetworkThreads]
local_variable[type[int], numStateServerQueryThreads]
assign[member[.kvStateServer], call[QueryableStateUtils.createKvStateServer, parameter[call[taskManagerServicesConfiguration.getTaskManagerAddress, parameter[]], call[qsConfig.getStateServerPortRange, parameter[]], member[.numStateServerNetworkThreads], member[.numStateServerQueryThreads], member[.kvStateRegistry], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=DisabledKvStateRequestStats, sub_type=None))]]]
else begin[{]
None
end[}]
return[ClassCreator(arguments=[MemberReference(member=kvStateRegistry, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=kvStateServer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=kvClientProxy, 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=KvStateService, sub_type=None))]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[KvStateService] identifier[fromConfiguration] operator[SEP] identifier[TaskManagerServicesConfiguration] identifier[taskManagerServicesConfiguration] operator[SEP] {
identifier[KvStateRegistry] identifier[kvStateRegistry] operator[=] Keyword[new] identifier[KvStateRegistry] operator[SEP] operator[SEP] operator[SEP] identifier[QueryableStateConfiguration] identifier[qsConfig] operator[=] identifier[taskManagerServicesConfiguration] operator[SEP] identifier[getQueryableStateConfig] operator[SEP] operator[SEP] operator[SEP] identifier[KvStateClientProxy] identifier[kvClientProxy] operator[=] Other[null] operator[SEP] identifier[KvStateServer] identifier[kvStateServer] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[qsConfig] operator[!=] Other[null] operator[SEP] {
Keyword[int] identifier[numProxyServerNetworkThreads] operator[=] identifier[qsConfig] operator[SEP] identifier[numProxyServerThreads] operator[SEP] operator[SEP] operator[==] Other[0] operator[?] identifier[taskManagerServicesConfiguration] operator[SEP] identifier[getNumberOfSlots] operator[SEP] operator[SEP] operator[:] identifier[qsConfig] operator[SEP] identifier[numProxyServerThreads] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[numProxyServerQueryThreads] operator[=] identifier[qsConfig] operator[SEP] identifier[numProxyQueryThreads] operator[SEP] operator[SEP] operator[==] Other[0] operator[?] identifier[taskManagerServicesConfiguration] operator[SEP] identifier[getNumberOfSlots] operator[SEP] operator[SEP] operator[:] identifier[qsConfig] operator[SEP] identifier[numProxyQueryThreads] operator[SEP] operator[SEP] operator[SEP] identifier[kvClientProxy] operator[=] identifier[QueryableStateUtils] operator[SEP] identifier[createKvStateClientProxy] operator[SEP] identifier[taskManagerServicesConfiguration] operator[SEP] identifier[getTaskManagerAddress] operator[SEP] operator[SEP] , identifier[qsConfig] operator[SEP] identifier[getProxyPortRange] operator[SEP] operator[SEP] , identifier[numProxyServerNetworkThreads] , identifier[numProxyServerQueryThreads] , Keyword[new] identifier[DisabledKvStateRequestStats] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[numStateServerNetworkThreads] operator[=] identifier[qsConfig] operator[SEP] identifier[numStateServerThreads] operator[SEP] operator[SEP] operator[==] Other[0] operator[?] identifier[taskManagerServicesConfiguration] operator[SEP] identifier[getNumberOfSlots] operator[SEP] operator[SEP] operator[:] identifier[qsConfig] operator[SEP] identifier[numStateServerThreads] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[numStateServerQueryThreads] operator[=] identifier[qsConfig] operator[SEP] identifier[numStateQueryThreads] operator[SEP] operator[SEP] operator[==] Other[0] operator[?] identifier[taskManagerServicesConfiguration] operator[SEP] identifier[getNumberOfSlots] operator[SEP] operator[SEP] operator[:] identifier[qsConfig] operator[SEP] identifier[numStateQueryThreads] operator[SEP] operator[SEP] operator[SEP] identifier[kvStateServer] operator[=] identifier[QueryableStateUtils] operator[SEP] identifier[createKvStateServer] operator[SEP] identifier[taskManagerServicesConfiguration] operator[SEP] identifier[getTaskManagerAddress] operator[SEP] operator[SEP] , identifier[qsConfig] operator[SEP] identifier[getStateServerPortRange] operator[SEP] operator[SEP] , identifier[numStateServerNetworkThreads] , identifier[numStateServerQueryThreads] , identifier[kvStateRegistry] , Keyword[new] identifier[DisabledKvStateRequestStats] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] Keyword[new] identifier[KvStateService] operator[SEP] identifier[kvStateRegistry] , identifier[kvStateServer] , identifier[kvClientProxy] operator[SEP] operator[SEP]
}
|
static public String substitute(String original, String[] match, String[] subst) {
boolean ok = true;
for (String aMatch : match) {
if (original.contains(aMatch)) {
ok = false;
break;
}
}
if (ok) {
return original;
}
// gotta do it;
StringBuilder sb = new StringBuilder(original);
for (int i = 0; i < match.length; i++) {
substitute(sb, match[i], subst[i]);
}
return sb.toString();
} | class class_name[name] begin[{]
method[substitute, return_type[type[String]], modifier[public static], parameter[original, match, subst]] begin[{]
local_variable[type[boolean], ok]
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=aMatch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=contains, postfix_operators=[], prefix_operators=[], qualifier=original, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=ok, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)), label=None), BreakStatement(goto=None, label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=match, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=aMatch)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None)
if[member[.ok]] begin[{]
return[member[.original]]
else begin[{]
None
end[}]
local_variable[type[StringBuilder], sb]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=sb, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=match, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), MemberReference(member=subst, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])], member=substitute, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=match, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
return[call[sb.toString, parameter[]]]
end[}]
END[}] | Keyword[static] Keyword[public] identifier[String] identifier[substitute] operator[SEP] identifier[String] identifier[original] , identifier[String] operator[SEP] operator[SEP] identifier[match] , identifier[String] operator[SEP] operator[SEP] identifier[subst] operator[SEP] {
Keyword[boolean] identifier[ok] operator[=] literal[boolean] operator[SEP] Keyword[for] operator[SEP] identifier[String] identifier[aMatch] operator[:] identifier[match] operator[SEP] {
Keyword[if] operator[SEP] identifier[original] operator[SEP] identifier[contains] operator[SEP] identifier[aMatch] operator[SEP] operator[SEP] {
identifier[ok] operator[=] literal[boolean] operator[SEP] Keyword[break] operator[SEP]
}
}
Keyword[if] operator[SEP] identifier[ok] operator[SEP] {
Keyword[return] identifier[original] operator[SEP]
}
identifier[StringBuilder] identifier[sb] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] identifier[original] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[match] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] {
identifier[substitute] operator[SEP] identifier[sb] , identifier[match] operator[SEP] identifier[i] operator[SEP] , identifier[subst] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] identifier[sb] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP]
}
|
public double[] satToEarth(double x, double y) {
if (scan_geom.equals(GOES)) { // convert from GOES to GEOS for transfrom below
double[] lambda_theta_geos = GOES_to_GEOS(x, y);
x = lambda_theta_geos[0];
y = lambda_theta_geos[1];
}
double c1 = (h * Math.cos(x) * Math.cos(y)) * (h * Math.cos(x) * Math.cos(y));
double c2 = (Math.cos(y) * Math.cos(y) + fp * Math.sin(y) * Math.sin(y)) * d;
if (c1 < c2) {
return new double[]{Double.NaN, Double.NaN};
}
double s_d = Math.sqrt(c1 - c2);
double s_n = (h * Math.cos(x) * Math.cos(y) - s_d) / (Math.cos(y) * Math.cos(y) + fp * Math.sin(y) * Math.sin(y));
double s_1 = h - s_n * Math.cos(x) * Math.cos(y);
double s_2 = s_n * Math.sin(x) * Math.cos(y);
double s_3 = -s_n * Math.sin(y);
double s_xy = Math.sqrt(s_1 * s_1 + s_2 * s_2);
double geographic_lon = Math.atan(s_2 / s_1) + sub_lon;
double geographic_lat = Math.atan(-fp * (s_3 / s_xy));
double lonDegrees = RAD_TO_DEG * geographic_lon;
double latDegrees = RAD_TO_DEG * geographic_lat;
// force output longitude to -180 to 180 range
if (lonDegrees < -180.0) lonDegrees += 360.0;
if (lonDegrees > 180.0) lonDegrees -= 360.0;
return new double[]{lonDegrees, latDegrees};
} | class class_name[name] begin[{]
method[satToEarth, return_type[type[double]], modifier[public], parameter[x, y]] begin[{]
if[call[scan_geom.equals, parameter[member[.GOES]]]] begin[{]
local_variable[type[double], lambda_theta_geos]
assign[member[.x], member[.lambda_theta_geos]]
assign[member[.y], member[.lambda_theta_geos]]
else begin[{]
None
end[}]
local_variable[type[double], c1]
local_variable[type[double], c2]
if[binary_operation[member[.c1], <, member[.c2]]] begin[{]
return[ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MemberReference(member=NaN, postfix_operators=[], prefix_operators=[], qualifier=Double, selectors=[]), MemberReference(member=NaN, postfix_operators=[], prefix_operators=[], qualifier=Double, selectors=[])]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=None, name=double))]
else begin[{]
None
end[}]
local_variable[type[double], s_d]
local_variable[type[double], s_n]
local_variable[type[double], s_1]
local_variable[type[double], s_2]
local_variable[type[double], s_3]
local_variable[type[double], s_xy]
local_variable[type[double], geographic_lon]
local_variable[type[double], geographic_lat]
local_variable[type[double], lonDegrees]
local_variable[type[double], latDegrees]
if[binary_operation[member[.lonDegrees], <, literal[180.0]]] begin[{]
assign[member[.lonDegrees], literal[360.0]]
else begin[{]
None
end[}]
if[binary_operation[member[.lonDegrees], >, literal[180.0]]] begin[{]
assign[member[.lonDegrees], literal[360.0]]
else begin[{]
None
end[}]
return[ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MemberReference(member=lonDegrees, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=latDegrees, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=None, name=double))]
end[}]
END[}] | Keyword[public] Keyword[double] operator[SEP] operator[SEP] identifier[satToEarth] operator[SEP] Keyword[double] identifier[x] , Keyword[double] identifier[y] operator[SEP] {
Keyword[if] operator[SEP] identifier[scan_geom] operator[SEP] identifier[equals] operator[SEP] identifier[GOES] operator[SEP] operator[SEP] {
Keyword[double] operator[SEP] operator[SEP] identifier[lambda_theta_geos] operator[=] identifier[GOES_to_GEOS] operator[SEP] identifier[x] , identifier[y] operator[SEP] operator[SEP] identifier[x] operator[=] identifier[lambda_theta_geos] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[y] operator[=] identifier[lambda_theta_geos] operator[SEP] Other[1] operator[SEP] operator[SEP]
}
Keyword[double] identifier[c1] operator[=] operator[SEP] identifier[h] operator[*] identifier[Math] operator[SEP] identifier[cos] operator[SEP] identifier[x] operator[SEP] operator[*] identifier[Math] operator[SEP] identifier[cos] operator[SEP] identifier[y] operator[SEP] operator[SEP] operator[*] operator[SEP] identifier[h] operator[*] identifier[Math] operator[SEP] identifier[cos] operator[SEP] identifier[x] operator[SEP] operator[*] identifier[Math] operator[SEP] identifier[cos] operator[SEP] identifier[y] operator[SEP] operator[SEP] operator[SEP] Keyword[double] identifier[c2] operator[=] operator[SEP] identifier[Math] operator[SEP] identifier[cos] operator[SEP] identifier[y] operator[SEP] operator[*] identifier[Math] operator[SEP] identifier[cos] operator[SEP] identifier[y] operator[SEP] operator[+] identifier[fp] operator[*] identifier[Math] operator[SEP] identifier[sin] operator[SEP] identifier[y] operator[SEP] operator[*] identifier[Math] operator[SEP] identifier[sin] operator[SEP] identifier[y] operator[SEP] operator[SEP] operator[*] identifier[d] operator[SEP] Keyword[if] operator[SEP] identifier[c1] operator[<] identifier[c2] operator[SEP] {
Keyword[return] Keyword[new] Keyword[double] operator[SEP] operator[SEP] {
identifier[Double] operator[SEP] identifier[NaN] , identifier[Double] operator[SEP] identifier[NaN]
} operator[SEP]
}
Keyword[double] identifier[s_d] operator[=] identifier[Math] operator[SEP] identifier[sqrt] operator[SEP] identifier[c1] operator[-] identifier[c2] operator[SEP] operator[SEP] Keyword[double] identifier[s_n] operator[=] operator[SEP] identifier[h] operator[*] identifier[Math] operator[SEP] identifier[cos] operator[SEP] identifier[x] operator[SEP] operator[*] identifier[Math] operator[SEP] identifier[cos] operator[SEP] identifier[y] operator[SEP] operator[-] identifier[s_d] operator[SEP] operator[/] operator[SEP] identifier[Math] operator[SEP] identifier[cos] operator[SEP] identifier[y] operator[SEP] operator[*] identifier[Math] operator[SEP] identifier[cos] operator[SEP] identifier[y] operator[SEP] operator[+] identifier[fp] operator[*] identifier[Math] operator[SEP] identifier[sin] operator[SEP] identifier[y] operator[SEP] operator[*] identifier[Math] operator[SEP] identifier[sin] operator[SEP] identifier[y] operator[SEP] operator[SEP] operator[SEP] Keyword[double] identifier[s_1] operator[=] identifier[h] operator[-] identifier[s_n] operator[*] identifier[Math] operator[SEP] identifier[cos] operator[SEP] identifier[x] operator[SEP] operator[*] identifier[Math] operator[SEP] identifier[cos] operator[SEP] identifier[y] operator[SEP] operator[SEP] Keyword[double] identifier[s_2] operator[=] identifier[s_n] operator[*] identifier[Math] operator[SEP] identifier[sin] operator[SEP] identifier[x] operator[SEP] operator[*] identifier[Math] operator[SEP] identifier[cos] operator[SEP] identifier[y] operator[SEP] operator[SEP] Keyword[double] identifier[s_3] operator[=] operator[-] identifier[s_n] operator[*] identifier[Math] operator[SEP] identifier[sin] operator[SEP] identifier[y] operator[SEP] operator[SEP] Keyword[double] identifier[s_xy] operator[=] identifier[Math] operator[SEP] identifier[sqrt] operator[SEP] identifier[s_1] operator[*] identifier[s_1] operator[+] identifier[s_2] operator[*] identifier[s_2] operator[SEP] operator[SEP] Keyword[double] identifier[geographic_lon] operator[=] identifier[Math] operator[SEP] identifier[atan] operator[SEP] identifier[s_2] operator[/] identifier[s_1] operator[SEP] operator[+] identifier[sub_lon] operator[SEP] Keyword[double] identifier[geographic_lat] operator[=] identifier[Math] operator[SEP] identifier[atan] operator[SEP] operator[-] identifier[fp] operator[*] operator[SEP] identifier[s_3] operator[/] identifier[s_xy] operator[SEP] operator[SEP] operator[SEP] Keyword[double] identifier[lonDegrees] operator[=] identifier[RAD_TO_DEG] operator[*] identifier[geographic_lon] operator[SEP] Keyword[double] identifier[latDegrees] operator[=] identifier[RAD_TO_DEG] operator[*] identifier[geographic_lat] operator[SEP] Keyword[if] operator[SEP] identifier[lonDegrees] operator[<] operator[-] literal[Float] operator[SEP] identifier[lonDegrees] operator[+=] literal[Float] operator[SEP] Keyword[if] operator[SEP] identifier[lonDegrees] operator[>] literal[Float] operator[SEP] identifier[lonDegrees] operator[-=] literal[Float] operator[SEP] Keyword[return] Keyword[new] Keyword[double] operator[SEP] operator[SEP] {
identifier[lonDegrees] , identifier[latDegrees]
} operator[SEP]
}
|
public static URI resolveParams(final URI uri,
final Map<String, String> params,
final boolean strict,
final boolean strictNorm) throws NormalizationException {
return resolve(uri, "&" + PARAM_JOINER.join(getParametersFromMap(params, strict)), strictNorm);
} | class class_name[name] begin[{]
method[resolveParams, return_type[type[URI]], modifier[public static], parameter[uri, params, strict, strictNorm]] begin[{]
return[call[.resolve, parameter[member[.uri], binary_operation[literal["&"], +, call[PARAM_JOINER.join, parameter[call[.getParametersFromMap, parameter[member[.params], member[.strict]]]]]], member[.strictNorm]]]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[URI] identifier[resolveParams] operator[SEP] Keyword[final] identifier[URI] identifier[uri] , Keyword[final] identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[params] , Keyword[final] Keyword[boolean] identifier[strict] , Keyword[final] Keyword[boolean] identifier[strictNorm] operator[SEP] Keyword[throws] identifier[NormalizationException] {
Keyword[return] identifier[resolve] operator[SEP] identifier[uri] , literal[String] operator[+] identifier[PARAM_JOINER] operator[SEP] identifier[join] operator[SEP] identifier[getParametersFromMap] operator[SEP] identifier[params] , identifier[strict] operator[SEP] operator[SEP] , identifier[strictNorm] operator[SEP] operator[SEP]
}
|
private void updatePayload() {
byte[] by = Charsetfunctions.utf8Bytes(reason);
ByteBuffer buf = ByteBuffer.allocate(4);
buf.putInt(code);
buf.position(2);
ByteBuffer pay = ByteBuffer.allocate(2 + by.length);
pay.put(buf);
pay.put(by);
pay.rewind();
super.setPayload(pay);
} | class class_name[name] begin[{]
method[updatePayload, return_type[void], modifier[private], parameter[]] begin[{]
local_variable[type[byte], by]
local_variable[type[ByteBuffer], buf]
call[buf.putInt, parameter[member[.code]]]
call[buf.position, parameter[literal[2]]]
local_variable[type[ByteBuffer], pay]
call[pay.put, parameter[member[.buf]]]
call[pay.put, parameter[member[.by]]]
call[pay.rewind, parameter[]]
SuperMethodInvocation(arguments=[MemberReference(member=pay, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setPayload, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None)
end[}]
END[}] | Keyword[private] Keyword[void] identifier[updatePayload] operator[SEP] operator[SEP] {
Keyword[byte] operator[SEP] operator[SEP] identifier[by] operator[=] identifier[Charsetfunctions] operator[SEP] identifier[utf8Bytes] operator[SEP] identifier[reason] operator[SEP] operator[SEP] identifier[ByteBuffer] identifier[buf] operator[=] identifier[ByteBuffer] operator[SEP] identifier[allocate] operator[SEP] Other[4] operator[SEP] operator[SEP] identifier[buf] operator[SEP] identifier[putInt] operator[SEP] identifier[code] operator[SEP] operator[SEP] identifier[buf] operator[SEP] identifier[position] operator[SEP] Other[2] operator[SEP] operator[SEP] identifier[ByteBuffer] identifier[pay] operator[=] identifier[ByteBuffer] operator[SEP] identifier[allocate] operator[SEP] Other[2] operator[+] identifier[by] operator[SEP] identifier[length] operator[SEP] operator[SEP] identifier[pay] operator[SEP] identifier[put] operator[SEP] identifier[buf] operator[SEP] operator[SEP] identifier[pay] operator[SEP] identifier[put] operator[SEP] identifier[by] operator[SEP] operator[SEP] identifier[pay] operator[SEP] identifier[rewind] operator[SEP] operator[SEP] operator[SEP] Keyword[super] operator[SEP] identifier[setPayload] operator[SEP] identifier[pay] operator[SEP] operator[SEP]
}
|
public void set(String glob) {
StringBuilder regex = new StringBuilder();
int setOpen = 0;
int curlyOpen = 0;
int len = glob.length();
hasWildcard = false;
for (int i = 0; i < len; i++) {
char c = glob.charAt(i);
switch (c) {
case BACKSLASH:
if (++i >= len) {
error("Missing escaped character", glob, i);
}
regex.append(c).append(glob.charAt(i));
continue;
case '.':
case '$':
case '(':
case ')':
case '|':
case '+':
// escape regex special chars that are not glob special chars
regex.append(BACKSLASH);
break;
case '*':
if (i + 1 < len && glob.charAt(i + 1) == '*') {
regex.append('.');
i++;
break;
}
regex.append("[^" + PATH_SEPARATOR + "]");
hasWildcard = true;
break;
case '?':
regex.append('.');
hasWildcard = true;
continue;
case '{': // start of a group
regex.append("(?:"); // non-capturing
curlyOpen++;
hasWildcard = true;
continue;
case ',':
regex.append(curlyOpen > 0 ? '|' : c);
continue;
case '}':
if (curlyOpen > 0) {
// end of a group
curlyOpen--;
regex.append(")");
continue;
}
break;
case '[':
if (setOpen > 0) {
error("Unclosed character class", glob, i);
}
setOpen++;
hasWildcard = true;
break;
case '^': // ^ inside [...] can be unescaped
if (setOpen == 0) {
regex.append(BACKSLASH);
}
break;
case '!': // [! needs to be translated to [^
regex.append(setOpen > 0 && '[' == glob.charAt(i - 1) ? '^' : '!');
continue;
case ']':
// Many set errors like [][] could not be easily detected here,
// as []], []-] and [-] are all valid POSIX glob and java regex.
// We'll just let the regex compiler do the real work.
setOpen = 0;
break;
default:
}
regex.append(c);
}
if (setOpen > 0) {
error("Unclosed character class", glob, len);
}
if (curlyOpen > 0) {
error("Unclosed group", glob, len);
}
compiled = Pattern.compile(regex.toString());
} | class class_name[name] begin[{]
method[set, return_type[void], modifier[public], parameter[glob]] begin[{]
local_variable[type[StringBuilder], regex]
local_variable[type[int], setOpen]
local_variable[type[int], curlyOpen]
local_variable[type[int], len]
assign[member[.hasWildcard], literal[false]]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=charAt, postfix_operators=[], prefix_operators=[], qualifier=glob, selectors=[], type_arguments=None), name=c)], modifiers=set(), type=BasicType(dimensions=[], name=char)), SwitchStatement(cases=[SwitchStatementCase(case=['BACKSLASH'], statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=['++'], qualifier=, selectors=[]), operandr=MemberReference(member=len, postfix_operators=[], prefix_operators=[], qualifier=, 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="Missing escaped character"), MemberReference(member=glob, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, 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=append, postfix_operators=[], prefix_operators=[], qualifier=regex, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=charAt, postfix_operators=[], prefix_operators=[], qualifier=glob, selectors=[], type_arguments=None)], member=append, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None), ContinueStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='.'), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='$'), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='('), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=')'), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='|'), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='+')], statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=BACKSLASH, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=append, postfix_operators=[], prefix_operators=[], qualifier=regex, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='*')], statements=[IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+), operandr=MemberReference(member=len, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+)], member=charAt, postfix_operators=[], prefix_operators=[], qualifier=glob, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='*'), operator===), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='.')], member=append, postfix_operators=[], prefix_operators=[], qualifier=regex, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]), label=None), BreakStatement(goto=None, label=None)])), StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="[^"), operandr=MemberReference(member=PATH_SEPARATOR, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="]"), operator=+)], member=append, postfix_operators=[], prefix_operators=[], qualifier=regex, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=hasWildcard, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='?')], statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='.')], member=append, postfix_operators=[], prefix_operators=[], qualifier=regex, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=hasWildcard, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)), label=None), ContinueStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='{')], statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="(?:")], member=append, postfix_operators=[], prefix_operators=[], qualifier=regex, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MemberReference(member=curlyOpen, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=hasWildcard, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)), label=None), ContinueStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=',')], statements=[StatementExpression(expression=MethodInvocation(arguments=[TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=curlyOpen, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>), if_false=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='|'))], member=append, postfix_operators=[], prefix_operators=[], qualifier=regex, selectors=[], type_arguments=None), label=None), ContinueStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='}')], statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=curlyOpen, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MemberReference(member=curlyOpen, postfix_operators=['--'], prefix_operators=[], qualifier=, selectors=[]), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=")")], member=append, postfix_operators=[], prefix_operators=[], qualifier=regex, selectors=[], type_arguments=None), label=None), ContinueStatement(goto=None, label=None)])), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='[')], statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=setOpen, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unclosed character class"), MemberReference(member=glob, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=MemberReference(member=setOpen, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=hasWildcard, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='^')], statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=setOpen, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=BACKSLASH, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=append, postfix_operators=[], prefix_operators=[], qualifier=regex, selectors=[], type_arguments=None), label=None)])), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='!')], statements=[StatementExpression(expression=MethodInvocation(arguments=[TernaryExpression(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=setOpen, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>), operandr=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='['), operandr=MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-)], member=charAt, postfix_operators=[], prefix_operators=[], qualifier=glob, selectors=[], type_arguments=None), operator===), operator=&&), if_false=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='!'), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='^'))], member=append, postfix_operators=[], prefix_operators=[], qualifier=regex, selectors=[], type_arguments=None), label=None), ContinueStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=']')], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=setOpen, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[], statements=[])], expression=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=append, postfix_operators=[], prefix_operators=[], qualifier=regex, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=len, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
if[binary_operation[member[.setOpen], >, literal[0]]] begin[{]
call[.error, parameter[literal["Unclosed character class"], member[.glob], member[.len]]]
else begin[{]
None
end[}]
if[binary_operation[member[.curlyOpen], >, literal[0]]] begin[{]
call[.error, parameter[literal["Unclosed group"], member[.glob], member[.len]]]
else begin[{]
None
end[}]
assign[member[.compiled], call[Pattern.compile, parameter[call[regex.toString, parameter[]]]]]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[set] operator[SEP] identifier[String] identifier[glob] operator[SEP] {
identifier[StringBuilder] identifier[regex] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[setOpen] operator[=] Other[0] operator[SEP] Keyword[int] identifier[curlyOpen] operator[=] Other[0] operator[SEP] Keyword[int] identifier[len] operator[=] identifier[glob] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] identifier[hasWildcard] operator[=] literal[boolean] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[len] operator[SEP] identifier[i] operator[++] operator[SEP] {
Keyword[char] identifier[c] operator[=] identifier[glob] operator[SEP] identifier[charAt] operator[SEP] identifier[i] operator[SEP] operator[SEP] Keyword[switch] operator[SEP] identifier[c] operator[SEP] {
Keyword[case] identifier[BACKSLASH] operator[:] Keyword[if] operator[SEP] operator[++] identifier[i] operator[>=] identifier[len] operator[SEP] {
identifier[error] operator[SEP] literal[String] , identifier[glob] , identifier[i] operator[SEP] operator[SEP]
}
identifier[regex] operator[SEP] identifier[append] operator[SEP] identifier[c] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[glob] operator[SEP] identifier[charAt] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP] Keyword[continue] operator[SEP] Keyword[case] literal[String] operator[:] Keyword[case] literal[String] operator[:] Keyword[case] literal[String] operator[:] Keyword[case] literal[String] operator[:] Keyword[case] literal[String] operator[:] Keyword[case] literal[String] operator[:] identifier[regex] operator[SEP] identifier[append] operator[SEP] identifier[BACKSLASH] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] literal[String] operator[:] Keyword[if] operator[SEP] identifier[i] operator[+] Other[1] operator[<] identifier[len] operator[&&] identifier[glob] operator[SEP] identifier[charAt] operator[SEP] identifier[i] operator[+] Other[1] operator[SEP] operator[==] literal[String] operator[SEP] {
identifier[regex] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[i] operator[++] operator[SEP] Keyword[break] operator[SEP]
}
identifier[regex] operator[SEP] identifier[append] operator[SEP] literal[String] operator[+] identifier[PATH_SEPARATOR] operator[+] literal[String] operator[SEP] operator[SEP] identifier[hasWildcard] operator[=] literal[boolean] operator[SEP] Keyword[break] operator[SEP] Keyword[case] literal[String] operator[:] identifier[regex] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[hasWildcard] operator[=] literal[boolean] operator[SEP] Keyword[continue] operator[SEP] Keyword[case] literal[String] operator[:] identifier[regex] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[curlyOpen] operator[++] operator[SEP] identifier[hasWildcard] operator[=] literal[boolean] operator[SEP] Keyword[continue] operator[SEP] Keyword[case] literal[String] operator[:] identifier[regex] operator[SEP] identifier[append] operator[SEP] identifier[curlyOpen] operator[>] Other[0] operator[?] literal[String] operator[:] identifier[c] operator[SEP] operator[SEP] Keyword[continue] operator[SEP] Keyword[case] literal[String] operator[:] Keyword[if] operator[SEP] identifier[curlyOpen] operator[>] Other[0] operator[SEP] {
identifier[curlyOpen] operator[--] operator[SEP] identifier[regex] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[continue] operator[SEP]
}
Keyword[break] operator[SEP] Keyword[case] literal[String] operator[:] Keyword[if] operator[SEP] identifier[setOpen] operator[>] Other[0] operator[SEP] {
identifier[error] operator[SEP] literal[String] , identifier[glob] , identifier[i] operator[SEP] operator[SEP]
}
identifier[setOpen] operator[++] operator[SEP] identifier[hasWildcard] operator[=] literal[boolean] operator[SEP] Keyword[break] operator[SEP] Keyword[case] literal[String] operator[:] Keyword[if] operator[SEP] identifier[setOpen] operator[==] Other[0] operator[SEP] {
identifier[regex] operator[SEP] identifier[append] operator[SEP] identifier[BACKSLASH] operator[SEP] operator[SEP]
}
Keyword[break] operator[SEP] Keyword[case] literal[String] operator[:] identifier[regex] operator[SEP] identifier[append] operator[SEP] identifier[setOpen] operator[>] Other[0] operator[&&] literal[String] operator[==] identifier[glob] operator[SEP] identifier[charAt] operator[SEP] identifier[i] operator[-] Other[1] operator[SEP] operator[?] literal[String] operator[:] literal[String] operator[SEP] operator[SEP] Keyword[continue] operator[SEP] Keyword[case] literal[String] operator[:] identifier[setOpen] operator[=] Other[0] operator[SEP] Keyword[break] operator[SEP] Keyword[default] operator[:]
}
identifier[regex] operator[SEP] identifier[append] operator[SEP] identifier[c] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[setOpen] operator[>] Other[0] operator[SEP] {
identifier[error] operator[SEP] literal[String] , identifier[glob] , identifier[len] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[curlyOpen] operator[>] Other[0] operator[SEP] {
identifier[error] operator[SEP] literal[String] , identifier[glob] , identifier[len] operator[SEP] operator[SEP]
}
identifier[compiled] operator[=] identifier[Pattern] operator[SEP] identifier[compile] operator[SEP] identifier[regex] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
public static ManagedChannel createChannelPool(final String host, final BigtableOptions options)
throws IOException, GeneralSecurityException {
return createChannelPool(host, options, 1);
} | class class_name[name] begin[{]
method[createChannelPool, return_type[type[ManagedChannel]], modifier[public static], parameter[host, options]] begin[{]
return[call[.createChannelPool, parameter[member[.host], member[.options], literal[1]]]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[ManagedChannel] identifier[createChannelPool] operator[SEP] Keyword[final] identifier[String] identifier[host] , Keyword[final] identifier[BigtableOptions] identifier[options] operator[SEP] Keyword[throws] identifier[IOException] , identifier[GeneralSecurityException] {
Keyword[return] identifier[createChannelPool] operator[SEP] identifier[host] , identifier[options] , Other[1] operator[SEP] operator[SEP]
}
|
public static String lemmatizedInsensitiveGroupingKey(TermWord termWord) {
return StringUtils.replaceAccents(String.format(
STEMMED_INSENSITIVE_GKEY_FORMAT,
termWord.getSyntacticLabel(),
termWord.getWord().getLemma()).toLowerCase());
} | class class_name[name] begin[{]
method[lemmatizedInsensitiveGroupingKey, return_type[type[String]], modifier[public static], parameter[termWord]] begin[{]
return[call[StringUtils.replaceAccents, parameter[call[String.format, parameter[member[.STEMMED_INSENSITIVE_GKEY_FORMAT], call[termWord.getSyntacticLabel, parameter[]], call[termWord.getWord, parameter[]]]]]]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[String] identifier[lemmatizedInsensitiveGroupingKey] operator[SEP] identifier[TermWord] identifier[termWord] operator[SEP] {
Keyword[return] identifier[StringUtils] operator[SEP] identifier[replaceAccents] operator[SEP] identifier[String] operator[SEP] identifier[format] operator[SEP] identifier[STEMMED_INSENSITIVE_GKEY_FORMAT] , identifier[termWord] operator[SEP] identifier[getSyntacticLabel] operator[SEP] operator[SEP] , identifier[termWord] operator[SEP] identifier[getWord] operator[SEP] operator[SEP] operator[SEP] identifier[getLemma] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[toLowerCase] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
public LsQuestion getQuestion(int surveyId, int questionId) throws LimesurveyRCException {
return getQuestions(surveyId).filter(question -> question.getId() == questionId)
.findFirst().orElseThrow(() -> new LimesurveyRCException("No question found for id " + questionId + " in survey " + surveyId));
} | class class_name[name] begin[{]
method[getQuestion, return_type[type[LsQuestion]], modifier[public], parameter[surveyId, questionId]] begin[{]
return[call[.getQuestions, parameter[member[.surveyId]]]]
end[}]
END[}] | Keyword[public] identifier[LsQuestion] identifier[getQuestion] operator[SEP] Keyword[int] identifier[surveyId] , Keyword[int] identifier[questionId] operator[SEP] Keyword[throws] identifier[LimesurveyRCException] {
Keyword[return] identifier[getQuestions] operator[SEP] identifier[surveyId] operator[SEP] operator[SEP] identifier[filter] operator[SEP] identifier[question] operator[->] identifier[question] operator[SEP] identifier[getId] operator[SEP] operator[SEP] operator[==] identifier[questionId] operator[SEP] operator[SEP] identifier[findFirst] operator[SEP] operator[SEP] operator[SEP] identifier[orElseThrow] operator[SEP] operator[SEP] operator[SEP] operator[->] Keyword[new] identifier[LimesurveyRCException] operator[SEP] literal[String] operator[+] identifier[questionId] operator[+] literal[String] operator[+] identifier[surveyId] operator[SEP] operator[SEP] operator[SEP]
}
|
public static Predicate<BuildRecord> includeTemporary(boolean temporary) {
return (root, query, cb) -> (temporary) ? cb.and() : cb.isFalse(root.get(BuildRecord_.temporaryBuild));
} | class class_name[name] begin[{]
method[includeTemporary, return_type[type[Predicate]], modifier[public static], parameter[temporary]] begin[{]
return[LambdaExpression(body=TernaryExpression(condition=MemberReference(member=temporary, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_false=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=temporaryBuild, postfix_operators=[], prefix_operators=[], qualifier=BuildRecord_, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=root, selectors=[], type_arguments=None)], member=isFalse, postfix_operators=[], prefix_operators=[], qualifier=cb, selectors=[], type_arguments=None), if_true=MethodInvocation(arguments=[], member=and, postfix_operators=[], prefix_operators=[], qualifier=cb, selectors=[], type_arguments=None)), parameters=[InferredFormalParameter(name=root), InferredFormalParameter(name=query), InferredFormalParameter(name=cb)])]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[Predicate] operator[<] identifier[BuildRecord] operator[>] identifier[includeTemporary] operator[SEP] Keyword[boolean] identifier[temporary] operator[SEP] {
Keyword[return] operator[SEP] identifier[root] , identifier[query] , identifier[cb] operator[SEP] operator[->] operator[SEP] identifier[temporary] operator[SEP] operator[?] identifier[cb] operator[SEP] identifier[and] operator[SEP] operator[SEP] operator[:] identifier[cb] operator[SEP] identifier[isFalse] operator[SEP] identifier[root] operator[SEP] identifier[get] operator[SEP] identifier[BuildRecord_] operator[SEP] identifier[temporaryBuild] operator[SEP] operator[SEP] operator[SEP]
}
|
public static Call create(final BandwidthClient client, final Map <String, Object>params)
throws Exception {
assert (client != null && params != null);
final String callUri = client.getUserResourceUri(BandwidthConstants.CALLS_URI_PATH);
final RestResponse response = client.post(callUri, params);
// success here, otherwise an exception is generated
final String callId = response.getLocation().substring(client.getPath(callUri).length() + 1);
return get(client, callId);
} | class class_name[name] begin[{]
method[create, return_type[type[Call]], modifier[public static], parameter[client, params]] begin[{]
AssertStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=client, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operandr=BinaryOperation(operandl=MemberReference(member=params, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operator=&&), label=None, value=None)
local_variable[type[String], callUri]
local_variable[type[RestResponse], response]
local_variable[type[String], callId]
return[call[.get, parameter[member[.client], member[.callId]]]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[Call] identifier[create] operator[SEP] Keyword[final] identifier[BandwidthClient] identifier[client] , Keyword[final] identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] identifier[params] operator[SEP] Keyword[throws] identifier[Exception] {
Keyword[assert] operator[SEP] identifier[client] operator[!=] Other[null] operator[&&] identifier[params] operator[!=] Other[null] operator[SEP] operator[SEP] Keyword[final] identifier[String] identifier[callUri] operator[=] identifier[client] operator[SEP] identifier[getUserResourceUri] operator[SEP] identifier[BandwidthConstants] operator[SEP] identifier[CALLS_URI_PATH] operator[SEP] operator[SEP] Keyword[final] identifier[RestResponse] identifier[response] operator[=] identifier[client] operator[SEP] identifier[post] operator[SEP] identifier[callUri] , identifier[params] operator[SEP] operator[SEP] Keyword[final] identifier[String] identifier[callId] operator[=] identifier[response] operator[SEP] identifier[getLocation] operator[SEP] operator[SEP] operator[SEP] identifier[substring] operator[SEP] identifier[client] operator[SEP] identifier[getPath] operator[SEP] identifier[callUri] operator[SEP] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[+] Other[1] operator[SEP] operator[SEP] Keyword[return] identifier[get] operator[SEP] identifier[client] , identifier[callId] operator[SEP] operator[SEP]
}
|
@Override
protected void initPrototypeId(int id)
{
switch (id) {
case Id_constructor:
initPrototypeMethod(CLASS_NAME, id, "constructor", 1);
break;
case Id_toString:
initPrototypeMethod(CLASS_NAME, id, "toString", 0);
break;
case Id_valueOf:
initPrototypeMethod(CLASS_NAME, id, "valueOf", 0);
break;
case SymbolId_toStringTag:
initPrototypeValue(id, SymbolKey.TO_STRING_TAG, CLASS_NAME, DONTENUM | READONLY);
break;
case SymbolId_toPrimitive:
initPrototypeMethod(CLASS_NAME, id, SymbolKey.TO_PRIMITIVE, "Symbol.toPrimitive", 1);
break;
default:
super.initPrototypeId(id);
break;
}
} | class class_name[name] begin[{]
method[initPrototypeId, return_type[void], modifier[protected], parameter[id]] begin[{]
SwitchStatement(cases=[SwitchStatementCase(case=['Id_constructor'], statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=CLASS_NAME, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=id, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="constructor"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], member=initPrototypeMethod, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=['Id_toString'], statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=CLASS_NAME, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=id, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="toString"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], member=initPrototypeMethod, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=['Id_valueOf'], statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=CLASS_NAME, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=id, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="valueOf"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], member=initPrototypeMethod, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=['SymbolId_toStringTag'], statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=id, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=TO_STRING_TAG, postfix_operators=[], prefix_operators=[], qualifier=SymbolKey, selectors=[]), MemberReference(member=CLASS_NAME, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=MemberReference(member=DONTENUM, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=READONLY, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=|)], member=initPrototypeValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=['SymbolId_toPrimitive'], statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=CLASS_NAME, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=id, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=TO_PRIMITIVE, postfix_operators=[], prefix_operators=[], qualifier=SymbolKey, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Symbol.toPrimitive"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], member=initPrototypeMethod, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[], statements=[StatementExpression(expression=SuperMethodInvocation(arguments=[MemberReference(member=id, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=initPrototypeId, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)])], expression=MemberReference(member=id, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)
end[}]
END[}] | annotation[@] identifier[Override] Keyword[protected] Keyword[void] identifier[initPrototypeId] operator[SEP] Keyword[int] identifier[id] operator[SEP] {
Keyword[switch] operator[SEP] identifier[id] operator[SEP] {
Keyword[case] identifier[Id_constructor] operator[:] identifier[initPrototypeMethod] operator[SEP] identifier[CLASS_NAME] , identifier[id] , literal[String] , Other[1] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[Id_toString] operator[:] identifier[initPrototypeMethod] operator[SEP] identifier[CLASS_NAME] , identifier[id] , literal[String] , Other[0] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[Id_valueOf] operator[:] identifier[initPrototypeMethod] operator[SEP] identifier[CLASS_NAME] , identifier[id] , literal[String] , Other[0] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[SymbolId_toStringTag] operator[:] identifier[initPrototypeValue] operator[SEP] identifier[id] , identifier[SymbolKey] operator[SEP] identifier[TO_STRING_TAG] , identifier[CLASS_NAME] , identifier[DONTENUM] operator[|] identifier[READONLY] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[SymbolId_toPrimitive] operator[:] identifier[initPrototypeMethod] operator[SEP] identifier[CLASS_NAME] , identifier[id] , identifier[SymbolKey] operator[SEP] identifier[TO_PRIMITIVE] , literal[String] , Other[1] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[default] operator[:] Keyword[super] operator[SEP] identifier[initPrototypeId] operator[SEP] identifier[id] operator[SEP] operator[SEP] Keyword[break] operator[SEP]
}
}
|
private static void splitRowsOnGaps(Row row, final SDocumentGraph graph,
long startTokenIndex, long endTokenIndex)
{
ListIterator<GridEvent> itEvents = row.getEvents().listIterator();
while (itEvents.hasNext())
{
GridEvent event = itEvents.next();
int lastTokenIndex = -1;
// sort the coveredIDs
LinkedList<String> sortedCoveredToken = new LinkedList<>(event.
getCoveredIDs());
Collections.sort(sortedCoveredToken, new Comparator<String>()
{
@Override
public int compare(String o1, String o2)
{
SNode node1 = graph.getNode(o1);
SNode node2 = graph.getNode(o2);
if (node1 == node2)
{
return 0;
}
if (node1 == null)
{
return -1;
}
if (node2 == null)
{
return +1;
}
RelannisNodeFeature feat1 = (RelannisNodeFeature) node1.getFeature(
ANNIS_NS,
FEAT_RELANNIS_NODE).getValue();
RelannisNodeFeature feat2 = (RelannisNodeFeature) node2.getFeature(
ANNIS_NS,
FEAT_RELANNIS_NODE).getValue();
long tokenIndex1 = feat1.getTokenIndex();
long tokenIndex2 = feat2.getTokenIndex();
return Long.compare(tokenIndex1, tokenIndex2);
}
});
// first calculate all gaps
List<GridEvent> gaps = new LinkedList<>();
for (String id : sortedCoveredToken)
{
SNode node = graph.getNode(id);
RelannisNodeFeature feat = (RelannisNodeFeature) node.getFeature(
ANNIS_NS,
FEAT_RELANNIS_NODE).getValue();
long tokenIndexRaw = feat.getTokenIndex();
tokenIndexRaw = clip(tokenIndexRaw, startTokenIndex, endTokenIndex);
int tokenIndex = (int) (tokenIndexRaw - startTokenIndex);
// sanity check
if(tokenIndex >= event.getLeft() && tokenIndex <= event.getRight())
{
int diff = tokenIndex - lastTokenIndex;
if (lastTokenIndex >= 0 && diff > 1)
{
// we detected a gap
GridEvent gap = new GridEvent(event.getId() + "_gap_" + gaps.size(),
lastTokenIndex + 1, tokenIndex - 1, "");
gap.setGap(true);
gaps.add(gap);
}
lastTokenIndex = tokenIndex;
}
else
{
// reset gap search when discovered there were token we use for
// hightlighting but do not actually cover
lastTokenIndex = -1;
}
} // end for each covered token id
ListIterator<GridEvent> itGaps = gaps.listIterator();
// remember the old right value
int oldRight = event.getRight();
int gapNr = 0;
while(itGaps.hasNext())
{
GridEvent gap = itGaps.next();
if(gapNr == 0)
{
// shorten original event
event.setRight(gap.getLeft() - 1);
}
// insert the real gap
itEvents.add(gap);
int rightBorder = oldRight;
if(itGaps.hasNext())
{
// don't use the old event right border since the gap should only go until
// the next event
GridEvent nextGap = itGaps.next();
itGaps.previous();
rightBorder = nextGap.getLeft()-1;
}
// insert a new event node that covers the rest of the event
GridEvent after = new GridEvent(event);
after.setId(event.getId() + "_after_" + gapNr);
after.setLeft(gap.getRight() + 1);
after.setRight(rightBorder);
itEvents.add(after);
gapNr++;
}
}
} | class class_name[name] begin[{]
method[splitRowsOnGaps, return_type[void], modifier[private static], parameter[row, graph, startTokenIndex, endTokenIndex]] begin[{]
local_variable[type[ListIterator], itEvents]
while[call[itEvents.hasNext, parameter[]]] begin[{]
local_variable[type[GridEvent], event]
local_variable[type[int], lastTokenIndex]
local_variable[type[LinkedList], sortedCoveredToken]
call[Collections.sort, parameter[member[.sortedCoveredToken], ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=o1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getNode, postfix_operators=[], prefix_operators=[], qualifier=graph, selectors=[], type_arguments=None), name=node1)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=SNode, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=o2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getNode, postfix_operators=[], prefix_operators=[], qualifier=graph, selectors=[], type_arguments=None), name=node2)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=SNode, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=node1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=node2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), label=None)])), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=node1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=1), label=None)])), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=node2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=['+'], qualifier=None, selectors=[], value=1), label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MethodInvocation(arguments=[MemberReference(member=ANNIS_NS, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=FEAT_RELANNIS_NODE, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getFeature, postfix_operators=[], prefix_operators=[], qualifier=node1, selectors=[MethodInvocation(arguments=[], member=getValue, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=RelannisNodeFeature, sub_type=None)), name=feat1)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=RelannisNodeFeature, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MethodInvocation(arguments=[MemberReference(member=ANNIS_NS, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=FEAT_RELANNIS_NODE, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getFeature, postfix_operators=[], prefix_operators=[], qualifier=node2, selectors=[MethodInvocation(arguments=[], member=getValue, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=RelannisNodeFeature, sub_type=None)), name=feat2)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=RelannisNodeFeature, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getTokenIndex, postfix_operators=[], prefix_operators=[], qualifier=feat1, selectors=[], type_arguments=None), name=tokenIndex1)], modifiers=set(), type=BasicType(dimensions=[], name=long)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getTokenIndex, postfix_operators=[], prefix_operators=[], qualifier=feat2, selectors=[], type_arguments=None), name=tokenIndex2)], modifiers=set(), type=BasicType(dimensions=[], name=long)), ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=tokenIndex1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=tokenIndex2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=compare, postfix_operators=[], prefix_operators=[], qualifier=Long, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=compare, parameters=[FormalParameter(annotations=[], modifiers=set(), name=o1, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None), varargs=False), FormalParameter(annotations=[], modifiers=set(), name=o2, type=ReferenceType(arguments=None, dimensions=[], name=String, 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=String, sub_type=None))], dimensions=None, name=Comparator, sub_type=None))]]
local_variable[type[List], gaps]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=id, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getNode, postfix_operators=[], prefix_operators=[], qualifier=graph, selectors=[], type_arguments=None), name=node)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=SNode, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MethodInvocation(arguments=[MemberReference(member=ANNIS_NS, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=FEAT_RELANNIS_NODE, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getFeature, postfix_operators=[], prefix_operators=[], qualifier=node, selectors=[MethodInvocation(arguments=[], member=getValue, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=RelannisNodeFeature, sub_type=None)), name=feat)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=RelannisNodeFeature, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getTokenIndex, postfix_operators=[], prefix_operators=[], qualifier=feat, selectors=[], type_arguments=None), name=tokenIndexRaw)], modifiers=set(), type=BasicType(dimensions=[], name=long)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=tokenIndexRaw, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=tokenIndexRaw, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=startTokenIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=endTokenIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=clip, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=BinaryOperation(operandl=MemberReference(member=tokenIndexRaw, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=startTokenIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=-), type=BasicType(dimensions=[], name=int)), name=tokenIndex)], modifiers=set(), type=BasicType(dimensions=[], name=int)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=tokenIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=getLeft, postfix_operators=[], prefix_operators=[], qualifier=event, selectors=[], type_arguments=None), operator=>=), operandr=BinaryOperation(operandl=MemberReference(member=tokenIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=getRight, postfix_operators=[], prefix_operators=[], qualifier=event, selectors=[], type_arguments=None), operator=<=), operator=&&), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=lastTokenIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=1)), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=MemberReference(member=tokenIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=lastTokenIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=-), name=diff)], modifiers=set(), type=BasicType(dimensions=[], name=int)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=lastTokenIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>=), operandr=BinaryOperation(operandl=MemberReference(member=diff, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=>), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getId, postfix_operators=[], prefix_operators=[], qualifier=event, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="_gap_"), operator=+), operandr=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=gaps, selectors=[], type_arguments=None), operator=+), BinaryOperation(operandl=MemberReference(member=lastTokenIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+), BinaryOperation(operandl=MemberReference(member=tokenIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-), 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=GridEvent, sub_type=None)), name=gap)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=GridEvent, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], member=setGap, postfix_operators=[], prefix_operators=[], qualifier=gap, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=gap, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=gaps, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=lastTokenIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=tokenIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=sortedCoveredToken, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=id)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None)
local_variable[type[ListIterator], itGaps]
local_variable[type[int], oldRight]
local_variable[type[int], gapNr]
while[call[itGaps.hasNext, parameter[]]] begin[{]
local_variable[type[GridEvent], gap]
if[binary_operation[member[.gapNr], ==, literal[0]]] begin[{]
call[event.setRight, parameter[binary_operation[call[gap.getLeft, parameter[]], -, literal[1]]]]
else begin[{]
None
end[}]
call[itEvents.add, parameter[member[.gap]]]
local_variable[type[int], rightBorder]
if[call[itGaps.hasNext, parameter[]]] begin[{]
local_variable[type[GridEvent], nextGap]
call[itGaps.previous, parameter[]]
assign[member[.rightBorder], binary_operation[call[nextGap.getLeft, parameter[]], -, literal[1]]]
else begin[{]
None
end[}]
local_variable[type[GridEvent], after]
call[after.setId, parameter[binary_operation[binary_operation[call[event.getId, parameter[]], +, literal["_after_"]], +, member[.gapNr]]]]
call[after.setLeft, parameter[binary_operation[call[gap.getRight, parameter[]], +, literal[1]]]]
call[after.setRight, parameter[member[.rightBorder]]]
call[itEvents.add, parameter[member[.after]]]
member[.gapNr]
end[}]
end[}]
end[}]
END[}] | Keyword[private] Keyword[static] Keyword[void] identifier[splitRowsOnGaps] operator[SEP] identifier[Row] identifier[row] , Keyword[final] identifier[SDocumentGraph] identifier[graph] , Keyword[long] identifier[startTokenIndex] , Keyword[long] identifier[endTokenIndex] operator[SEP] {
identifier[ListIterator] operator[<] identifier[GridEvent] operator[>] identifier[itEvents] operator[=] identifier[row] operator[SEP] identifier[getEvents] operator[SEP] operator[SEP] operator[SEP] identifier[listIterator] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[itEvents] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] {
identifier[GridEvent] identifier[event] operator[=] identifier[itEvents] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[lastTokenIndex] operator[=] operator[-] Other[1] operator[SEP] identifier[LinkedList] operator[<] identifier[String] operator[>] identifier[sortedCoveredToken] operator[=] Keyword[new] identifier[LinkedList] operator[<] operator[>] operator[SEP] identifier[event] operator[SEP] identifier[getCoveredIDs] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[Collections] operator[SEP] identifier[sort] operator[SEP] identifier[sortedCoveredToken] , Keyword[new] identifier[Comparator] operator[<] identifier[String] operator[>] operator[SEP] operator[SEP] {
annotation[@] identifier[Override] Keyword[public] Keyword[int] identifier[compare] operator[SEP] identifier[String] identifier[o1] , identifier[String] identifier[o2] operator[SEP] {
identifier[SNode] identifier[node1] operator[=] identifier[graph] operator[SEP] identifier[getNode] operator[SEP] identifier[o1] operator[SEP] operator[SEP] identifier[SNode] identifier[node2] operator[=] identifier[graph] operator[SEP] identifier[getNode] operator[SEP] identifier[o2] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[node1] operator[==] identifier[node2] operator[SEP] {
Keyword[return] Other[0] operator[SEP]
}
Keyword[if] operator[SEP] identifier[node1] operator[==] Other[null] operator[SEP] {
Keyword[return] operator[-] Other[1] operator[SEP]
}
Keyword[if] operator[SEP] identifier[node2] operator[==] Other[null] operator[SEP] {
Keyword[return] operator[+] Other[1] operator[SEP]
}
identifier[RelannisNodeFeature] identifier[feat1] operator[=] operator[SEP] identifier[RelannisNodeFeature] operator[SEP] identifier[node1] operator[SEP] identifier[getFeature] operator[SEP] identifier[ANNIS_NS] , identifier[FEAT_RELANNIS_NODE] operator[SEP] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] identifier[RelannisNodeFeature] identifier[feat2] operator[=] operator[SEP] identifier[RelannisNodeFeature] operator[SEP] identifier[node2] operator[SEP] identifier[getFeature] operator[SEP] identifier[ANNIS_NS] , identifier[FEAT_RELANNIS_NODE] operator[SEP] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] Keyword[long] identifier[tokenIndex1] operator[=] identifier[feat1] operator[SEP] identifier[getTokenIndex] operator[SEP] operator[SEP] operator[SEP] Keyword[long] identifier[tokenIndex2] operator[=] identifier[feat2] operator[SEP] identifier[getTokenIndex] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[Long] operator[SEP] identifier[compare] operator[SEP] identifier[tokenIndex1] , identifier[tokenIndex2] operator[SEP] operator[SEP]
}
} operator[SEP] operator[SEP] identifier[List] operator[<] identifier[GridEvent] operator[>] identifier[gaps] operator[=] Keyword[new] identifier[LinkedList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[String] identifier[id] operator[:] identifier[sortedCoveredToken] operator[SEP] {
identifier[SNode] identifier[node] operator[=] identifier[graph] operator[SEP] identifier[getNode] operator[SEP] identifier[id] operator[SEP] operator[SEP] identifier[RelannisNodeFeature] identifier[feat] operator[=] operator[SEP] identifier[RelannisNodeFeature] operator[SEP] identifier[node] operator[SEP] identifier[getFeature] operator[SEP] identifier[ANNIS_NS] , identifier[FEAT_RELANNIS_NODE] operator[SEP] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] Keyword[long] identifier[tokenIndexRaw] operator[=] identifier[feat] operator[SEP] identifier[getTokenIndex] operator[SEP] operator[SEP] operator[SEP] identifier[tokenIndexRaw] operator[=] identifier[clip] operator[SEP] identifier[tokenIndexRaw] , identifier[startTokenIndex] , identifier[endTokenIndex] operator[SEP] operator[SEP] Keyword[int] identifier[tokenIndex] operator[=] operator[SEP] Keyword[int] operator[SEP] operator[SEP] identifier[tokenIndexRaw] operator[-] identifier[startTokenIndex] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[tokenIndex] operator[>=] identifier[event] operator[SEP] identifier[getLeft] operator[SEP] operator[SEP] operator[&&] identifier[tokenIndex] operator[<=] identifier[event] operator[SEP] identifier[getRight] operator[SEP] operator[SEP] operator[SEP] {
Keyword[int] identifier[diff] operator[=] identifier[tokenIndex] operator[-] identifier[lastTokenIndex] operator[SEP] Keyword[if] operator[SEP] identifier[lastTokenIndex] operator[>=] Other[0] operator[&&] identifier[diff] operator[>] Other[1] operator[SEP] {
identifier[GridEvent] identifier[gap] operator[=] Keyword[new] identifier[GridEvent] operator[SEP] identifier[event] operator[SEP] identifier[getId] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[gaps] operator[SEP] identifier[size] operator[SEP] operator[SEP] , identifier[lastTokenIndex] operator[+] Other[1] , identifier[tokenIndex] operator[-] Other[1] , literal[String] operator[SEP] operator[SEP] identifier[gap] operator[SEP] identifier[setGap] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[gaps] operator[SEP] identifier[add] operator[SEP] identifier[gap] operator[SEP] operator[SEP]
}
identifier[lastTokenIndex] operator[=] identifier[tokenIndex] operator[SEP]
}
Keyword[else] {
identifier[lastTokenIndex] operator[=] operator[-] Other[1] operator[SEP]
}
}
identifier[ListIterator] operator[<] identifier[GridEvent] operator[>] identifier[itGaps] operator[=] identifier[gaps] operator[SEP] identifier[listIterator] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[oldRight] operator[=] identifier[event] operator[SEP] identifier[getRight] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[gapNr] operator[=] Other[0] operator[SEP] Keyword[while] operator[SEP] identifier[itGaps] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] {
identifier[GridEvent] identifier[gap] operator[=] identifier[itGaps] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[gapNr] operator[==] Other[0] operator[SEP] {
identifier[event] operator[SEP] identifier[setRight] operator[SEP] identifier[gap] operator[SEP] identifier[getLeft] operator[SEP] operator[SEP] operator[-] Other[1] operator[SEP] operator[SEP]
}
identifier[itEvents] operator[SEP] identifier[add] operator[SEP] identifier[gap] operator[SEP] operator[SEP] Keyword[int] identifier[rightBorder] operator[=] identifier[oldRight] operator[SEP] Keyword[if] operator[SEP] identifier[itGaps] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] {
identifier[GridEvent] identifier[nextGap] operator[=] identifier[itGaps] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] identifier[itGaps] operator[SEP] identifier[previous] operator[SEP] operator[SEP] operator[SEP] identifier[rightBorder] operator[=] identifier[nextGap] operator[SEP] identifier[getLeft] operator[SEP] operator[SEP] operator[-] Other[1] operator[SEP]
}
identifier[GridEvent] identifier[after] operator[=] Keyword[new] identifier[GridEvent] operator[SEP] identifier[event] operator[SEP] operator[SEP] identifier[after] operator[SEP] identifier[setId] operator[SEP] identifier[event] operator[SEP] identifier[getId] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[gapNr] operator[SEP] operator[SEP] identifier[after] operator[SEP] identifier[setLeft] operator[SEP] identifier[gap] operator[SEP] identifier[getRight] operator[SEP] operator[SEP] operator[+] Other[1] operator[SEP] operator[SEP] identifier[after] operator[SEP] identifier[setRight] operator[SEP] identifier[rightBorder] operator[SEP] operator[SEP] identifier[itEvents] operator[SEP] identifier[add] operator[SEP] identifier[after] operator[SEP] operator[SEP] identifier[gapNr] operator[++] operator[SEP]
}
}
}
|
@SuppressWarnings("unused")
private void parseCustomBusinessValuesOld(BusinessValueList bvlXml,
IBusinessValueList businessValueList) throws JAXBException {
if (bvlXml.getCustomBusinessValue() != null) {
for (Object bvlItem : bvlXml.getCustomBusinessValue()) {
CustomBusinessValue item = (CustomBusinessValue) um.unmarshal((Node) bvlItem);
for (Penalty action: item.getPenalties()) {
IPenaltyDefinition penaltyDef = newPenaltyDefinition(item, action);
businessValueList.addPenalty(penaltyDef);
}
}
}
} | class class_name[name] begin[{]
method[parseCustomBusinessValuesOld, return_type[void], modifier[private], parameter[bvlXml, businessValueList]] begin[{]
if[binary_operation[call[bvlXml.getCustomBusinessValue, parameter[]], !=, literal[null]]] begin[{]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MethodInvocation(arguments=[Cast(expression=MemberReference(member=bvlItem, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Node, sub_type=None))], member=unmarshal, postfix_operators=[], prefix_operators=[], qualifier=um, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=CustomBusinessValue, sub_type=None)), name=item)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=CustomBusinessValue, sub_type=None)), ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=item, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=action, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=newPenaltyDefinition, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=penaltyDef)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=IPenaltyDefinition, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=penaltyDef, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addPenalty, postfix_operators=[], prefix_operators=[], qualifier=businessValueList, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getPenalties, postfix_operators=[], prefix_operators=[], qualifier=item, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=action)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Penalty, sub_type=None))), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getCustomBusinessValue, postfix_operators=[], prefix_operators=[], qualifier=bvlXml, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=bvlItem)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))), label=None)
else begin[{]
None
end[}]
end[}]
END[}] | annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] Keyword[private] Keyword[void] identifier[parseCustomBusinessValuesOld] operator[SEP] identifier[BusinessValueList] identifier[bvlXml] , identifier[IBusinessValueList] identifier[businessValueList] operator[SEP] Keyword[throws] identifier[JAXBException] {
Keyword[if] operator[SEP] identifier[bvlXml] operator[SEP] identifier[getCustomBusinessValue] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] {
Keyword[for] operator[SEP] identifier[Object] identifier[bvlItem] operator[:] identifier[bvlXml] operator[SEP] identifier[getCustomBusinessValue] operator[SEP] operator[SEP] operator[SEP] {
identifier[CustomBusinessValue] identifier[item] operator[=] operator[SEP] identifier[CustomBusinessValue] operator[SEP] identifier[um] operator[SEP] identifier[unmarshal] operator[SEP] operator[SEP] identifier[Node] operator[SEP] identifier[bvlItem] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Penalty] identifier[action] operator[:] identifier[item] operator[SEP] identifier[getPenalties] operator[SEP] operator[SEP] operator[SEP] {
identifier[IPenaltyDefinition] identifier[penaltyDef] operator[=] identifier[newPenaltyDefinition] operator[SEP] identifier[item] , identifier[action] operator[SEP] operator[SEP] identifier[businessValueList] operator[SEP] identifier[addPenalty] operator[SEP] identifier[penaltyDef] operator[SEP] operator[SEP]
}
}
}
}
|
public static HystrixCollapserProperties.Setter initializeCollapserProperties(List<HystrixProperty> properties) {
return initializeProperties(HystrixCollapserProperties.Setter(), properties, COLLAPSER_PROP_MAP, "collapser");
} | class class_name[name] begin[{]
method[initializeCollapserProperties, return_type[type[HystrixCollapserProperties]], modifier[public static], parameter[properties]] begin[{]
return[call[.initializeProperties, parameter[call[HystrixCollapserProperties.Setter, parameter[]], member[.properties], member[.COLLAPSER_PROP_MAP], literal["collapser"]]]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[HystrixCollapserProperties] operator[SEP] identifier[Setter] identifier[initializeCollapserProperties] operator[SEP] identifier[List] operator[<] identifier[HystrixProperty] operator[>] identifier[properties] operator[SEP] {
Keyword[return] identifier[initializeProperties] operator[SEP] identifier[HystrixCollapserProperties] operator[SEP] identifier[Setter] operator[SEP] operator[SEP] , identifier[properties] , identifier[COLLAPSER_PROP_MAP] , literal[String] operator[SEP] operator[SEP]
}
|
@Override
public S isNotLessThan(A other) {
comparables.assertNotLessThan(description, actual, other);
return myself;
} | class class_name[name] begin[{]
method[isNotLessThan, return_type[type[S]], modifier[public], parameter[other]] begin[{]
call[comparables.assertNotLessThan, parameter[member[.description], member[.actual], member[.other]]]
return[member[.myself]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] identifier[S] identifier[isNotLessThan] operator[SEP] identifier[A] identifier[other] operator[SEP] {
identifier[comparables] operator[SEP] identifier[assertNotLessThan] operator[SEP] identifier[description] , identifier[actual] , identifier[other] operator[SEP] operator[SEP] Keyword[return] identifier[myself] operator[SEP]
}
|
private void obtainMaxNumber(@NonNull final TypedArray typedArray) {
int defaultValue = getContext().getResources()
.getInteger(R.integer.number_picker_preference_default_max_number);
setMaxNumber(typedArray
.getInteger(R.styleable.AbstractNumericPreference_android_max, defaultValue));
} | class class_name[name] begin[{]
method[obtainMaxNumber, return_type[void], modifier[private], parameter[typedArray]] begin[{]
local_variable[type[int], defaultValue]
call[.setMaxNumber, parameter[call[typedArray.getInteger, parameter[member[R.styleable.AbstractNumericPreference_android_max], member[.defaultValue]]]]]
end[}]
END[}] | Keyword[private] Keyword[void] identifier[obtainMaxNumber] operator[SEP] annotation[@] identifier[NonNull] Keyword[final] identifier[TypedArray] identifier[typedArray] operator[SEP] {
Keyword[int] identifier[defaultValue] operator[=] identifier[getContext] operator[SEP] operator[SEP] operator[SEP] identifier[getResources] operator[SEP] operator[SEP] operator[SEP] identifier[getInteger] operator[SEP] identifier[R] operator[SEP] identifier[integer] operator[SEP] identifier[number_picker_preference_default_max_number] operator[SEP] operator[SEP] identifier[setMaxNumber] operator[SEP] identifier[typedArray] operator[SEP] identifier[getInteger] operator[SEP] identifier[R] operator[SEP] identifier[styleable] operator[SEP] identifier[AbstractNumericPreference_android_max] , identifier[defaultValue] operator[SEP] operator[SEP] operator[SEP]
}
|
private static IType findActualDeclaringType( IType ownersType, IType declaringType )
{
if( ownersType == null )
{
return null;
}
if( declaringType.isParameterizedType() && !declaringType.isGenericType() )
{
return declaringType;
}
if( ownersType == declaringType )
{
return declaringType;
}
if( ownersType.getGenericType() == declaringType )
{
return ownersType;
}
IType actualDeclaringType = findActualDeclaringType( ownersType.getSupertype(), declaringType );
if( actualDeclaringType != null && actualDeclaringType != declaringType )
{
return actualDeclaringType;
}
for( IType iface : ownersType.getInterfaces() )
{
actualDeclaringType = findActualDeclaringType( iface, declaringType );
if( actualDeclaringType != null && actualDeclaringType != declaringType )
{
return actualDeclaringType;
}
}
return declaringType;
} | class class_name[name] begin[{]
method[findActualDeclaringType, return_type[type[IType]], modifier[private static], parameter[ownersType, declaringType]] begin[{]
if[binary_operation[member[.ownersType], ==, literal[null]]] begin[{]
return[literal[null]]
else begin[{]
None
end[}]
if[binary_operation[call[declaringType.isParameterizedType, parameter[]], &&, call[declaringType.isGenericType, parameter[]]]] begin[{]
return[member[.declaringType]]
else begin[{]
None
end[}]
if[binary_operation[member[.ownersType], ==, member[.declaringType]]] begin[{]
return[member[.declaringType]]
else begin[{]
None
end[}]
if[binary_operation[call[ownersType.getGenericType, parameter[]], ==, member[.declaringType]]] begin[{]
return[member[.ownersType]]
else begin[{]
None
end[}]
local_variable[type[IType], actualDeclaringType]
if[binary_operation[binary_operation[member[.actualDeclaringType], !=, literal[null]], &&, binary_operation[member[.actualDeclaringType], !=, member[.declaringType]]]] begin[{]
return[member[.actualDeclaringType]]
else begin[{]
None
end[}]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=actualDeclaringType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=iface, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=declaringType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=findActualDeclaringType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=actualDeclaringType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operandr=BinaryOperation(operandl=MemberReference(member=actualDeclaringType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=declaringType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=!=), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=MemberReference(member=actualDeclaringType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getInterfaces, postfix_operators=[], prefix_operators=[], qualifier=ownersType, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=iface)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=IType, sub_type=None))), label=None)
return[member[.declaringType]]
end[}]
END[}] | Keyword[private] Keyword[static] identifier[IType] identifier[findActualDeclaringType] operator[SEP] identifier[IType] identifier[ownersType] , identifier[IType] identifier[declaringType] operator[SEP] {
Keyword[if] operator[SEP] identifier[ownersType] operator[==] Other[null] operator[SEP] {
Keyword[return] Other[null] operator[SEP]
}
Keyword[if] operator[SEP] identifier[declaringType] operator[SEP] identifier[isParameterizedType] operator[SEP] operator[SEP] operator[&&] operator[!] identifier[declaringType] operator[SEP] identifier[isGenericType] operator[SEP] operator[SEP] operator[SEP] {
Keyword[return] identifier[declaringType] operator[SEP]
}
Keyword[if] operator[SEP] identifier[ownersType] operator[==] identifier[declaringType] operator[SEP] {
Keyword[return] identifier[declaringType] operator[SEP]
}
Keyword[if] operator[SEP] identifier[ownersType] operator[SEP] identifier[getGenericType] operator[SEP] operator[SEP] operator[==] identifier[declaringType] operator[SEP] {
Keyword[return] identifier[ownersType] operator[SEP]
}
identifier[IType] identifier[actualDeclaringType] operator[=] identifier[findActualDeclaringType] operator[SEP] identifier[ownersType] operator[SEP] identifier[getSupertype] operator[SEP] operator[SEP] , identifier[declaringType] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[actualDeclaringType] operator[!=] Other[null] operator[&&] identifier[actualDeclaringType] operator[!=] identifier[declaringType] operator[SEP] {
Keyword[return] identifier[actualDeclaringType] operator[SEP]
}
Keyword[for] operator[SEP] identifier[IType] identifier[iface] operator[:] identifier[ownersType] operator[SEP] identifier[getInterfaces] operator[SEP] operator[SEP] operator[SEP] {
identifier[actualDeclaringType] operator[=] identifier[findActualDeclaringType] operator[SEP] identifier[iface] , identifier[declaringType] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[actualDeclaringType] operator[!=] Other[null] operator[&&] identifier[actualDeclaringType] operator[!=] identifier[declaringType] operator[SEP] {
Keyword[return] identifier[actualDeclaringType] operator[SEP]
}
}
Keyword[return] identifier[declaringType] operator[SEP]
}
|
public <V> SortedMap<T, V> toSortedMap(Function<? super T, ? extends V> valMapper) {
return toSortedMap(Function.identity(), valMapper);
} | class class_name[name] begin[{]
method[toSortedMap, return_type[type[SortedMap]], modifier[public], parameter[valMapper]] begin[{]
return[call[.toSortedMap, parameter[call[Function.identity, parameter[]], member[.valMapper]]]]
end[}]
END[}] | Keyword[public] operator[<] identifier[V] operator[>] identifier[SortedMap] operator[<] identifier[T] , identifier[V] operator[>] identifier[toSortedMap] operator[SEP] identifier[Function] operator[<] operator[?] Keyword[super] identifier[T] , operator[?] Keyword[extends] identifier[V] operator[>] identifier[valMapper] operator[SEP] {
Keyword[return] identifier[toSortedMap] operator[SEP] identifier[Function] operator[SEP] identifier[identity] operator[SEP] operator[SEP] , identifier[valMapper] operator[SEP] operator[SEP]
}
|
@Override
public ResultSet getBestRowIdentifier(String catalog, String schema, String table, int scope, boolean nullable) throws SQLException
{
checkClosed();
throw SQLError.noSupport();
} | class class_name[name] begin[{]
method[getBestRowIdentifier, return_type[type[ResultSet]], modifier[public], parameter[catalog, schema, table, scope, nullable]] begin[{]
call[.checkClosed, parameter[]]
ThrowStatement(expression=MethodInvocation(arguments=[], member=noSupport, postfix_operators=[], prefix_operators=[], qualifier=SQLError, selectors=[], type_arguments=None), label=None)
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] identifier[ResultSet] identifier[getBestRowIdentifier] operator[SEP] identifier[String] identifier[catalog] , identifier[String] identifier[schema] , identifier[String] identifier[table] , Keyword[int] identifier[scope] , Keyword[boolean] identifier[nullable] operator[SEP] Keyword[throws] identifier[SQLException] {
identifier[checkClosed] operator[SEP] operator[SEP] operator[SEP] Keyword[throw] identifier[SQLError] operator[SEP] identifier[noSupport] operator[SEP] operator[SEP] operator[SEP]
}
|
private void showNewDebugger(EnhancedDebugger debugger) {
if (frame == null) {
createDebug();
}
debugger.tabbedPane.setName("XMPPConnection_" + tabbedPane.getComponentCount());
tabbedPane.add(debugger.tabbedPane, tabbedPane.getComponentCount() - 1);
tabbedPane.setIconAt(tabbedPane.indexOfComponent(debugger.tabbedPane), connectionCreatedIcon);
frame.setTitle(
"Smack Debug Window -- Total connections: " + (tabbedPane.getComponentCount() - 1));
// Keep the added debugger for later access
debuggers.add(debugger);
} | class class_name[name] begin[{]
method[showNewDebugger, return_type[void], modifier[private], parameter[debugger]] begin[{]
if[binary_operation[member[.frame], ==, literal[null]]] begin[{]
call[.createDebug, parameter[]]
else begin[{]
None
end[}]
call[debugger.tabbedPane.setName, parameter[binary_operation[literal["XMPPConnection_"], +, call[tabbedPane.getComponentCount, parameter[]]]]]
call[tabbedPane.add, parameter[member[debugger.tabbedPane], binary_operation[call[tabbedPane.getComponentCount, parameter[]], -, literal[1]]]]
call[tabbedPane.setIconAt, parameter[call[tabbedPane.indexOfComponent, parameter[member[debugger.tabbedPane]]], member[.connectionCreatedIcon]]]
call[frame.setTitle, parameter[binary_operation[literal["Smack Debug Window -- Total connections: "], +, binary_operation[call[tabbedPane.getComponentCount, parameter[]], -, literal[1]]]]]
call[debuggers.add, parameter[member[.debugger]]]
end[}]
END[}] | Keyword[private] Keyword[void] identifier[showNewDebugger] operator[SEP] identifier[EnhancedDebugger] identifier[debugger] operator[SEP] {
Keyword[if] operator[SEP] identifier[frame] operator[==] Other[null] operator[SEP] {
identifier[createDebug] operator[SEP] operator[SEP] operator[SEP]
}
identifier[debugger] operator[SEP] identifier[tabbedPane] operator[SEP] identifier[setName] operator[SEP] literal[String] operator[+] identifier[tabbedPane] operator[SEP] identifier[getComponentCount] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[tabbedPane] operator[SEP] identifier[add] operator[SEP] identifier[debugger] operator[SEP] identifier[tabbedPane] , identifier[tabbedPane] operator[SEP] identifier[getComponentCount] operator[SEP] operator[SEP] operator[-] Other[1] operator[SEP] operator[SEP] identifier[tabbedPane] operator[SEP] identifier[setIconAt] operator[SEP] identifier[tabbedPane] operator[SEP] identifier[indexOfComponent] operator[SEP] identifier[debugger] operator[SEP] identifier[tabbedPane] operator[SEP] , identifier[connectionCreatedIcon] operator[SEP] operator[SEP] identifier[frame] operator[SEP] identifier[setTitle] operator[SEP] literal[String] operator[+] operator[SEP] identifier[tabbedPane] operator[SEP] identifier[getComponentCount] operator[SEP] operator[SEP] operator[-] Other[1] operator[SEP] operator[SEP] operator[SEP] identifier[debuggers] operator[SEP] identifier[add] operator[SEP] identifier[debugger] operator[SEP] operator[SEP]
}
|
public int generateFiles()
{
List<URL> allTemplateFilesFromClassPath = FileUtils.getAllTemplateFilesFromClasspath(this.templateDirectory, this.classPathURLs);
for (URL url : allTemplateFilesFromClassPath)
{
this.url = url;
this.templateFile = new STGroupFile(this.url, "UTF-8", '<', '>');
this.templateFile.setListener(this.stErrorListener);
this.templateFile.registerRenderer(String.class, new IntegerOrStringRenderer());
if (this.templateFile.isDefined("fileName"))
{
this.setTest();
File targetPath = this.constructTargetPath();
FileUtils.createDirectory(targetPath);
boolean hasTwoPrimitives = this.templateFile.isDefined("hasTwoPrimitives") && Boolean.valueOf(this.templateFile.getInstanceOf("hasTwoPrimitives").render());
boolean skipBoolean = this.templateFile.isDefined("skipBoolean") && Boolean.valueOf(this.templateFile.getInstanceOf("skipBoolean").render());
boolean skipBooleanKeys = this.templateFile.isDefined("skipBooleanKeys") && Boolean.valueOf(this.templateFile.getInstanceOf("skipBooleanKeys").render());
if (hasTwoPrimitives)
{
for (Primitive primitive1 : Primitive.values())
{
if (primitive1 == Primitive.BOOLEAN && (skipBoolean || skipBooleanKeys))
{
continue;
}
for (Primitive primitive2 : Primitive.values())
{
if (primitive2 == Primitive.BOOLEAN && skipBoolean)
{
continue;
}
String sourceFileName = this.executeTemplate(primitive1, primitive2, "fileName");
File outputFile = new File(targetPath, sourceFileName + ".java");
if (!GsCollectionsCodeGenerator.sourceFileExists(outputFile))
{
String classContents = this.executeTemplate(primitive1, primitive2, "class");
this.checkSumClassContentsAndWrite(classContents, targetPath, sourceFileName);
}
}
}
}
else
{
for (Primitive primitive : Primitive.values())
{
if (primitive == Primitive.BOOLEAN && skipBoolean)
{
continue;
}
String sourceFileName = this.executeTemplate(primitive, "fileName");
File outputFile = new File(targetPath, sourceFileName + ".java");
if (!GsCollectionsCodeGenerator.sourceFileExists(outputFile))
{
String classContents = this.executeTemplate(primitive, "class");
this.checkSumClassContentsAndWrite(classContents, targetPath, sourceFileName);
}
}
}
}
}
return this.numFileWritten;
} | class class_name[name] begin[{]
method[generateFiles, return_type[type[int]], modifier[public], parameter[]] begin[{]
local_variable[type[List], allTemplateFilesFromClassPath]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=url, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), type==, value=MemberReference(member=url, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), StatementExpression(expression=Assignment(expressionl=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=templateFile, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), type==, value=ClassCreator(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=url, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="UTF-8"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='<'), 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=STGroupFile, sub_type=None))), label=None), StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=templateFile, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=stErrorListener, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)])], member=setListener, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None), StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=templateFile, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=String, sub_type=None)), ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IntegerOrStringRenderer, sub_type=None))], member=registerRenderer, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None), IfStatement(condition=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=templateFile, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="fileName")], member=isDefined, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[], member=setTest, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[], member=constructTargetPath, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), name=targetPath)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=File, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=targetPath, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=createDirectory, postfix_operators=[], prefix_operators=[], qualifier=FileUtils, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=templateFile, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="hasTwoPrimitives")], member=isDefined, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), operandr=MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=templateFile, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="hasTwoPrimitives")], member=getInstanceOf, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=render, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)])], member=valueOf, postfix_operators=[], prefix_operators=[], qualifier=Boolean, selectors=[], type_arguments=None), operator=&&), name=hasTwoPrimitives)], modifiers=set(), type=BasicType(dimensions=[], name=boolean)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=templateFile, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="skipBoolean")], member=isDefined, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), operandr=MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=templateFile, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="skipBoolean")], member=getInstanceOf, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=render, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)])], member=valueOf, postfix_operators=[], prefix_operators=[], qualifier=Boolean, selectors=[], type_arguments=None), operator=&&), name=skipBoolean)], modifiers=set(), type=BasicType(dimensions=[], name=boolean)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=templateFile, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="skipBooleanKeys")], member=isDefined, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), operandr=MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=templateFile, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="skipBooleanKeys")], member=getInstanceOf, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=render, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)])], member=valueOf, postfix_operators=[], prefix_operators=[], qualifier=Boolean, selectors=[], type_arguments=None), operator=&&), name=skipBooleanKeys)], modifiers=set(), type=BasicType(dimensions=[], name=boolean)), IfStatement(condition=MemberReference(member=hasTwoPrimitives, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=BlockStatement(label=None, statements=[ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=primitive, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=BOOLEAN, postfix_operators=[], prefix_operators=[], qualifier=Primitive, selectors=[]), operator===), operandr=MemberReference(member=skipBoolean, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ContinueStatement(goto=None, label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=primitive, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="fileName")], member=executeTemplate, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), name=sourceFileName)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MemberReference(member=targetPath, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=MemberReference(member=sourceFileName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=".java"), operator=+)], 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=outputFile)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=File, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=outputFile, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=sourceFileExists, postfix_operators=[], prefix_operators=['!'], qualifier=GsCollectionsCodeGenerator, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=primitive, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="class")], member=executeTemplate, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), name=classContents)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=classContents, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=targetPath, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=sourceFileName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=checkSumClassContentsAndWrite, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=values, postfix_operators=[], prefix_operators=[], qualifier=Primitive, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=primitive)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Primitive, sub_type=None))), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=primitive1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=BOOLEAN, postfix_operators=[], prefix_operators=[], qualifier=Primitive, selectors=[]), operator===), operandr=BinaryOperation(operandl=MemberReference(member=skipBoolean, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=skipBooleanKeys, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=||), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ContinueStatement(goto=None, label=None)])), ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=primitive2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=BOOLEAN, postfix_operators=[], prefix_operators=[], qualifier=Primitive, selectors=[]), operator===), operandr=MemberReference(member=skipBoolean, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ContinueStatement(goto=None, label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=primitive1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=primitive2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="fileName")], member=executeTemplate, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), name=sourceFileName)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MemberReference(member=targetPath, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=MemberReference(member=sourceFileName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=".java"), operator=+)], 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=outputFile)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=File, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=outputFile, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=sourceFileExists, postfix_operators=[], prefix_operators=['!'], qualifier=GsCollectionsCodeGenerator, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=primitive1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=primitive2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="class")], member=executeTemplate, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), name=classContents)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=classContents, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=targetPath, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=sourceFileName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=checkSumClassContentsAndWrite, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=values, postfix_operators=[], prefix_operators=[], qualifier=Primitive, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=primitive2)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Primitive, sub_type=None))), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=values, postfix_operators=[], prefix_operators=[], qualifier=Primitive, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=primitive1)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Primitive, sub_type=None))), label=None)]))]))]), control=EnhancedForControl(iterable=MemberReference(member=allTemplateFilesFromClassPath, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=url)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=URL, sub_type=None))), label=None)
return[THIS[member[None.numFileWritten]]]
end[}]
END[}] | Keyword[public] Keyword[int] identifier[generateFiles] operator[SEP] operator[SEP] {
identifier[List] operator[<] identifier[URL] operator[>] identifier[allTemplateFilesFromClassPath] operator[=] identifier[FileUtils] operator[SEP] identifier[getAllTemplateFilesFromClasspath] operator[SEP] Keyword[this] operator[SEP] identifier[templateDirectory] , Keyword[this] operator[SEP] identifier[classPathURLs] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[URL] identifier[url] operator[:] identifier[allTemplateFilesFromClassPath] operator[SEP] {
Keyword[this] operator[SEP] identifier[url] operator[=] identifier[url] operator[SEP] Keyword[this] operator[SEP] identifier[templateFile] operator[=] Keyword[new] identifier[STGroupFile] operator[SEP] Keyword[this] operator[SEP] identifier[url] , literal[String] , literal[String] , literal[String] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[templateFile] operator[SEP] identifier[setListener] operator[SEP] Keyword[this] operator[SEP] identifier[stErrorListener] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[templateFile] operator[SEP] identifier[registerRenderer] operator[SEP] identifier[String] operator[SEP] Keyword[class] , Keyword[new] identifier[IntegerOrStringRenderer] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[templateFile] operator[SEP] identifier[isDefined] operator[SEP] literal[String] operator[SEP] operator[SEP] {
Keyword[this] operator[SEP] identifier[setTest] operator[SEP] operator[SEP] operator[SEP] identifier[File] identifier[targetPath] operator[=] Keyword[this] operator[SEP] identifier[constructTargetPath] operator[SEP] operator[SEP] operator[SEP] identifier[FileUtils] operator[SEP] identifier[createDirectory] operator[SEP] identifier[targetPath] operator[SEP] operator[SEP] Keyword[boolean] identifier[hasTwoPrimitives] operator[=] Keyword[this] operator[SEP] identifier[templateFile] operator[SEP] identifier[isDefined] operator[SEP] literal[String] operator[SEP] operator[&&] identifier[Boolean] operator[SEP] identifier[valueOf] operator[SEP] Keyword[this] operator[SEP] identifier[templateFile] operator[SEP] identifier[getInstanceOf] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[render] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[boolean] identifier[skipBoolean] operator[=] Keyword[this] operator[SEP] identifier[templateFile] operator[SEP] identifier[isDefined] operator[SEP] literal[String] operator[SEP] operator[&&] identifier[Boolean] operator[SEP] identifier[valueOf] operator[SEP] Keyword[this] operator[SEP] identifier[templateFile] operator[SEP] identifier[getInstanceOf] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[render] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[boolean] identifier[skipBooleanKeys] operator[=] Keyword[this] operator[SEP] identifier[templateFile] operator[SEP] identifier[isDefined] operator[SEP] literal[String] operator[SEP] operator[&&] identifier[Boolean] operator[SEP] identifier[valueOf] operator[SEP] Keyword[this] operator[SEP] identifier[templateFile] operator[SEP] identifier[getInstanceOf] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[render] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[hasTwoPrimitives] operator[SEP] {
Keyword[for] operator[SEP] identifier[Primitive] identifier[primitive1] operator[:] identifier[Primitive] operator[SEP] identifier[values] operator[SEP] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[primitive1] operator[==] identifier[Primitive] operator[SEP] identifier[BOOLEAN] operator[&&] operator[SEP] identifier[skipBoolean] operator[||] identifier[skipBooleanKeys] operator[SEP] operator[SEP] {
Keyword[continue] operator[SEP]
}
Keyword[for] operator[SEP] identifier[Primitive] identifier[primitive2] operator[:] identifier[Primitive] operator[SEP] identifier[values] operator[SEP] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[primitive2] operator[==] identifier[Primitive] operator[SEP] identifier[BOOLEAN] operator[&&] identifier[skipBoolean] operator[SEP] {
Keyword[continue] operator[SEP]
}
identifier[String] identifier[sourceFileName] operator[=] Keyword[this] operator[SEP] identifier[executeTemplate] operator[SEP] identifier[primitive1] , identifier[primitive2] , literal[String] operator[SEP] operator[SEP] identifier[File] identifier[outputFile] operator[=] Keyword[new] identifier[File] operator[SEP] identifier[targetPath] , identifier[sourceFileName] operator[+] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[GsCollectionsCodeGenerator] operator[SEP] identifier[sourceFileExists] operator[SEP] identifier[outputFile] operator[SEP] operator[SEP] {
identifier[String] identifier[classContents] operator[=] Keyword[this] operator[SEP] identifier[executeTemplate] operator[SEP] identifier[primitive1] , identifier[primitive2] , literal[String] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[checkSumClassContentsAndWrite] operator[SEP] identifier[classContents] , identifier[targetPath] , identifier[sourceFileName] operator[SEP] operator[SEP]
}
}
}
}
Keyword[else] {
Keyword[for] operator[SEP] identifier[Primitive] identifier[primitive] operator[:] identifier[Primitive] operator[SEP] identifier[values] operator[SEP] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[primitive] operator[==] identifier[Primitive] operator[SEP] identifier[BOOLEAN] operator[&&] identifier[skipBoolean] operator[SEP] {
Keyword[continue] operator[SEP]
}
identifier[String] identifier[sourceFileName] operator[=] Keyword[this] operator[SEP] identifier[executeTemplate] operator[SEP] identifier[primitive] , literal[String] operator[SEP] operator[SEP] identifier[File] identifier[outputFile] operator[=] Keyword[new] identifier[File] operator[SEP] identifier[targetPath] , identifier[sourceFileName] operator[+] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[GsCollectionsCodeGenerator] operator[SEP] identifier[sourceFileExists] operator[SEP] identifier[outputFile] operator[SEP] operator[SEP] {
identifier[String] identifier[classContents] operator[=] Keyword[this] operator[SEP] identifier[executeTemplate] operator[SEP] identifier[primitive] , literal[String] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[checkSumClassContentsAndWrite] operator[SEP] identifier[classContents] , identifier[targetPath] , identifier[sourceFileName] operator[SEP] operator[SEP]
}
}
}
}
}
Keyword[return] Keyword[this] operator[SEP] identifier[numFileWritten] operator[SEP]
}
|
private void expandAttributeNodes(CComplexObject sourceObject) {
List<CAttribute> differentialAttributes = Lists.newArrayList();
for (CAttribute cAttribute : sourceObject.getAttributes()) {
if (cAttribute.getDifferentialPath() != null) {
differentialAttributes.add(cAttribute);
}
}
for (CAttribute specializedAttribute : differentialAttributes) {
expandAttribute(sourceObject, specializedAttribute);
sourceObject.getAttributes().remove(specializedAttribute);
}
for (CAttribute cAttribute : sourceObject.getAttributes()) {
for (CObject cObject : cAttribute.getChildren()) {
if (cObject instanceof CComplexObject) {
expandAttributeNodes((CComplexObject) cObject);
}
}
}
} | class class_name[name] begin[{]
method[expandAttributeNodes, return_type[void], modifier[private], parameter[sourceObject]] begin[{]
local_variable[type[List], differentialAttributes]
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getDifferentialPath, postfix_operators=[], prefix_operators=[], qualifier=cAttribute, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=cAttribute, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=differentialAttributes, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getAttributes, postfix_operators=[], prefix_operators=[], qualifier=sourceObject, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=cAttribute)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=CAttribute, sub_type=None))), label=None)
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=sourceObject, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=specializedAttribute, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=expandAttribute, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=getAttributes, postfix_operators=[], prefix_operators=[], qualifier=sourceObject, selectors=[MethodInvocation(arguments=[MemberReference(member=specializedAttribute, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=remove, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=differentialAttributes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=specializedAttribute)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=CAttribute, sub_type=None))), label=None)
ForStatement(body=BlockStatement(label=None, statements=[ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=cObject, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=CComplexObject, sub_type=None), operator=instanceof), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Cast(expression=MemberReference(member=cObject, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=CComplexObject, sub_type=None))], member=expandAttributeNodes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getChildren, postfix_operators=[], prefix_operators=[], qualifier=cAttribute, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=cObject)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=CObject, sub_type=None))), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getAttributes, postfix_operators=[], prefix_operators=[], qualifier=sourceObject, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=cAttribute)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=CAttribute, sub_type=None))), label=None)
end[}]
END[}] | Keyword[private] Keyword[void] identifier[expandAttributeNodes] operator[SEP] identifier[CComplexObject] identifier[sourceObject] operator[SEP] {
identifier[List] operator[<] identifier[CAttribute] operator[>] identifier[differentialAttributes] operator[=] identifier[Lists] operator[SEP] identifier[newArrayList] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[CAttribute] identifier[cAttribute] operator[:] identifier[sourceObject] operator[SEP] identifier[getAttributes] operator[SEP] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[cAttribute] operator[SEP] identifier[getDifferentialPath] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] {
identifier[differentialAttributes] operator[SEP] identifier[add] operator[SEP] identifier[cAttribute] operator[SEP] operator[SEP]
}
}
Keyword[for] operator[SEP] identifier[CAttribute] identifier[specializedAttribute] operator[:] identifier[differentialAttributes] operator[SEP] {
identifier[expandAttribute] operator[SEP] identifier[sourceObject] , identifier[specializedAttribute] operator[SEP] operator[SEP] identifier[sourceObject] operator[SEP] identifier[getAttributes] operator[SEP] operator[SEP] operator[SEP] identifier[remove] operator[SEP] identifier[specializedAttribute] operator[SEP] operator[SEP]
}
Keyword[for] operator[SEP] identifier[CAttribute] identifier[cAttribute] operator[:] identifier[sourceObject] operator[SEP] identifier[getAttributes] operator[SEP] operator[SEP] operator[SEP] {
Keyword[for] operator[SEP] identifier[CObject] identifier[cObject] operator[:] identifier[cAttribute] operator[SEP] identifier[getChildren] operator[SEP] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[cObject] Keyword[instanceof] identifier[CComplexObject] operator[SEP] {
identifier[expandAttributeNodes] operator[SEP] operator[SEP] identifier[CComplexObject] operator[SEP] identifier[cObject] operator[SEP] operator[SEP]
}
}
}
}
|
private static Object jsonBasicValueToObject(final Object jsonVal, final Type expectedType,
final boolean convertStringToNumber) {
if (jsonVal == null) {
return null;
} else if (jsonVal instanceof JSONArray || jsonVal instanceof JSONObject) {
throw ClassGraphException.newClassGraphException("Expected a basic value type");
}
if (expectedType instanceof ParameterizedType) {
// TODO: add support for Class<T> reference values, which may be parameterized
throw new IllegalArgumentException("Got illegal ParameterizedType: " + expectedType);
} else if (!(expectedType instanceof Class<?>)) {
throw new IllegalArgumentException("Got illegal basic value type: " + expectedType);
}
final Class<?> rawType = (Class<?>) expectedType;
if (rawType == String.class) {
if (!(jsonVal instanceof CharSequence)) {
throw new IllegalArgumentException("Expected string; got " + jsonVal.getClass().getName());
}
return jsonVal.toString();
} else if (rawType == CharSequence.class) {
if (!(jsonVal instanceof CharSequence)) {
throw new IllegalArgumentException("Expected CharSequence; got " + jsonVal.getClass().getName());
}
return jsonVal;
} else if (rawType == Integer.class || rawType == Integer.TYPE) {
if (convertStringToNumber && jsonVal instanceof CharSequence) {
return Integer.parseInt(jsonVal.toString());
}
if (!(jsonVal instanceof Integer)) {
throw new IllegalArgumentException("Expected integer; got " + jsonVal.getClass().getName());
}
return jsonVal;
} else if (rawType == Long.class || rawType == Long.TYPE) {
final boolean isLong = jsonVal instanceof Long;
final boolean isInteger = jsonVal instanceof Integer;
if (convertStringToNumber && jsonVal instanceof CharSequence) {
return isLong ? Long.parseLong(jsonVal.toString()) : Integer.parseInt(jsonVal.toString());
}
if (!(isLong || isInteger)) {
throw new IllegalArgumentException("Expected long; got " + jsonVal.getClass().getName());
}
if (isLong) {
return jsonVal;
} else {
return (long) (Integer) jsonVal;
}
} else if (rawType == Short.class || rawType == Short.TYPE) {
if (convertStringToNumber && jsonVal instanceof CharSequence) {
return Short.parseShort(jsonVal.toString());
}
if (!(jsonVal instanceof Integer)) {
throw new IllegalArgumentException("Expected short; got " + jsonVal.getClass().getName());
}
final int intValue = (Integer) jsonVal;
if (intValue < Short.MIN_VALUE || intValue > Short.MAX_VALUE) {
throw new IllegalArgumentException("Expected short; got out-of-range value " + intValue);
}
return (short) intValue;
} else if (rawType == Float.class || rawType == Float.TYPE) {
if (convertStringToNumber && jsonVal instanceof CharSequence) {
return Float.parseFloat(jsonVal.toString());
}
if (!(jsonVal instanceof Double)) {
throw new IllegalArgumentException("Expected float; got " + jsonVal.getClass().getName());
}
final double doubleValue = (Double) jsonVal;
if (doubleValue < Float.MIN_VALUE || doubleValue > Float.MAX_VALUE) {
throw new IllegalArgumentException("Expected float; got out-of-range value " + doubleValue);
}
return (float) doubleValue;
} else if (rawType == Double.class || rawType == Double.TYPE) {
if (convertStringToNumber && jsonVal instanceof CharSequence) {
return Double.parseDouble(jsonVal.toString());
}
if (!(jsonVal instanceof Double)) {
throw new IllegalArgumentException("Expected double; got " + jsonVal.getClass().getName());
}
return jsonVal;
} else if (rawType == Byte.class || rawType == Byte.TYPE) {
if (convertStringToNumber && jsonVal instanceof CharSequence) {
return Byte.parseByte(jsonVal.toString());
}
if (!(jsonVal instanceof Integer)) {
throw new IllegalArgumentException("Expected byte; got " + jsonVal.getClass().getName());
}
final int intValue = (Integer) jsonVal;
if (intValue < Byte.MIN_VALUE || intValue > Byte.MAX_VALUE) {
throw new IllegalArgumentException("Expected byte; got out-of-range value " + intValue);
}
return (byte) intValue;
} else if (rawType == Character.class || rawType == Character.TYPE) {
if (!(jsonVal instanceof CharSequence)) {
throw new IllegalArgumentException("Expected character; got " + jsonVal.getClass().getName());
}
final CharSequence charSequence = (CharSequence) jsonVal;
if (charSequence.length() != 1) {
throw new IllegalArgumentException("Expected single character; got string");
}
return charSequence.charAt(0);
} else if (rawType == Boolean.class || rawType == Boolean.TYPE) {
if (convertStringToNumber && jsonVal instanceof CharSequence) {
return Boolean.parseBoolean(jsonVal.toString());
}
if (!(jsonVal instanceof Boolean)) {
throw new IllegalArgumentException("Expected boolean; got " + jsonVal.getClass().getName());
}
return jsonVal;
} else if (Enum.class.isAssignableFrom(rawType)) {
if (!(jsonVal instanceof CharSequence)) {
throw new IllegalArgumentException(
"Expected string for enum value; got " + jsonVal.getClass().getName());
}
@SuppressWarnings({ "rawtypes", "unchecked" })
final Enum enumValue = Enum.valueOf((Class<Enum>) rawType, jsonVal.toString());
return enumValue;
} else if (JSONUtils.getRawType(expectedType).isAssignableFrom(jsonVal.getClass())) {
return jsonVal;
} else {
throw new IllegalArgumentException("Got type " + jsonVal.getClass() + "; expected " + expectedType);
}
} | class class_name[name] begin[{]
method[jsonBasicValueToObject, return_type[type[Object]], modifier[private static], parameter[jsonVal, expectedType, convertStringToNumber]] begin[{]
if[binary_operation[member[.jsonVal], ==, literal[null]]] begin[{]
return[literal[null]]
else begin[{]
if[binary_operation[binary_operation[member[.jsonVal], instanceof, type[JSONArray]], ||, binary_operation[member[.jsonVal], instanceof, type[JSONObject]]]] begin[{]
ThrowStatement(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Expected a basic value type")], member=newClassGraphException, postfix_operators=[], prefix_operators=[], qualifier=ClassGraphException, selectors=[], type_arguments=None), label=None)
else begin[{]
None
end[}]
end[}]
if[binary_operation[member[.expectedType], instanceof, type[ParameterizedType]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Got illegal ParameterizedType: "), operandr=MemberReference(member=expectedType, 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[{]
if[binary_operation[member[.expectedType], instanceof, type[Class]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Got illegal basic value type: "), operandr=MemberReference(member=expectedType, 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[}]
end[}]
local_variable[type[Class], rawType]
if[binary_operation[member[.rawType], ==, ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=String, sub_type=None))]] begin[{]
if[binary_operation[member[.jsonVal], instanceof, type[CharSequence]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Expected string; got "), operandr=MethodInvocation(arguments=[], member=getClass, postfix_operators=[], prefix_operators=[], qualifier=jsonVal, selectors=[MethodInvocation(arguments=[], member=getName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None)
else begin[{]
None
end[}]
return[call[jsonVal.toString, parameter[]]]
else begin[{]
if[binary_operation[member[.rawType], ==, ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=CharSequence, sub_type=None))]] begin[{]
if[binary_operation[member[.jsonVal], instanceof, type[CharSequence]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Expected CharSequence; got "), operandr=MethodInvocation(arguments=[], member=getClass, postfix_operators=[], prefix_operators=[], qualifier=jsonVal, selectors=[MethodInvocation(arguments=[], member=getName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None)
else begin[{]
None
end[}]
return[member[.jsonVal]]
else begin[{]
if[binary_operation[binary_operation[member[.rawType], ==, ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Integer, sub_type=None))], ||, binary_operation[member[.rawType], ==, member[Integer.TYPE]]]] begin[{]
if[binary_operation[member[.convertStringToNumber], &&, binary_operation[member[.jsonVal], instanceof, type[CharSequence]]]] begin[{]
return[call[Integer.parseInt, parameter[call[jsonVal.toString, parameter[]]]]]
else begin[{]
None
end[}]
if[binary_operation[member[.jsonVal], instanceof, type[Integer]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Expected integer; got "), operandr=MethodInvocation(arguments=[], member=getClass, postfix_operators=[], prefix_operators=[], qualifier=jsonVal, selectors=[MethodInvocation(arguments=[], member=getName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None)
else begin[{]
None
end[}]
return[member[.jsonVal]]
else begin[{]
if[binary_operation[binary_operation[member[.rawType], ==, ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Long, sub_type=None))], ||, binary_operation[member[.rawType], ==, member[Long.TYPE]]]] begin[{]
local_variable[type[boolean], isLong]
local_variable[type[boolean], isInteger]
if[binary_operation[member[.convertStringToNumber], &&, binary_operation[member[.jsonVal], instanceof, type[CharSequence]]]] begin[{]
return[TernaryExpression(condition=MemberReference(member=isLong, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_false=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=jsonVal, selectors=[], type_arguments=None)], member=parseInt, postfix_operators=[], prefix_operators=[], qualifier=Integer, selectors=[], type_arguments=None), if_true=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=jsonVal, selectors=[], type_arguments=None)], member=parseLong, postfix_operators=[], prefix_operators=[], qualifier=Long, selectors=[], type_arguments=None))]
else begin[{]
None
end[}]
if[binary_operation[member[.isLong], ||, member[.isInteger]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Expected long; got "), operandr=MethodInvocation(arguments=[], member=getClass, postfix_operators=[], prefix_operators=[], qualifier=jsonVal, selectors=[MethodInvocation(arguments=[], member=getName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None)
else begin[{]
None
end[}]
if[member[.isLong]] begin[{]
return[member[.jsonVal]]
else begin[{]
return[Cast(expression=Cast(expression=MemberReference(member=jsonVal, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Integer, sub_type=None)), type=BasicType(dimensions=[], name=long))]
end[}]
else begin[{]
if[binary_operation[binary_operation[member[.rawType], ==, ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Short, sub_type=None))], ||, binary_operation[member[.rawType], ==, member[Short.TYPE]]]] begin[{]
if[binary_operation[member[.convertStringToNumber], &&, binary_operation[member[.jsonVal], instanceof, type[CharSequence]]]] begin[{]
return[call[Short.parseShort, parameter[call[jsonVal.toString, parameter[]]]]]
else begin[{]
None
end[}]
if[binary_operation[member[.jsonVal], instanceof, type[Integer]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Expected short; got "), operandr=MethodInvocation(arguments=[], member=getClass, postfix_operators=[], prefix_operators=[], qualifier=jsonVal, selectors=[MethodInvocation(arguments=[], member=getName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None)
else begin[{]
None
end[}]
local_variable[type[int], intValue]
if[binary_operation[binary_operation[member[.intValue], <, member[Short.MIN_VALUE]], ||, binary_operation[member[.intValue], >, member[Short.MAX_VALUE]]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Expected short; got out-of-range value "), operandr=MemberReference(member=intValue, 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[}]
return[Cast(expression=MemberReference(member=intValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=BasicType(dimensions=[], name=short))]
else begin[{]
if[binary_operation[binary_operation[member[.rawType], ==, ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Float, sub_type=None))], ||, binary_operation[member[.rawType], ==, member[Float.TYPE]]]] begin[{]
if[binary_operation[member[.convertStringToNumber], &&, binary_operation[member[.jsonVal], instanceof, type[CharSequence]]]] begin[{]
return[call[Float.parseFloat, parameter[call[jsonVal.toString, parameter[]]]]]
else begin[{]
None
end[}]
if[binary_operation[member[.jsonVal], instanceof, type[Double]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Expected float; got "), operandr=MethodInvocation(arguments=[], member=getClass, postfix_operators=[], prefix_operators=[], qualifier=jsonVal, selectors=[MethodInvocation(arguments=[], member=getName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None)
else begin[{]
None
end[}]
local_variable[type[double], doubleValue]
if[binary_operation[binary_operation[member[.doubleValue], <, member[Float.MIN_VALUE]], ||, binary_operation[member[.doubleValue], >, member[Float.MAX_VALUE]]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Expected float; got out-of-range value "), operandr=MemberReference(member=doubleValue, 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[}]
return[Cast(expression=MemberReference(member=doubleValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=BasicType(dimensions=[], name=float))]
else begin[{]
if[binary_operation[binary_operation[member[.rawType], ==, ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Double, sub_type=None))], ||, binary_operation[member[.rawType], ==, member[Double.TYPE]]]] begin[{]
if[binary_operation[member[.convertStringToNumber], &&, binary_operation[member[.jsonVal], instanceof, type[CharSequence]]]] begin[{]
return[call[Double.parseDouble, parameter[call[jsonVal.toString, parameter[]]]]]
else begin[{]
None
end[}]
if[binary_operation[member[.jsonVal], instanceof, type[Double]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Expected double; got "), operandr=MethodInvocation(arguments=[], member=getClass, postfix_operators=[], prefix_operators=[], qualifier=jsonVal, selectors=[MethodInvocation(arguments=[], member=getName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None)
else begin[{]
None
end[}]
return[member[.jsonVal]]
else begin[{]
if[binary_operation[binary_operation[member[.rawType], ==, ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Byte, sub_type=None))], ||, binary_operation[member[.rawType], ==, member[Byte.TYPE]]]] begin[{]
if[binary_operation[member[.convertStringToNumber], &&, binary_operation[member[.jsonVal], instanceof, type[CharSequence]]]] begin[{]
return[call[Byte.parseByte, parameter[call[jsonVal.toString, parameter[]]]]]
else begin[{]
None
end[}]
if[binary_operation[member[.jsonVal], instanceof, type[Integer]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Expected byte; got "), operandr=MethodInvocation(arguments=[], member=getClass, postfix_operators=[], prefix_operators=[], qualifier=jsonVal, selectors=[MethodInvocation(arguments=[], member=getName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None)
else begin[{]
None
end[}]
local_variable[type[int], intValue]
if[binary_operation[binary_operation[member[.intValue], <, member[Byte.MIN_VALUE]], ||, binary_operation[member[.intValue], >, member[Byte.MAX_VALUE]]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Expected byte; got out-of-range value "), operandr=MemberReference(member=intValue, 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[}]
return[Cast(expression=MemberReference(member=intValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=BasicType(dimensions=[], name=byte))]
else begin[{]
if[binary_operation[binary_operation[member[.rawType], ==, ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Character, sub_type=None))], ||, binary_operation[member[.rawType], ==, member[Character.TYPE]]]] begin[{]
if[binary_operation[member[.jsonVal], instanceof, type[CharSequence]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Expected character; got "), operandr=MethodInvocation(arguments=[], member=getClass, postfix_operators=[], prefix_operators=[], qualifier=jsonVal, selectors=[MethodInvocation(arguments=[], member=getName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None)
else begin[{]
None
end[}]
local_variable[type[CharSequence], charSequence]
if[binary_operation[call[charSequence.length, parameter[]], !=, literal[1]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Expected single character; got string")], 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[call[charSequence.charAt, parameter[literal[0]]]]
else begin[{]
if[binary_operation[binary_operation[member[.rawType], ==, ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Boolean, sub_type=None))], ||, binary_operation[member[.rawType], ==, member[Boolean.TYPE]]]] begin[{]
if[binary_operation[member[.convertStringToNumber], &&, binary_operation[member[.jsonVal], instanceof, type[CharSequence]]]] begin[{]
return[call[Boolean.parseBoolean, parameter[call[jsonVal.toString, parameter[]]]]]
else begin[{]
None
end[}]
if[binary_operation[member[.jsonVal], instanceof, type[Boolean]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Expected boolean; got "), operandr=MethodInvocation(arguments=[], member=getClass, postfix_operators=[], prefix_operators=[], qualifier=jsonVal, selectors=[MethodInvocation(arguments=[], member=getName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None)
else begin[{]
None
end[}]
return[member[.jsonVal]]
else begin[{]
if[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[MemberReference(member=rawType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isAssignableFrom, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=Enum, sub_type=None))] begin[{]
if[binary_operation[member[.jsonVal], instanceof, type[CharSequence]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Expected string for enum value; got "), operandr=MethodInvocation(arguments=[], member=getClass, postfix_operators=[], prefix_operators=[], qualifier=jsonVal, selectors=[MethodInvocation(arguments=[], member=getName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None)
else begin[{]
None
end[}]
local_variable[type[Enum], enumValue]
return[member[.enumValue]]
else begin[{]
if[call[JSONUtils.getRawType, parameter[member[.expectedType]]]] begin[{]
return[member[.jsonVal]]
else begin[{]
ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Got type "), operandr=MethodInvocation(arguments=[], member=getClass, postfix_operators=[], prefix_operators=[], qualifier=jsonVal, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="; expected "), operator=+), operandr=MemberReference(member=expectedType, 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)
end[}]
end[}]
end[}]
end[}]
end[}]
end[}]
end[}]
end[}]
end[}]
end[}]
end[}]
end[}]
end[}]
END[}] | Keyword[private] Keyword[static] identifier[Object] identifier[jsonBasicValueToObject] operator[SEP] Keyword[final] identifier[Object] identifier[jsonVal] , Keyword[final] identifier[Type] identifier[expectedType] , Keyword[final] Keyword[boolean] identifier[convertStringToNumber] operator[SEP] {
Keyword[if] operator[SEP] identifier[jsonVal] operator[==] Other[null] operator[SEP] {
Keyword[return] Other[null] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[jsonVal] Keyword[instanceof] identifier[JSONArray] operator[||] identifier[jsonVal] Keyword[instanceof] identifier[JSONObject] operator[SEP] {
Keyword[throw] identifier[ClassGraphException] operator[SEP] identifier[newClassGraphException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[expectedType] Keyword[instanceof] identifier[ParameterizedType] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[+] identifier[expectedType] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] operator[!] operator[SEP] identifier[expectedType] Keyword[instanceof] identifier[Class] operator[<] operator[?] operator[>] operator[SEP] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[+] identifier[expectedType] operator[SEP] operator[SEP]
}
Keyword[final] identifier[Class] operator[<] operator[?] operator[>] identifier[rawType] operator[=] operator[SEP] identifier[Class] operator[<] operator[?] operator[>] operator[SEP] identifier[expectedType] operator[SEP] Keyword[if] operator[SEP] identifier[rawType] operator[==] identifier[String] operator[SEP] Keyword[class] operator[SEP] {
Keyword[if] operator[SEP] operator[!] operator[SEP] identifier[jsonVal] Keyword[instanceof] identifier[CharSequence] operator[SEP] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[+] identifier[jsonVal] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] identifier[jsonVal] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[rawType] operator[==] identifier[CharSequence] operator[SEP] Keyword[class] operator[SEP] {
Keyword[if] operator[SEP] operator[!] operator[SEP] identifier[jsonVal] Keyword[instanceof] identifier[CharSequence] operator[SEP] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[+] identifier[jsonVal] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] identifier[jsonVal] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[rawType] operator[==] identifier[Integer] operator[SEP] Keyword[class] operator[||] identifier[rawType] operator[==] identifier[Integer] operator[SEP] identifier[TYPE] operator[SEP] {
Keyword[if] operator[SEP] identifier[convertStringToNumber] operator[&&] identifier[jsonVal] Keyword[instanceof] identifier[CharSequence] operator[SEP] {
Keyword[return] identifier[Integer] operator[SEP] identifier[parseInt] operator[SEP] identifier[jsonVal] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] operator[!] operator[SEP] identifier[jsonVal] Keyword[instanceof] identifier[Integer] operator[SEP] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[+] identifier[jsonVal] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] identifier[jsonVal] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[rawType] operator[==] identifier[Long] operator[SEP] Keyword[class] operator[||] identifier[rawType] operator[==] identifier[Long] operator[SEP] identifier[TYPE] operator[SEP] {
Keyword[final] Keyword[boolean] identifier[isLong] operator[=] identifier[jsonVal] Keyword[instanceof] identifier[Long] operator[SEP] Keyword[final] Keyword[boolean] identifier[isInteger] operator[=] identifier[jsonVal] Keyword[instanceof] identifier[Integer] operator[SEP] Keyword[if] operator[SEP] identifier[convertStringToNumber] operator[&&] identifier[jsonVal] Keyword[instanceof] identifier[CharSequence] operator[SEP] {
Keyword[return] identifier[isLong] operator[?] identifier[Long] operator[SEP] identifier[parseLong] operator[SEP] identifier[jsonVal] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[:] identifier[Integer] operator[SEP] identifier[parseInt] operator[SEP] identifier[jsonVal] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] operator[!] operator[SEP] identifier[isLong] operator[||] identifier[isInteger] operator[SEP] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[+] identifier[jsonVal] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[isLong] operator[SEP] {
Keyword[return] identifier[jsonVal] operator[SEP]
}
Keyword[else] {
Keyword[return] operator[SEP] Keyword[long] operator[SEP] operator[SEP] identifier[Integer] operator[SEP] identifier[jsonVal] operator[SEP]
}
}
Keyword[else] Keyword[if] operator[SEP] identifier[rawType] operator[==] identifier[Short] operator[SEP] Keyword[class] operator[||] identifier[rawType] operator[==] identifier[Short] operator[SEP] identifier[TYPE] operator[SEP] {
Keyword[if] operator[SEP] identifier[convertStringToNumber] operator[&&] identifier[jsonVal] Keyword[instanceof] identifier[CharSequence] operator[SEP] {
Keyword[return] identifier[Short] operator[SEP] identifier[parseShort] operator[SEP] identifier[jsonVal] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] operator[!] operator[SEP] identifier[jsonVal] Keyword[instanceof] identifier[Integer] operator[SEP] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[+] identifier[jsonVal] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[final] Keyword[int] identifier[intValue] operator[=] operator[SEP] identifier[Integer] operator[SEP] identifier[jsonVal] operator[SEP] Keyword[if] operator[SEP] identifier[intValue] operator[<] identifier[Short] operator[SEP] identifier[MIN_VALUE] operator[||] identifier[intValue] operator[>] identifier[Short] operator[SEP] identifier[MAX_VALUE] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[+] identifier[intValue] operator[SEP] operator[SEP]
}
Keyword[return] operator[SEP] Keyword[short] operator[SEP] identifier[intValue] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[rawType] operator[==] identifier[Float] operator[SEP] Keyword[class] operator[||] identifier[rawType] operator[==] identifier[Float] operator[SEP] identifier[TYPE] operator[SEP] {
Keyword[if] operator[SEP] identifier[convertStringToNumber] operator[&&] identifier[jsonVal] Keyword[instanceof] identifier[CharSequence] operator[SEP] {
Keyword[return] identifier[Float] operator[SEP] identifier[parseFloat] operator[SEP] identifier[jsonVal] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] operator[!] operator[SEP] identifier[jsonVal] Keyword[instanceof] identifier[Double] operator[SEP] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[+] identifier[jsonVal] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[final] Keyword[double] identifier[doubleValue] operator[=] operator[SEP] identifier[Double] operator[SEP] identifier[jsonVal] operator[SEP] Keyword[if] operator[SEP] identifier[doubleValue] operator[<] identifier[Float] operator[SEP] identifier[MIN_VALUE] operator[||] identifier[doubleValue] operator[>] identifier[Float] operator[SEP] identifier[MAX_VALUE] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[+] identifier[doubleValue] operator[SEP] operator[SEP]
}
Keyword[return] operator[SEP] Keyword[float] operator[SEP] identifier[doubleValue] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[rawType] operator[==] identifier[Double] operator[SEP] Keyword[class] operator[||] identifier[rawType] operator[==] identifier[Double] operator[SEP] identifier[TYPE] operator[SEP] {
Keyword[if] operator[SEP] identifier[convertStringToNumber] operator[&&] identifier[jsonVal] Keyword[instanceof] identifier[CharSequence] operator[SEP] {
Keyword[return] identifier[Double] operator[SEP] identifier[parseDouble] operator[SEP] identifier[jsonVal] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] operator[!] operator[SEP] identifier[jsonVal] Keyword[instanceof] identifier[Double] operator[SEP] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[+] identifier[jsonVal] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] identifier[jsonVal] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[rawType] operator[==] identifier[Byte] operator[SEP] Keyword[class] operator[||] identifier[rawType] operator[==] identifier[Byte] operator[SEP] identifier[TYPE] operator[SEP] {
Keyword[if] operator[SEP] identifier[convertStringToNumber] operator[&&] identifier[jsonVal] Keyword[instanceof] identifier[CharSequence] operator[SEP] {
Keyword[return] identifier[Byte] operator[SEP] identifier[parseByte] operator[SEP] identifier[jsonVal] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] operator[!] operator[SEP] identifier[jsonVal] Keyword[instanceof] identifier[Integer] operator[SEP] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[+] identifier[jsonVal] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[final] Keyword[int] identifier[intValue] operator[=] operator[SEP] identifier[Integer] operator[SEP] identifier[jsonVal] operator[SEP] Keyword[if] operator[SEP] identifier[intValue] operator[<] identifier[Byte] operator[SEP] identifier[MIN_VALUE] operator[||] identifier[intValue] operator[>] identifier[Byte] operator[SEP] identifier[MAX_VALUE] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[+] identifier[intValue] operator[SEP] operator[SEP]
}
Keyword[return] operator[SEP] Keyword[byte] operator[SEP] identifier[intValue] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[rawType] operator[==] identifier[Character] operator[SEP] Keyword[class] operator[||] identifier[rawType] operator[==] identifier[Character] operator[SEP] identifier[TYPE] operator[SEP] {
Keyword[if] operator[SEP] operator[!] operator[SEP] identifier[jsonVal] Keyword[instanceof] identifier[CharSequence] operator[SEP] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[+] identifier[jsonVal] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[final] identifier[CharSequence] identifier[charSequence] operator[=] operator[SEP] identifier[CharSequence] operator[SEP] identifier[jsonVal] operator[SEP] Keyword[if] operator[SEP] identifier[charSequence] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[!=] Other[1] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[return] identifier[charSequence] operator[SEP] identifier[charAt] operator[SEP] Other[0] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[rawType] operator[==] identifier[Boolean] operator[SEP] Keyword[class] operator[||] identifier[rawType] operator[==] identifier[Boolean] operator[SEP] identifier[TYPE] operator[SEP] {
Keyword[if] operator[SEP] identifier[convertStringToNumber] operator[&&] identifier[jsonVal] Keyword[instanceof] identifier[CharSequence] operator[SEP] {
Keyword[return] identifier[Boolean] operator[SEP] identifier[parseBoolean] operator[SEP] identifier[jsonVal] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] operator[!] operator[SEP] identifier[jsonVal] Keyword[instanceof] identifier[Boolean] operator[SEP] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[+] identifier[jsonVal] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] identifier[jsonVal] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[Enum] operator[SEP] Keyword[class] operator[SEP] identifier[isAssignableFrom] operator[SEP] identifier[rawType] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] operator[!] operator[SEP] identifier[jsonVal] Keyword[instanceof] identifier[CharSequence] operator[SEP] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[+] identifier[jsonVal] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
} annotation[@] identifier[SuppressWarnings] operator[SEP] {
literal[String] , literal[String]
} operator[SEP] Keyword[final] identifier[Enum] identifier[enumValue] operator[=] identifier[Enum] operator[SEP] identifier[valueOf] operator[SEP] operator[SEP] identifier[Class] operator[<] identifier[Enum] operator[>] operator[SEP] identifier[rawType] , identifier[jsonVal] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[enumValue] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[JSONUtils] operator[SEP] identifier[getRawType] operator[SEP] identifier[expectedType] operator[SEP] operator[SEP] identifier[isAssignableFrom] operator[SEP] identifier[jsonVal] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
Keyword[return] identifier[jsonVal] operator[SEP]
}
Keyword[else] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[+] identifier[jsonVal] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[expectedType] operator[SEP] operator[SEP]
}
}
|
public static String depositRefund(Map<String, String> params, InputStream certFile, String certPassword) {
return doPostSSL(DEPOSIT_REFUND_URL, params, certFile, certPassword);
} | class class_name[name] begin[{]
method[depositRefund, return_type[type[String]], modifier[public static], parameter[params, certFile, certPassword]] begin[{]
return[call[.doPostSSL, parameter[member[.DEPOSIT_REFUND_URL], member[.params], member[.certFile], member[.certPassword]]]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[String] identifier[depositRefund] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[params] , identifier[InputStream] identifier[certFile] , identifier[String] identifier[certPassword] operator[SEP] {
Keyword[return] identifier[doPostSSL] operator[SEP] identifier[DEPOSIT_REFUND_URL] , identifier[params] , identifier[certFile] , identifier[certPassword] operator[SEP] operator[SEP]
}
|
private List<Entity> generateResults(QueryBuilder<?> builder, boolean keysOnly) throws FalsePredicateException {
return datastore.query(new Query(builder, keysOnly));
} | class class_name[name] begin[{]
method[generateResults, return_type[type[List]], modifier[private], parameter[builder, keysOnly]] begin[{]
return[call[datastore.query, parameter[ClassCreator(arguments=[MemberReference(member=builder, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=keysOnly, 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=Query, sub_type=None))]]]
end[}]
END[}] | Keyword[private] identifier[List] operator[<] identifier[Entity] operator[>] identifier[generateResults] operator[SEP] identifier[QueryBuilder] operator[<] operator[?] operator[>] identifier[builder] , Keyword[boolean] identifier[keysOnly] operator[SEP] Keyword[throws] identifier[FalsePredicateException] {
Keyword[return] identifier[datastore] operator[SEP] identifier[query] operator[SEP] Keyword[new] identifier[Query] operator[SEP] identifier[builder] , identifier[keysOnly] operator[SEP] operator[SEP] operator[SEP]
}
|
public static double evaluate( PlaneNormal3D_F64 plane , Point3D_F64 point ) {
double dx = point.x - plane.p.x;
double dy = point.y - plane.p.y;
double dz = point.z - plane.p.z;
return plane.n.x*dx + plane.n.y*dy + plane.n.z*dz;
} | class class_name[name] begin[{]
method[evaluate, return_type[type[double]], modifier[public static], parameter[plane, point]] begin[{]
local_variable[type[double], dx]
local_variable[type[double], dy]
local_variable[type[double], dz]
return[binary_operation[binary_operation[binary_operation[member[plane.n.x], *, member[.dx]], +, binary_operation[member[plane.n.y], *, member[.dy]]], +, binary_operation[member[plane.n.z], *, member[.dz]]]]
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[double] identifier[evaluate] operator[SEP] identifier[PlaneNormal3D_F64] identifier[plane] , identifier[Point3D_F64] identifier[point] operator[SEP] {
Keyword[double] identifier[dx] operator[=] identifier[point] operator[SEP] identifier[x] operator[-] identifier[plane] operator[SEP] identifier[p] operator[SEP] identifier[x] operator[SEP] Keyword[double] identifier[dy] operator[=] identifier[point] operator[SEP] identifier[y] operator[-] identifier[plane] operator[SEP] identifier[p] operator[SEP] identifier[y] operator[SEP] Keyword[double] identifier[dz] operator[=] identifier[point] operator[SEP] identifier[z] operator[-] identifier[plane] operator[SEP] identifier[p] operator[SEP] identifier[z] operator[SEP] Keyword[return] identifier[plane] operator[SEP] identifier[n] operator[SEP] identifier[x] operator[*] identifier[dx] operator[+] identifier[plane] operator[SEP] identifier[n] operator[SEP] identifier[y] operator[*] identifier[dy] operator[+] identifier[plane] operator[SEP] identifier[n] operator[SEP] identifier[z] operator[*] identifier[dz] operator[SEP]
}
|
void fireProgressEvent(int state, int progress, String message, boolean allowCancel) throws InstallException {
log(Level.FINEST, message);
if (enableEvent) {
try {
eventManager.fireProgressEvent(state, progress, message);
} catch (CancelException ce) {
if (allowCancel)
throw ce;
else
log(Level.FINEST, "fireProgressEvent caught cancel exception: " + ce.getMessage());
} catch (Exception e) {
log(Level.FINEST, "fireProgressEvent caught exception: " + e.getMessage());
}
}
} | class class_name[name] begin[{]
method[fireProgressEvent, return_type[void], modifier[default], parameter[state, progress, message, allowCancel]] begin[{]
call[.log, parameter[member[Level.FINEST], member[.message]]]
if[member[.enableEvent]] begin[{]
TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=state, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=progress, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=message, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=fireProgressEvent, postfix_operators=[], prefix_operators=[], qualifier=eventManager, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[IfStatement(condition=MemberReference(member=allowCancel, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=FINEST, postfix_operators=[], prefix_operators=[], qualifier=Level, selectors=[]), BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="fireProgressEvent caught cancel exception: "), operandr=MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=ce, selectors=[], type_arguments=None), operator=+)], member=log, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), label=None, then_statement=ThrowStatement(expression=MemberReference(member=ce, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None))], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ce, types=['CancelException'])), CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=FINEST, postfix_operators=[], prefix_operators=[], qualifier=Level, selectors=[]), BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="fireProgressEvent caught exception: "), operandr=MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), operator=+)], member=log, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None)
else begin[{]
None
end[}]
end[}]
END[}] | Keyword[void] identifier[fireProgressEvent] operator[SEP] Keyword[int] identifier[state] , Keyword[int] identifier[progress] , identifier[String] identifier[message] , Keyword[boolean] identifier[allowCancel] operator[SEP] Keyword[throws] identifier[InstallException] {
identifier[log] operator[SEP] identifier[Level] operator[SEP] identifier[FINEST] , identifier[message] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[enableEvent] operator[SEP] {
Keyword[try] {
identifier[eventManager] operator[SEP] identifier[fireProgressEvent] operator[SEP] identifier[state] , identifier[progress] , identifier[message] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[CancelException] identifier[ce] operator[SEP] {
Keyword[if] operator[SEP] identifier[allowCancel] operator[SEP] Keyword[throw] identifier[ce] operator[SEP] Keyword[else] identifier[log] operator[SEP] identifier[Level] operator[SEP] identifier[FINEST] , literal[String] operator[+] identifier[ce] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] {
identifier[log] operator[SEP] identifier[Level] operator[SEP] identifier[FINEST] , literal[String] operator[+] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
}
}
|
@Override
public Object getService(IServiceReference serviceReference) {
final String sourceMethod = "getService"; //$NON-NLS-1$
boolean isTraceLogging = log.isLoggable(Level.FINER);
if (isTraceLogging) {
log.entering(PlatformServicesImpl.class.getName(), sourceMethod, serviceReference);
}
Object result = null;
BundleContext bundleContext = Activator.getBundleContext();
if (bundleContext != null) {
result = bundleContext
.getService((ServiceReference<?>) serviceReference.getPlatformObject());
}
if (isTraceLogging) {
log.exiting(PlatformServicesImpl.class.getName(), sourceMethod, result);
}
return result;
} | class class_name[name] begin[{]
method[getService, return_type[type[Object]], modifier[public], parameter[serviceReference]] begin[{]
local_variable[type[String], sourceMethod]
local_variable[type[boolean], isTraceLogging]
if[member[.isTraceLogging]] begin[{]
call[log.entering, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[], member=getName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=PlatformServicesImpl, sub_type=None)), member[.sourceMethod], member[.serviceReference]]]
else begin[{]
None
end[}]
local_variable[type[Object], result]
local_variable[type[BundleContext], bundleContext]
if[binary_operation[member[.bundleContext], !=, literal[null]]] begin[{]
assign[member[.result], call[bundleContext.getService, parameter[Cast(expression=MethodInvocation(arguments=[], member=getPlatformObject, postfix_operators=[], prefix_operators=[], qualifier=serviceReference, selectors=[], type_arguments=None), type=ReferenceType(arguments=[TypeArgument(pattern_type=?, type=None)], dimensions=[], name=ServiceReference, sub_type=None))]]]
else begin[{]
None
end[}]
if[member[.isTraceLogging]] begin[{]
call[log.exiting, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[], member=getName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=PlatformServicesImpl, sub_type=None)), member[.sourceMethod], member[.result]]]
else begin[{]
None
end[}]
return[member[.result]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] identifier[Object] identifier[getService] operator[SEP] identifier[IServiceReference] identifier[serviceReference] operator[SEP] {
Keyword[final] identifier[String] identifier[sourceMethod] operator[=] literal[String] operator[SEP] Keyword[boolean] identifier[isTraceLogging] operator[=] identifier[log] operator[SEP] identifier[isLoggable] operator[SEP] identifier[Level] operator[SEP] identifier[FINER] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[isTraceLogging] operator[SEP] {
identifier[log] operator[SEP] identifier[entering] operator[SEP] identifier[PlatformServicesImpl] operator[SEP] Keyword[class] operator[SEP] identifier[getName] operator[SEP] operator[SEP] , identifier[sourceMethod] , identifier[serviceReference] operator[SEP] operator[SEP]
}
identifier[Object] identifier[result] operator[=] Other[null] operator[SEP] identifier[BundleContext] identifier[bundleContext] operator[=] identifier[Activator] operator[SEP] identifier[getBundleContext] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[bundleContext] operator[!=] Other[null] operator[SEP] {
identifier[result] operator[=] identifier[bundleContext] operator[SEP] identifier[getService] operator[SEP] operator[SEP] identifier[ServiceReference] operator[<] operator[?] operator[>] operator[SEP] identifier[serviceReference] operator[SEP] identifier[getPlatformObject] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[isTraceLogging] operator[SEP] {
identifier[log] operator[SEP] identifier[exiting] operator[SEP] identifier[PlatformServicesImpl] operator[SEP] Keyword[class] operator[SEP] identifier[getName] operator[SEP] operator[SEP] , identifier[sourceMethod] , identifier[result] operator[SEP] operator[SEP]
}
Keyword[return] identifier[result] operator[SEP]
}
|
public static String format( final String messagePattern, Object arg1, Object arg2 )
{
int i = 0;
int patternLength = messagePattern.length();
StringBuffer sbuf = new StringBuffer( patternLength + 50 );
for( int L = 0; L < 2; L++ )
{
int j = messagePattern.indexOf( DELIM_START, i );
if( j == -1 || ( j + 1 == patternLength ) )
{
// no more variables
if( i == 0 )
{ // this is a simple string
return messagePattern;
}
else
{ // add the tail string which contains no variables and return the result.
sbuf.append( messagePattern.substring( i, patternLength ) );
return sbuf.toString();
}
}
else
{
char delimStop = messagePattern.charAt( j + 1 );
if( delimStop != DELIM_STOP )
{
// invalid DELIM_START/DELIM_STOP pair
sbuf.append( messagePattern.substring( i, patternLength ) );
return sbuf.toString();
}
sbuf.append( messagePattern.substring( i, j ) );
if( L == 0 )
{
sbuf.append( arg1 );
}
else
{
sbuf.append( arg2 );
}
i = j + 2;
}
}
// append the characters following the second {} pair.
String remainder = messagePattern.substring( i, patternLength );
sbuf.append( remainder );
return sbuf.toString();
} | class class_name[name] begin[{]
method[format, return_type[type[String]], modifier[public static], parameter[messagePattern, arg1, arg2]] begin[{]
local_variable[type[int], i]
local_variable[type[int], patternLength]
local_variable[type[StringBuffer], sbuf]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=DELIM_START, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=indexOf, postfix_operators=[], prefix_operators=[], qualifier=messagePattern, selectors=[], type_arguments=None), name=j)], modifiers=set(), type=BasicType(dimensions=[], name=int)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=1), operator===), operandr=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+), operandr=MemberReference(member=patternLength, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), operator=||), else_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+)], member=charAt, postfix_operators=[], prefix_operators=[], qualifier=messagePattern, selectors=[], type_arguments=None), name=delimStop)], modifiers=set(), type=BasicType(dimensions=[], name=char)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=delimStop, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=DELIM_STOP, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=patternLength, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=substring, postfix_operators=[], prefix_operators=[], qualifier=messagePattern, selectors=[], type_arguments=None)], member=append, postfix_operators=[], prefix_operators=[], qualifier=sbuf, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=sbuf, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=substring, postfix_operators=[], prefix_operators=[], qualifier=messagePattern, selectors=[], type_arguments=None)], member=append, postfix_operators=[], prefix_operators=[], qualifier=sbuf, selectors=[], type_arguments=None), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=L, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator===), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=arg2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=append, postfix_operators=[], prefix_operators=[], qualifier=sbuf, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=arg1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=append, postfix_operators=[], prefix_operators=[], qualifier=sbuf, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=BinaryOperation(operandl=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), operator=+)), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator===), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=patternLength, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=substring, postfix_operators=[], prefix_operators=[], qualifier=messagePattern, selectors=[], type_arguments=None)], member=append, postfix_operators=[], prefix_operators=[], qualifier=sbuf, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=sbuf, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=MemberReference(member=messagePattern, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)]))]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=L, 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=L)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=L, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
local_variable[type[String], remainder]
call[sbuf.append, parameter[member[.remainder]]]
return[call[sbuf.toString, parameter[]]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[String] identifier[format] operator[SEP] Keyword[final] identifier[String] identifier[messagePattern] , identifier[Object] identifier[arg1] , identifier[Object] identifier[arg2] operator[SEP] {
Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] Keyword[int] identifier[patternLength] operator[=] identifier[messagePattern] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] identifier[StringBuffer] identifier[sbuf] operator[=] Keyword[new] identifier[StringBuffer] operator[SEP] identifier[patternLength] operator[+] Other[50] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[L] operator[=] Other[0] operator[SEP] identifier[L] operator[<] Other[2] operator[SEP] identifier[L] operator[++] operator[SEP] {
Keyword[int] identifier[j] operator[=] identifier[messagePattern] operator[SEP] identifier[indexOf] operator[SEP] identifier[DELIM_START] , identifier[i] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[j] operator[==] operator[-] Other[1] operator[||] operator[SEP] identifier[j] operator[+] Other[1] operator[==] identifier[patternLength] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[i] operator[==] Other[0] operator[SEP] {
Keyword[return] identifier[messagePattern] operator[SEP]
}
Keyword[else] {
identifier[sbuf] operator[SEP] identifier[append] operator[SEP] identifier[messagePattern] operator[SEP] identifier[substring] operator[SEP] identifier[i] , identifier[patternLength] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[sbuf] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[else] {
Keyword[char] identifier[delimStop] operator[=] identifier[messagePattern] operator[SEP] identifier[charAt] operator[SEP] identifier[j] operator[+] Other[1] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[delimStop] operator[!=] identifier[DELIM_STOP] operator[SEP] {
identifier[sbuf] operator[SEP] identifier[append] operator[SEP] identifier[messagePattern] operator[SEP] identifier[substring] operator[SEP] identifier[i] , identifier[patternLength] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[sbuf] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP]
}
identifier[sbuf] operator[SEP] identifier[append] operator[SEP] identifier[messagePattern] operator[SEP] identifier[substring] operator[SEP] identifier[i] , identifier[j] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[L] operator[==] Other[0] operator[SEP] {
identifier[sbuf] operator[SEP] identifier[append] operator[SEP] identifier[arg1] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[sbuf] operator[SEP] identifier[append] operator[SEP] identifier[arg2] operator[SEP] operator[SEP]
}
identifier[i] operator[=] identifier[j] operator[+] Other[2] operator[SEP]
}
}
identifier[String] identifier[remainder] operator[=] identifier[messagePattern] operator[SEP] identifier[substring] operator[SEP] identifier[i] , identifier[patternLength] operator[SEP] operator[SEP] identifier[sbuf] operator[SEP] identifier[append] operator[SEP] identifier[remainder] operator[SEP] operator[SEP] Keyword[return] identifier[sbuf] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP]
}
|
public void update(@NonNull ViewPosition from) {
if (GestureDebug.isDebugAnimator()) {
Log.d(TAG, "Updating view position: " + from.pack());
}
updateInternal(from);
} | class class_name[name] begin[{]
method[update, return_type[void], modifier[public], parameter[from]] begin[{]
if[call[GestureDebug.isDebugAnimator, parameter[]]] begin[{]
call[Log.d, parameter[member[.TAG], binary_operation[literal["Updating view position: "], +, call[from.pack, parameter[]]]]]
else begin[{]
None
end[}]
call[.updateInternal, parameter[member[.from]]]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[update] operator[SEP] annotation[@] identifier[NonNull] identifier[ViewPosition] identifier[from] operator[SEP] {
Keyword[if] operator[SEP] identifier[GestureDebug] operator[SEP] identifier[isDebugAnimator] operator[SEP] operator[SEP] operator[SEP] {
identifier[Log] operator[SEP] identifier[d] operator[SEP] identifier[TAG] , literal[String] operator[+] identifier[from] operator[SEP] identifier[pack] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
identifier[updateInternal] operator[SEP] identifier[from] operator[SEP] operator[SEP]
}
|
public static <T extends TypeDefinition> ElementMatcher.Junction<T> isVariable(ElementMatcher<? super NamedElement> matcher) {
return new TypeSortMatcher<T>(anyOf(TypeDefinition.Sort.VARIABLE, TypeDefinition.Sort.VARIABLE_SYMBOLIC)).and(matcher);
} | class class_name[name] begin[{]
method[isVariable, return_type[type[ElementMatcher]], modifier[public static], parameter[matcher]] begin[{]
return[ClassCreator(arguments=[MethodInvocation(arguments=[MemberReference(member=VARIABLE, postfix_operators=[], prefix_operators=[], qualifier=TypeDefinition.Sort, selectors=[]), MemberReference(member=VARIABLE_SYMBOLIC, postfix_operators=[], prefix_operators=[], qualifier=TypeDefinition.Sort, selectors=[])], member=anyOf, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=matcher, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=and, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None))], dimensions=None, name=TypeSortMatcher, sub_type=None))]
end[}]
END[}] | Keyword[public] Keyword[static] operator[<] identifier[T] Keyword[extends] identifier[TypeDefinition] operator[>] identifier[ElementMatcher] operator[SEP] identifier[Junction] operator[<] identifier[T] operator[>] identifier[isVariable] operator[SEP] identifier[ElementMatcher] operator[<] operator[?] Keyword[super] identifier[NamedElement] operator[>] identifier[matcher] operator[SEP] {
Keyword[return] Keyword[new] identifier[TypeSortMatcher] operator[<] identifier[T] operator[>] operator[SEP] identifier[anyOf] operator[SEP] identifier[TypeDefinition] operator[SEP] identifier[Sort] operator[SEP] identifier[VARIABLE] , identifier[TypeDefinition] operator[SEP] identifier[Sort] operator[SEP] identifier[VARIABLE_SYMBOLIC] operator[SEP] operator[SEP] operator[SEP] identifier[and] operator[SEP] identifier[matcher] operator[SEP] operator[SEP]
}
|
private FileStatus[] getFileStatus(Path[] paths) throws IOException {
if (paths == null) {
return null;
}
ArrayList<FileStatus> results = new ArrayList<FileStatus>(paths.length);
for (int i = 0; i < paths.length; i++) {
try {
results.add(getFileStatus(paths[i]));
} catch (FileNotFoundException e) { // do nothing
}
}
return results.toArray(new FileStatus[results.size()]);
} | class class_name[name] begin[{]
method[getFileStatus, return_type[type[FileStatus]], modifier[private], parameter[paths]] begin[{]
if[binary_operation[member[.paths], ==, literal[null]]] begin[{]
return[literal[null]]
else begin[{]
None
end[}]
local_variable[type[ArrayList], results]
ForStatement(body=BlockStatement(label=None, statements=[TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=paths, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])], member=getFileStatus, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=results, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['FileNotFoundException']))], finally_block=None, label=None, resources=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=paths, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
return[call[results.toArray, parameter[ArrayCreator(dimensions=[MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=results, selectors=[], type_arguments=None)], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=FileStatus, sub_type=None))]]]
end[}]
END[}] | Keyword[private] identifier[FileStatus] operator[SEP] operator[SEP] identifier[getFileStatus] operator[SEP] identifier[Path] operator[SEP] operator[SEP] identifier[paths] operator[SEP] Keyword[throws] identifier[IOException] {
Keyword[if] operator[SEP] identifier[paths] operator[==] Other[null] operator[SEP] {
Keyword[return] Other[null] operator[SEP]
}
identifier[ArrayList] operator[<] identifier[FileStatus] operator[>] identifier[results] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[FileStatus] operator[>] operator[SEP] identifier[paths] operator[SEP] identifier[length] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[paths] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] {
Keyword[try] {
identifier[results] operator[SEP] identifier[add] operator[SEP] identifier[getFileStatus] operator[SEP] identifier[paths] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[FileNotFoundException] identifier[e] operator[SEP] {
}
}
Keyword[return] identifier[results] operator[SEP] identifier[toArray] operator[SEP] Keyword[new] identifier[FileStatus] operator[SEP] identifier[results] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.