code
stringlengths 63
466k
| code_sememe
stringlengths 141
3.79M
| token_type
stringlengths 274
1.23M
|
---|---|---|
public java.rmi.Remote getPort(Class serviceEndpointInterface) throws javax.xml.rpc.ServiceException {
try {
if (com.google.api.ads.admanager.axis.v201811.CreativeServiceInterface.class.isAssignableFrom(serviceEndpointInterface)) {
com.google.api.ads.admanager.axis.v201811.CreativeServiceSoapBindingStub _stub = new com.google.api.ads.admanager.axis.v201811.CreativeServiceSoapBindingStub(new java.net.URL(CreativeServiceInterfacePort_address), this);
_stub.setPortName(getCreativeServiceInterfacePortWSDDServiceName());
return _stub;
}
}
catch (java.lang.Throwable t) {
throw new javax.xml.rpc.ServiceException(t);
}
throw new javax.xml.rpc.ServiceException("There is no stub implementation for the interface: " + (serviceEndpointInterface == null ? "null" : serviceEndpointInterface.getName()));
} | class class_name[name] begin[{]
method[getPort, return_type[type[java]], modifier[public], parameter[serviceEndpointInterface]] begin[{]
TryStatement(block=[IfStatement(condition=ClassReference(postfix_operators=[], prefix_operators=[], qualifier=com.google.api.ads.admanager.axis.v201811, selectors=[MethodInvocation(arguments=[MemberReference(member=serviceEndpointInterface, 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=CreativeServiceInterface, sub_type=None)), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[ClassCreator(arguments=[MemberReference(member=CreativeServiceInterfacePort_address, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=java, sub_type=ReferenceType(arguments=None, dimensions=None, name=net, sub_type=ReferenceType(arguments=None, dimensions=None, name=URL, sub_type=None)))), This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=com, sub_type=ReferenceType(arguments=None, dimensions=None, name=google, sub_type=ReferenceType(arguments=None, dimensions=None, name=api, sub_type=ReferenceType(arguments=None, dimensions=None, name=ads, sub_type=ReferenceType(arguments=None, dimensions=None, name=admanager, sub_type=ReferenceType(arguments=None, dimensions=None, name=axis, sub_type=ReferenceType(arguments=None, dimensions=None, name=v201811, sub_type=ReferenceType(arguments=None, dimensions=None, name=CreativeServiceSoapBindingStub, sub_type=None))))))))), name=_stub)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=com, sub_type=ReferenceType(arguments=None, dimensions=None, name=google, sub_type=ReferenceType(arguments=None, dimensions=None, name=api, sub_type=ReferenceType(arguments=None, dimensions=None, name=ads, sub_type=ReferenceType(arguments=None, dimensions=None, name=admanager, sub_type=ReferenceType(arguments=None, dimensions=None, name=axis, sub_type=ReferenceType(arguments=None, dimensions=None, name=v201811, sub_type=ReferenceType(arguments=None, dimensions=None, name=CreativeServiceSoapBindingStub, sub_type=None))))))))), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getCreativeServiceInterfacePortWSDDServiceName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=setPortName, postfix_operators=[], prefix_operators=[], qualifier=_stub, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=MemberReference(member=_stub, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)]))], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=t, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=javax, sub_type=ReferenceType(arguments=None, dimensions=None, name=xml, sub_type=ReferenceType(arguments=None, dimensions=None, name=rpc, sub_type=ReferenceType(arguments=None, dimensions=None, name=ServiceException, sub_type=None))))), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=t, types=['java.lang.Throwable']))], finally_block=None, label=None, resources=None)
ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="There is no stub implementation for the interface: "), operandr=TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=serviceEndpointInterface, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), if_false=MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=serviceEndpointInterface, selectors=[], type_arguments=None), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="null")), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=javax, sub_type=ReferenceType(arguments=None, dimensions=None, name=xml, sub_type=ReferenceType(arguments=None, dimensions=None, name=rpc, sub_type=ReferenceType(arguments=None, dimensions=None, name=ServiceException, sub_type=None))))), label=None)
end[}]
END[}] | Keyword[public] identifier[java] operator[SEP] identifier[rmi] operator[SEP] identifier[Remote] identifier[getPort] operator[SEP] identifier[Class] identifier[serviceEndpointInterface] operator[SEP] Keyword[throws] identifier[javax] operator[SEP] identifier[xml] operator[SEP] identifier[rpc] operator[SEP] identifier[ServiceException] {
Keyword[try] {
Keyword[if] 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[CreativeServiceInterface] operator[SEP] Keyword[class] operator[SEP] identifier[isAssignableFrom] operator[SEP] identifier[serviceEndpointInterface] operator[SEP] 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[CreativeServiceSoapBindingStub] identifier[_stub] operator[=] Keyword[new] 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[CreativeServiceSoapBindingStub] operator[SEP] Keyword[new] identifier[java] operator[SEP] identifier[net] operator[SEP] identifier[URL] operator[SEP] identifier[CreativeServiceInterfacePort_address] operator[SEP] , Keyword[this] operator[SEP] operator[SEP] identifier[_stub] operator[SEP] identifier[setPortName] operator[SEP] identifier[getCreativeServiceInterfacePortWSDDServiceName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[_stub] operator[SEP]
}
}
Keyword[catch] operator[SEP] identifier[java] operator[SEP] identifier[lang] operator[SEP] identifier[Throwable] identifier[t] operator[SEP] {
Keyword[throw] Keyword[new] identifier[javax] operator[SEP] identifier[xml] operator[SEP] identifier[rpc] operator[SEP] identifier[ServiceException] operator[SEP] identifier[t] operator[SEP] operator[SEP]
}
Keyword[throw] Keyword[new] identifier[javax] operator[SEP] identifier[xml] operator[SEP] identifier[rpc] operator[SEP] identifier[ServiceException] operator[SEP] literal[String] operator[+] operator[SEP] identifier[serviceEndpointInterface] operator[==] Other[null] operator[?] literal[String] operator[:] identifier[serviceEndpointInterface] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
public static Uri getFileUri(Activity activity, File file) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
return FileProvider.getUriForFile(activity, activity.getPackageName() + ".file.path.share", file);
}
return Uri.fromFile(file);
} | class class_name[name] begin[{]
method[getFileUri, return_type[type[Uri]], modifier[public static], parameter[activity, file]] begin[{]
if[binary_operation[member[Build.VERSION.SDK_INT], >=, member[Build.VERSION_CODES.N]]] begin[{]
return[call[FileProvider.getUriForFile, parameter[member[.activity], binary_operation[call[activity.getPackageName, parameter[]], +, literal[".file.path.share"]], member[.file]]]]
else begin[{]
None
end[}]
return[call[Uri.fromFile, parameter[member[.file]]]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[Uri] identifier[getFileUri] operator[SEP] identifier[Activity] identifier[activity] , identifier[File] identifier[file] operator[SEP] {
Keyword[if] operator[SEP] identifier[Build] operator[SEP] identifier[VERSION] operator[SEP] identifier[SDK_INT] operator[>=] identifier[Build] operator[SEP] identifier[VERSION_CODES] operator[SEP] identifier[N] operator[SEP] {
Keyword[return] identifier[FileProvider] operator[SEP] identifier[getUriForFile] operator[SEP] identifier[activity] , identifier[activity] operator[SEP] identifier[getPackageName] operator[SEP] operator[SEP] operator[+] literal[String] , identifier[file] operator[SEP] operator[SEP]
}
Keyword[return] identifier[Uri] operator[SEP] identifier[fromFile] operator[SEP] identifier[file] operator[SEP] operator[SEP]
}
|
public final void mT__52() throws RecognitionException {
try {
int _type = T__52;
int _channel = DEFAULT_TOKEN_CHANNEL;
// InternalSARL.g:38:7: ( 'with' )
// InternalSARL.g:38:9: 'with'
{
match("with");
}
state.type = _type;
state.channel = _channel;
}
finally {
}
} | class class_name[name] begin[{]
method[mT__52, return_type[void], modifier[final public], parameter[]] begin[{]
TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=T__52, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), name=_type)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=DEFAULT_TOKEN_CHANNEL, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), name=_channel)], modifiers=set(), type=BasicType(dimensions=[], name=int)), BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="with")], member=match, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), StatementExpression(expression=Assignment(expressionl=MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=state, selectors=[]), type==, value=MemberReference(member=_type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=channel, postfix_operators=[], prefix_operators=[], qualifier=state, selectors=[]), type==, value=MemberReference(member=_channel, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)], catches=None, finally_block=[], label=None, resources=None)
end[}]
END[}] | Keyword[public] Keyword[final] Keyword[void] identifier[mT__52] operator[SEP] operator[SEP] Keyword[throws] identifier[RecognitionException] {
Keyword[try] {
Keyword[int] identifier[_type] operator[=] identifier[T__52] operator[SEP] Keyword[int] identifier[_channel] operator[=] identifier[DEFAULT_TOKEN_CHANNEL] operator[SEP] {
identifier[match] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
identifier[state] operator[SEP] identifier[type] operator[=] identifier[_type] operator[SEP] identifier[state] operator[SEP] identifier[channel] operator[=] identifier[_channel] operator[SEP]
}
Keyword[finally] {
}
}
|
public String getRelativePathToBenchmarkReportDirectory(File file) {
String benchmarkReportDirectoryPath = plannerBenchmarkResult.getBenchmarkReportDirectory().getAbsoluteFile().toURI().getPath();
String filePath = file.getAbsoluteFile().toURI().getPath();
if (!filePath.startsWith(benchmarkReportDirectoryPath)) {
throw new IllegalArgumentException("The filePath (" + filePath
+ ") does not start with the benchmarkReportDirectoryPath (" + benchmarkReportDirectoryPath + ").");
}
String relativePath = filePath.substring(benchmarkReportDirectoryPath.length());
if (relativePath.startsWith("/")) {
relativePath = relativePath.substring(1);
}
return relativePath;
} | class class_name[name] begin[{]
method[getRelativePathToBenchmarkReportDirectory, return_type[type[String]], modifier[public], parameter[file]] begin[{]
local_variable[type[String], benchmarkReportDirectoryPath]
local_variable[type[String], filePath]
if[call[filePath.startsWith, parameter[member[.benchmarkReportDirectoryPath]]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="The filePath ("), operandr=MemberReference(member=filePath, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=") does not start with the benchmarkReportDirectoryPath ("), operator=+), operandr=MemberReference(member=benchmarkReportDirectoryPath, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=")."), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None)
else begin[{]
None
end[}]
local_variable[type[String], relativePath]
if[call[relativePath.startsWith, parameter[literal["/"]]]] begin[{]
assign[member[.relativePath], call[relativePath.substring, parameter[literal[1]]]]
else begin[{]
None
end[}]
return[member[.relativePath]]
end[}]
END[}] | Keyword[public] identifier[String] identifier[getRelativePathToBenchmarkReportDirectory] operator[SEP] identifier[File] identifier[file] operator[SEP] {
identifier[String] identifier[benchmarkReportDirectoryPath] operator[=] identifier[plannerBenchmarkResult] operator[SEP] identifier[getBenchmarkReportDirectory] operator[SEP] operator[SEP] operator[SEP] identifier[getAbsoluteFile] operator[SEP] operator[SEP] operator[SEP] identifier[toURI] operator[SEP] operator[SEP] operator[SEP] identifier[getPath] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[filePath] operator[=] identifier[file] operator[SEP] identifier[getAbsoluteFile] operator[SEP] operator[SEP] operator[SEP] identifier[toURI] operator[SEP] operator[SEP] operator[SEP] identifier[getPath] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[filePath] operator[SEP] identifier[startsWith] operator[SEP] identifier[benchmarkReportDirectoryPath] operator[SEP] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[+] identifier[filePath] operator[+] literal[String] operator[+] identifier[benchmarkReportDirectoryPath] operator[+] literal[String] operator[SEP] operator[SEP]
}
identifier[String] identifier[relativePath] operator[=] identifier[filePath] operator[SEP] identifier[substring] operator[SEP] identifier[benchmarkReportDirectoryPath] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[relativePath] operator[SEP] identifier[startsWith] operator[SEP] literal[String] operator[SEP] operator[SEP] {
identifier[relativePath] operator[=] identifier[relativePath] operator[SEP] identifier[substring] operator[SEP] Other[1] operator[SEP] operator[SEP]
}
Keyword[return] identifier[relativePath] operator[SEP]
}
|
private static String getEnumAnnotationFieldName(IAnnotationBinding annotation, String varName) {
if (annotation == null) {
throw new NullPointerException();
}
if (varName == null) {
throw new NullPointerException();
}
for (IMemberValuePairBinding value : annotation.getDeclaredMemberValuePairs()) {
if (value.getName() != null && value.getName().equals(varName)) {
assert value.getValue() != null; // annotation value cannot be null
assert value.getValue() instanceof IVariableBinding;
IVariableBinding varBinding = (IVariableBinding) value.getValue();
assert varBinding.isEnumConstant();
return varBinding.getName();
}
}
return null;
} | class class_name[name] begin[{]
method[getEnumAnnotationFieldName, return_type[type[String]], modifier[private static], parameter[annotation, varName]] begin[{]
if[binary_operation[member[.annotation], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=NullPointerException, sub_type=None)), label=None)
else begin[{]
None
end[}]
if[binary_operation[member[.varName], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=NullPointerException, sub_type=None)), label=None)
else begin[{]
None
end[}]
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=value, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operandr=MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=value, selectors=[MethodInvocation(arguments=[MemberReference(member=varName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[AssertStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=value, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), label=None, value=None), AssertStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=value, selectors=[], type_arguments=None), operandr=ReferenceType(arguments=None, dimensions=[], name=IVariableBinding, sub_type=None), operator=instanceof), label=None, value=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=value, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=IVariableBinding, sub_type=None)), name=varBinding)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=IVariableBinding, sub_type=None)), AssertStatement(condition=MethodInvocation(arguments=[], member=isEnumConstant, postfix_operators=[], prefix_operators=[], qualifier=varBinding, selectors=[], type_arguments=None), label=None, value=None), ReturnStatement(expression=MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=varBinding, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getDeclaredMemberValuePairs, postfix_operators=[], prefix_operators=[], qualifier=annotation, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=value)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=IMemberValuePairBinding, sub_type=None))), label=None)
return[literal[null]]
end[}]
END[}] | Keyword[private] Keyword[static] identifier[String] identifier[getEnumAnnotationFieldName] operator[SEP] identifier[IAnnotationBinding] identifier[annotation] , identifier[String] identifier[varName] operator[SEP] {
Keyword[if] operator[SEP] identifier[annotation] operator[==] Other[null] operator[SEP] {
Keyword[throw] Keyword[new] identifier[NullPointerException] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[varName] operator[==] Other[null] operator[SEP] {
Keyword[throw] Keyword[new] identifier[NullPointerException] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[for] operator[SEP] identifier[IMemberValuePairBinding] identifier[value] operator[:] identifier[annotation] operator[SEP] identifier[getDeclaredMemberValuePairs] operator[SEP] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[value] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[!=] Other[null] operator[&&] identifier[value] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[varName] operator[SEP] operator[SEP] {
Keyword[assert] identifier[value] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] Keyword[assert] identifier[value] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] Keyword[instanceof] identifier[IVariableBinding] operator[SEP] identifier[IVariableBinding] identifier[varBinding] operator[=] operator[SEP] identifier[IVariableBinding] operator[SEP] identifier[value] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] Keyword[assert] identifier[varBinding] operator[SEP] identifier[isEnumConstant] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[varBinding] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[return] Other[null] operator[SEP]
}
|
public void downloadUpdates(String deviceName, String resourceGroupName) {
downloadUpdatesWithServiceResponseAsync(deviceName, resourceGroupName).toBlocking().last().body();
} | class class_name[name] begin[{]
method[downloadUpdates, return_type[void], modifier[public], parameter[deviceName, resourceGroupName]] begin[{]
call[.downloadUpdatesWithServiceResponseAsync, parameter[member[.deviceName], member[.resourceGroupName]]]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[downloadUpdates] operator[SEP] identifier[String] identifier[deviceName] , identifier[String] identifier[resourceGroupName] operator[SEP] {
identifier[downloadUpdatesWithServiceResponseAsync] operator[SEP] identifier[deviceName] , identifier[resourceGroupName] operator[SEP] operator[SEP] identifier[toBlocking] operator[SEP] operator[SEP] operator[SEP] identifier[last] operator[SEP] operator[SEP] operator[SEP] identifier[body] operator[SEP] operator[SEP] operator[SEP]
}
|
public static Assignments cluster(Matrix matrix,
int numClusters,
int numRepetitions) {
return cluster(matrix, numClusters, numRepetitions,
new RandomSeed(), new I1Function());
} | class class_name[name] begin[{]
method[cluster, return_type[type[Assignments]], modifier[public static], parameter[matrix, numClusters, numRepetitions]] begin[{]
return[call[.cluster, parameter[member[.matrix], member[.numClusters], member[.numRepetitions], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=RandomSeed, 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=I1Function, sub_type=None))]]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[Assignments] identifier[cluster] operator[SEP] identifier[Matrix] identifier[matrix] , Keyword[int] identifier[numClusters] , Keyword[int] identifier[numRepetitions] operator[SEP] {
Keyword[return] identifier[cluster] operator[SEP] identifier[matrix] , identifier[numClusters] , identifier[numRepetitions] , Keyword[new] identifier[RandomSeed] operator[SEP] operator[SEP] , Keyword[new] identifier[I1Function] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
@Nullable
public static String searchPropertiesFile(String propertiesFile,
String[] confPathList) {
if (propertiesFile == null || confPathList == null) {
return null;
}
for (String path : confPathList) {
String file = PathUtils.concatPath(path, propertiesFile);
Properties properties = loadPropertiesFromFile(file);
if (properties != null) {
// If a site conf is successfully loaded, stop trying different paths.
return file;
}
}
return null;
} | class class_name[name] begin[{]
method[searchPropertiesFile, return_type[type[String]], modifier[public static], parameter[propertiesFile, confPathList]] begin[{]
if[binary_operation[binary_operation[member[.propertiesFile], ==, literal[null]], ||, binary_operation[member[.confPathList], ==, literal[null]]]] begin[{]
return[literal[null]]
else begin[{]
None
end[}]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=path, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=propertiesFile, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=concatPath, postfix_operators=[], prefix_operators=[], qualifier=PathUtils, selectors=[], type_arguments=None), name=file)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=file, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=loadPropertiesFromFile, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=properties)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Properties, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=properties, 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=MemberReference(member=file, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=confPathList, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=path)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None)
return[literal[null]]
end[}]
END[}] | annotation[@] identifier[Nullable] Keyword[public] Keyword[static] identifier[String] identifier[searchPropertiesFile] operator[SEP] identifier[String] identifier[propertiesFile] , identifier[String] operator[SEP] operator[SEP] identifier[confPathList] operator[SEP] {
Keyword[if] operator[SEP] identifier[propertiesFile] operator[==] Other[null] operator[||] identifier[confPathList] operator[==] Other[null] operator[SEP] {
Keyword[return] Other[null] operator[SEP]
}
Keyword[for] operator[SEP] identifier[String] identifier[path] operator[:] identifier[confPathList] operator[SEP] {
identifier[String] identifier[file] operator[=] identifier[PathUtils] operator[SEP] identifier[concatPath] operator[SEP] identifier[path] , identifier[propertiesFile] operator[SEP] operator[SEP] identifier[Properties] identifier[properties] operator[=] identifier[loadPropertiesFromFile] operator[SEP] identifier[file] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[properties] operator[!=] Other[null] operator[SEP] {
Keyword[return] identifier[file] operator[SEP]
}
}
Keyword[return] Other[null] operator[SEP]
}
|
public IfcWorkControlTypeEnum createIfcWorkControlTypeEnumFromString(EDataType eDataType, String initialValue) {
IfcWorkControlTypeEnum result = IfcWorkControlTypeEnum.get(initialValue);
if (result == null)
throw new IllegalArgumentException(
"The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'");
return result;
} | class class_name[name] begin[{]
method[createIfcWorkControlTypeEnumFromString, return_type[type[IfcWorkControlTypeEnum]], modifier[public], parameter[eDataType, initialValue]] begin[{]
local_variable[type[IfcWorkControlTypeEnum], result]
if[binary_operation[member[.result], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="The value '"), operandr=MemberReference(member=initialValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="' is not a valid enumerator of '"), operator=+), operandr=MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=eDataType, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="'"), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None)
else begin[{]
None
end[}]
return[member[.result]]
end[}]
END[}] | Keyword[public] identifier[IfcWorkControlTypeEnum] identifier[createIfcWorkControlTypeEnumFromString] operator[SEP] identifier[EDataType] identifier[eDataType] , identifier[String] identifier[initialValue] operator[SEP] {
identifier[IfcWorkControlTypeEnum] identifier[result] operator[=] identifier[IfcWorkControlTypeEnum] operator[SEP] identifier[get] operator[SEP] identifier[initialValue] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[result] operator[==] Other[null] operator[SEP] Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[+] identifier[initialValue] operator[+] literal[String] operator[+] identifier[eDataType] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[result] operator[SEP]
}
|
@Override
public void write(ChannelHandlerContext ctx, Object msg, ChannelPromise promise)
throws Exception {
if (msg instanceof SendGrpcFrameCommand) {
sendGrpcFrame(ctx, (SendGrpcFrameCommand) msg, promise);
} else if (msg instanceof SendResponseHeadersCommand) {
sendResponseHeaders(ctx, (SendResponseHeadersCommand) msg, promise);
} else if (msg instanceof CancelServerStreamCommand) {
cancelStream(ctx, (CancelServerStreamCommand) msg, promise);
} else if (msg instanceof ForcefulCloseCommand) {
forcefulClose(ctx, (ForcefulCloseCommand) msg, promise);
} else {
AssertionError e =
new AssertionError("Write called for unexpected type: " + msg.getClass().getName());
ReferenceCountUtil.release(msg);
promise.setFailure(e);
throw e;
}
} | class class_name[name] begin[{]
method[write, return_type[void], modifier[public], parameter[ctx, msg, promise]] begin[{]
if[binary_operation[member[.msg], instanceof, type[SendGrpcFrameCommand]]] begin[{]
call[.sendGrpcFrame, parameter[member[.ctx], Cast(expression=MemberReference(member=msg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=SendGrpcFrameCommand, sub_type=None)), member[.promise]]]
else begin[{]
if[binary_operation[member[.msg], instanceof, type[SendResponseHeadersCommand]]] begin[{]
call[.sendResponseHeaders, parameter[member[.ctx], Cast(expression=MemberReference(member=msg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=SendResponseHeadersCommand, sub_type=None)), member[.promise]]]
else begin[{]
if[binary_operation[member[.msg], instanceof, type[CancelServerStreamCommand]]] begin[{]
call[.cancelStream, parameter[member[.ctx], Cast(expression=MemberReference(member=msg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=CancelServerStreamCommand, sub_type=None)), member[.promise]]]
else begin[{]
if[binary_operation[member[.msg], instanceof, type[ForcefulCloseCommand]]] begin[{]
call[.forcefulClose, parameter[member[.ctx], Cast(expression=MemberReference(member=msg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=ForcefulCloseCommand, sub_type=None)), member[.promise]]]
else begin[{]
local_variable[type[AssertionError], e]
call[ReferenceCountUtil.release, parameter[member[.msg]]]
call[promise.setFailure, parameter[member[.e]]]
ThrowStatement(expression=MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)
end[}]
end[}]
end[}]
end[}]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[write] operator[SEP] identifier[ChannelHandlerContext] identifier[ctx] , identifier[Object] identifier[msg] , identifier[ChannelPromise] identifier[promise] operator[SEP] Keyword[throws] identifier[Exception] {
Keyword[if] operator[SEP] identifier[msg] Keyword[instanceof] identifier[SendGrpcFrameCommand] operator[SEP] {
identifier[sendGrpcFrame] operator[SEP] identifier[ctx] , operator[SEP] identifier[SendGrpcFrameCommand] operator[SEP] identifier[msg] , identifier[promise] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[msg] Keyword[instanceof] identifier[SendResponseHeadersCommand] operator[SEP] {
identifier[sendResponseHeaders] operator[SEP] identifier[ctx] , operator[SEP] identifier[SendResponseHeadersCommand] operator[SEP] identifier[msg] , identifier[promise] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[msg] Keyword[instanceof] identifier[CancelServerStreamCommand] operator[SEP] {
identifier[cancelStream] operator[SEP] identifier[ctx] , operator[SEP] identifier[CancelServerStreamCommand] operator[SEP] identifier[msg] , identifier[promise] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[msg] Keyword[instanceof] identifier[ForcefulCloseCommand] operator[SEP] {
identifier[forcefulClose] operator[SEP] identifier[ctx] , operator[SEP] identifier[ForcefulCloseCommand] operator[SEP] identifier[msg] , identifier[promise] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[AssertionError] identifier[e] operator[=] Keyword[new] identifier[AssertionError] operator[SEP] literal[String] operator[+] identifier[msg] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[ReferenceCountUtil] operator[SEP] identifier[release] operator[SEP] identifier[msg] operator[SEP] operator[SEP] identifier[promise] operator[SEP] identifier[setFailure] operator[SEP] identifier[e] operator[SEP] operator[SEP] Keyword[throw] identifier[e] operator[SEP]
}
}
|
static String typeParametersString(DocEnv env, Symbol sym, boolean full) {
if (env.legacyDoclet || sym.type.getTypeArguments().isEmpty()) {
return "";
}
StringBuilder s = new StringBuilder();
for (Type t : sym.type.getTypeArguments()) {
s.append(s.length() == 0 ? "<" : ", ");
s.append(TypeVariableImpl.typeVarToString(env, (TypeVar)t, full));
}
s.append(">");
return s.toString();
} | class class_name[name] begin[{]
method[typeParametersString, return_type[type[String]], modifier[static], parameter[env, sym, full]] begin[{]
if[binary_operation[member[env.legacyDoclet], ||, call[sym.type.getTypeArguments, parameter[]]]] begin[{]
return[literal[""]]
else begin[{]
None
end[}]
local_variable[type[StringBuilder], s]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[TernaryExpression(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=s, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), 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=s, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=env, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Cast(expression=MemberReference(member=t, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=TypeVar, sub_type=None)), MemberReference(member=full, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=typeVarToString, postfix_operators=[], prefix_operators=[], qualifier=TypeVariableImpl, selectors=[], type_arguments=None)], member=append, postfix_operators=[], prefix_operators=[], qualifier=s, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getTypeArguments, postfix_operators=[], prefix_operators=[], qualifier=sym.type, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=t)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Type, sub_type=None))), label=None)
call[s.append, parameter[literal[">"]]]
return[call[s.toString, parameter[]]]
end[}]
END[}] | Keyword[static] identifier[String] identifier[typeParametersString] operator[SEP] identifier[DocEnv] identifier[env] , identifier[Symbol] identifier[sym] , Keyword[boolean] identifier[full] operator[SEP] {
Keyword[if] operator[SEP] identifier[env] operator[SEP] identifier[legacyDoclet] operator[||] identifier[sym] operator[SEP] identifier[type] operator[SEP] identifier[getTypeArguments] operator[SEP] operator[SEP] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] {
Keyword[return] literal[String] operator[SEP]
}
identifier[StringBuilder] identifier[s] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Type] identifier[t] operator[:] identifier[sym] operator[SEP] identifier[type] operator[SEP] identifier[getTypeArguments] operator[SEP] operator[SEP] operator[SEP] {
identifier[s] operator[SEP] identifier[append] operator[SEP] identifier[s] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[==] Other[0] operator[?] literal[String] operator[:] literal[String] operator[SEP] operator[SEP] identifier[s] operator[SEP] identifier[append] operator[SEP] identifier[TypeVariableImpl] operator[SEP] identifier[typeVarToString] operator[SEP] identifier[env] , operator[SEP] identifier[TypeVar] operator[SEP] identifier[t] , identifier[full] operator[SEP] operator[SEP] operator[SEP]
}
identifier[s] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[s] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP]
}
|
public static void event(TraceComponent tc, String msg) {
if(isTracing()) SibTr.event(tc, msg);
} | class class_name[name] begin[{]
method[event, return_type[void], modifier[public static], parameter[tc, msg]] begin[{]
if[call[.isTracing, parameter[]]] begin[{]
call[SibTr.event, parameter[member[.tc], member[.msg]]]
else begin[{]
None
end[}]
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[void] identifier[event] operator[SEP] identifier[TraceComponent] identifier[tc] , identifier[String] identifier[msg] operator[SEP] {
Keyword[if] operator[SEP] identifier[isTracing] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[event] operator[SEP] identifier[tc] , identifier[msg] operator[SEP] operator[SEP]
}
|
public static void unmapByteBuffer(final MappedByteBuffer map) {
if(map == null) {
return;
}
map.force();
try {
if(Runtime.class.getDeclaredMethod("version") != null)
return; // At later Java, the hack below will not work anymore.
}
catch(NoSuchMethodException e) {
// This is an ugly hack, but all that Java <8 offers to help freeing
// memory allocated using such buffers.
// See also: http://bugs.sun.com/view_bug.do?bug_id=4724038
AccessController.doPrivileged(new PrivilegedAction<Object>() {
@Override
public Object run() {
try {
Method getCleanerMethod = map.getClass().getMethod("cleaner", new Class[0]);
if(getCleanerMethod == null) {
return null;
}
getCleanerMethod.setAccessible(true);
Object cleaner = getCleanerMethod.invoke(map, new Object[0]);
Method cleanMethod = cleaner.getClass().getMethod("clean");
if(cleanMethod == null) {
return null;
}
cleanMethod.invoke(cleaner);
}
catch(Exception e) {
LoggingUtil.exception(e);
}
return null;
}
});
}
catch(SecurityException e1) {
// Ignore.
}
} | class class_name[name] begin[{]
method[unmapByteBuffer, return_type[void], modifier[public static], parameter[map]] begin[{]
if[binary_operation[member[.map], ==, literal[null]]] begin[{]
return[None]
else begin[{]
None
end[}]
call[map.force, parameter[]]
TryStatement(block=[IfStatement(condition=BinaryOperation(operandl=ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="version")], member=getDeclaredMethod, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=Runtime, sub_type=None)), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=ReturnStatement(expression=None, label=None))], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getClass, postfix_operators=[], prefix_operators=[], qualifier=map, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="cleaner"), 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=Class, sub_type=None))], member=getMethod, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=getCleanerMethod)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Method, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=getCleanerMethod, 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=null), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], member=setAccessible, postfix_operators=[], prefix_operators=[], qualifier=getCleanerMethod, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=map, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), 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=Object, sub_type=None))], member=invoke, postfix_operators=[], prefix_operators=[], qualifier=getCleanerMethod, selectors=[], type_arguments=None), name=cleaner)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getClass, postfix_operators=[], prefix_operators=[], qualifier=cleaner, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="clean")], member=getMethod, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=cleanMethod)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Method, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=cleanMethod, 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=null), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=cleaner, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=invoke, postfix_operators=[], prefix_operators=[], qualifier=cleanMethod, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=exception, postfix_operators=[], prefix_operators=[], qualifier=LoggingUtil, 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), ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), label=None)], documentation=None, modifiers={'public'}, name=run, parameters=[], return_type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None), throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))], dimensions=None, name=PrivilegedAction, sub_type=None))], member=doPrivileged, postfix_operators=[], prefix_operators=[], qualifier=AccessController, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['NoSuchMethodException'])), CatchClause(block=[], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e1, types=['SecurityException']))], finally_block=None, label=None, resources=None)
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[void] identifier[unmapByteBuffer] operator[SEP] Keyword[final] identifier[MappedByteBuffer] identifier[map] operator[SEP] {
Keyword[if] operator[SEP] identifier[map] operator[==] Other[null] operator[SEP] {
Keyword[return] operator[SEP]
}
identifier[map] operator[SEP] identifier[force] operator[SEP] operator[SEP] operator[SEP] Keyword[try] {
Keyword[if] operator[SEP] identifier[Runtime] operator[SEP] Keyword[class] operator[SEP] identifier[getDeclaredMethod] operator[SEP] literal[String] operator[SEP] operator[!=] Other[null] operator[SEP] Keyword[return] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[NoSuchMethodException] identifier[e] operator[SEP] {
identifier[AccessController] operator[SEP] identifier[doPrivileged] operator[SEP] Keyword[new] identifier[PrivilegedAction] operator[<] identifier[Object] operator[>] operator[SEP] operator[SEP] {
annotation[@] identifier[Override] Keyword[public] identifier[Object] identifier[run] operator[SEP] operator[SEP] {
Keyword[try] {
identifier[Method] identifier[getCleanerMethod] operator[=] identifier[map] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] identifier[getMethod] operator[SEP] literal[String] , Keyword[new] identifier[Class] operator[SEP] Other[0] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[getCleanerMethod] operator[==] Other[null] operator[SEP] {
Keyword[return] Other[null] operator[SEP]
}
identifier[getCleanerMethod] operator[SEP] identifier[setAccessible] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[Object] identifier[cleaner] operator[=] identifier[getCleanerMethod] operator[SEP] identifier[invoke] operator[SEP] identifier[map] , Keyword[new] identifier[Object] operator[SEP] Other[0] operator[SEP] operator[SEP] operator[SEP] identifier[Method] identifier[cleanMethod] operator[=] identifier[cleaner] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] identifier[getMethod] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[cleanMethod] operator[==] Other[null] operator[SEP] {
Keyword[return] Other[null] operator[SEP]
}
identifier[cleanMethod] operator[SEP] identifier[invoke] operator[SEP] identifier[cleaner] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] {
identifier[LoggingUtil] operator[SEP] identifier[exception] operator[SEP] identifier[e] operator[SEP] operator[SEP]
}
Keyword[return] Other[null] operator[SEP]
}
} operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[SecurityException] identifier[e1] operator[SEP] {
}
}
|
public static ExpectedCondition<Boolean> textToBePresentInElementValue(final WebElement element,
final String text) {
return new ExpectedCondition<Boolean>() {
@Override
public Boolean apply(WebDriver driver) {
try {
String elementText = element.getAttribute("value");
if (elementText != null) {
return elementText.contains(text);
}
return false;
} catch (StaleElementReferenceException e) {
return null;
}
}
@Override
public String toString() {
return String.format("text ('%s') to be the value of element %s", text, element);
}
};
} | class class_name[name] begin[{]
method[textToBePresentInElementValue, return_type[type[ExpectedCondition]], modifier[public static], parameter[element, text]] begin[{]
return[ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="value")], member=getAttribute, postfix_operators=[], prefix_operators=[], qualifier=element, selectors=[], type_arguments=None), name=elementText)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=elementText, 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=MethodInvocation(arguments=[MemberReference(member=text, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=contains, postfix_operators=[], prefix_operators=[], qualifier=elementText, selectors=[], type_arguments=None), label=None)])), ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), label=None)], catches=[CatchClause(block=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['StaleElementReferenceException']))], finally_block=None, label=None, resources=None)], documentation=None, modifiers={'public'}, name=apply, parameters=[FormalParameter(annotations=[], modifiers=set(), name=driver, type=ReferenceType(arguments=None, dimensions=[], name=WebDriver, sub_type=None), varargs=False)], return_type=ReferenceType(arguments=None, dimensions=[], name=Boolean, sub_type=None), throws=None, type_parameters=None), MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[ReturnStatement(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="text ('%s') to be the value of element %s"), MemberReference(member=text, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=element, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=format, postfix_operators=[], prefix_operators=[], qualifier=String, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=toString, parameters=[], return_type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None), throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Boolean, sub_type=None))], dimensions=None, name=ExpectedCondition, sub_type=None))]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[ExpectedCondition] operator[<] identifier[Boolean] operator[>] identifier[textToBePresentInElementValue] operator[SEP] Keyword[final] identifier[WebElement] identifier[element] , Keyword[final] identifier[String] identifier[text] operator[SEP] {
Keyword[return] Keyword[new] identifier[ExpectedCondition] operator[<] identifier[Boolean] operator[>] operator[SEP] operator[SEP] {
annotation[@] identifier[Override] Keyword[public] identifier[Boolean] identifier[apply] operator[SEP] identifier[WebDriver] identifier[driver] operator[SEP] {
Keyword[try] {
identifier[String] identifier[elementText] operator[=] identifier[element] operator[SEP] identifier[getAttribute] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[elementText] operator[!=] Other[null] operator[SEP] {
Keyword[return] identifier[elementText] operator[SEP] identifier[contains] operator[SEP] identifier[text] operator[SEP] operator[SEP]
}
Keyword[return] literal[boolean] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[StaleElementReferenceException] identifier[e] operator[SEP] {
Keyword[return] Other[null] operator[SEP]
}
} annotation[@] identifier[Override] Keyword[public] identifier[String] identifier[toString] operator[SEP] operator[SEP] {
Keyword[return] identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[text] , identifier[element] operator[SEP] operator[SEP]
}
} operator[SEP]
}
|
public IndexedSet<T> transactionsOf(I item) {
IndexedSet<T> res = allTransactions.empty();
res.indices().addAll(matrix.getCol(itemToIndex(item)));
return res;
} | class class_name[name] begin[{]
method[transactionsOf, return_type[type[IndexedSet]], modifier[public], parameter[item]] begin[{]
local_variable[type[IndexedSet], res]
call[res.indices, parameter[]]
return[member[.res]]
end[}]
END[}] | Keyword[public] identifier[IndexedSet] operator[<] identifier[T] operator[>] identifier[transactionsOf] operator[SEP] identifier[I] identifier[item] operator[SEP] {
identifier[IndexedSet] operator[<] identifier[T] operator[>] identifier[res] operator[=] identifier[allTransactions] operator[SEP] identifier[empty] operator[SEP] operator[SEP] operator[SEP] identifier[res] operator[SEP] identifier[indices] operator[SEP] operator[SEP] operator[SEP] identifier[addAll] operator[SEP] identifier[matrix] operator[SEP] identifier[getCol] operator[SEP] identifier[itemToIndex] operator[SEP] identifier[item] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[res] operator[SEP]
}
|
public void marshall(DeprecateDomainRequest deprecateDomainRequest, ProtocolMarshaller protocolMarshaller) {
if (deprecateDomainRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(deprecateDomainRequest.getName(), NAME_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[deprecateDomainRequest, protocolMarshaller]] begin[{]
if[binary_operation[member[.deprecateDomainRequest], ==, 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=getName, postfix_operators=[], prefix_operators=[], qualifier=deprecateDomainRequest, selectors=[], type_arguments=None), MemberReference(member=NAME_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None)], 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[DeprecateDomainRequest] identifier[deprecateDomainRequest] , identifier[ProtocolMarshaller] identifier[protocolMarshaller] operator[SEP] {
Keyword[if] operator[SEP] identifier[deprecateDomainRequest] 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[deprecateDomainRequest] operator[SEP] identifier[getName] operator[SEP] operator[SEP] , identifier[NAME_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 Cassandra doWithCluster(final Consumer<Cluster> configurer) {
requireNonNull(configurer, "Cluster conf callbackrequired.");
return doWithCluster((cc, c) -> configurer.accept(cc));
} | class class_name[name] begin[{]
method[doWithCluster, return_type[type[Cassandra]], modifier[public], parameter[configurer]] begin[{]
call[.requireNonNull, parameter[member[.configurer], literal["Cluster conf callbackrequired."]]]
return[call[.doWithCluster, parameter[LambdaExpression(body=MethodInvocation(arguments=[MemberReference(member=cc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=accept, postfix_operators=[], prefix_operators=[], qualifier=configurer, selectors=[], type_arguments=None), parameters=[InferredFormalParameter(name=cc), InferredFormalParameter(name=c)])]]]
end[}]
END[}] | Keyword[public] identifier[Cassandra] identifier[doWithCluster] operator[SEP] Keyword[final] identifier[Consumer] operator[<] identifier[Cluster] operator[>] identifier[configurer] operator[SEP] {
identifier[requireNonNull] operator[SEP] identifier[configurer] , literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[doWithCluster] operator[SEP] operator[SEP] identifier[cc] , identifier[c] operator[SEP] operator[->] identifier[configurer] operator[SEP] identifier[accept] operator[SEP] identifier[cc] operator[SEP] operator[SEP] operator[SEP]
}
|
public static String rightTrim(final String aString) {
if (aString == null) {
return null;
}
int end = aString.length() - 1;
while ((end >= 0) && (aString.charAt(end) <= ' ')) {
end--;
}
if (end == aString.length() - 1) {
return aString;
}
return aString.substring(0, end + 1);
} | class class_name[name] begin[{]
method[rightTrim, return_type[type[String]], modifier[public static], parameter[aString]] begin[{]
if[binary_operation[member[.aString], ==, literal[null]]] begin[{]
return[literal[null]]
else begin[{]
None
end[}]
local_variable[type[int], end]
while[binary_operation[binary_operation[member[.end], >=, literal[0]], &&, binary_operation[call[aString.charAt, parameter[member[.end]]], <=, literal[' ']]]] begin[{]
member[.end]
end[}]
if[binary_operation[member[.end], ==, binary_operation[call[aString.length, parameter[]], -, literal[1]]]] begin[{]
return[member[.aString]]
else begin[{]
None
end[}]
return[call[aString.substring, parameter[literal[0], binary_operation[member[.end], +, literal[1]]]]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[String] identifier[rightTrim] operator[SEP] Keyword[final] identifier[String] identifier[aString] operator[SEP] {
Keyword[if] operator[SEP] identifier[aString] operator[==] Other[null] operator[SEP] {
Keyword[return] Other[null] operator[SEP]
}
Keyword[int] identifier[end] operator[=] identifier[aString] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[-] Other[1] operator[SEP] Keyword[while] operator[SEP] operator[SEP] identifier[end] operator[>=] Other[0] operator[SEP] operator[&&] operator[SEP] identifier[aString] operator[SEP] identifier[charAt] operator[SEP] identifier[end] operator[SEP] operator[<=] literal[String] operator[SEP] operator[SEP] {
identifier[end] operator[--] operator[SEP]
}
Keyword[if] operator[SEP] identifier[end] operator[==] identifier[aString] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[-] Other[1] operator[SEP] {
Keyword[return] identifier[aString] operator[SEP]
}
Keyword[return] identifier[aString] operator[SEP] identifier[substring] operator[SEP] Other[0] , identifier[end] operator[+] Other[1] operator[SEP] operator[SEP]
}
|
@Override
public DataModelIF<U, I>[] split(DataModelIF<U, I> data) {
@SuppressWarnings("unchecked")
final PrintWriter[] splits = new PrintWriter[2];
TemporalDataModelIF<U, I> temporalModel = null;
boolean hasTimestamps = data instanceof TemporalDataModelIF<?, ?>;
if (hasTimestamps) {
temporalModel = (TemporalDataModelIF<U, I>) data;
}
String trainFile = outPath + "train_0.csv";
String testFile = outPath + "test_0.csv";
try {
splits[0] = new PrintWriter(trainFile);
splits[1] = new PrintWriter(testFile);
} catch (FileNotFoundException e) {
throw new RuntimeException("Error writting: " + e);
}
for (U user : data.getUsers()) {
List<I> items = new ArrayList<>();
for (I i : data.getUserItems(user)) {
items.add(i);
}
if (items.size() >= minPreferences) {
Collections.shuffle(items, rnd);
I crossValidatedItem = items.remove(0);
double prefCV = data.getUserItemPreference(user, crossValidatedItem);
String timestamp = null;
if (hasTimestamps) {
List<Long> times = new ArrayList<>();
for (Long time : temporalModel.getUserItemTimestamps(user, crossValidatedItem)) {
times.add(time);
}
timestamp = "" + Collections.min(times);
splits[1].println(user + "\t" + crossValidatedItem + "\t" + prefCV + "\t" + timestamp);
} else {
splits[1].println(user + "\t" + crossValidatedItem + "\t" + prefCV);
}
for (I item : items) {
Double pref = data.getUserItemPreference(user, item);
if (hasTimestamps) {
List<Long> times = new ArrayList<>();
for (Long time : temporalModel.getUserItemTimestamps(user, item)) {
times.add(time);
}
timestamp = "" + Collections.min(times);
splits[0].println(user + "\t" + item + "\t" + pref + "\t" + timestamp);
}
else {
splits[0].println(user + "\t" + item + "\t" + pref);
}
}
}
}
for (int i = 0; i < splits.length; i++) {
splits[i].flush();
splits[i].close();
}
return null;
} | class class_name[name] begin[{]
method[split, return_type[type[DataModelIF]], modifier[public], parameter[data]] begin[{]
local_variable[type[PrintWriter], splits]
local_variable[type[TemporalDataModelIF], temporalModel]
local_variable[type[boolean], hasTimestamps]
if[member[.hasTimestamps]] begin[{]
assign[member[.temporalModel], Cast(expression=MemberReference(member=data, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=U, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=I, sub_type=None))], dimensions=[], name=TemporalDataModelIF, sub_type=None))]
else begin[{]
None
end[}]
local_variable[type[String], trainFile]
local_variable[type[String], testFile]
TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=splits, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))]), type==, value=ClassCreator(arguments=[MemberReference(member=trainFile, 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=PrintWriter, sub_type=None))), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=splits, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1))]), type==, value=ClassCreator(arguments=[MemberReference(member=testFile, 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=PrintWriter, sub_type=None))), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Error writting: "), operandr=MemberReference(member=e, 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)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['FileNotFoundException']))], finally_block=None, label=None, resources=None)
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=ArrayList, sub_type=None)), name=items)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=I, sub_type=None))], dimensions=[], name=List, sub_type=None)), ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=items, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[MemberReference(member=user, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getUserItems, postfix_operators=[], prefix_operators=[], qualifier=data, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=i)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=I, sub_type=None))), label=None), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=items, selectors=[], type_arguments=None), operandr=MemberReference(member=minPreferences, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=>=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=items, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=rnd, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=shuffle, postfix_operators=[], prefix_operators=[], qualifier=Collections, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], member=remove, postfix_operators=[], prefix_operators=[], qualifier=items, selectors=[], type_arguments=None), name=crossValidatedItem)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=I, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=user, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=crossValidatedItem, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getUserItemPreference, postfix_operators=[], prefix_operators=[], qualifier=data, selectors=[], type_arguments=None), name=prefCV)], modifiers=set(), type=BasicType(dimensions=[], name=double)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), name=timestamp)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=MemberReference(member=hasTimestamps, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MemberReference(member=splits, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)), MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=user, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\t"), operator=+), operandr=MemberReference(member=crossValidatedItem, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\t"), operator=+), operandr=MemberReference(member=prefCV, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=println, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=ArrayList, sub_type=None)), name=times)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Long, sub_type=None))], dimensions=[], name=List, sub_type=None)), ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=time, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=times, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[MemberReference(member=user, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=crossValidatedItem, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getUserItemTimestamps, postfix_operators=[], prefix_operators=[], qualifier=temporalModel, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=time)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Long, sub_type=None))), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=timestamp, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=""), operandr=MethodInvocation(arguments=[MemberReference(member=times, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=min, postfix_operators=[], prefix_operators=[], qualifier=Collections, selectors=[], type_arguments=None), operator=+)), label=None), StatementExpression(expression=MemberReference(member=splits, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)), MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=user, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\t"), operator=+), operandr=MemberReference(member=crossValidatedItem, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\t"), operator=+), operandr=MemberReference(member=prefCV, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\t"), operator=+), operandr=MemberReference(member=timestamp, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=println, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None)])), ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=user, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=item, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getUserItemPreference, postfix_operators=[], prefix_operators=[], qualifier=data, selectors=[], type_arguments=None), name=pref)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Double, sub_type=None)), IfStatement(condition=MemberReference(member=hasTimestamps, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MemberReference(member=splits, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)), MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=user, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\t"), operator=+), operandr=MemberReference(member=item, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\t"), operator=+), operandr=MemberReference(member=pref, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=println, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=ArrayList, sub_type=None)), name=times)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Long, sub_type=None))], dimensions=[], name=List, sub_type=None)), ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=time, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=times, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[MemberReference(member=user, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=item, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getUserItemTimestamps, postfix_operators=[], prefix_operators=[], qualifier=temporalModel, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=time)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Long, sub_type=None))), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=timestamp, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=""), operandr=MethodInvocation(arguments=[MemberReference(member=times, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=min, postfix_operators=[], prefix_operators=[], qualifier=Collections, selectors=[], type_arguments=None), operator=+)), label=None), StatementExpression(expression=MemberReference(member=splits, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)), MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=user, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\t"), operator=+), operandr=MemberReference(member=item, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\t"), operator=+), operandr=MemberReference(member=pref, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\t"), operator=+), operandr=MemberReference(member=timestamp, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=println, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=items, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=item)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=I, sub_type=None))), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getUsers, postfix_operators=[], prefix_operators=[], qualifier=data, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=user)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=U, sub_type=None))), label=None)
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MemberReference(member=splits, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MethodInvocation(arguments=[], member=flush, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None), StatementExpression(expression=MemberReference(member=splits, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MethodInvocation(arguments=[], member=close, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=splits, 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[literal[null]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] identifier[DataModelIF] operator[<] identifier[U] , identifier[I] operator[>] operator[SEP] operator[SEP] identifier[split] operator[SEP] identifier[DataModelIF] operator[<] identifier[U] , identifier[I] operator[>] identifier[data] operator[SEP] {
annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] Keyword[final] identifier[PrintWriter] operator[SEP] operator[SEP] identifier[splits] operator[=] Keyword[new] identifier[PrintWriter] operator[SEP] Other[2] operator[SEP] operator[SEP] identifier[TemporalDataModelIF] operator[<] identifier[U] , identifier[I] operator[>] identifier[temporalModel] operator[=] Other[null] operator[SEP] Keyword[boolean] identifier[hasTimestamps] operator[=] identifier[data] Keyword[instanceof] identifier[TemporalDataModelIF] operator[<] operator[?] , operator[?] operator[>] operator[SEP] Keyword[if] operator[SEP] identifier[hasTimestamps] operator[SEP] {
identifier[temporalModel] operator[=] operator[SEP] identifier[TemporalDataModelIF] operator[<] identifier[U] , identifier[I] operator[>] operator[SEP] identifier[data] operator[SEP]
}
identifier[String] identifier[trainFile] operator[=] identifier[outPath] operator[+] literal[String] operator[SEP] identifier[String] identifier[testFile] operator[=] identifier[outPath] operator[+] literal[String] operator[SEP] Keyword[try] {
identifier[splits] operator[SEP] Other[0] operator[SEP] operator[=] Keyword[new] identifier[PrintWriter] operator[SEP] identifier[trainFile] operator[SEP] operator[SEP] identifier[splits] operator[SEP] Other[1] operator[SEP] operator[=] Keyword[new] identifier[PrintWriter] operator[SEP] identifier[testFile] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[FileNotFoundException] identifier[e] operator[SEP] {
Keyword[throw] Keyword[new] identifier[RuntimeException] operator[SEP] literal[String] operator[+] identifier[e] operator[SEP] operator[SEP]
}
Keyword[for] operator[SEP] identifier[U] identifier[user] operator[:] identifier[data] operator[SEP] identifier[getUsers] operator[SEP] operator[SEP] operator[SEP] {
identifier[List] operator[<] identifier[I] operator[>] identifier[items] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[I] identifier[i] operator[:] identifier[data] operator[SEP] identifier[getUserItems] operator[SEP] identifier[user] operator[SEP] operator[SEP] {
identifier[items] operator[SEP] identifier[add] operator[SEP] identifier[i] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[items] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[>=] identifier[minPreferences] operator[SEP] {
identifier[Collections] operator[SEP] identifier[shuffle] operator[SEP] identifier[items] , identifier[rnd] operator[SEP] operator[SEP] identifier[I] identifier[crossValidatedItem] operator[=] identifier[items] operator[SEP] identifier[remove] operator[SEP] Other[0] operator[SEP] operator[SEP] Keyword[double] identifier[prefCV] operator[=] identifier[data] operator[SEP] identifier[getUserItemPreference] operator[SEP] identifier[user] , identifier[crossValidatedItem] operator[SEP] operator[SEP] identifier[String] identifier[timestamp] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[hasTimestamps] operator[SEP] {
identifier[List] operator[<] identifier[Long] operator[>] identifier[times] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Long] identifier[time] operator[:] identifier[temporalModel] operator[SEP] identifier[getUserItemTimestamps] operator[SEP] identifier[user] , identifier[crossValidatedItem] operator[SEP] operator[SEP] {
identifier[times] operator[SEP] identifier[add] operator[SEP] identifier[time] operator[SEP] operator[SEP]
}
identifier[timestamp] operator[=] literal[String] operator[+] identifier[Collections] operator[SEP] identifier[min] operator[SEP] identifier[times] operator[SEP] operator[SEP] identifier[splits] operator[SEP] Other[1] operator[SEP] operator[SEP] identifier[println] operator[SEP] identifier[user] operator[+] literal[String] operator[+] identifier[crossValidatedItem] operator[+] literal[String] operator[+] identifier[prefCV] operator[+] literal[String] operator[+] identifier[timestamp] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[splits] operator[SEP] Other[1] operator[SEP] operator[SEP] identifier[println] operator[SEP] identifier[user] operator[+] literal[String] operator[+] identifier[crossValidatedItem] operator[+] literal[String] operator[+] identifier[prefCV] operator[SEP] operator[SEP]
}
Keyword[for] operator[SEP] identifier[I] identifier[item] operator[:] identifier[items] operator[SEP] {
identifier[Double] identifier[pref] operator[=] identifier[data] operator[SEP] identifier[getUserItemPreference] operator[SEP] identifier[user] , identifier[item] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[hasTimestamps] operator[SEP] {
identifier[List] operator[<] identifier[Long] operator[>] identifier[times] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Long] identifier[time] operator[:] identifier[temporalModel] operator[SEP] identifier[getUserItemTimestamps] operator[SEP] identifier[user] , identifier[item] operator[SEP] operator[SEP] {
identifier[times] operator[SEP] identifier[add] operator[SEP] identifier[time] operator[SEP] operator[SEP]
}
identifier[timestamp] operator[=] literal[String] operator[+] identifier[Collections] operator[SEP] identifier[min] operator[SEP] identifier[times] operator[SEP] operator[SEP] identifier[splits] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[println] operator[SEP] identifier[user] operator[+] literal[String] operator[+] identifier[item] operator[+] literal[String] operator[+] identifier[pref] operator[+] literal[String] operator[+] identifier[timestamp] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[splits] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[println] operator[SEP] identifier[user] operator[+] literal[String] operator[+] identifier[item] operator[+] literal[String] operator[+] identifier[pref] operator[SEP] operator[SEP]
}
}
}
}
Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[splits] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] {
identifier[splits] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[flush] operator[SEP] operator[SEP] operator[SEP] identifier[splits] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] Other[null] operator[SEP]
}
|
private String getChainSpecification(List<Integer> modelNumbers, List<String> chainIds, int subunit) {
if (onTheFly) {
if (Collections.max(modelNumbers) > 1) {
return chainIds.get(subunit) + "&symop=" + (modelNumbers.get(subunit)+1);
} else {
// if there is only a single symop, Jmol does not accept the symop syntax
return chainIds.get(subunit);
}
} else {
return chainIds.get(subunit) + "/" + (modelNumbers.get(subunit)+1);
}
} | class class_name[name] begin[{]
method[getChainSpecification, return_type[type[String]], modifier[private], parameter[modelNumbers, chainIds, subunit]] begin[{]
if[member[.onTheFly]] begin[{]
if[binary_operation[call[Collections.max, parameter[member[.modelNumbers]]], >, literal[1]]] begin[{]
return[binary_operation[binary_operation[call[chainIds.get, parameter[member[.subunit]]], +, literal["&symop="]], +, binary_operation[call[modelNumbers.get, parameter[member[.subunit]]], +, literal[1]]]]
else begin[{]
return[call[chainIds.get, parameter[member[.subunit]]]]
end[}]
else begin[{]
return[binary_operation[binary_operation[call[chainIds.get, parameter[member[.subunit]]], +, literal["/"]], +, binary_operation[call[modelNumbers.get, parameter[member[.subunit]]], +, literal[1]]]]
end[}]
end[}]
END[}] | Keyword[private] identifier[String] identifier[getChainSpecification] operator[SEP] identifier[List] operator[<] identifier[Integer] operator[>] identifier[modelNumbers] , identifier[List] operator[<] identifier[String] operator[>] identifier[chainIds] , Keyword[int] identifier[subunit] operator[SEP] {
Keyword[if] operator[SEP] identifier[onTheFly] operator[SEP] {
Keyword[if] operator[SEP] identifier[Collections] operator[SEP] identifier[max] operator[SEP] identifier[modelNumbers] operator[SEP] operator[>] Other[1] operator[SEP] {
Keyword[return] identifier[chainIds] operator[SEP] identifier[get] operator[SEP] identifier[subunit] operator[SEP] operator[+] literal[String] operator[+] operator[SEP] identifier[modelNumbers] operator[SEP] identifier[get] operator[SEP] identifier[subunit] operator[SEP] operator[+] Other[1] operator[SEP] operator[SEP]
}
Keyword[else] {
Keyword[return] identifier[chainIds] operator[SEP] identifier[get] operator[SEP] identifier[subunit] operator[SEP] operator[SEP]
}
}
Keyword[else] {
Keyword[return] identifier[chainIds] operator[SEP] identifier[get] operator[SEP] identifier[subunit] operator[SEP] operator[+] literal[String] operator[+] operator[SEP] identifier[modelNumbers] operator[SEP] identifier[get] operator[SEP] identifier[subunit] operator[SEP] operator[+] Other[1] operator[SEP] operator[SEP]
}
}
|
@Override
public SpatialReferenceSystem queryForFirst(
PreparedQuery<SpatialReferenceSystem> preparedQuery)
throws SQLException {
SpatialReferenceSystem srs = super.queryForFirst(preparedQuery);
setDefinition_12_063(srs);
return srs;
} | class class_name[name] begin[{]
method[queryForFirst, return_type[type[SpatialReferenceSystem]], modifier[public], parameter[preparedQuery]] begin[{]
local_variable[type[SpatialReferenceSystem], srs]
call[.setDefinition_12_063, parameter[member[.srs]]]
return[member[.srs]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] identifier[SpatialReferenceSystem] identifier[queryForFirst] operator[SEP] identifier[PreparedQuery] operator[<] identifier[SpatialReferenceSystem] operator[>] identifier[preparedQuery] operator[SEP] Keyword[throws] identifier[SQLException] {
identifier[SpatialReferenceSystem] identifier[srs] operator[=] Keyword[super] operator[SEP] identifier[queryForFirst] operator[SEP] identifier[preparedQuery] operator[SEP] operator[SEP] identifier[setDefinition_12_063] operator[SEP] identifier[srs] operator[SEP] operator[SEP] Keyword[return] identifier[srs] operator[SEP]
}
|
public void setVariable(String variableName, Object value, boolean fetchAllVariables) {
setVariable(variableName, value, getSourceActivityExecution(), fetchAllVariables);
} | class class_name[name] begin[{]
method[setVariable, return_type[void], modifier[public], parameter[variableName, value, fetchAllVariables]] begin[{]
call[.setVariable, parameter[member[.variableName], member[.value], call[.getSourceActivityExecution, parameter[]], member[.fetchAllVariables]]]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[setVariable] operator[SEP] identifier[String] identifier[variableName] , identifier[Object] identifier[value] , Keyword[boolean] identifier[fetchAllVariables] operator[SEP] {
identifier[setVariable] operator[SEP] identifier[variableName] , identifier[value] , identifier[getSourceActivityExecution] operator[SEP] operator[SEP] , identifier[fetchAllVariables] operator[SEP] operator[SEP]
}
|
public void print()
{
for (int c = 0; c < nCols; ++c) {
System.out.print(" " + values[0][c]);
}
System.out.println();
} | class class_name[name] begin[{]
method[print, return_type[void], modifier[public], parameter[]] begin[{]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" "), operandr=MemberReference(member=values, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)), ArraySelector(index=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operator=+)], member=print, postfix_operators=[], prefix_operators=[], qualifier=System.out, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=nCols, 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=c)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=c, postfix_operators=[], prefix_operators=['++'], qualifier=, selectors=[])]), label=None)
call[System.out.println, parameter[]]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[print] operator[SEP] operator[SEP] {
Keyword[for] operator[SEP] Keyword[int] identifier[c] operator[=] Other[0] operator[SEP] identifier[c] operator[<] identifier[nCols] operator[SEP] operator[++] identifier[c] operator[SEP] {
identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[print] operator[SEP] literal[String] operator[+] identifier[values] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[c] operator[SEP] operator[SEP] operator[SEP]
}
identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[println] operator[SEP] operator[SEP] operator[SEP]
}
|
@Override
protected boolean isReGenerationRequired() {
//
// Use the stale flag method to identify if we should re-generate the XSDs from the sources.
// Basically, we should re-generate the XSDs if:
//
// a) The staleFile does not exist
// b) The staleFile exists and is older than one of the sources (Java or XJB files).
// "Older" is determined by comparing the modification timestamp of the staleFile and the source files.
//
final File staleFile = getStaleFile();
final String debugPrefix = "StaleFile [" + FileSystemUtilities.getCanonicalPath(staleFile) + "]";
boolean stale = !staleFile.exists();
if (stale) {
getLog().debug(debugPrefix + " not found. XML Schema (re-)generation required.");
} else {
final List<URL> sources = getSources();
if (getLog().isDebugEnabled()) {
getLog().debug(debugPrefix + " found. Checking timestamps on source Java "
+ "files to determine if XML Schema (re-)generation is required.");
}
final long staleFileLastModified = staleFile.lastModified();
for (URL current : sources) {
final URLConnection sourceFileConnection;
try {
sourceFileConnection = current.openConnection();
sourceFileConnection.connect();
} catch (Exception e) {
if (getLog().isDebugEnabled()) {
getLog().debug("Could not open a sourceFileConnection to [" + current + "]", e);
}
// Can't determine if the staleFile is younger than this source.
// Re-generate to be on the safe side.
stale = true;
break;
}
try {
if (sourceFileConnection.getLastModified() > staleFileLastModified) {
if (getLog().isDebugEnabled()) {
getLog().debug(current.toString() + " is newer than the stale flag file.");
}
stale = true;
}
} finally {
if (sourceFileConnection instanceof HttpURLConnection) {
((HttpURLConnection) sourceFileConnection).disconnect();
}
}
}
}
// All done.
return stale;
} | class class_name[name] begin[{]
method[isReGenerationRequired, return_type[type[boolean]], modifier[protected], parameter[]] begin[{]
local_variable[type[File], staleFile]
local_variable[type[String], debugPrefix]
local_variable[type[boolean], stale]
if[member[.stale]] begin[{]
call[.getLog, parameter[]]
else begin[{]
local_variable[type[List], sources]
if[call[.getLog, parameter[]]] begin[{]
call[.getLog, parameter[]]
else begin[{]
None
end[}]
local_variable[type[long], staleFileLastModified]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=None, name=sourceFileConnection)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=URLConnection, sub_type=None)), TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=sourceFileConnection, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=openConnection, postfix_operators=[], prefix_operators=[], qualifier=current, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=connect, postfix_operators=[], prefix_operators=[], qualifier=sourceFileConnection, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[IfStatement(condition=MethodInvocation(arguments=[], member=getLog, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[], member=isDebugEnabled, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=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="Could not open a sourceFileConnection to ["), operandr=MemberReference(member=current, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="]"), operator=+), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=debug, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=stale, 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)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None), TryStatement(block=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getLastModified, postfix_operators=[], prefix_operators=[], qualifier=sourceFileConnection, selectors=[], type_arguments=None), operandr=MemberReference(member=staleFileLastModified, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=>), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[], member=getLog, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[], member=isDebugEnabled, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=getLog, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[BinaryOperation(operandl=MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=current, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" is newer than the stale flag file."), operator=+)], member=debug, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=stale, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)), label=None)]))], catches=None, finally_block=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=sourceFileConnection, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=HttpURLConnection, sub_type=None), operator=instanceof), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Cast(expression=MemberReference(member=sourceFileConnection, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=HttpURLConnection, sub_type=None)), label=None)]))], label=None, resources=None)]), control=EnhancedForControl(iterable=MemberReference(member=sources, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=current)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=URL, sub_type=None))), label=None)
end[}]
return[member[.stale]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[protected] Keyword[boolean] identifier[isReGenerationRequired] operator[SEP] operator[SEP] {
Keyword[final] identifier[File] identifier[staleFile] operator[=] identifier[getStaleFile] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[String] identifier[debugPrefix] operator[=] literal[String] operator[+] identifier[FileSystemUtilities] operator[SEP] identifier[getCanonicalPath] operator[SEP] identifier[staleFile] operator[SEP] operator[+] literal[String] operator[SEP] Keyword[boolean] identifier[stale] operator[=] operator[!] identifier[staleFile] operator[SEP] identifier[exists] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[stale] operator[SEP] {
identifier[getLog] operator[SEP] operator[SEP] operator[SEP] identifier[debug] operator[SEP] identifier[debugPrefix] operator[+] literal[String] operator[SEP] operator[SEP]
}
Keyword[else] {
Keyword[final] identifier[List] operator[<] identifier[URL] operator[>] identifier[sources] operator[=] identifier[getSources] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[getLog] operator[SEP] operator[SEP] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] {
identifier[getLog] operator[SEP] operator[SEP] operator[SEP] identifier[debug] operator[SEP] identifier[debugPrefix] operator[+] literal[String] operator[+] literal[String] operator[SEP] operator[SEP]
}
Keyword[final] Keyword[long] identifier[staleFileLastModified] operator[=] identifier[staleFile] operator[SEP] identifier[lastModified] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[URL] identifier[current] operator[:] identifier[sources] operator[SEP] {
Keyword[final] identifier[URLConnection] identifier[sourceFileConnection] operator[SEP] Keyword[try] {
identifier[sourceFileConnection] operator[=] identifier[current] operator[SEP] identifier[openConnection] operator[SEP] operator[SEP] operator[SEP] identifier[sourceFileConnection] operator[SEP] identifier[connect] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] {
Keyword[if] operator[SEP] identifier[getLog] operator[SEP] operator[SEP] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] {
identifier[getLog] operator[SEP] operator[SEP] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[+] identifier[current] operator[+] literal[String] , identifier[e] operator[SEP] operator[SEP]
}
identifier[stale] operator[=] literal[boolean] operator[SEP] Keyword[break] operator[SEP]
}
Keyword[try] {
Keyword[if] operator[SEP] identifier[sourceFileConnection] operator[SEP] identifier[getLastModified] operator[SEP] operator[SEP] operator[>] identifier[staleFileLastModified] operator[SEP] {
Keyword[if] operator[SEP] identifier[getLog] operator[SEP] operator[SEP] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] {
identifier[getLog] operator[SEP] operator[SEP] operator[SEP] identifier[debug] operator[SEP] identifier[current] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP]
}
identifier[stale] operator[=] literal[boolean] operator[SEP]
}
}
Keyword[finally] {
Keyword[if] operator[SEP] identifier[sourceFileConnection] Keyword[instanceof] identifier[HttpURLConnection] operator[SEP] {
operator[SEP] operator[SEP] identifier[HttpURLConnection] operator[SEP] identifier[sourceFileConnection] operator[SEP] operator[SEP] identifier[disconnect] operator[SEP] operator[SEP] operator[SEP]
}
}
}
}
Keyword[return] identifier[stale] operator[SEP]
}
|
public void setPercentString(String percentString) {
if (percentString == null) {
throw new NullPointerException("The input percent sign is null");
}
this.percentString = percentString;
if (percentString.length() == 1) {
this.percent = percentString.charAt(0);
} else {
// Use default percent character as fallback
this.percent = DEF_PERCENT;
}
} | class class_name[name] begin[{]
method[setPercentString, return_type[void], modifier[public], parameter[percentString]] begin[{]
if[binary_operation[member[.percentString], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="The input percent sign is null")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=NullPointerException, sub_type=None)), label=None)
else begin[{]
None
end[}]
assign[THIS[member[None.percentString]], member[.percentString]]
if[binary_operation[call[percentString.length, parameter[]], ==, literal[1]]] begin[{]
assign[THIS[member[None.percent]], call[percentString.charAt, parameter[literal[0]]]]
else begin[{]
assign[THIS[member[None.percent]], member[.DEF_PERCENT]]
end[}]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[setPercentString] operator[SEP] identifier[String] identifier[percentString] operator[SEP] {
Keyword[if] operator[SEP] identifier[percentString] operator[==] Other[null] operator[SEP] {
Keyword[throw] Keyword[new] identifier[NullPointerException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[this] operator[SEP] identifier[percentString] operator[=] identifier[percentString] operator[SEP] Keyword[if] operator[SEP] identifier[percentString] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[==] Other[1] operator[SEP] {
Keyword[this] operator[SEP] identifier[percent] operator[=] identifier[percentString] operator[SEP] identifier[charAt] operator[SEP] Other[0] operator[SEP] operator[SEP]
}
Keyword[else] {
Keyword[this] operator[SEP] identifier[percent] operator[=] identifier[DEF_PERCENT] operator[SEP]
}
}
|
public boolean isIndexed(String expression) {
if (expression == null || expression.length() == 0) { return false; }
for (int i = 0; i < expression.length(); i++) {
char c = expression.charAt(i);
if (c == Nested || c == MappedStart) {
return false;
} else if (c == IndexedStart) { return true; }
}
return false;
} | class class_name[name] begin[{]
method[isIndexed, return_type[type[boolean]], modifier[public], parameter[expression]] begin[{]
if[binary_operation[binary_operation[member[.expression], ==, literal[null]], ||, binary_operation[call[expression.length, parameter[]], ==, literal[0]]]] begin[{]
return[literal[false]]
else begin[{]
None
end[}]
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=expression, selectors=[], type_arguments=None), name=c)], modifiers=set(), type=BasicType(dimensions=[], name=char)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=Nested, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), operandr=BinaryOperation(operandl=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=MappedStart, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), operator=||), else_statement=IfStatement(condition=BinaryOperation(operandl=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=IndexedStart, 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=true), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=expression, selectors=[], type_arguments=None), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
return[literal[false]]
end[}]
END[}] | Keyword[public] Keyword[boolean] identifier[isIndexed] operator[SEP] identifier[String] identifier[expression] operator[SEP] {
Keyword[if] operator[SEP] identifier[expression] operator[==] Other[null] operator[||] identifier[expression] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[==] Other[0] operator[SEP] {
Keyword[return] literal[boolean] operator[SEP]
}
Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[expression] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[++] operator[SEP] {
Keyword[char] identifier[c] operator[=] identifier[expression] operator[SEP] identifier[charAt] operator[SEP] identifier[i] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[c] operator[==] identifier[Nested] operator[||] identifier[c] operator[==] identifier[MappedStart] operator[SEP] {
Keyword[return] literal[boolean] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[c] operator[==] identifier[IndexedStart] operator[SEP] {
Keyword[return] literal[boolean] operator[SEP]
}
}
Keyword[return] literal[boolean] operator[SEP]
}
|
public ServiceFuture<PolicyEventsQueryResultsInner> listQueryResultsForPolicyDefinitionAsync(String subscriptionId, String policyDefinitionName, QueryOptions queryOptions, final ServiceCallback<PolicyEventsQueryResultsInner> serviceCallback) {
return ServiceFuture.fromResponse(listQueryResultsForPolicyDefinitionWithServiceResponseAsync(subscriptionId, policyDefinitionName, queryOptions), serviceCallback);
} | class class_name[name] begin[{]
method[listQueryResultsForPolicyDefinitionAsync, return_type[type[ServiceFuture]], modifier[public], parameter[subscriptionId, policyDefinitionName, queryOptions, serviceCallback]] begin[{]
return[call[ServiceFuture.fromResponse, parameter[call[.listQueryResultsForPolicyDefinitionWithServiceResponseAsync, parameter[member[.subscriptionId], member[.policyDefinitionName], member[.queryOptions]]], member[.serviceCallback]]]]
end[}]
END[}] | Keyword[public] identifier[ServiceFuture] operator[<] identifier[PolicyEventsQueryResultsInner] operator[>] identifier[listQueryResultsForPolicyDefinitionAsync] operator[SEP] identifier[String] identifier[subscriptionId] , identifier[String] identifier[policyDefinitionName] , identifier[QueryOptions] identifier[queryOptions] , Keyword[final] identifier[ServiceCallback] operator[<] identifier[PolicyEventsQueryResultsInner] operator[>] identifier[serviceCallback] operator[SEP] {
Keyword[return] identifier[ServiceFuture] operator[SEP] identifier[fromResponse] operator[SEP] identifier[listQueryResultsForPolicyDefinitionWithServiceResponseAsync] operator[SEP] identifier[subscriptionId] , identifier[policyDefinitionName] , identifier[queryOptions] operator[SEP] , identifier[serviceCallback] operator[SEP] operator[SEP]
}
|
public ListInstanceProfilesResult withInstanceProfiles(InstanceProfile... instanceProfiles) {
if (this.instanceProfiles == null) {
setInstanceProfiles(new java.util.ArrayList<InstanceProfile>(instanceProfiles.length));
}
for (InstanceProfile ele : instanceProfiles) {
this.instanceProfiles.add(ele);
}
return this;
} | class class_name[name] begin[{]
method[withInstanceProfiles, return_type[type[ListInstanceProfilesResult]], modifier[public], parameter[instanceProfiles]] begin[{]
if[binary_operation[THIS[member[None.instanceProfiles]], ==, literal[null]]] begin[{]
call[.setInstanceProfiles, parameter[ClassCreator(arguments=[MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=instanceProfiles, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=java, sub_type=ReferenceType(arguments=None, dimensions=None, name=util, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=InstanceProfile, sub_type=None))], dimensions=None, name=ArrayList, sub_type=None))))]]
else begin[{]
None
end[}]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=instanceProfiles, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[MemberReference(member=ele, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=instanceProfiles, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=ele)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=InstanceProfile, sub_type=None))), label=None)
return[THIS[]]
end[}]
END[}] | Keyword[public] identifier[ListInstanceProfilesResult] identifier[withInstanceProfiles] operator[SEP] identifier[InstanceProfile] operator[...] identifier[instanceProfiles] operator[SEP] {
Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[instanceProfiles] operator[==] Other[null] operator[SEP] {
identifier[setInstanceProfiles] operator[SEP] Keyword[new] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[ArrayList] operator[<] identifier[InstanceProfile] operator[>] operator[SEP] identifier[instanceProfiles] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[for] operator[SEP] identifier[InstanceProfile] identifier[ele] operator[:] identifier[instanceProfiles] operator[SEP] {
Keyword[this] operator[SEP] identifier[instanceProfiles] operator[SEP] identifier[add] operator[SEP] identifier[ele] operator[SEP] operator[SEP]
}
Keyword[return] Keyword[this] operator[SEP]
}
|
protected final void writeMapTo( Map<String,Object> map , RawDataBuffer out )
{
if (map == null)
{
out.writeInt(0);
return;
}
out.writeInt(map.size());
if (!map.isEmpty())
{
Iterator<Map.Entry<String,Object>> allEntries = map.entrySet().iterator();
while (allEntries.hasNext())
{
Map.Entry<String,Object> entry = allEntries.next();
out.writeUTF(entry.getKey());
out.writeGeneric(entry.getValue());
}
}
} | class class_name[name] begin[{]
method[writeMapTo, return_type[void], modifier[final protected], parameter[map, out]] begin[{]
if[binary_operation[member[.map], ==, literal[null]]] begin[{]
call[out.writeInt, parameter[literal[0]]]
return[None]
else begin[{]
None
end[}]
call[out.writeInt, parameter[call[map.size, parameter[]]]]
if[call[map.isEmpty, parameter[]]] begin[{]
local_variable[type[Iterator], allEntries]
while[call[allEntries.hasNext, parameter[]]] begin[{]
local_variable[type[Map], entry]
call[out.writeUTF, parameter[call[entry.getKey, parameter[]]]]
call[out.writeGeneric, parameter[call[entry.getValue, parameter[]]]]
end[}]
else begin[{]
None
end[}]
end[}]
END[}] | Keyword[protected] Keyword[final] Keyword[void] identifier[writeMapTo] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] identifier[map] , identifier[RawDataBuffer] identifier[out] operator[SEP] {
Keyword[if] operator[SEP] identifier[map] operator[==] Other[null] operator[SEP] {
identifier[out] operator[SEP] identifier[writeInt] operator[SEP] Other[0] operator[SEP] operator[SEP] Keyword[return] operator[SEP]
}
identifier[out] operator[SEP] identifier[writeInt] operator[SEP] identifier[map] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[map] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] {
identifier[Iterator] operator[<] identifier[Map] operator[SEP] identifier[Entry] operator[<] identifier[String] , identifier[Object] operator[>] operator[>] identifier[allEntries] operator[=] identifier[map] operator[SEP] identifier[entrySet] operator[SEP] operator[SEP] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[allEntries] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] {
identifier[Map] operator[SEP] identifier[Entry] operator[<] identifier[String] , identifier[Object] operator[>] identifier[entry] operator[=] identifier[allEntries] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] identifier[out] operator[SEP] identifier[writeUTF] operator[SEP] identifier[entry] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[out] operator[SEP] identifier[writeGeneric] operator[SEP] identifier[entry] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
}
}
|
@Override
public CheckpointStorage createCheckpointStorage(JobID jobId) throws IOException {
return new MemoryBackendCheckpointStorage(jobId, getCheckpointPath(), getSavepointPath(), maxStateSize);
} | class class_name[name] begin[{]
method[createCheckpointStorage, return_type[type[CheckpointStorage]], modifier[public], parameter[jobId]] begin[{]
return[ClassCreator(arguments=[MemberReference(member=jobId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getCheckpointPath, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getSavepointPath, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), MemberReference(member=maxStateSize, 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=MemoryBackendCheckpointStorage, sub_type=None))]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] identifier[CheckpointStorage] identifier[createCheckpointStorage] operator[SEP] identifier[JobID] identifier[jobId] operator[SEP] Keyword[throws] identifier[IOException] {
Keyword[return] Keyword[new] identifier[MemoryBackendCheckpointStorage] operator[SEP] identifier[jobId] , identifier[getCheckpointPath] operator[SEP] operator[SEP] , identifier[getSavepointPath] operator[SEP] operator[SEP] , identifier[maxStateSize] operator[SEP] operator[SEP]
}
|
@Override
public boolean isViewHolderUpdated(View view) {
RecyclerView.ViewHolder holder = getChildViewHolder(view);
return holder == null || isViewHolderUpdated(holder);
} | class class_name[name] begin[{]
method[isViewHolderUpdated, return_type[type[boolean]], modifier[public], parameter[view]] begin[{]
local_variable[type[RecyclerView], holder]
return[binary_operation[binary_operation[member[.holder], ==, literal[null]], ||, call[.isViewHolderUpdated, parameter[member[.holder]]]]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] Keyword[boolean] identifier[isViewHolderUpdated] operator[SEP] identifier[View] identifier[view] operator[SEP] {
identifier[RecyclerView] operator[SEP] identifier[ViewHolder] identifier[holder] operator[=] identifier[getChildViewHolder] operator[SEP] identifier[view] operator[SEP] operator[SEP] Keyword[return] identifier[holder] operator[==] Other[null] operator[||] identifier[isViewHolderUpdated] operator[SEP] identifier[holder] operator[SEP] operator[SEP]
}
|
public static Class[] resolveTypeArguments(Type genericType) {
Class[] typeArguments = ReflectionUtils.EMPTY_CLASS_ARRAY;
if (genericType instanceof ParameterizedType) {
ParameterizedType pt = (ParameterizedType) genericType;
typeArguments = resolveParameterizedType(pt);
}
return typeArguments;
} | class class_name[name] begin[{]
method[resolveTypeArguments, return_type[type[Class]], modifier[public static], parameter[genericType]] begin[{]
local_variable[type[Class], typeArguments]
if[binary_operation[member[.genericType], instanceof, type[ParameterizedType]]] begin[{]
local_variable[type[ParameterizedType], pt]
assign[member[.typeArguments], call[.resolveParameterizedType, parameter[member[.pt]]]]
else begin[{]
None
end[}]
return[member[.typeArguments]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[Class] operator[SEP] operator[SEP] identifier[resolveTypeArguments] operator[SEP] identifier[Type] identifier[genericType] operator[SEP] {
identifier[Class] operator[SEP] operator[SEP] identifier[typeArguments] operator[=] identifier[ReflectionUtils] operator[SEP] identifier[EMPTY_CLASS_ARRAY] operator[SEP] Keyword[if] operator[SEP] identifier[genericType] Keyword[instanceof] identifier[ParameterizedType] operator[SEP] {
identifier[ParameterizedType] identifier[pt] operator[=] operator[SEP] identifier[ParameterizedType] operator[SEP] identifier[genericType] operator[SEP] identifier[typeArguments] operator[=] identifier[resolveParameterizedType] operator[SEP] identifier[pt] operator[SEP] operator[SEP]
}
Keyword[return] identifier[typeArguments] operator[SEP]
}
|
public static <T> Optional<T> find(final Iterable<? extends T> iterable, final Predicate<? super T> predicate) {
checkNotNull(iterable, "iterable may not be null");
checkNotNull(predicate, "the predicate may not be null");
for (T t : iterable) {
if (predicate.test(t)) {
return of(t);
}
}
return Optional.empty();
} | class class_name[name] begin[{]
method[find, return_type[type[Optional]], modifier[public static], parameter[iterable, predicate]] begin[{]
call[.checkNotNull, parameter[member[.iterable], literal["iterable may not be null"]]]
call[.checkNotNull, parameter[member[.predicate], literal["the predicate may not be null"]]]
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=t, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=test, postfix_operators=[], prefix_operators=[], qualifier=predicate, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=t, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=of, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=iterable, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=t)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None))), label=None)
return[call[Optional.empty, parameter[]]]
end[}]
END[}] | Keyword[public] Keyword[static] operator[<] identifier[T] operator[>] identifier[Optional] operator[<] identifier[T] operator[>] identifier[find] operator[SEP] Keyword[final] identifier[Iterable] operator[<] operator[?] Keyword[extends] identifier[T] operator[>] identifier[iterable] , Keyword[final] identifier[Predicate] operator[<] operator[?] Keyword[super] identifier[T] operator[>] identifier[predicate] operator[SEP] {
identifier[checkNotNull] operator[SEP] identifier[iterable] , literal[String] operator[SEP] operator[SEP] identifier[checkNotNull] operator[SEP] identifier[predicate] , literal[String] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[T] identifier[t] operator[:] identifier[iterable] operator[SEP] {
Keyword[if] operator[SEP] identifier[predicate] operator[SEP] identifier[test] operator[SEP] identifier[t] operator[SEP] operator[SEP] {
Keyword[return] identifier[of] operator[SEP] identifier[t] operator[SEP] operator[SEP]
}
}
Keyword[return] identifier[Optional] operator[SEP] identifier[empty] operator[SEP] operator[SEP] operator[SEP]
}
|
public boolean execute(Campaign campaign) {
boolean campaignResult = true;
currentCampaign = campaign;
campaignStartTimeStamp = new Date();
try {
createReport();
for (CampaignRun run : currentCampaign.getRuns()) {
if (TestEngine.isAbortedByUser()) {
break;
}
currentTestBed = run.getTestbed();
String testSuiteName = currentCampaign.getName() + " - " + currentTestBed.substring(0,
currentTestBed.lastIndexOf('.'));
TestBedConfiguration.setConfigFile(StaticConfiguration.TESTBED_CONFIG_DIRECTORY + "/" + currentTestBed);
currentTestSuite = MetaTestSuite.createMetaTestSuite(testSuiteName, run.getTestsuites());
if (currentTestSuite == null) {
continue;
}
currentTestSuite.addTestReportListener(this);
campaignResult &= TestEngine.execute(
currentTestSuite); // NOSONAR - Potentially dangerous use of non-short-circuit logic
currentTestSuite.removeTestReportListener(this);
currentTestSuite = null;
}
CampaignReportManager.getInstance().stopReport();
} finally {
TestEngine.tearDown();
campaignStartTimeStamp = null;
currentCampaign = null;
}
return campaignResult;
} | class class_name[name] begin[{]
method[execute, return_type[type[boolean]], modifier[public], parameter[campaign]] begin[{]
local_variable[type[boolean], campaignResult]
assign[member[.currentCampaign], member[.campaign]]
assign[member[.campaignStartTimeStamp], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Date, sub_type=None))]
TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=createReport, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[], member=isAbortedByUser, postfix_operators=[], prefix_operators=[], qualifier=TestEngine, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[BreakStatement(goto=None, label=None)])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=currentTestBed, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=getTestbed, postfix_operators=[], prefix_operators=[], qualifier=run, selectors=[], type_arguments=None)), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=currentCampaign, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" - "), operator=+), operandr=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='.')], member=lastIndexOf, postfix_operators=[], prefix_operators=[], qualifier=currentTestBed, selectors=[], type_arguments=None)], member=substring, postfix_operators=[], prefix_operators=[], qualifier=currentTestBed, selectors=[], type_arguments=None), operator=+), name=testSuiteName)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=TESTBED_CONFIG_DIRECTORY, postfix_operators=[], prefix_operators=[], qualifier=StaticConfiguration, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="/"), operator=+), operandr=MemberReference(member=currentTestBed, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=setConfigFile, postfix_operators=[], prefix_operators=[], qualifier=TestBedConfiguration, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=currentTestSuite, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=testSuiteName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getTestsuites, postfix_operators=[], prefix_operators=[], qualifier=run, selectors=[], type_arguments=None)], member=createMetaTestSuite, postfix_operators=[], prefix_operators=[], qualifier=MetaTestSuite, selectors=[], type_arguments=None)), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=currentTestSuite, 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=[ContinueStatement(goto=None, label=None)])), StatementExpression(expression=MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[])], member=addTestReportListener, postfix_operators=[], prefix_operators=[], qualifier=currentTestSuite, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=campaignResult, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=&=, value=MethodInvocation(arguments=[MemberReference(member=currentTestSuite, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=execute, postfix_operators=[], prefix_operators=[], qualifier=TestEngine, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[])], member=removeTestReportListener, postfix_operators=[], prefix_operators=[], qualifier=currentTestSuite, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=currentTestSuite, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getRuns, postfix_operators=[], prefix_operators=[], qualifier=currentCampaign, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=run)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=CampaignRun, sub_type=None))), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=getInstance, postfix_operators=[], prefix_operators=[], qualifier=CampaignReportManager, selectors=[MethodInvocation(arguments=[], member=stopReport, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)], catches=None, finally_block=[StatementExpression(expression=MethodInvocation(arguments=[], member=tearDown, postfix_operators=[], prefix_operators=[], qualifier=TestEngine, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=campaignStartTimeStamp, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=currentCampaign, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)), label=None)], label=None, resources=None)
return[member[.campaignResult]]
end[}]
END[}] | Keyword[public] Keyword[boolean] identifier[execute] operator[SEP] identifier[Campaign] identifier[campaign] operator[SEP] {
Keyword[boolean] identifier[campaignResult] operator[=] literal[boolean] operator[SEP] identifier[currentCampaign] operator[=] identifier[campaign] operator[SEP] identifier[campaignStartTimeStamp] operator[=] Keyword[new] identifier[Date] operator[SEP] operator[SEP] operator[SEP] Keyword[try] {
identifier[createReport] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[CampaignRun] identifier[run] operator[:] identifier[currentCampaign] operator[SEP] identifier[getRuns] operator[SEP] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[TestEngine] operator[SEP] identifier[isAbortedByUser] operator[SEP] operator[SEP] operator[SEP] {
Keyword[break] operator[SEP]
}
identifier[currentTestBed] operator[=] identifier[run] operator[SEP] identifier[getTestbed] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[testSuiteName] operator[=] identifier[currentCampaign] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[currentTestBed] operator[SEP] identifier[substring] operator[SEP] Other[0] , identifier[currentTestBed] operator[SEP] identifier[lastIndexOf] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[TestBedConfiguration] operator[SEP] identifier[setConfigFile] operator[SEP] identifier[StaticConfiguration] operator[SEP] identifier[TESTBED_CONFIG_DIRECTORY] operator[+] literal[String] operator[+] identifier[currentTestBed] operator[SEP] operator[SEP] identifier[currentTestSuite] operator[=] identifier[MetaTestSuite] operator[SEP] identifier[createMetaTestSuite] operator[SEP] identifier[testSuiteName] , identifier[run] operator[SEP] identifier[getTestsuites] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[currentTestSuite] operator[==] Other[null] operator[SEP] {
Keyword[continue] operator[SEP]
}
identifier[currentTestSuite] operator[SEP] identifier[addTestReportListener] operator[SEP] Keyword[this] operator[SEP] operator[SEP] identifier[campaignResult] operator[&=] identifier[TestEngine] operator[SEP] identifier[execute] operator[SEP] identifier[currentTestSuite] operator[SEP] operator[SEP] identifier[currentTestSuite] operator[SEP] identifier[removeTestReportListener] operator[SEP] Keyword[this] operator[SEP] operator[SEP] identifier[currentTestSuite] operator[=] Other[null] operator[SEP]
}
identifier[CampaignReportManager] operator[SEP] identifier[getInstance] operator[SEP] operator[SEP] operator[SEP] identifier[stopReport] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[finally] {
identifier[TestEngine] operator[SEP] identifier[tearDown] operator[SEP] operator[SEP] operator[SEP] identifier[campaignStartTimeStamp] operator[=] Other[null] operator[SEP] identifier[currentCampaign] operator[=] Other[null] operator[SEP]
}
Keyword[return] identifier[campaignResult] operator[SEP]
}
|
void updateDataFields(int why) {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "updateDataFields");
super.updateDataFields(why);
if (bodyList != null && bodyList.isChanged())
getPayload().setField(JmsStreamBodyAccess.BODY_DATA_VALUE, bodyList.getList());
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "updateDataFields");
} | class class_name[name] begin[{]
method[updateDataFields, return_type[void], modifier[default], parameter[why]] begin[{]
if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{]
call[SibTr.entry, parameter[THIS[], member[.tc], literal["updateDataFields"]]]
else begin[{]
None
end[}]
SuperMethodInvocation(arguments=[MemberReference(member=why, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=updateDataFields, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None)
if[binary_operation[binary_operation[member[.bodyList], !=, literal[null]], &&, call[bodyList.isChanged, parameter[]]]] begin[{]
call[.getPayload, parameter[]]
else begin[{]
None
end[}]
if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{]
call[SibTr.exit, parameter[THIS[], member[.tc], literal["updateDataFields"]]]
else begin[{]
None
end[}]
end[}]
END[}] | Keyword[void] identifier[updateDataFields] operator[SEP] Keyword[int] identifier[why] operator[SEP] {
Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[entry] operator[SEP] Keyword[this] , identifier[tc] , literal[String] operator[SEP] operator[SEP] Keyword[super] operator[SEP] identifier[updateDataFields] operator[SEP] identifier[why] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[bodyList] operator[!=] Other[null] operator[&&] identifier[bodyList] operator[SEP] identifier[isChanged] operator[SEP] operator[SEP] operator[SEP] identifier[getPayload] operator[SEP] operator[SEP] operator[SEP] identifier[setField] operator[SEP] identifier[JmsStreamBodyAccess] operator[SEP] identifier[BODY_DATA_VALUE] , identifier[bodyList] operator[SEP] identifier[getList] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[exit] operator[SEP] Keyword[this] , identifier[tc] , literal[String] operator[SEP] operator[SEP]
}
|
public I_CmsResourceType getResourceType(String typeName) throws CmsLoaderException {
I_CmsResourceType result = m_configuration.getResourceTypeByName(typeName);
if (result != null) {
return result;
}
throw new CmsLoaderException(Messages.get().container(Messages.ERR_UNKNOWN_RESTYPE_NAME_REQ_1, typeName));
} | class class_name[name] begin[{]
method[getResourceType, return_type[type[I_CmsResourceType]], modifier[public], parameter[typeName]] begin[{]
local_variable[type[I_CmsResourceType], result]
if[binary_operation[member[.result], !=, literal[null]]] begin[{]
return[member[.result]]
else begin[{]
None
end[}]
ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[], member=get, postfix_operators=[], prefix_operators=[], qualifier=Messages, selectors=[MethodInvocation(arguments=[MemberReference(member=ERR_UNKNOWN_RESTYPE_NAME_REQ_1, postfix_operators=[], prefix_operators=[], qualifier=Messages, selectors=[]), MemberReference(member=typeName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=container, 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=CmsLoaderException, sub_type=None)), label=None)
end[}]
END[}] | Keyword[public] identifier[I_CmsResourceType] identifier[getResourceType] operator[SEP] identifier[String] identifier[typeName] operator[SEP] Keyword[throws] identifier[CmsLoaderException] {
identifier[I_CmsResourceType] identifier[result] operator[=] identifier[m_configuration] operator[SEP] identifier[getResourceTypeByName] operator[SEP] identifier[typeName] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[result] operator[!=] Other[null] operator[SEP] {
Keyword[return] identifier[result] operator[SEP]
}
Keyword[throw] Keyword[new] identifier[CmsLoaderException] operator[SEP] identifier[Messages] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[container] operator[SEP] identifier[Messages] operator[SEP] identifier[ERR_UNKNOWN_RESTYPE_NAME_REQ_1] , identifier[typeName] operator[SEP] operator[SEP] operator[SEP]
}
|
public static <S extends Enum<S>> S getSystemPropertyAsEnum(Class<S> type, String name, S defaultValue) {
final String value = getSystemProperty(name, null);
if (value != null) {
try {
final S enumeration = Enum.valueOf(type, value);
if (enumeration != null) {
return enumeration;
}
} catch (Throwable exception) {
//
}
try {
final int ordinal = Integer.parseInt(value);
final S enumeration = type.getEnumConstants()[ordinal];
if (enumeration != null) {
return enumeration;
}
} catch (Throwable exception) {
//
}
}
return defaultValue;
} | class class_name[name] begin[{]
method[getSystemPropertyAsEnum, return_type[type[S]], modifier[public static], parameter[type, name, defaultValue]] begin[{]
local_variable[type[String], value]
if[binary_operation[member[.value], !=, literal[null]]] begin[{]
TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=valueOf, postfix_operators=[], prefix_operators=[], qualifier=Enum, selectors=[], type_arguments=None), name=enumeration)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=S, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=enumeration, 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=MemberReference(member=enumeration, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)]))], catches=[CatchClause(block=[], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=exception, types=['Throwable']))], finally_block=None, label=None, resources=None)
TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=parseInt, postfix_operators=[], prefix_operators=[], qualifier=Integer, selectors=[], type_arguments=None), name=ordinal)], modifiers={'final'}, type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getEnumConstants, postfix_operators=[], prefix_operators=[], qualifier=type, selectors=[ArraySelector(index=MemberReference(member=ordinal, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))], type_arguments=None), name=enumeration)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=S, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=enumeration, 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=MemberReference(member=enumeration, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)]))], catches=[CatchClause(block=[], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=exception, types=['Throwable']))], finally_block=None, label=None, resources=None)
else begin[{]
None
end[}]
return[member[.defaultValue]]
end[}]
END[}] | Keyword[public] Keyword[static] operator[<] identifier[S] Keyword[extends] identifier[Enum] operator[<] identifier[S] operator[>] operator[>] identifier[S] identifier[getSystemPropertyAsEnum] operator[SEP] identifier[Class] operator[<] identifier[S] operator[>] identifier[type] , identifier[String] identifier[name] , identifier[S] identifier[defaultValue] operator[SEP] {
Keyword[final] identifier[String] identifier[value] operator[=] identifier[getSystemProperty] operator[SEP] identifier[name] , Other[null] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[value] operator[!=] Other[null] operator[SEP] {
Keyword[try] {
Keyword[final] identifier[S] identifier[enumeration] operator[=] identifier[Enum] operator[SEP] identifier[valueOf] operator[SEP] identifier[type] , identifier[value] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[enumeration] operator[!=] Other[null] operator[SEP] {
Keyword[return] identifier[enumeration] operator[SEP]
}
}
Keyword[catch] operator[SEP] identifier[Throwable] identifier[exception] operator[SEP] {
}
Keyword[try] {
Keyword[final] Keyword[int] identifier[ordinal] operator[=] identifier[Integer] operator[SEP] identifier[parseInt] operator[SEP] identifier[value] operator[SEP] operator[SEP] Keyword[final] identifier[S] identifier[enumeration] operator[=] identifier[type] operator[SEP] identifier[getEnumConstants] operator[SEP] operator[SEP] operator[SEP] identifier[ordinal] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[enumeration] operator[!=] Other[null] operator[SEP] {
Keyword[return] identifier[enumeration] operator[SEP]
}
}
Keyword[catch] operator[SEP] identifier[Throwable] identifier[exception] operator[SEP] {
}
}
Keyword[return] identifier[defaultValue] operator[SEP]
}
|
public void setSections( List<Section> sections ){
for( Section s: sections ) superSection.addSection(s);
} | class class_name[name] begin[{]
method[setSections, return_type[void], modifier[public], parameter[sections]] begin[{]
ForStatement(body=StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=s, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addSection, postfix_operators=[], prefix_operators=[], qualifier=superSection, selectors=[], type_arguments=None), label=None), control=EnhancedForControl(iterable=MemberReference(member=sections, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=s)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Section, sub_type=None))), label=None)
end[}]
END[}] | Keyword[public] Keyword[void] identifier[setSections] operator[SEP] identifier[List] operator[<] identifier[Section] operator[>] identifier[sections] operator[SEP] {
Keyword[for] operator[SEP] identifier[Section] identifier[s] operator[:] identifier[sections] operator[SEP] identifier[superSection] operator[SEP] identifier[addSection] operator[SEP] identifier[s] operator[SEP] operator[SEP]
}
|
@Override
protected int pruneCache() {
int count = 0;
CacheObj<K, V> comin = null;
// 清理过期对象并找出访问最少的对象
Iterator<CacheObj<K, V>> values = cacheMap.values().iterator();
CacheObj<K, V> co;
while (values.hasNext()) {
co = values.next();
if (co.isExpired() == true) {
values.remove();
onRemove(co.key, co.obj);
count++;
continue;
}
//找出访问最少的对象
if (comin == null || co.accessCount < comin.accessCount) {
comin = co;
}
}
// 减少所有对象访问量,并清除减少后为0的访问对象
if (isFull() && comin != null) {
long minAccessCount = comin.accessCount;
values = cacheMap.values().iterator();
CacheObj<K, V> co1;
while (values.hasNext()) {
co1 = values.next();
co1.accessCount -= minAccessCount;
if (co1.accessCount <= 0) {
values.remove();
onRemove(co1.key, co1.obj);
count++;
}
}
}
return count;
} | class class_name[name] begin[{]
method[pruneCache, return_type[type[int]], modifier[protected], parameter[]] begin[{]
local_variable[type[int], count]
local_variable[type[CacheObj], comin]
local_variable[type[Iterator], values]
local_variable[type[CacheObj], co]
while[call[values.hasNext, parameter[]]] begin[{]
assign[member[.co], call[values.next, parameter[]]]
if[binary_operation[call[co.isExpired, parameter[]], ==, literal[true]]] begin[{]
call[values.remove, parameter[]]
call[.onRemove, parameter[member[co.key], member[co.obj]]]
member[.count]
ContinueStatement(goto=None, label=None)
else begin[{]
None
end[}]
if[binary_operation[binary_operation[member[.comin], ==, literal[null]], ||, binary_operation[member[co.accessCount], <, member[comin.accessCount]]]] begin[{]
assign[member[.comin], member[.co]]
else begin[{]
None
end[}]
end[}]
if[binary_operation[call[.isFull, parameter[]], &&, binary_operation[member[.comin], !=, literal[null]]]] begin[{]
local_variable[type[long], minAccessCount]
assign[member[.values], call[cacheMap.values, parameter[]]]
local_variable[type[CacheObj], co1]
while[call[values.hasNext, parameter[]]] begin[{]
assign[member[.co1], call[values.next, parameter[]]]
assign[member[co1.accessCount], member[.minAccessCount]]
if[binary_operation[member[co1.accessCount], <=, literal[0]]] begin[{]
call[values.remove, parameter[]]
call[.onRemove, parameter[member[co1.key], member[co1.obj]]]
member[.count]
else begin[{]
None
end[}]
end[}]
else begin[{]
None
end[}]
return[member[.count]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[protected] Keyword[int] identifier[pruneCache] operator[SEP] operator[SEP] {
Keyword[int] identifier[count] operator[=] Other[0] operator[SEP] identifier[CacheObj] operator[<] identifier[K] , identifier[V] operator[>] identifier[comin] operator[=] Other[null] operator[SEP] identifier[Iterator] operator[<] identifier[CacheObj] operator[<] identifier[K] , identifier[V] operator[>] operator[>] identifier[values] operator[=] identifier[cacheMap] operator[SEP] identifier[values] operator[SEP] operator[SEP] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] identifier[CacheObj] operator[<] identifier[K] , identifier[V] operator[>] identifier[co] operator[SEP] Keyword[while] operator[SEP] identifier[values] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] {
identifier[co] operator[=] identifier[values] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[co] operator[SEP] identifier[isExpired] operator[SEP] operator[SEP] operator[==] literal[boolean] operator[SEP] {
identifier[values] operator[SEP] identifier[remove] operator[SEP] operator[SEP] operator[SEP] identifier[onRemove] operator[SEP] identifier[co] operator[SEP] identifier[key] , identifier[co] operator[SEP] identifier[obj] operator[SEP] operator[SEP] identifier[count] operator[++] operator[SEP] Keyword[continue] operator[SEP]
}
Keyword[if] operator[SEP] identifier[comin] operator[==] Other[null] operator[||] identifier[co] operator[SEP] identifier[accessCount] operator[<] identifier[comin] operator[SEP] identifier[accessCount] operator[SEP] {
identifier[comin] operator[=] identifier[co] operator[SEP]
}
}
Keyword[if] operator[SEP] identifier[isFull] operator[SEP] operator[SEP] operator[&&] identifier[comin] operator[!=] Other[null] operator[SEP] {
Keyword[long] identifier[minAccessCount] operator[=] identifier[comin] operator[SEP] identifier[accessCount] operator[SEP] identifier[values] operator[=] identifier[cacheMap] operator[SEP] identifier[values] operator[SEP] operator[SEP] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] identifier[CacheObj] operator[<] identifier[K] , identifier[V] operator[>] identifier[co1] operator[SEP] Keyword[while] operator[SEP] identifier[values] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] {
identifier[co1] operator[=] identifier[values] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] identifier[co1] operator[SEP] identifier[accessCount] operator[-=] identifier[minAccessCount] operator[SEP] Keyword[if] operator[SEP] identifier[co1] operator[SEP] identifier[accessCount] operator[<=] Other[0] operator[SEP] {
identifier[values] operator[SEP] identifier[remove] operator[SEP] operator[SEP] operator[SEP] identifier[onRemove] operator[SEP] identifier[co1] operator[SEP] identifier[key] , identifier[co1] operator[SEP] identifier[obj] operator[SEP] operator[SEP] identifier[count] operator[++] operator[SEP]
}
}
}
Keyword[return] identifier[count] operator[SEP]
}
|
public InvService findService(String name) {
if (name == null) return null;
for (InvService s : services) {
if (name.equals(s.getName())) return s;
// look for nested servers
if (s.getServiceType() == ServiceType.COMPOUND) {
InvService result = s.findNestedService(name);
if (result != null) return result;
}
}
return null;
} | class class_name[name] begin[{]
method[findService, return_type[type[InvService]], modifier[public], parameter[name]] begin[{]
if[binary_operation[member[.name], ==, literal[null]]] begin[{]
return[literal[null]]
else begin[{]
None
end[}]
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=s, selectors=[], type_arguments=None)], member=equals, postfix_operators=[], prefix_operators=[], qualifier=name, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=ReturnStatement(expression=MemberReference(member=s, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getServiceType, postfix_operators=[], prefix_operators=[], qualifier=s, selectors=[], type_arguments=None), operandr=MemberReference(member=COMPOUND, postfix_operators=[], prefix_operators=[], qualifier=ServiceType, selectors=[]), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=findNestedService, postfix_operators=[], prefix_operators=[], qualifier=s, selectors=[], type_arguments=None), name=result)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=InvService, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=ReturnStatement(expression=MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None))]))]), control=EnhancedForControl(iterable=MemberReference(member=services, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=s)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=InvService, sub_type=None))), label=None)
return[literal[null]]
end[}]
END[}] | Keyword[public] identifier[InvService] identifier[findService] operator[SEP] identifier[String] identifier[name] operator[SEP] {
Keyword[if] operator[SEP] identifier[name] operator[==] Other[null] operator[SEP] Keyword[return] Other[null] operator[SEP] Keyword[for] operator[SEP] identifier[InvService] identifier[s] operator[:] identifier[services] operator[SEP] {
Keyword[if] operator[SEP] identifier[name] operator[SEP] identifier[equals] operator[SEP] identifier[s] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[s] operator[SEP] Keyword[if] operator[SEP] identifier[s] operator[SEP] identifier[getServiceType] operator[SEP] operator[SEP] operator[==] identifier[ServiceType] operator[SEP] identifier[COMPOUND] operator[SEP] {
identifier[InvService] identifier[result] operator[=] identifier[s] operator[SEP] identifier[findNestedService] operator[SEP] identifier[name] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[result] operator[!=] Other[null] operator[SEP] Keyword[return] identifier[result] operator[SEP]
}
}
Keyword[return] Other[null] operator[SEP]
}
|
public static Map<Integer, Long> getSuspensionLevelsBySubsystem(EntityManager em, SubSystem subSystem) {
return findBySubsystem(em, subSystem).getLevels();
} | class class_name[name] begin[{]
method[getSuspensionLevelsBySubsystem, return_type[type[Map]], modifier[public static], parameter[em, subSystem]] begin[{]
return[call[.findBySubsystem, parameter[member[.em], member[.subSystem]]]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[Map] operator[<] identifier[Integer] , identifier[Long] operator[>] identifier[getSuspensionLevelsBySubsystem] operator[SEP] identifier[EntityManager] identifier[em] , identifier[SubSystem] identifier[subSystem] operator[SEP] {
Keyword[return] identifier[findBySubsystem] operator[SEP] identifier[em] , identifier[subSystem] operator[SEP] operator[SEP] identifier[getLevels] operator[SEP] operator[SEP] operator[SEP]
}
|
public void setAssessmentRuns(java.util.Collection<AssessmentRun> assessmentRuns) {
if (assessmentRuns == null) {
this.assessmentRuns = null;
return;
}
this.assessmentRuns = new java.util.ArrayList<AssessmentRun>(assessmentRuns);
} | class class_name[name] begin[{]
method[setAssessmentRuns, return_type[void], modifier[public], parameter[assessmentRuns]] begin[{]
if[binary_operation[member[.assessmentRuns], ==, literal[null]]] begin[{]
assign[THIS[member[None.assessmentRuns]], literal[null]]
return[None]
else begin[{]
None
end[}]
assign[THIS[member[None.assessmentRuns]], ClassCreator(arguments=[MemberReference(member=assessmentRuns, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=java, sub_type=ReferenceType(arguments=None, dimensions=None, name=util, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=AssessmentRun, sub_type=None))], dimensions=None, name=ArrayList, sub_type=None))))]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[setAssessmentRuns] operator[SEP] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[Collection] operator[<] identifier[AssessmentRun] operator[>] identifier[assessmentRuns] operator[SEP] {
Keyword[if] operator[SEP] identifier[assessmentRuns] operator[==] Other[null] operator[SEP] {
Keyword[this] operator[SEP] identifier[assessmentRuns] operator[=] Other[null] operator[SEP] Keyword[return] operator[SEP]
}
Keyword[this] operator[SEP] identifier[assessmentRuns] operator[=] Keyword[new] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[ArrayList] operator[<] identifier[AssessmentRun] operator[>] operator[SEP] identifier[assessmentRuns] operator[SEP] operator[SEP]
}
|
public void stop() {
stopWrites();
stopReads();
if (timerRef != null && timerRef.get() != null) {
timerRef.get().shutdownNow();
timerRef.set(null);
}
ndBenchMonitor.resetStats();
} | class class_name[name] begin[{]
method[stop, return_type[void], modifier[public], parameter[]] begin[{]
call[.stopWrites, parameter[]]
call[.stopReads, parameter[]]
if[binary_operation[binary_operation[member[.timerRef], !=, literal[null]], &&, binary_operation[call[timerRef.get, parameter[]], !=, literal[null]]]] begin[{]
call[timerRef.get, parameter[]]
call[timerRef.set, parameter[literal[null]]]
else begin[{]
None
end[}]
call[ndBenchMonitor.resetStats, parameter[]]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[stop] operator[SEP] operator[SEP] {
identifier[stopWrites] operator[SEP] operator[SEP] operator[SEP] identifier[stopReads] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[timerRef] operator[!=] Other[null] operator[&&] identifier[timerRef] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] {
identifier[timerRef] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[shutdownNow] operator[SEP] operator[SEP] operator[SEP] identifier[timerRef] operator[SEP] identifier[set] operator[SEP] Other[null] operator[SEP] operator[SEP]
}
identifier[ndBenchMonitor] operator[SEP] identifier[resetStats] operator[SEP] operator[SEP] operator[SEP]
}
|
private Map<String, String> resourceForPath(Path path) {
return AuthorizationUtil.resource(STORAGE_PATH_AUTH_RES_TYPE, authResForPath(path));
} | class class_name[name] begin[{]
method[resourceForPath, return_type[type[Map]], modifier[private], parameter[path]] begin[{]
return[call[AuthorizationUtil.resource, parameter[member[.STORAGE_PATH_AUTH_RES_TYPE], call[.authResForPath, parameter[member[.path]]]]]]
end[}]
END[}] | Keyword[private] identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[resourceForPath] operator[SEP] identifier[Path] identifier[path] operator[SEP] {
Keyword[return] identifier[AuthorizationUtil] operator[SEP] identifier[resource] operator[SEP] identifier[STORAGE_PATH_AUTH_RES_TYPE] , identifier[authResForPath] operator[SEP] identifier[path] operator[SEP] operator[SEP] operator[SEP]
}
|
public String print(
ChronoPrinter<T> printer,
String intervalPattern
) {
I interval = this.toCanonical();
AttributeQuery attrs = printer.getAttributes();
StringBuilder sb = new StringBuilder(32);
int i = 0;
int n = intervalPattern.length();
while (i < n) {
char c = intervalPattern.charAt(i);
if ((c == '{') && (i + 2 < n) && (intervalPattern.charAt(i + 2) == '}')) {
char next = intervalPattern.charAt(i + 1);
if (next == '0') {
if (interval.getStart().isInfinite()) {
sb.append("-\u221E");
} else {
printer.print(interval.getStart().getTemporal(), sb, attrs);
}
i += 3;
continue;
} else if (next == '1') {
if (interval.getEnd().isInfinite()) {
sb.append("+\u221E");
} else {
printer.print(interval.getEnd().getTemporal(), sb, attrs);
}
i += 3;
continue;
}
}
sb.append(c);
i++;
}
return sb.toString();
} | class class_name[name] begin[{]
method[print, return_type[type[String]], modifier[public], parameter[printer, intervalPattern]] begin[{]
local_variable[type[I], interval]
local_variable[type[AttributeQuery], attrs]
local_variable[type[StringBuilder], sb]
local_variable[type[int], i]
local_variable[type[int], n]
while[binary_operation[member[.i], <, member[.n]]] begin[{]
local_variable[type[char], c]
if[binary_operation[binary_operation[binary_operation[member[.c], ==, literal['{']], &&, binary_operation[binary_operation[member[.i], +, literal[2]], <, member[.n]]], &&, binary_operation[call[intervalPattern.charAt, parameter[binary_operation[member[.i], +, literal[2]]]], ==, literal['}']]]] begin[{]
local_variable[type[char], next]
if[binary_operation[member[.next], ==, literal['0']]] begin[{]
if[call[interval.getStart, parameter[]]] begin[{]
call[sb.append, parameter[literal["-∞"]]]
else begin[{]
call[printer.print, parameter[call[interval.getStart, parameter[]], member[.sb], member[.attrs]]]
end[}]
assign[member[.i], literal[3]]
ContinueStatement(goto=None, label=None)
else begin[{]
if[binary_operation[member[.next], ==, literal['1']]] begin[{]
if[call[interval.getEnd, parameter[]]] begin[{]
call[sb.append, parameter[literal["+∞"]]]
else begin[{]
call[printer.print, parameter[call[interval.getEnd, parameter[]], member[.sb], member[.attrs]]]
end[}]
assign[member[.i], literal[3]]
ContinueStatement(goto=None, label=None)
else begin[{]
None
end[}]
end[}]
else begin[{]
None
end[}]
call[sb.append, parameter[member[.c]]]
member[.i]
end[}]
return[call[sb.toString, parameter[]]]
end[}]
END[}] | Keyword[public] identifier[String] identifier[print] operator[SEP] identifier[ChronoPrinter] operator[<] identifier[T] operator[>] identifier[printer] , identifier[String] identifier[intervalPattern] operator[SEP] {
identifier[I] identifier[interval] operator[=] Keyword[this] operator[SEP] identifier[toCanonical] operator[SEP] operator[SEP] operator[SEP] identifier[AttributeQuery] identifier[attrs] operator[=] identifier[printer] operator[SEP] identifier[getAttributes] operator[SEP] operator[SEP] operator[SEP] identifier[StringBuilder] identifier[sb] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] Other[32] operator[SEP] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] Keyword[int] identifier[n] operator[=] identifier[intervalPattern] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[i] operator[<] identifier[n] operator[SEP] {
Keyword[char] identifier[c] operator[=] identifier[intervalPattern] operator[SEP] identifier[charAt] operator[SEP] identifier[i] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[SEP] identifier[c] operator[==] literal[String] operator[SEP] operator[&&] operator[SEP] identifier[i] operator[+] Other[2] operator[<] identifier[n] operator[SEP] operator[&&] operator[SEP] identifier[intervalPattern] operator[SEP] identifier[charAt] operator[SEP] identifier[i] operator[+] Other[2] operator[SEP] operator[==] literal[String] operator[SEP] operator[SEP] {
Keyword[char] identifier[next] operator[=] identifier[intervalPattern] operator[SEP] identifier[charAt] operator[SEP] identifier[i] operator[+] Other[1] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[next] operator[==] literal[String] operator[SEP] {
Keyword[if] operator[SEP] identifier[interval] operator[SEP] identifier[getStart] operator[SEP] operator[SEP] operator[SEP] identifier[isInfinite] operator[SEP] operator[SEP] operator[SEP] {
identifier[sb] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[printer] operator[SEP] identifier[print] operator[SEP] identifier[interval] operator[SEP] identifier[getStart] operator[SEP] operator[SEP] operator[SEP] identifier[getTemporal] operator[SEP] operator[SEP] , identifier[sb] , identifier[attrs] operator[SEP] operator[SEP]
}
identifier[i] operator[+=] Other[3] operator[SEP] Keyword[continue] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[next] operator[==] literal[String] operator[SEP] {
Keyword[if] operator[SEP] identifier[interval] operator[SEP] identifier[getEnd] operator[SEP] operator[SEP] operator[SEP] identifier[isInfinite] operator[SEP] operator[SEP] operator[SEP] {
identifier[sb] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[printer] operator[SEP] identifier[print] operator[SEP] identifier[interval] operator[SEP] identifier[getEnd] operator[SEP] operator[SEP] operator[SEP] identifier[getTemporal] operator[SEP] operator[SEP] , identifier[sb] , identifier[attrs] operator[SEP] operator[SEP]
}
identifier[i] operator[+=] Other[3] operator[SEP] Keyword[continue] operator[SEP]
}
}
identifier[sb] operator[SEP] identifier[append] operator[SEP] identifier[c] operator[SEP] operator[SEP] identifier[i] operator[++] operator[SEP]
}
Keyword[return] identifier[sb] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP]
}
|
private static void formatElseIfClauseWithNoDependencies(
IfThenPair<?> condition, FormattingContext ctx) {
ctx.append(" else if (").appendOutputExpression(condition.predicate).append(") ");
try (FormattingContext ignored = ctx.enterBlock()) {
ctx.appendAll(condition.consequent);
}
} | class class_name[name] begin[{]
method[formatElseIfClauseWithNoDependencies, return_type[void], modifier[private static], parameter[condition, ctx]] begin[{]
call[ctx.append, parameter[literal[" else if ("]]]
TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=consequent, postfix_operators=[], prefix_operators=[], qualifier=condition, selectors=[])], member=appendAll, postfix_operators=[], prefix_operators=[], qualifier=ctx, selectors=[], type_arguments=None), label=None)], catches=None, finally_block=None, label=None, resources=[TryResource(annotations=[], modifiers=set(), name=ignored, type=ReferenceType(arguments=None, dimensions=[], name=FormattingContext, sub_type=None), value=MethodInvocation(arguments=[], member=enterBlock, postfix_operators=[], prefix_operators=[], qualifier=ctx, selectors=[], type_arguments=None))])
end[}]
END[}] | Keyword[private] Keyword[static] Keyword[void] identifier[formatElseIfClauseWithNoDependencies] operator[SEP] identifier[IfThenPair] operator[<] operator[?] operator[>] identifier[condition] , identifier[FormattingContext] identifier[ctx] operator[SEP] {
identifier[ctx] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[appendOutputExpression] operator[SEP] identifier[condition] operator[SEP] identifier[predicate] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[try] operator[SEP] identifier[FormattingContext] identifier[ignored] operator[=] identifier[ctx] operator[SEP] identifier[enterBlock] operator[SEP] operator[SEP] operator[SEP] {
identifier[ctx] operator[SEP] identifier[appendAll] operator[SEP] identifier[condition] operator[SEP] identifier[consequent] operator[SEP] operator[SEP]
}
}
|
public static Number checkBetween(Number value, Number min, Number max) {
notNull(value);
notNull(min);
notNull(max);
double valueDouble = value.doubleValue();
double minDouble = min.doubleValue();
double maxDouble = max.doubleValue();
if (valueDouble < minDouble || valueDouble > maxDouble) {
throw new IllegalArgumentException(StrUtil.format("Length must be between {} and {}.", min, max));
}
return value;
} | class class_name[name] begin[{]
method[checkBetween, return_type[type[Number]], modifier[public static], parameter[value, min, max]] begin[{]
call[.notNull, parameter[member[.value]]]
call[.notNull, parameter[member[.min]]]
call[.notNull, parameter[member[.max]]]
local_variable[type[double], valueDouble]
local_variable[type[double], minDouble]
local_variable[type[double], maxDouble]
if[binary_operation[binary_operation[member[.valueDouble], <, member[.minDouble]], ||, binary_operation[member[.valueDouble], >, member[.maxDouble]]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Length must be between {} and {}."), MemberReference(member=min, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=max, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=format, postfix_operators=[], prefix_operators=[], qualifier=StrUtil, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None)
else begin[{]
None
end[}]
return[member[.value]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[Number] identifier[checkBetween] operator[SEP] identifier[Number] identifier[value] , identifier[Number] identifier[min] , identifier[Number] identifier[max] operator[SEP] {
identifier[notNull] operator[SEP] identifier[value] operator[SEP] operator[SEP] identifier[notNull] operator[SEP] identifier[min] operator[SEP] operator[SEP] identifier[notNull] operator[SEP] identifier[max] operator[SEP] operator[SEP] Keyword[double] identifier[valueDouble] operator[=] identifier[value] operator[SEP] identifier[doubleValue] operator[SEP] operator[SEP] operator[SEP] Keyword[double] identifier[minDouble] operator[=] identifier[min] operator[SEP] identifier[doubleValue] operator[SEP] operator[SEP] operator[SEP] Keyword[double] identifier[maxDouble] operator[=] identifier[max] operator[SEP] identifier[doubleValue] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[valueDouble] operator[<] identifier[minDouble] operator[||] identifier[valueDouble] operator[>] identifier[maxDouble] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] identifier[StrUtil] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[min] , identifier[max] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] identifier[value] operator[SEP]
}
|
public void setLocales(Locale... locales) {
String[] array = new String[locales.length];
for (int i = 0; i < locales.length; i++) {
array[i] = locales[i].toString();
}
setLocales(array);
} | class class_name[name] begin[{]
method[setLocales, return_type[void], modifier[public], parameter[locales]] begin[{]
local_variable[type[String], array]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=array, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MemberReference(member=locales, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MethodInvocation(arguments=[], member=toString, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)])), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=locales, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
call[.setLocales, parameter[member[.array]]]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[setLocales] operator[SEP] identifier[Locale] operator[...] identifier[locales] operator[SEP] {
identifier[String] operator[SEP] operator[SEP] identifier[array] operator[=] Keyword[new] identifier[String] operator[SEP] identifier[locales] 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[locales] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] {
identifier[array] operator[SEP] identifier[i] operator[SEP] operator[=] identifier[locales] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP]
}
identifier[setLocales] operator[SEP] identifier[array] operator[SEP] operator[SEP]
}
|
public Dashboard createDashboard(Dashboard dashboard) throws IOException, TokenExpiredException {
String requestUrl = RESOURCE;
ArgusResponse response = getClient().executeHttpRequest(ArgusHttpClient.RequestType.POST, requestUrl, dashboard);
assertValidResponse(response, requestUrl);
return fromJson(response.getResult(), Dashboard.class);
} | class class_name[name] begin[{]
method[createDashboard, return_type[type[Dashboard]], modifier[public], parameter[dashboard]] begin[{]
local_variable[type[String], requestUrl]
local_variable[type[ArgusResponse], response]
call[.assertValidResponse, parameter[member[.response], member[.requestUrl]]]
return[call[.fromJson, parameter[call[response.getResult, parameter[]], ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Dashboard, sub_type=None))]]]
end[}]
END[}] | Keyword[public] identifier[Dashboard] identifier[createDashboard] operator[SEP] identifier[Dashboard] identifier[dashboard] operator[SEP] Keyword[throws] identifier[IOException] , identifier[TokenExpiredException] {
identifier[String] identifier[requestUrl] operator[=] identifier[RESOURCE] operator[SEP] identifier[ArgusResponse] identifier[response] operator[=] identifier[getClient] operator[SEP] operator[SEP] operator[SEP] identifier[executeHttpRequest] operator[SEP] identifier[ArgusHttpClient] operator[SEP] identifier[RequestType] operator[SEP] identifier[POST] , identifier[requestUrl] , identifier[dashboard] operator[SEP] operator[SEP] identifier[assertValidResponse] operator[SEP] identifier[response] , identifier[requestUrl] operator[SEP] operator[SEP] Keyword[return] identifier[fromJson] operator[SEP] identifier[response] operator[SEP] identifier[getResult] operator[SEP] operator[SEP] , identifier[Dashboard] operator[SEP] Keyword[class] operator[SEP] operator[SEP]
}
|
@Override
public ResourceSet<Room> read(final TwilioRestClient client) {
return new ResourceSet<>(this, client, firstPage(client));
} | class class_name[name] begin[{]
method[read, return_type[type[ResourceSet]], modifier[public], parameter[client]] begin[{]
return[ClassCreator(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), MemberReference(member=client, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[MemberReference(member=client, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=firstPage, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=ResourceSet, sub_type=None))]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] identifier[ResourceSet] operator[<] identifier[Room] operator[>] identifier[read] operator[SEP] Keyword[final] identifier[TwilioRestClient] identifier[client] operator[SEP] {
Keyword[return] Keyword[new] identifier[ResourceSet] operator[<] operator[>] operator[SEP] Keyword[this] , identifier[client] , identifier[firstPage] operator[SEP] identifier[client] operator[SEP] operator[SEP] operator[SEP]
}
|
synchronized void flushOperations(RTEditText editor) {
Stack<Operation> undoStack = getUndoStack(editor);
Stack<Operation> redoStack = getRedoStack(editor);
undoStack.clear();
redoStack.clear();
} | class class_name[name] begin[{]
method[flushOperations, return_type[void], modifier[synchronized], parameter[editor]] begin[{]
local_variable[type[Stack], undoStack]
local_variable[type[Stack], redoStack]
call[undoStack.clear, parameter[]]
call[redoStack.clear, parameter[]]
end[}]
END[}] | Keyword[synchronized] Keyword[void] identifier[flushOperations] operator[SEP] identifier[RTEditText] identifier[editor] operator[SEP] {
identifier[Stack] operator[<] identifier[Operation] operator[>] identifier[undoStack] operator[=] identifier[getUndoStack] operator[SEP] identifier[editor] operator[SEP] operator[SEP] identifier[Stack] operator[<] identifier[Operation] operator[>] identifier[redoStack] operator[=] identifier[getRedoStack] operator[SEP] identifier[editor] operator[SEP] operator[SEP] identifier[undoStack] operator[SEP] identifier[clear] operator[SEP] operator[SEP] operator[SEP] identifier[redoStack] operator[SEP] identifier[clear] operator[SEP] operator[SEP] operator[SEP]
}
|
public void setTableSwitchJump(int switchStart, int caseIndex,
int jumpTarget) {
if (jumpTarget < 0 || itsCodeBufferTop < jumpTarget)
throw new IllegalArgumentException("Bad jump target: " + jumpTarget);
if (caseIndex < -1)
throw new IllegalArgumentException("Bad case index: " + caseIndex);
int padSize = 3 & ~switchStart; // == 3 - switchStart % 4
int caseOffset;
if (caseIndex < 0) {
// default label
caseOffset = switchStart + 1 + padSize;
} else {
caseOffset = switchStart + 1 + padSize + 4 * (3 + caseIndex);
}
if (switchStart < 0 || itsCodeBufferTop - 4 * 4 - padSize - 1 < switchStart) {
throw new IllegalArgumentException(
switchStart + " is outside a possible range of tableswitch"
+ " in already generated code");
}
if ((0xFF & itsCodeBuffer[switchStart]) != ByteCode.TABLESWITCH) {
throw new IllegalArgumentException(
switchStart + " is not offset of tableswitch statement");
}
if (caseOffset < 0 || itsCodeBufferTop < caseOffset + 4) {
// caseIndex >= -1 does not guarantee that caseOffset >= 0 due
// to a possible overflow.
throw new ClassFileFormatException("Too big case index: " + caseIndex);
}
// ALERT: perhaps check against case bounds?
putInt32(jumpTarget - switchStart, itsCodeBuffer, caseOffset);
} | class class_name[name] begin[{]
method[setTableSwitchJump, return_type[void], modifier[public], parameter[switchStart, caseIndex, jumpTarget]] begin[{]
if[binary_operation[binary_operation[member[.jumpTarget], <, literal[0]], ||, binary_operation[member[.itsCodeBufferTop], <, member[.jumpTarget]]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Bad jump target: "), operandr=MemberReference(member=jumpTarget, 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[}]
if[binary_operation[member[.caseIndex], <, literal[1]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Bad case index: "), operandr=MemberReference(member=caseIndex, 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[}]
local_variable[type[int], padSize]
local_variable[type[int], caseOffset]
if[binary_operation[member[.caseIndex], <, literal[0]]] begin[{]
assign[member[.caseOffset], binary_operation[binary_operation[member[.switchStart], +, literal[1]], +, member[.padSize]]]
else begin[{]
assign[member[.caseOffset], binary_operation[binary_operation[binary_operation[member[.switchStart], +, literal[1]], +, member[.padSize]], +, binary_operation[literal[4], *, binary_operation[literal[3], +, member[.caseIndex]]]]]
end[}]
if[binary_operation[binary_operation[member[.switchStart], <, literal[0]], ||, binary_operation[binary_operation[binary_operation[binary_operation[member[.itsCodeBufferTop], -, binary_operation[literal[4], *, literal[4]]], -, member[.padSize]], -, literal[1]], <, member[.switchStart]]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=switchStart, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" is outside a possible range of tableswitch"), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" in already generated code"), 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[binary_operation[binary_operation[literal[0xFF], &, member[.itsCodeBuffer]], !=, member[ByteCode.TABLESWITCH]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=MemberReference(member=switchStart, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" is not offset of tableswitch statement"), 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[binary_operation[binary_operation[member[.caseOffset], <, literal[0]], ||, binary_operation[member[.itsCodeBufferTop], <, binary_operation[member[.caseOffset], +, literal[4]]]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Too big case index: "), operandr=MemberReference(member=caseIndex, 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=ClassFileFormatException, sub_type=None)), label=None)
else begin[{]
None
end[}]
call[.putInt32, parameter[binary_operation[member[.jumpTarget], -, member[.switchStart]], member[.itsCodeBuffer], member[.caseOffset]]]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[setTableSwitchJump] operator[SEP] Keyword[int] identifier[switchStart] , Keyword[int] identifier[caseIndex] , Keyword[int] identifier[jumpTarget] operator[SEP] {
Keyword[if] operator[SEP] identifier[jumpTarget] operator[<] Other[0] operator[||] identifier[itsCodeBufferTop] operator[<] identifier[jumpTarget] operator[SEP] Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[+] identifier[jumpTarget] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[caseIndex] operator[<] operator[-] Other[1] operator[SEP] Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[+] identifier[caseIndex] operator[SEP] operator[SEP] Keyword[int] identifier[padSize] operator[=] Other[3] operator[&] operator[~] identifier[switchStart] operator[SEP] Keyword[int] identifier[caseOffset] operator[SEP] Keyword[if] operator[SEP] identifier[caseIndex] operator[<] Other[0] operator[SEP] {
identifier[caseOffset] operator[=] identifier[switchStart] operator[+] Other[1] operator[+] identifier[padSize] operator[SEP]
}
Keyword[else] {
identifier[caseOffset] operator[=] identifier[switchStart] operator[+] Other[1] operator[+] identifier[padSize] operator[+] Other[4] operator[*] operator[SEP] Other[3] operator[+] identifier[caseIndex] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[switchStart] operator[<] Other[0] operator[||] identifier[itsCodeBufferTop] operator[-] Other[4] operator[*] Other[4] operator[-] identifier[padSize] operator[-] Other[1] operator[<] identifier[switchStart] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] identifier[switchStart] operator[+] literal[String] operator[+] literal[String] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] operator[SEP] literal[Integer] operator[&] identifier[itsCodeBuffer] operator[SEP] identifier[switchStart] operator[SEP] operator[SEP] operator[!=] identifier[ByteCode] operator[SEP] identifier[TABLESWITCH] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] identifier[switchStart] operator[+] literal[String] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[caseOffset] operator[<] Other[0] operator[||] identifier[itsCodeBufferTop] operator[<] identifier[caseOffset] operator[+] Other[4] operator[SEP] {
Keyword[throw] Keyword[new] identifier[ClassFileFormatException] operator[SEP] literal[String] operator[+] identifier[caseIndex] operator[SEP] operator[SEP]
}
identifier[putInt32] operator[SEP] identifier[jumpTarget] operator[-] identifier[switchStart] , identifier[itsCodeBuffer] , identifier[caseOffset] operator[SEP] operator[SEP]
}
|
public TimelineEvent merge(TimelineEvent event, Collection<TimelineEvent> events, TimelineUpdater timelineUpdater) {
if (event == null) {
// nothing to merge
return null;
}
if (events == null || events.isEmpty()) {
// nothing to merge
return event;
}
// check whether all events within the same group
String group = event.getGroup();
for (TimelineEvent e : events) {
if ((group == null && e.getGroup() != null) || (group != null && !group.equals(e.getGroup()))) {
throw new IllegalStateException("Events to be merged may be only belong to one and the same group!");
}
}
// order events according to their start / end dates
TreeSet<TimelineEvent> orderedEvents = new TreeSet<TimelineEvent>(new TimelineEventComparator());
orderedEvents.add(event);
orderedEvents.addAll(events);
// find the largest end date
Date endDate = null;
for (TimelineEvent e : orderedEvents) {
if (endDate == null && e.getEndDate() != null) {
endDate = e.getEndDate();
}
else if (endDate != null && e.getEndDate() != null && endDate.before(e.getEndDate())) {
endDate = e.getEndDate();
}
}
TimelineEvent mergedEvent
= new TimelineEvent(event.getData(), orderedEvents.first().getStartDate(), endDate, event.isEditable(),
event.getGroup(), event.getStyleClass());
// merge...
deleteAll(events, timelineUpdater);
update(mergedEvent, timelineUpdater);
return mergedEvent;
} | class class_name[name] begin[{]
method[merge, return_type[type[TimelineEvent]], modifier[public], parameter[event, events, timelineUpdater]] begin[{]
if[binary_operation[member[.event], ==, literal[null]]] begin[{]
return[literal[null]]
else begin[{]
None
end[}]
if[binary_operation[binary_operation[member[.events], ==, literal[null]], ||, call[events.isEmpty, parameter[]]]] begin[{]
return[member[.event]]
else begin[{]
None
end[}]
local_variable[type[String], group]
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=group, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getGroup, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operator=&&), operandr=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=group, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operandr=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getGroup, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None)], member=equals, postfix_operators=[], prefix_operators=['!'], qualifier=group, selectors=[], type_arguments=None), operator=&&), operator=||), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Events to be merged may be only belong to one and the same group!")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalStateException, sub_type=None)), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=events, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=e)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=TimelineEvent, sub_type=None))), label=None)
local_variable[type[TreeSet], orderedEvents]
call[orderedEvents.add, parameter[member[.event]]]
call[orderedEvents.addAll, parameter[member[.events]]]
local_variable[type[Date], endDate]
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=endDate, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getEndDate, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operator=&&), else_statement=IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=endDate, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getEndDate, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operator=&&), operandr=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getEndDate, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None)], member=before, postfix_operators=[], prefix_operators=[], qualifier=endDate, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=endDate, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=getEndDate, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None)), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=endDate, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=getEndDate, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None)), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=orderedEvents, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=e)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=TimelineEvent, sub_type=None))), label=None)
local_variable[type[TimelineEvent], mergedEvent]
call[.deleteAll, parameter[member[.events], member[.timelineUpdater]]]
call[.update, parameter[member[.mergedEvent], member[.timelineUpdater]]]
return[member[.mergedEvent]]
end[}]
END[}] | Keyword[public] identifier[TimelineEvent] identifier[merge] operator[SEP] identifier[TimelineEvent] identifier[event] , identifier[Collection] operator[<] identifier[TimelineEvent] operator[>] identifier[events] , identifier[TimelineUpdater] identifier[timelineUpdater] operator[SEP] {
Keyword[if] operator[SEP] identifier[event] operator[==] Other[null] operator[SEP] {
Keyword[return] Other[null] operator[SEP]
}
Keyword[if] operator[SEP] identifier[events] operator[==] Other[null] operator[||] identifier[events] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] {
Keyword[return] identifier[event] operator[SEP]
}
identifier[String] identifier[group] operator[=] identifier[event] operator[SEP] identifier[getGroup] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[TimelineEvent] identifier[e] operator[:] identifier[events] operator[SEP] {
Keyword[if] operator[SEP] operator[SEP] identifier[group] operator[==] Other[null] operator[&&] identifier[e] operator[SEP] identifier[getGroup] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] operator[||] operator[SEP] identifier[group] operator[!=] Other[null] operator[&&] operator[!] identifier[group] operator[SEP] identifier[equals] operator[SEP] identifier[e] operator[SEP] identifier[getGroup] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
}
identifier[TreeSet] operator[<] identifier[TimelineEvent] operator[>] identifier[orderedEvents] operator[=] Keyword[new] identifier[TreeSet] operator[<] identifier[TimelineEvent] operator[>] operator[SEP] Keyword[new] identifier[TimelineEventComparator] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[orderedEvents] operator[SEP] identifier[add] operator[SEP] identifier[event] operator[SEP] operator[SEP] identifier[orderedEvents] operator[SEP] identifier[addAll] operator[SEP] identifier[events] operator[SEP] operator[SEP] identifier[Date] identifier[endDate] operator[=] Other[null] operator[SEP] Keyword[for] operator[SEP] identifier[TimelineEvent] identifier[e] operator[:] identifier[orderedEvents] operator[SEP] {
Keyword[if] operator[SEP] identifier[endDate] operator[==] Other[null] operator[&&] identifier[e] operator[SEP] identifier[getEndDate] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] {
identifier[endDate] operator[=] identifier[e] operator[SEP] identifier[getEndDate] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[endDate] operator[!=] Other[null] operator[&&] identifier[e] operator[SEP] identifier[getEndDate] operator[SEP] operator[SEP] operator[!=] Other[null] operator[&&] identifier[endDate] operator[SEP] identifier[before] operator[SEP] identifier[e] operator[SEP] identifier[getEndDate] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
identifier[endDate] operator[=] identifier[e] operator[SEP] identifier[getEndDate] operator[SEP] operator[SEP] operator[SEP]
}
}
identifier[TimelineEvent] identifier[mergedEvent] operator[=] Keyword[new] identifier[TimelineEvent] operator[SEP] identifier[event] operator[SEP] identifier[getData] operator[SEP] operator[SEP] , identifier[orderedEvents] operator[SEP] identifier[first] operator[SEP] operator[SEP] operator[SEP] identifier[getStartDate] operator[SEP] operator[SEP] , identifier[endDate] , identifier[event] operator[SEP] identifier[isEditable] operator[SEP] operator[SEP] , identifier[event] operator[SEP] identifier[getGroup] operator[SEP] operator[SEP] , identifier[event] operator[SEP] identifier[getStyleClass] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[deleteAll] operator[SEP] identifier[events] , identifier[timelineUpdater] operator[SEP] operator[SEP] identifier[update] operator[SEP] identifier[mergedEvent] , identifier[timelineUpdater] operator[SEP] operator[SEP] Keyword[return] identifier[mergedEvent] operator[SEP]
}
|
public static GeometryValidationState validate(Geometry geometry) {
validationContext.clear();
if (Geometry.LINE_STRING.equals(geometry.getGeometryType())) {
IndexedLineString lineString = helper.createLineString(geometry);
validateLineString(lineString);
} else if (Geometry.LINEAR_RING.equals(geometry.getGeometryType())) {
IndexedLinearRing ring = helper.createLinearRing(geometry);
validateLinearRing(ring);
} else if (Geometry.POLYGON.equals(geometry.getGeometryType())) {
IndexedPolygon polygon = helper.createPolygon(geometry);
validatePolygon(polygon);
} else if (Geometry.MULTI_LINE_STRING.equals(geometry.getGeometryType())) {
IndexedMultiLineString multiLineString = helper.createMultiLineString(geometry);
validateMultiLineString(multiLineString);
} else if (Geometry.MULTI_POLYGON.equals(geometry.getGeometryType())) {
IndexedMultiPolygon multiPolygon = helper.createMultiPolygon(geometry);
validateMultiPolygon(multiPolygon);
}
return validationContext.getState();
} | class class_name[name] begin[{]
method[validate, return_type[type[GeometryValidationState]], modifier[public static], parameter[geometry]] begin[{]
call[validationContext.clear, parameter[]]
if[call[Geometry.LINE_STRING.equals, parameter[call[geometry.getGeometryType, parameter[]]]]] begin[{]
local_variable[type[IndexedLineString], lineString]
call[.validateLineString, parameter[member[.lineString]]]
else begin[{]
if[call[Geometry.LINEAR_RING.equals, parameter[call[geometry.getGeometryType, parameter[]]]]] begin[{]
local_variable[type[IndexedLinearRing], ring]
call[.validateLinearRing, parameter[member[.ring]]]
else begin[{]
if[call[Geometry.POLYGON.equals, parameter[call[geometry.getGeometryType, parameter[]]]]] begin[{]
local_variable[type[IndexedPolygon], polygon]
call[.validatePolygon, parameter[member[.polygon]]]
else begin[{]
if[call[Geometry.MULTI_LINE_STRING.equals, parameter[call[geometry.getGeometryType, parameter[]]]]] begin[{]
local_variable[type[IndexedMultiLineString], multiLineString]
call[.validateMultiLineString, parameter[member[.multiLineString]]]
else begin[{]
if[call[Geometry.MULTI_POLYGON.equals, parameter[call[geometry.getGeometryType, parameter[]]]]] begin[{]
local_variable[type[IndexedMultiPolygon], multiPolygon]
call[.validateMultiPolygon, parameter[member[.multiPolygon]]]
else begin[{]
None
end[}]
end[}]
end[}]
end[}]
end[}]
return[call[validationContext.getState, parameter[]]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[GeometryValidationState] identifier[validate] operator[SEP] identifier[Geometry] identifier[geometry] operator[SEP] {
identifier[validationContext] operator[SEP] identifier[clear] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[Geometry] operator[SEP] identifier[LINE_STRING] operator[SEP] identifier[equals] operator[SEP] identifier[geometry] operator[SEP] identifier[getGeometryType] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
identifier[IndexedLineString] identifier[lineString] operator[=] identifier[helper] operator[SEP] identifier[createLineString] operator[SEP] identifier[geometry] operator[SEP] operator[SEP] identifier[validateLineString] operator[SEP] identifier[lineString] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[Geometry] operator[SEP] identifier[LINEAR_RING] operator[SEP] identifier[equals] operator[SEP] identifier[geometry] operator[SEP] identifier[getGeometryType] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
identifier[IndexedLinearRing] identifier[ring] operator[=] identifier[helper] operator[SEP] identifier[createLinearRing] operator[SEP] identifier[geometry] operator[SEP] operator[SEP] identifier[validateLinearRing] operator[SEP] identifier[ring] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[Geometry] operator[SEP] identifier[POLYGON] operator[SEP] identifier[equals] operator[SEP] identifier[geometry] operator[SEP] identifier[getGeometryType] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
identifier[IndexedPolygon] identifier[polygon] operator[=] identifier[helper] operator[SEP] identifier[createPolygon] operator[SEP] identifier[geometry] operator[SEP] operator[SEP] identifier[validatePolygon] operator[SEP] identifier[polygon] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[Geometry] operator[SEP] identifier[MULTI_LINE_STRING] operator[SEP] identifier[equals] operator[SEP] identifier[geometry] operator[SEP] identifier[getGeometryType] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
identifier[IndexedMultiLineString] identifier[multiLineString] operator[=] identifier[helper] operator[SEP] identifier[createMultiLineString] operator[SEP] identifier[geometry] operator[SEP] operator[SEP] identifier[validateMultiLineString] operator[SEP] identifier[multiLineString] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[Geometry] operator[SEP] identifier[MULTI_POLYGON] operator[SEP] identifier[equals] operator[SEP] identifier[geometry] operator[SEP] identifier[getGeometryType] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
identifier[IndexedMultiPolygon] identifier[multiPolygon] operator[=] identifier[helper] operator[SEP] identifier[createMultiPolygon] operator[SEP] identifier[geometry] operator[SEP] operator[SEP] identifier[validateMultiPolygon] operator[SEP] identifier[multiPolygon] operator[SEP] operator[SEP]
}
Keyword[return] identifier[validationContext] operator[SEP] identifier[getState] operator[SEP] operator[SEP] operator[SEP]
}
|
@Override
public ListUniqueProblemsResult listUniqueProblems(ListUniqueProblemsRequest request) {
request = beforeClientExecution(request);
return executeListUniqueProblems(request);
} | class class_name[name] begin[{]
method[listUniqueProblems, return_type[type[ListUniqueProblemsResult]], modifier[public], parameter[request]] begin[{]
assign[member[.request], call[.beforeClientExecution, parameter[member[.request]]]]
return[call[.executeListUniqueProblems, parameter[member[.request]]]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] identifier[ListUniqueProblemsResult] identifier[listUniqueProblems] operator[SEP] identifier[ListUniqueProblemsRequest] identifier[request] operator[SEP] {
identifier[request] operator[=] identifier[beforeClientExecution] operator[SEP] identifier[request] operator[SEP] operator[SEP] Keyword[return] identifier[executeListUniqueProblems] operator[SEP] identifier[request] operator[SEP] operator[SEP]
}
|
public static CommerceUserSegmentEntry fetchByG_K(long groupId, String key,
boolean retrieveFromCache) {
return getPersistence().fetchByG_K(groupId, key, retrieveFromCache);
} | class class_name[name] begin[{]
method[fetchByG_K, return_type[type[CommerceUserSegmentEntry]], modifier[public static], parameter[groupId, key, retrieveFromCache]] begin[{]
return[call[.getPersistence, parameter[]]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[CommerceUserSegmentEntry] identifier[fetchByG_K] operator[SEP] Keyword[long] identifier[groupId] , identifier[String] identifier[key] , Keyword[boolean] identifier[retrieveFromCache] operator[SEP] {
Keyword[return] identifier[getPersistence] operator[SEP] operator[SEP] operator[SEP] identifier[fetchByG_K] operator[SEP] identifier[groupId] , identifier[key] , identifier[retrieveFromCache] operator[SEP] operator[SEP]
}
|
@FFDCIgnore(value = { NoSuchMethodException.class, NumberFormatException.class, Exception.class })
// Liberty Change for CXF End
@SuppressWarnings("unchecked")
public static <T> T handleParameter(String value,
boolean decoded,
Class<T> pClass,
Type genericType,
Annotation[] paramAnns,
ParameterType pType,
Message message) {
if (value == null) {
return null;
}
//fix new Date("") throw exception defect
if (value.isEmpty() && genericType == Date.class) {
return null;
}
if (pType == ParameterType.PATH) {
if (PathSegment.class.isAssignableFrom(pClass)) {
return pClass.cast(new PathSegmentImpl(value, decoded));
} else if (!MessageUtils.isTrue(
message.getContextualProperty(IGNORE_MATRIX_PARAMETERS))) {
value = new PathSegmentImpl(value, false).getPath();
}
}
value = decodeValue(value, decoded, pType);
Object result = null;
try {
result = createFromParameterHandler(value, pClass, genericType, paramAnns, message);
} catch (IllegalArgumentException nfe) {
throw createParamConversionException(pType, nfe);
}
if (result != null) {
T theResult = null;
if (pClass.isPrimitive()) {
theResult = (T) result;
} else {
theResult = pClass.cast(result);
}
return theResult;
}
if (Number.class.isAssignableFrom(pClass) && "".equals(value)) {
//pass empty string to boxed number type will result in 404
return null;
}
if (Boolean.class == pClass) {
// allow == checks for Boolean object
pClass = (Class<T>) Boolean.TYPE;
}
if (pClass.isPrimitive()) {
try {
@SuppressWarnings("unchecked")
T ret = (T) PrimitiveUtils.read(value, pClass);
// cannot us pClass.cast as the pClass is something like
// Boolean.TYPE (representing the boolean primitive) and
// the object is a Boolean object
return ret;
} catch (NumberFormatException nfe) {
throw createParamConversionException(pType, nfe);
}
}
boolean adapterHasToBeUsed = false;
Class<?> cls = pClass;
Class<?> valueType = JAXBUtils.getValueTypeFromAdapter(pClass, pClass, paramAnns);
if (valueType != cls) {
cls = valueType;
adapterHasToBeUsed = true;
}
if (pClass == String.class && !adapterHasToBeUsed) {
return pClass.cast(value);
}
// check constructors accepting a single String value
try {
Constructor<?> c = cls.getConstructor(new Class<?>[] { String.class });
result = c.newInstance(new Object[] { value });
} catch (NoSuchMethodException ex) {
// try valueOf
} catch (WebApplicationException ex) {
throw ex;
} catch (Exception ex) {
Throwable t = getOrThrowActualException(ex);
Tr.warning(tc, new org.apache.cxf.common.i18n.Message("CLASS_CONSTRUCTOR_FAILURE",
BUNDLE,
pClass.getName()).toString());
Response r = JAXRSUtils.toResponse(HttpUtils.getParameterFailureStatus(pType));
throw ExceptionUtils.toHttpException(t, r);
}
if (result == null) {
// check for valueOf(String) static methods
String[] methodNames = cls.isEnum()
? new String[] { "fromString", "fromValue", "valueOf" }
: new String[] { "valueOf", "fromString" };
result = evaluateFactoryMethods(value, pType, result, cls, methodNames);
}
if (adapterHasToBeUsed) {
// as the last resort, try XmlJavaTypeAdapters
Object valueToReplace = result != null ? result : value;
try {
result = JAXBUtils.convertWithAdapter(valueToReplace, pClass, paramAnns);
} catch (Throwable ex) {
result = null;
}
}
if (result == null) {
reportServerError("WRONG_PARAMETER_TYPE", pClass.getName());
}
return pClass.cast(result);
} | class class_name[name] begin[{]
method[handleParameter, return_type[type[T]], modifier[public static], parameter[value, decoded, pClass, genericType, paramAnns, pType, message]] begin[{]
if[binary_operation[member[.value], ==, literal[null]]] begin[{]
return[literal[null]]
else begin[{]
None
end[}]
if[binary_operation[call[value.isEmpty, parameter[]], &&, binary_operation[member[.genericType], ==, ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Date, sub_type=None))]]] begin[{]
return[literal[null]]
else begin[{]
None
end[}]
if[binary_operation[member[.pType], ==, member[ParameterType.PATH]]] begin[{]
if[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[MemberReference(member=pClass, 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=PathSegment, sub_type=None))] begin[{]
return[call[pClass.cast, parameter[ClassCreator(arguments=[MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=decoded, 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=PathSegmentImpl, sub_type=None))]]]
else begin[{]
if[call[MessageUtils.isTrue, parameter[call[message.getContextualProperty, parameter[member[.IGNORE_MATRIX_PARAMETERS]]]]]] begin[{]
assign[member[.value], ClassCreator(arguments=[MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[], member=getPath, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=PathSegmentImpl, sub_type=None))]
else begin[{]
None
end[}]
end[}]
else begin[{]
None
end[}]
assign[member[.value], call[.decodeValue, parameter[member[.value], member[.decoded], member[.pType]]]]
local_variable[type[Object], result]
TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=pClass, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=genericType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=paramAnns, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=message, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=createFromParameterHandler, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=MethodInvocation(arguments=[MemberReference(member=pType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=nfe, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=createParamConversionException, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=nfe, types=['IllegalArgumentException']))], finally_block=None, label=None, resources=None)
if[binary_operation[member[.result], !=, literal[null]]] begin[{]
local_variable[type[T], theResult]
if[call[pClass.isPrimitive, parameter[]]] begin[{]
assign[member[.theResult], Cast(expression=MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None))]
else begin[{]
assign[member[.theResult], call[pClass.cast, parameter[member[.result]]]]
end[}]
return[member[.theResult]]
else begin[{]
None
end[}]
if[binary_operation[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[MemberReference(member=pClass, 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=Number, sub_type=None)), &&, literal[""]]] begin[{]
return[literal[null]]
else begin[{]
None
end[}]
if[binary_operation[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Boolean, sub_type=None)), ==, member[.pClass]]] begin[{]
assign[member[.pClass], Cast(expression=MemberReference(member=TYPE, postfix_operators=[], prefix_operators=[], qualifier=Boolean, selectors=[]), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None))], dimensions=[], name=Class, sub_type=None))]
else begin[{]
None
end[}]
if[call[pClass.isPrimitive, parameter[]]] begin[{]
TryStatement(block=[LocalVariableDeclaration(annotations=[Annotation(element=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="unchecked"), name=SuppressWarnings)], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MethodInvocation(arguments=[MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=pClass, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=read, postfix_operators=[], prefix_operators=[], qualifier=PrimitiveUtils, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None)), name=ret)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None)), ReturnStatement(expression=MemberReference(member=ret, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=MethodInvocation(arguments=[MemberReference(member=pType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=nfe, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=createParamConversionException, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=nfe, types=['NumberFormatException']))], finally_block=None, label=None, resources=None)
else begin[{]
None
end[}]
local_variable[type[boolean], adapterHasToBeUsed]
local_variable[type[Class], cls]
local_variable[type[Class], valueType]
if[binary_operation[member[.valueType], !=, member[.cls]]] begin[{]
assign[member[.cls], member[.valueType]]
assign[member[.adapterHasToBeUsed], literal[true]]
else begin[{]
None
end[}]
if[binary_operation[binary_operation[member[.pClass], ==, ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=String, sub_type=None))], &&, member[.adapterHasToBeUsed]]] begin[{]
return[call[pClass.cast, parameter[member[.value]]]]
else begin[{]
None
end[}]
TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=String, sub_type=None))]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=?, type=None)], dimensions=None, name=Class, sub_type=None))], member=getConstructor, postfix_operators=[], prefix_operators=[], qualifier=cls, selectors=[], type_arguments=None), name=c)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=?, type=None)], dimensions=[], name=Constructor, sub_type=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Object, sub_type=None))], member=newInstance, postfix_operators=[], prefix_operators=[], qualifier=c, selectors=[], type_arguments=None)), label=None)], catches=[CatchClause(block=[], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ex, types=['NoSuchMethodException'])), CatchClause(block=[ThrowStatement(expression=MemberReference(member=ex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ex, types=['WebApplicationException'])), CatchClause(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=ex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getOrThrowActualException, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=t)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Throwable, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=tc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="CLASS_CONSTRUCTOR_FAILURE"), MemberReference(member=BUNDLE, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=pClass, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[], member=toString, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=org, sub_type=ReferenceType(arguments=None, dimensions=None, name=apache, sub_type=ReferenceType(arguments=None, dimensions=None, name=cxf, sub_type=ReferenceType(arguments=None, dimensions=None, name=common, sub_type=ReferenceType(arguments=None, dimensions=None, name=i18n, sub_type=ReferenceType(arguments=None, dimensions=None, name=Message, sub_type=None)))))))], member=warning, postfix_operators=[], prefix_operators=[], qualifier=Tr, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=pType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getParameterFailureStatus, postfix_operators=[], prefix_operators=[], qualifier=HttpUtils, selectors=[], type_arguments=None)], member=toResponse, postfix_operators=[], prefix_operators=[], qualifier=JAXRSUtils, selectors=[], type_arguments=None), name=r)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Response, sub_type=None)), ThrowStatement(expression=MethodInvocation(arguments=[MemberReference(member=t, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=r, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=toHttpException, postfix_operators=[], prefix_operators=[], qualifier=ExceptionUtils, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ex, types=['Exception']))], finally_block=None, label=None, resources=None)
if[binary_operation[member[.result], ==, literal[null]]] begin[{]
local_variable[type[String], methodNames]
assign[member[.result], call[.evaluateFactoryMethods, parameter[member[.value], member[.pType], member[.result], member[.cls], member[.methodNames]]]]
else begin[{]
None
end[}]
if[member[.adapterHasToBeUsed]] begin[{]
local_variable[type[Object], valueToReplace]
TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=valueToReplace, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=pClass, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=paramAnns, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=convertWithAdapter, postfix_operators=[], prefix_operators=[], qualifier=JAXBUtils, selectors=[], type_arguments=None)), label=None)], catches=[CatchClause(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ex, types=['Throwable']))], finally_block=None, label=None, resources=None)
else begin[{]
None
end[}]
if[binary_operation[member[.result], ==, literal[null]]] begin[{]
call[.reportServerError, parameter[literal["WRONG_PARAMETER_TYPE"], call[pClass.getName, parameter[]]]]
else begin[{]
None
end[}]
return[call[pClass.cast, parameter[member[.result]]]]
end[}]
END[}] | annotation[@] identifier[FFDCIgnore] operator[SEP] identifier[value] operator[=] {
identifier[NoSuchMethodException] operator[SEP] Keyword[class] , identifier[NumberFormatException] operator[SEP] Keyword[class] , identifier[Exception] operator[SEP] Keyword[class]
} operator[SEP] annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] Keyword[public] Keyword[static] operator[<] identifier[T] operator[>] identifier[T] identifier[handleParameter] operator[SEP] identifier[String] identifier[value] , Keyword[boolean] identifier[decoded] , identifier[Class] operator[<] identifier[T] operator[>] identifier[pClass] , identifier[Type] identifier[genericType] , identifier[Annotation] operator[SEP] operator[SEP] identifier[paramAnns] , identifier[ParameterType] identifier[pType] , identifier[Message] identifier[message] operator[SEP] {
Keyword[if] operator[SEP] identifier[value] operator[==] Other[null] operator[SEP] {
Keyword[return] Other[null] operator[SEP]
}
Keyword[if] operator[SEP] identifier[value] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[&&] identifier[genericType] operator[==] identifier[Date] operator[SEP] Keyword[class] operator[SEP] {
Keyword[return] Other[null] operator[SEP]
}
Keyword[if] operator[SEP] identifier[pType] operator[==] identifier[ParameterType] operator[SEP] identifier[PATH] operator[SEP] {
Keyword[if] operator[SEP] identifier[PathSegment] operator[SEP] Keyword[class] operator[SEP] identifier[isAssignableFrom] operator[SEP] identifier[pClass] operator[SEP] operator[SEP] {
Keyword[return] identifier[pClass] operator[SEP] identifier[cast] operator[SEP] Keyword[new] identifier[PathSegmentImpl] operator[SEP] identifier[value] , identifier[decoded] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] operator[!] identifier[MessageUtils] operator[SEP] identifier[isTrue] operator[SEP] identifier[message] operator[SEP] identifier[getContextualProperty] operator[SEP] identifier[IGNORE_MATRIX_PARAMETERS] operator[SEP] operator[SEP] operator[SEP] {
identifier[value] operator[=] Keyword[new] identifier[PathSegmentImpl] operator[SEP] identifier[value] , literal[boolean] operator[SEP] operator[SEP] identifier[getPath] operator[SEP] operator[SEP] operator[SEP]
}
}
identifier[value] operator[=] identifier[decodeValue] operator[SEP] identifier[value] , identifier[decoded] , identifier[pType] operator[SEP] operator[SEP] identifier[Object] identifier[result] operator[=] Other[null] operator[SEP] Keyword[try] {
identifier[result] operator[=] identifier[createFromParameterHandler] operator[SEP] identifier[value] , identifier[pClass] , identifier[genericType] , identifier[paramAnns] , identifier[message] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[IllegalArgumentException] identifier[nfe] operator[SEP] {
Keyword[throw] identifier[createParamConversionException] operator[SEP] identifier[pType] , identifier[nfe] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[result] operator[!=] Other[null] operator[SEP] {
identifier[T] identifier[theResult] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[pClass] operator[SEP] identifier[isPrimitive] operator[SEP] operator[SEP] operator[SEP] {
identifier[theResult] operator[=] operator[SEP] identifier[T] operator[SEP] identifier[result] operator[SEP]
}
Keyword[else] {
identifier[theResult] operator[=] identifier[pClass] operator[SEP] identifier[cast] operator[SEP] identifier[result] operator[SEP] operator[SEP]
}
Keyword[return] identifier[theResult] operator[SEP]
}
Keyword[if] operator[SEP] identifier[Number] operator[SEP] Keyword[class] operator[SEP] identifier[isAssignableFrom] operator[SEP] identifier[pClass] operator[SEP] operator[&&] literal[String] operator[SEP] identifier[equals] operator[SEP] identifier[value] operator[SEP] operator[SEP] {
Keyword[return] Other[null] operator[SEP]
}
Keyword[if] operator[SEP] identifier[Boolean] operator[SEP] Keyword[class] operator[==] identifier[pClass] operator[SEP] {
identifier[pClass] operator[=] operator[SEP] identifier[Class] operator[<] identifier[T] operator[>] operator[SEP] identifier[Boolean] operator[SEP] identifier[TYPE] operator[SEP]
}
Keyword[if] operator[SEP] identifier[pClass] operator[SEP] identifier[isPrimitive] operator[SEP] operator[SEP] operator[SEP] {
Keyword[try] {
annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] identifier[T] identifier[ret] operator[=] operator[SEP] identifier[T] operator[SEP] identifier[PrimitiveUtils] operator[SEP] identifier[read] operator[SEP] identifier[value] , identifier[pClass] operator[SEP] operator[SEP] Keyword[return] identifier[ret] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[NumberFormatException] identifier[nfe] operator[SEP] {
Keyword[throw] identifier[createParamConversionException] operator[SEP] identifier[pType] , identifier[nfe] operator[SEP] operator[SEP]
}
}
Keyword[boolean] identifier[adapterHasToBeUsed] operator[=] literal[boolean] operator[SEP] identifier[Class] operator[<] operator[?] operator[>] identifier[cls] operator[=] identifier[pClass] operator[SEP] identifier[Class] operator[<] operator[?] operator[>] identifier[valueType] operator[=] identifier[JAXBUtils] operator[SEP] identifier[getValueTypeFromAdapter] operator[SEP] identifier[pClass] , identifier[pClass] , identifier[paramAnns] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[valueType] operator[!=] identifier[cls] operator[SEP] {
identifier[cls] operator[=] identifier[valueType] operator[SEP] identifier[adapterHasToBeUsed] operator[=] literal[boolean] operator[SEP]
}
Keyword[if] operator[SEP] identifier[pClass] operator[==] identifier[String] operator[SEP] Keyword[class] operator[&&] operator[!] identifier[adapterHasToBeUsed] operator[SEP] {
Keyword[return] identifier[pClass] operator[SEP] identifier[cast] operator[SEP] identifier[value] operator[SEP] operator[SEP]
}
Keyword[try] {
identifier[Constructor] operator[<] operator[?] operator[>] identifier[c] operator[=] identifier[cls] operator[SEP] identifier[getConstructor] operator[SEP] Keyword[new] identifier[Class] operator[<] operator[?] operator[>] operator[SEP] operator[SEP] {
identifier[String] operator[SEP] Keyword[class]
} operator[SEP] operator[SEP] identifier[result] operator[=] identifier[c] operator[SEP] identifier[newInstance] operator[SEP] Keyword[new] identifier[Object] operator[SEP] operator[SEP] {
identifier[value]
} operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[NoSuchMethodException] identifier[ex] operator[SEP] {
}
Keyword[catch] operator[SEP] identifier[WebApplicationException] identifier[ex] operator[SEP] {
Keyword[throw] identifier[ex] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Exception] identifier[ex] operator[SEP] {
identifier[Throwable] identifier[t] operator[=] identifier[getOrThrowActualException] operator[SEP] identifier[ex] operator[SEP] operator[SEP] identifier[Tr] operator[SEP] identifier[warning] operator[SEP] identifier[tc] , Keyword[new] identifier[org] operator[SEP] identifier[apache] operator[SEP] identifier[cxf] operator[SEP] identifier[common] operator[SEP] identifier[i18n] operator[SEP] identifier[Message] operator[SEP] literal[String] , identifier[BUNDLE] , identifier[pClass] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[Response] identifier[r] operator[=] identifier[JAXRSUtils] operator[SEP] identifier[toResponse] operator[SEP] identifier[HttpUtils] operator[SEP] identifier[getParameterFailureStatus] operator[SEP] identifier[pType] operator[SEP] operator[SEP] operator[SEP] Keyword[throw] identifier[ExceptionUtils] operator[SEP] identifier[toHttpException] operator[SEP] identifier[t] , identifier[r] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[result] operator[==] Other[null] operator[SEP] {
identifier[String] operator[SEP] operator[SEP] identifier[methodNames] operator[=] identifier[cls] operator[SEP] identifier[isEnum] operator[SEP] operator[SEP] operator[?] Keyword[new] identifier[String] operator[SEP] operator[SEP] {
literal[String] , literal[String] , literal[String]
} operator[:] Keyword[new] identifier[String] operator[SEP] operator[SEP] {
literal[String] , literal[String]
} operator[SEP] identifier[result] operator[=] identifier[evaluateFactoryMethods] operator[SEP] identifier[value] , identifier[pType] , identifier[result] , identifier[cls] , identifier[methodNames] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[adapterHasToBeUsed] operator[SEP] {
identifier[Object] identifier[valueToReplace] operator[=] identifier[result] operator[!=] Other[null] operator[?] identifier[result] operator[:] identifier[value] operator[SEP] Keyword[try] {
identifier[result] operator[=] identifier[JAXBUtils] operator[SEP] identifier[convertWithAdapter] operator[SEP] identifier[valueToReplace] , identifier[pClass] , identifier[paramAnns] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Throwable] identifier[ex] operator[SEP] {
identifier[result] operator[=] Other[null] operator[SEP]
}
}
Keyword[if] operator[SEP] identifier[result] operator[==] Other[null] operator[SEP] {
identifier[reportServerError] operator[SEP] literal[String] , identifier[pClass] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] identifier[pClass] operator[SEP] identifier[cast] operator[SEP] identifier[result] operator[SEP] operator[SEP]
}
|
static Locale getLocale(PageContext pageContext, String name) {
Locale loc = null;
Object obj = Config.find(pageContext, name);
if (obj != null) {
if (obj instanceof Locale) {
loc = (Locale) obj;
} else {
loc = parseLocale((String) obj, null);
}
}
return loc;
} | class class_name[name] begin[{]
method[getLocale, return_type[type[Locale]], modifier[static], parameter[pageContext, name]] begin[{]
local_variable[type[Locale], loc]
local_variable[type[Object], obj]
if[binary_operation[member[.obj], !=, literal[null]]] begin[{]
if[binary_operation[member[.obj], instanceof, type[Locale]]] begin[{]
assign[member[.loc], Cast(expression=MemberReference(member=obj, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Locale, sub_type=None))]
else begin[{]
assign[member[.loc], call[.parseLocale, parameter[Cast(expression=MemberReference(member=obj, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), literal[null]]]]
end[}]
else begin[{]
None
end[}]
return[member[.loc]]
end[}]
END[}] | Keyword[static] identifier[Locale] identifier[getLocale] operator[SEP] identifier[PageContext] identifier[pageContext] , identifier[String] identifier[name] operator[SEP] {
identifier[Locale] identifier[loc] operator[=] Other[null] operator[SEP] identifier[Object] identifier[obj] operator[=] identifier[Config] operator[SEP] identifier[find] operator[SEP] identifier[pageContext] , identifier[name] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[obj] operator[!=] Other[null] operator[SEP] {
Keyword[if] operator[SEP] identifier[obj] Keyword[instanceof] identifier[Locale] operator[SEP] {
identifier[loc] operator[=] operator[SEP] identifier[Locale] operator[SEP] identifier[obj] operator[SEP]
}
Keyword[else] {
identifier[loc] operator[=] identifier[parseLocale] operator[SEP] operator[SEP] identifier[String] operator[SEP] identifier[obj] , Other[null] operator[SEP] operator[SEP]
}
}
Keyword[return] identifier[loc] operator[SEP]
}
|
private static List<MethodParameterDto> _getMethodParams(Method method) {
List<MethodParameterDto> result = new ArrayList<>();
Annotation[][] parameterAnnotations = method.getParameterAnnotations();
Class<?>[] parameterTypes = method.getParameterTypes();
for (int i = 0; i < parameterTypes.length; i++) {
Class<?> parameterType = parameterTypes[i];
Annotation[] annotations = parameterAnnotations[i];
if (annotations.length > 0) {
if (Context.class.isAssignableFrom(annotations[0].getClass())) {
continue;
}
MethodParameterDto param = new MethodParameterDto();
for (int j = 0; j < annotations.length; j++) {
Annotation annotation = annotations[j];
if (QueryParam.class.isAssignableFrom(annotation.getClass())) {
QueryParam queryParam = QueryParam.class.cast(annotation);
param.setName(queryParam.value());
param.setParamType("query");
} else if (FormParam.class.isAssignableFrom(annotation.getClass())) {
FormParam queryParam = FormParam.class.cast(annotation);
param.setName(queryParam.value());
param.setParamType("form");
} else if (PathParam.class.isAssignableFrom(annotation.getClass())) {
PathParam queryParam = PathParam.class.cast(annotation);
param.setName(queryParam.value());
param.setParamType("path");
} else if (DefaultValue.class.isAssignableFrom(annotation.getClass())) {
DefaultValue defaultValue = DefaultValue.class.cast(annotation);
param.setDefaultValue(defaultValue.value());
}
try {
if (BaseDto.class.isAssignableFrom(parameterType)) {
param.setSchema(BaseDto.class.cast(parameterType.newInstance()).createExample());
}
} catch (Exception ex) {
param.setSchema(parameterType);
}
String paramName = parameterType.getSimpleName().toLowerCase();
param.setDataType(paramName.toLowerCase().replaceAll("dto", ""));
}
result.add(param);
} else {
MethodParameterDto param = new MethodParameterDto();
String paramName = parameterType.getSimpleName().toLowerCase();
param.setDataType(paramName.toLowerCase().replaceAll("dto", ""));
param.setName("body");
param.setParamType("body");
try {
if (BaseDto.class.isAssignableFrom(parameterType)) {
param.setSchema(BaseDto.class.cast(parameterType.newInstance()).createExample());
}
} catch (Exception ex) {
param.setSchema(parameterType);
}
result.add(param);
} // end if-else
} // end for
return result;
} | class class_name[name] begin[{]
method[_getMethodParams, return_type[type[List]], modifier[private static], parameter[method]] begin[{]
local_variable[type[List], result]
local_variable[type[Annotation], parameterAnnotations]
local_variable[type[Class], parameterTypes]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=parameterTypes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), name=parameterType)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=?, type=None)], dimensions=[], name=Class, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=parameterAnnotations, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), name=annotations)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[None], name=Annotation, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=annotations, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>), else_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=MethodParameterDto, sub_type=None)), name=param)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=MethodParameterDto, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getSimpleName, postfix_operators=[], prefix_operators=[], qualifier=parameterType, selectors=[MethodInvocation(arguments=[], member=toLowerCase, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=paramName)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=toLowerCase, postfix_operators=[], prefix_operators=[], qualifier=paramName, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="dto"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="")], member=replaceAll, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=setDataType, postfix_operators=[], prefix_operators=[], qualifier=param, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="body")], member=setName, postfix_operators=[], prefix_operators=[], qualifier=param, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="body")], member=setParamType, postfix_operators=[], prefix_operators=[], qualifier=param, selectors=[], type_arguments=None), label=None), TryStatement(block=[IfStatement(condition=ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[MemberReference(member=parameterType, 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=BaseDto, sub_type=None)), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=newInstance, postfix_operators=[], prefix_operators=[], qualifier=parameterType, selectors=[], type_arguments=None)], member=cast, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=createExample, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=BaseDto, sub_type=None))], member=setSchema, postfix_operators=[], prefix_operators=[], qualifier=param, selectors=[], type_arguments=None), label=None)]))], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=parameterType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setSchema, postfix_operators=[], prefix_operators=[], qualifier=param, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ex, types=['Exception']))], finally_block=None, label=None, resources=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=param, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[MemberReference(member=annotations, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)), MethodInvocation(arguments=[], member=getClass, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)])], member=isAssignableFrom, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=Context, sub_type=None)), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ContinueStatement(goto=None, label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=MethodParameterDto, sub_type=None)), name=param)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=MethodParameterDto, sub_type=None)), ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=annotations, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), name=annotation)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Annotation, sub_type=None)), IfStatement(condition=ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getClass, postfix_operators=[], prefix_operators=[], qualifier=annotation, selectors=[], type_arguments=None)], member=isAssignableFrom, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=QueryParam, sub_type=None)), else_statement=IfStatement(condition=ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getClass, postfix_operators=[], prefix_operators=[], qualifier=annotation, selectors=[], type_arguments=None)], member=isAssignableFrom, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=FormParam, sub_type=None)), else_statement=IfStatement(condition=ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getClass, postfix_operators=[], prefix_operators=[], qualifier=annotation, selectors=[], type_arguments=None)], member=isAssignableFrom, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=PathParam, sub_type=None)), else_statement=IfStatement(condition=ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getClass, postfix_operators=[], prefix_operators=[], qualifier=annotation, selectors=[], type_arguments=None)], member=isAssignableFrom, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=DefaultValue, sub_type=None)), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[MemberReference(member=annotation, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=cast, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=DefaultValue, sub_type=None)), name=defaultValue)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=DefaultValue, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=value, postfix_operators=[], prefix_operators=[], qualifier=defaultValue, selectors=[], type_arguments=None)], member=setDefaultValue, postfix_operators=[], prefix_operators=[], qualifier=param, selectors=[], type_arguments=None), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[MemberReference(member=annotation, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=cast, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=PathParam, sub_type=None)), name=queryParam)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=PathParam, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=value, postfix_operators=[], prefix_operators=[], qualifier=queryParam, selectors=[], type_arguments=None)], member=setName, postfix_operators=[], prefix_operators=[], qualifier=param, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="path")], member=setParamType, postfix_operators=[], prefix_operators=[], qualifier=param, selectors=[], type_arguments=None), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[MemberReference(member=annotation, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=cast, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=FormParam, sub_type=None)), name=queryParam)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=FormParam, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=value, postfix_operators=[], prefix_operators=[], qualifier=queryParam, selectors=[], type_arguments=None)], member=setName, postfix_operators=[], prefix_operators=[], qualifier=param, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="form")], member=setParamType, postfix_operators=[], prefix_operators=[], qualifier=param, selectors=[], type_arguments=None), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[MemberReference(member=annotation, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=cast, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=QueryParam, sub_type=None)), name=queryParam)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=QueryParam, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=value, postfix_operators=[], prefix_operators=[], qualifier=queryParam, selectors=[], type_arguments=None)], member=setName, postfix_operators=[], prefix_operators=[], qualifier=param, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="query")], member=setParamType, postfix_operators=[], prefix_operators=[], qualifier=param, selectors=[], type_arguments=None), label=None)])), TryStatement(block=[IfStatement(condition=ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[MemberReference(member=parameterType, 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=BaseDto, sub_type=None)), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=newInstance, postfix_operators=[], prefix_operators=[], qualifier=parameterType, selectors=[], type_arguments=None)], member=cast, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=createExample, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=BaseDto, sub_type=None))], member=setSchema, postfix_operators=[], prefix_operators=[], qualifier=param, selectors=[], type_arguments=None), label=None)]))], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=parameterType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setSchema, postfix_operators=[], prefix_operators=[], qualifier=param, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ex, types=['Exception']))], finally_block=None, label=None, resources=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getSimpleName, postfix_operators=[], prefix_operators=[], qualifier=parameterType, selectors=[MethodInvocation(arguments=[], member=toLowerCase, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=paramName)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=toLowerCase, postfix_operators=[], prefix_operators=[], qualifier=paramName, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="dto"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="")], member=replaceAll, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=setDataType, postfix_operators=[], prefix_operators=[], qualifier=param, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=annotations, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=j)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=j, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=param, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=result, 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=parameterTypes, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
return[member[.result]]
end[}]
END[}] | Keyword[private] Keyword[static] identifier[List] operator[<] identifier[MethodParameterDto] operator[>] identifier[_getMethodParams] operator[SEP] identifier[Method] identifier[method] operator[SEP] {
identifier[List] operator[<] identifier[MethodParameterDto] operator[>] identifier[result] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[Annotation] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[parameterAnnotations] operator[=] identifier[method] operator[SEP] identifier[getParameterAnnotations] operator[SEP] operator[SEP] operator[SEP] identifier[Class] operator[<] operator[?] operator[>] operator[SEP] operator[SEP] identifier[parameterTypes] operator[=] identifier[method] operator[SEP] identifier[getParameterTypes] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[parameterTypes] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] {
identifier[Class] operator[<] operator[?] operator[>] identifier[parameterType] operator[=] identifier[parameterTypes] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[Annotation] operator[SEP] operator[SEP] identifier[annotations] operator[=] identifier[parameterAnnotations] operator[SEP] identifier[i] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[annotations] operator[SEP] identifier[length] operator[>] Other[0] operator[SEP] {
Keyword[if] operator[SEP] identifier[Context] operator[SEP] Keyword[class] operator[SEP] identifier[isAssignableFrom] operator[SEP] identifier[annotations] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
Keyword[continue] operator[SEP]
}
identifier[MethodParameterDto] identifier[param] operator[=] Keyword[new] identifier[MethodParameterDto] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[j] operator[=] Other[0] operator[SEP] identifier[j] operator[<] identifier[annotations] operator[SEP] identifier[length] operator[SEP] identifier[j] operator[++] operator[SEP] {
identifier[Annotation] identifier[annotation] operator[=] identifier[annotations] operator[SEP] identifier[j] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[QueryParam] operator[SEP] Keyword[class] operator[SEP] identifier[isAssignableFrom] operator[SEP] identifier[annotation] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
identifier[QueryParam] identifier[queryParam] operator[=] identifier[QueryParam] operator[SEP] Keyword[class] operator[SEP] identifier[cast] operator[SEP] identifier[annotation] operator[SEP] operator[SEP] identifier[param] operator[SEP] identifier[setName] operator[SEP] identifier[queryParam] operator[SEP] identifier[value] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[param] operator[SEP] identifier[setParamType] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[FormParam] operator[SEP] Keyword[class] operator[SEP] identifier[isAssignableFrom] operator[SEP] identifier[annotation] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
identifier[FormParam] identifier[queryParam] operator[=] identifier[FormParam] operator[SEP] Keyword[class] operator[SEP] identifier[cast] operator[SEP] identifier[annotation] operator[SEP] operator[SEP] identifier[param] operator[SEP] identifier[setName] operator[SEP] identifier[queryParam] operator[SEP] identifier[value] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[param] operator[SEP] identifier[setParamType] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[PathParam] operator[SEP] Keyword[class] operator[SEP] identifier[isAssignableFrom] operator[SEP] identifier[annotation] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
identifier[PathParam] identifier[queryParam] operator[=] identifier[PathParam] operator[SEP] Keyword[class] operator[SEP] identifier[cast] operator[SEP] identifier[annotation] operator[SEP] operator[SEP] identifier[param] operator[SEP] identifier[setName] operator[SEP] identifier[queryParam] operator[SEP] identifier[value] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[param] operator[SEP] identifier[setParamType] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[DefaultValue] operator[SEP] Keyword[class] operator[SEP] identifier[isAssignableFrom] operator[SEP] identifier[annotation] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
identifier[DefaultValue] identifier[defaultValue] operator[=] identifier[DefaultValue] operator[SEP] Keyword[class] operator[SEP] identifier[cast] operator[SEP] identifier[annotation] operator[SEP] operator[SEP] identifier[param] operator[SEP] identifier[setDefaultValue] operator[SEP] identifier[defaultValue] operator[SEP] identifier[value] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[try] {
Keyword[if] operator[SEP] identifier[BaseDto] operator[SEP] Keyword[class] operator[SEP] identifier[isAssignableFrom] operator[SEP] identifier[parameterType] operator[SEP] operator[SEP] {
identifier[param] operator[SEP] identifier[setSchema] operator[SEP] identifier[BaseDto] operator[SEP] Keyword[class] operator[SEP] identifier[cast] operator[SEP] identifier[parameterType] operator[SEP] identifier[newInstance] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[createExample] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[catch] operator[SEP] identifier[Exception] identifier[ex] operator[SEP] {
identifier[param] operator[SEP] identifier[setSchema] operator[SEP] identifier[parameterType] operator[SEP] operator[SEP]
}
identifier[String] identifier[paramName] operator[=] identifier[parameterType] operator[SEP] identifier[getSimpleName] operator[SEP] operator[SEP] operator[SEP] identifier[toLowerCase] operator[SEP] operator[SEP] operator[SEP] identifier[param] operator[SEP] identifier[setDataType] operator[SEP] identifier[paramName] operator[SEP] identifier[toLowerCase] operator[SEP] operator[SEP] operator[SEP] identifier[replaceAll] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] operator[SEP]
}
identifier[result] operator[SEP] identifier[add] operator[SEP] identifier[param] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[MethodParameterDto] identifier[param] operator[=] Keyword[new] identifier[MethodParameterDto] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[paramName] operator[=] identifier[parameterType] operator[SEP] identifier[getSimpleName] operator[SEP] operator[SEP] operator[SEP] identifier[toLowerCase] operator[SEP] operator[SEP] operator[SEP] identifier[param] operator[SEP] identifier[setDataType] operator[SEP] identifier[paramName] operator[SEP] identifier[toLowerCase] operator[SEP] operator[SEP] operator[SEP] identifier[replaceAll] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[param] operator[SEP] identifier[setName] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[param] operator[SEP] identifier[setParamType] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[try] {
Keyword[if] operator[SEP] identifier[BaseDto] operator[SEP] Keyword[class] operator[SEP] identifier[isAssignableFrom] operator[SEP] identifier[parameterType] operator[SEP] operator[SEP] {
identifier[param] operator[SEP] identifier[setSchema] operator[SEP] identifier[BaseDto] operator[SEP] Keyword[class] operator[SEP] identifier[cast] operator[SEP] identifier[parameterType] operator[SEP] identifier[newInstance] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[createExample] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[catch] operator[SEP] identifier[Exception] identifier[ex] operator[SEP] {
identifier[param] operator[SEP] identifier[setSchema] operator[SEP] identifier[parameterType] operator[SEP] operator[SEP]
}
identifier[result] operator[SEP] identifier[add] operator[SEP] identifier[param] operator[SEP] operator[SEP]
}
}
Keyword[return] identifier[result] operator[SEP]
}
|
public V getValue(int index) {
int entryPosition = getIntValue(POSITIONS_ARRAY_OFFSET + index * OIntegerSerializer.INT_SIZE);
// skip hash code
entryPosition += OLongSerializer.LONG_SIZE;
if (encryption == null) {
// skip key
entryPosition += getObjectSizeInDirectMemory(keySerializer, entryPosition);
} else {
final int encryptedLength = getIntValue(entryPosition);
entryPosition += encryptedLength + OIntegerSerializer.INT_SIZE;
}
return deserializeFromDirectMemory(valueSerializer, entryPosition);
} | class class_name[name] begin[{]
method[getValue, return_type[type[V]], modifier[public], parameter[index]] begin[{]
local_variable[type[int], entryPosition]
assign[member[.entryPosition], member[OLongSerializer.LONG_SIZE]]
if[binary_operation[member[.encryption], ==, literal[null]]] begin[{]
assign[member[.entryPosition], call[.getObjectSizeInDirectMemory, parameter[member[.keySerializer], member[.entryPosition]]]]
else begin[{]
local_variable[type[int], encryptedLength]
assign[member[.entryPosition], binary_operation[member[.encryptedLength], +, member[OIntegerSerializer.INT_SIZE]]]
end[}]
return[call[.deserializeFromDirectMemory, parameter[member[.valueSerializer], member[.entryPosition]]]]
end[}]
END[}] | Keyword[public] identifier[V] identifier[getValue] operator[SEP] Keyword[int] identifier[index] operator[SEP] {
Keyword[int] identifier[entryPosition] operator[=] identifier[getIntValue] operator[SEP] identifier[POSITIONS_ARRAY_OFFSET] operator[+] identifier[index] operator[*] identifier[OIntegerSerializer] operator[SEP] identifier[INT_SIZE] operator[SEP] operator[SEP] identifier[entryPosition] operator[+=] identifier[OLongSerializer] operator[SEP] identifier[LONG_SIZE] operator[SEP] Keyword[if] operator[SEP] identifier[encryption] operator[==] Other[null] operator[SEP] {
identifier[entryPosition] operator[+=] identifier[getObjectSizeInDirectMemory] operator[SEP] identifier[keySerializer] , identifier[entryPosition] operator[SEP] operator[SEP]
}
Keyword[else] {
Keyword[final] Keyword[int] identifier[encryptedLength] operator[=] identifier[getIntValue] operator[SEP] identifier[entryPosition] operator[SEP] operator[SEP] identifier[entryPosition] operator[+=] identifier[encryptedLength] operator[+] identifier[OIntegerSerializer] operator[SEP] identifier[INT_SIZE] operator[SEP]
}
Keyword[return] identifier[deserializeFromDirectMemory] operator[SEP] identifier[valueSerializer] , identifier[entryPosition] operator[SEP] operator[SEP]
}
|
@Override
public Integer getPropertyInteger(Class<?> aClass, String key,
int defaultValue)
{
return getPropertyInteger(new StringBuilder(aClass.getName()).append(".")
.append(key).toString(), defaultValue);
} | class class_name[name] begin[{]
method[getPropertyInteger, return_type[type[Integer]], modifier[public], parameter[aClass, key, defaultValue]] begin[{]
return[call[.getPropertyInteger, parameter[ClassCreator(arguments=[MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=aClass, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=".")], member=append, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=append, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=toString, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=StringBuilder, sub_type=None)), member[.defaultValue]]]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] identifier[Integer] identifier[getPropertyInteger] operator[SEP] identifier[Class] operator[<] operator[?] operator[>] identifier[aClass] , identifier[String] identifier[key] , Keyword[int] identifier[defaultValue] operator[SEP] {
Keyword[return] identifier[getPropertyInteger] operator[SEP] Keyword[new] identifier[StringBuilder] operator[SEP] identifier[aClass] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[key] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] , identifier[defaultValue] operator[SEP] operator[SEP]
}
|
private void driveCallBacks(int stage, FailureScope failureScope) {
if (tc.isEntryEnabled()) {
switch (stage) {
case CALLBACK_RECOVERYSTARTED:
Tr.entry(tc, "driveCallBacks", new Object[] { "CALLBACK_RECOVERYSTARTED", failureScope });
break;
case CALLBACK_RECOVERYCOMPLETE:
Tr.entry(tc, "driveCallBacks", new Object[] { "CALLBACK_RECOVERYCOMPLETE", failureScope });
break;
case CALLBACK_TERMINATIONSTARTED:
Tr.entry(tc, "driveCallBacks", new Object[] { "CALLBACK_TERMINATIONSTARTED", failureScope });
break;
case CALLBACK_TERMINATIONCOMPLETE:
Tr.entry(tc, "driveCallBacks", new Object[] { "CALLBACK_TERMINATIONCOMPLETE", failureScope });
break;
case CALLBACK_RECOVERYFAILED:
Tr.entry(tc, "driveCallBacks", new Object[] { "CALLBACK_RECOVERYFAILED", failureScope });
break;
default:
Tr.entry(tc, "driveCallBacks", new Object[] { new Integer(stage), failureScope });
break;
}
}
if (_registeredCallbacks != null) {
final Iterator registeredCallbacksIterator = _registeredCallbacks.iterator();
while (registeredCallbacksIterator.hasNext()) {
final RecoveryLogCallBack callBack = (RecoveryLogCallBack) registeredCallbacksIterator.next();
switch (stage) {
case CALLBACK_RECOVERYSTARTED:
callBack.recoveryStarted(failureScope);
break;
case CALLBACK_RECOVERYCOMPLETE:
case CALLBACK_RECOVERYFAILED:
callBack.recoveryCompleted(failureScope);
break;
case CALLBACK_TERMINATIONSTARTED:
callBack.terminateStarted(failureScope);
break;
case CALLBACK_TERMINATIONCOMPLETE:
callBack.terminateCompleted(failureScope);
break;
}
}
}
if (tc.isEntryEnabled())
Tr.exit(tc, "driveCallBacks");
} | class class_name[name] begin[{]
method[driveCallBacks, return_type[void], modifier[private], parameter[stage, failureScope]] begin[{]
if[call[tc.isEntryEnabled, parameter[]]] begin[{]
SwitchStatement(cases=[SwitchStatementCase(case=['CALLBACK_RECOVERYSTARTED'], statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=tc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="driveCallBacks"), ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="CALLBACK_RECOVERYSTARTED"), MemberReference(member=failureScope, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Object, sub_type=None))], member=entry, postfix_operators=[], prefix_operators=[], qualifier=Tr, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=['CALLBACK_RECOVERYCOMPLETE'], statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=tc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="driveCallBacks"), ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="CALLBACK_RECOVERYCOMPLETE"), MemberReference(member=failureScope, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Object, sub_type=None))], member=entry, postfix_operators=[], prefix_operators=[], qualifier=Tr, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=['CALLBACK_TERMINATIONSTARTED'], statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=tc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="driveCallBacks"), ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="CALLBACK_TERMINATIONSTARTED"), MemberReference(member=failureScope, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Object, sub_type=None))], member=entry, postfix_operators=[], prefix_operators=[], qualifier=Tr, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=['CALLBACK_TERMINATIONCOMPLETE'], statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=tc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="driveCallBacks"), ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="CALLBACK_TERMINATIONCOMPLETE"), MemberReference(member=failureScope, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Object, sub_type=None))], member=entry, postfix_operators=[], prefix_operators=[], qualifier=Tr, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=['CALLBACK_RECOVERYFAILED'], statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=tc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="driveCallBacks"), ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="CALLBACK_RECOVERYFAILED"), MemberReference(member=failureScope, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Object, sub_type=None))], member=entry, postfix_operators=[], prefix_operators=[], qualifier=Tr, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[], statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=tc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="driveCallBacks"), ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[ClassCreator(arguments=[MemberReference(member=stage, 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=Integer, sub_type=None)), MemberReference(member=failureScope, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Object, sub_type=None))], member=entry, postfix_operators=[], prefix_operators=[], qualifier=Tr, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)])], expression=MemberReference(member=stage, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)
else begin[{]
None
end[}]
if[binary_operation[member[._registeredCallbacks], !=, literal[null]]] begin[{]
local_variable[type[Iterator], registeredCallbacksIterator]
while[call[registeredCallbacksIterator.hasNext, parameter[]]] begin[{]
local_variable[type[RecoveryLogCallBack], callBack]
SwitchStatement(cases=[SwitchStatementCase(case=['CALLBACK_RECOVERYSTARTED'], statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=failureScope, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=recoveryStarted, postfix_operators=[], prefix_operators=[], qualifier=callBack, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=['CALLBACK_RECOVERYCOMPLETE', 'CALLBACK_RECOVERYFAILED'], statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=failureScope, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=recoveryCompleted, postfix_operators=[], prefix_operators=[], qualifier=callBack, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=['CALLBACK_TERMINATIONSTARTED'], statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=failureScope, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=terminateStarted, postfix_operators=[], prefix_operators=[], qualifier=callBack, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=['CALLBACK_TERMINATIONCOMPLETE'], statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=failureScope, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=terminateCompleted, postfix_operators=[], prefix_operators=[], qualifier=callBack, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)])], expression=MemberReference(member=stage, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)
end[}]
else begin[{]
None
end[}]
if[call[tc.isEntryEnabled, parameter[]]] begin[{]
call[Tr.exit, parameter[member[.tc], literal["driveCallBacks"]]]
else begin[{]
None
end[}]
end[}]
END[}] | Keyword[private] Keyword[void] identifier[driveCallBacks] operator[SEP] Keyword[int] identifier[stage] , identifier[FailureScope] identifier[failureScope] operator[SEP] {
Keyword[if] operator[SEP] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] {
Keyword[switch] operator[SEP] identifier[stage] operator[SEP] {
Keyword[case] identifier[CALLBACK_RECOVERYSTARTED] operator[:] identifier[Tr] operator[SEP] identifier[entry] operator[SEP] identifier[tc] , literal[String] , Keyword[new] identifier[Object] operator[SEP] operator[SEP] {
literal[String] , identifier[failureScope]
} operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[CALLBACK_RECOVERYCOMPLETE] operator[:] identifier[Tr] operator[SEP] identifier[entry] operator[SEP] identifier[tc] , literal[String] , Keyword[new] identifier[Object] operator[SEP] operator[SEP] {
literal[String] , identifier[failureScope]
} operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[CALLBACK_TERMINATIONSTARTED] operator[:] identifier[Tr] operator[SEP] identifier[entry] operator[SEP] identifier[tc] , literal[String] , Keyword[new] identifier[Object] operator[SEP] operator[SEP] {
literal[String] , identifier[failureScope]
} operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[CALLBACK_TERMINATIONCOMPLETE] operator[:] identifier[Tr] operator[SEP] identifier[entry] operator[SEP] identifier[tc] , literal[String] , Keyword[new] identifier[Object] operator[SEP] operator[SEP] {
literal[String] , identifier[failureScope]
} operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[CALLBACK_RECOVERYFAILED] operator[:] identifier[Tr] operator[SEP] identifier[entry] operator[SEP] identifier[tc] , literal[String] , Keyword[new] identifier[Object] operator[SEP] operator[SEP] {
literal[String] , identifier[failureScope]
} operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[default] operator[:] identifier[Tr] operator[SEP] identifier[entry] operator[SEP] identifier[tc] , literal[String] , Keyword[new] identifier[Object] operator[SEP] operator[SEP] {
Keyword[new] identifier[Integer] operator[SEP] identifier[stage] operator[SEP] , identifier[failureScope]
} operator[SEP] operator[SEP] Keyword[break] operator[SEP]
}
}
Keyword[if] operator[SEP] identifier[_registeredCallbacks] operator[!=] Other[null] operator[SEP] {
Keyword[final] identifier[Iterator] identifier[registeredCallbacksIterator] operator[=] identifier[_registeredCallbacks] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[registeredCallbacksIterator] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] {
Keyword[final] identifier[RecoveryLogCallBack] identifier[callBack] operator[=] operator[SEP] identifier[RecoveryLogCallBack] operator[SEP] identifier[registeredCallbacksIterator] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] Keyword[switch] operator[SEP] identifier[stage] operator[SEP] {
Keyword[case] identifier[CALLBACK_RECOVERYSTARTED] operator[:] identifier[callBack] operator[SEP] identifier[recoveryStarted] operator[SEP] identifier[failureScope] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[CALLBACK_RECOVERYCOMPLETE] operator[:] Keyword[case] identifier[CALLBACK_RECOVERYFAILED] operator[:] identifier[callBack] operator[SEP] identifier[recoveryCompleted] operator[SEP] identifier[failureScope] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[CALLBACK_TERMINATIONSTARTED] operator[:] identifier[callBack] operator[SEP] identifier[terminateStarted] operator[SEP] identifier[failureScope] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[CALLBACK_TERMINATIONCOMPLETE] operator[:] identifier[callBack] operator[SEP] identifier[terminateCompleted] operator[SEP] identifier[failureScope] operator[SEP] operator[SEP] Keyword[break] operator[SEP]
}
}
}
Keyword[if] operator[SEP] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[Tr] operator[SEP] identifier[exit] operator[SEP] identifier[tc] , literal[String] operator[SEP] operator[SEP]
}
|
@JsMethod(namespace = "jscomp")
public static ChunkOutput compile(Flags flags, File[] inputs) throws IOException {
// The PhaseOptimizer logs skipped pass warnings that interfere with capturing
// output and errors in the open source runners.
phaseLogger.setLevel(Level.OFF);
String[] unhandled = updateFlags(flags, getDefaultFlags());
if (unhandled.length > 0) {
throw new RuntimeException("Unhandled flag: " + unhandled[0]);
}
List<SourceFile> jsCode = null;
ImmutableMap<String, SourceMapInput> sourceMaps = null;
if (flags.jsCode != null) {
jsCode = fromFileArray(flags.jsCode, "Input_");
sourceMaps = buildSourceMaps(flags.jsCode, "Input_");
}
ImmutableMap.Builder<String, String> inputPathByWebpackId = new ImmutableMap.Builder<>();
if (inputs != null) {
List<SourceFile> sourceFiles = fromFileArray(inputs, "Input_");
ImmutableMap<String, SourceMapInput> inputSourceMaps = buildSourceMaps(inputs, "Input_");
if (jsCode == null) {
jsCode = sourceFiles;
} else {
jsCode.addAll(sourceFiles);
}
if (sourceMaps == null) {
sourceMaps = inputSourceMaps;
} else {
HashMap<String, SourceMapInput> tempMaps = new HashMap<>(sourceMaps);
tempMaps.putAll(inputSourceMaps);
sourceMaps = ImmutableMap.copyOf(tempMaps);
}
for (GwtRunner.File element : inputs) {
if (element.webpackId != null && element.path != null) {
inputPathByWebpackId.put(element.webpackId, element.path);
}
}
}
if (flags.js != null) {
File[] jsFiles = getJsFiles(getStringArray(flags, "js"));
if (jsFiles == null) {
throw new RuntimeException(
"Can only load files from the filesystem when running in NodeJS.");
} else {
jsCode.addAll(fromFileArray(jsFiles, "Input_"));
}
}
Compiler compiler = new Compiler(new NodePrintStream());
CompilerOptions options = new CompilerOptions();
applyOptionsFromFlags(options, flags, compiler.getDiagnosticGroups());
options.setInputSourceMaps(sourceMaps);
List<SourceFile> externs = new ArrayList<>();
if (flags.externs != null) {
File[] externFiles = fromExternsFlag(getStringArray(flags, "externs"));
if (externFiles == null) {
throw new RuntimeException(
"Can only load files from the filesystem when running in NodeJS.");
}
externs = fromFileArray(externFiles, "Extern_");
}
externs.addAll(createExterns(options.getEnvironment()));
NodeErrorManager errorManager = new NodeErrorManager();
compiler.initWebpackMap(inputPathByWebpackId.build());
compiler.setErrorManager(errorManager);
List<String> chunkSpecs = new ArrayList<>();
if (flags.chunk != null) {
Collections.addAll(chunkSpecs, flags.chunk);
}
List<JsModuleSpec> jsChunkSpecs = new ArrayList<>();
for (int i = 0; i < chunkSpecs.size(); i++) {
jsChunkSpecs.add(JsModuleSpec.create(chunkSpecs.get(i), i == 0));
}
ChunkOutput output;
if (!jsChunkSpecs.isEmpty()) {
List<JSModule> chunks = createJsModules(jsChunkSpecs, jsCode);
compiler.compileModules(externs, chunks, options);
output = writeChunkOutput(compiler, flags, chunks);
} else {
compiler.compile(externs, jsCode, options);
output = writeOutput(compiler, flags);
}
output.errors = toNativeErrorArray(errorManager.errors);
output.warnings = toNativeErrorArray(errorManager.warnings);
return output;
} | class class_name[name] begin[{]
method[compile, return_type[type[ChunkOutput]], modifier[public static], parameter[flags, inputs]] begin[{]
call[phaseLogger.setLevel, parameter[member[Level.OFF]]]
local_variable[type[String], unhandled]
if[binary_operation[member[unhandled.length], >, literal[0]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unhandled flag: "), operandr=MemberReference(member=unhandled, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))]), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=RuntimeException, sub_type=None)), label=None)
else begin[{]
None
end[}]
local_variable[type[List], jsCode]
local_variable[type[ImmutableMap], sourceMaps]
if[binary_operation[member[flags.jsCode], !=, literal[null]]] begin[{]
assign[member[.jsCode], call[.fromFileArray, parameter[member[flags.jsCode], literal["Input_"]]]]
assign[member[.sourceMaps], call[.buildSourceMaps, parameter[member[flags.jsCode], literal["Input_"]]]]
else begin[{]
None
end[}]
local_variable[type[ImmutableMap], inputPathByWebpackId]
if[binary_operation[member[.inputs], !=, literal[null]]] begin[{]
local_variable[type[List], sourceFiles]
local_variable[type[ImmutableMap], inputSourceMaps]
if[binary_operation[member[.jsCode], ==, literal[null]]] begin[{]
assign[member[.jsCode], member[.sourceFiles]]
else begin[{]
call[jsCode.addAll, parameter[member[.sourceFiles]]]
end[}]
if[binary_operation[member[.sourceMaps], ==, literal[null]]] begin[{]
assign[member[.sourceMaps], member[.inputSourceMaps]]
else begin[{]
local_variable[type[HashMap], tempMaps]
call[tempMaps.putAll, parameter[member[.inputSourceMaps]]]
assign[member[.sourceMaps], call[ImmutableMap.copyOf, parameter[member[.tempMaps]]]]
end[}]
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=webpackId, postfix_operators=[], prefix_operators=[], qualifier=element, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operandr=BinaryOperation(operandl=MemberReference(member=path, postfix_operators=[], prefix_operators=[], qualifier=element, 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=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=webpackId, postfix_operators=[], prefix_operators=[], qualifier=element, selectors=[]), MemberReference(member=path, postfix_operators=[], prefix_operators=[], qualifier=element, selectors=[])], member=put, postfix_operators=[], prefix_operators=[], qualifier=inputPathByWebpackId, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=inputs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=element)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=GwtRunner, sub_type=ReferenceType(arguments=None, dimensions=None, name=File, sub_type=None)))), label=None)
else begin[{]
None
end[}]
if[binary_operation[member[flags.js], !=, literal[null]]] begin[{]
local_variable[type[File], jsFiles]
if[binary_operation[member[.jsFiles], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Can only load files from the filesystem when running in NodeJS.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=RuntimeException, sub_type=None)), label=None)
else begin[{]
call[jsCode.addAll, parameter[call[.fromFileArray, parameter[member[.jsFiles], literal["Input_"]]]]]
end[}]
else begin[{]
None
end[}]
local_variable[type[Compiler], compiler]
local_variable[type[CompilerOptions], options]
call[.applyOptionsFromFlags, parameter[member[.options], member[.flags], call[compiler.getDiagnosticGroups, parameter[]]]]
call[options.setInputSourceMaps, parameter[member[.sourceMaps]]]
local_variable[type[List], externs]
if[binary_operation[member[flags.externs], !=, literal[null]]] begin[{]
local_variable[type[File], externFiles]
if[binary_operation[member[.externFiles], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Can only load files from the filesystem when running in NodeJS.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=RuntimeException, sub_type=None)), label=None)
else begin[{]
None
end[}]
assign[member[.externs], call[.fromFileArray, parameter[member[.externFiles], literal["Extern_"]]]]
else begin[{]
None
end[}]
call[externs.addAll, parameter[call[.createExterns, parameter[call[options.getEnvironment, parameter[]]]]]]
local_variable[type[NodeErrorManager], errorManager]
call[compiler.initWebpackMap, parameter[call[inputPathByWebpackId.build, parameter[]]]]
call[compiler.setErrorManager, parameter[member[.errorManager]]]
local_variable[type[List], chunkSpecs]
if[binary_operation[member[flags.chunk], !=, literal[null]]] begin[{]
call[Collections.addAll, parameter[member[.chunkSpecs], member[flags.chunk]]]
else begin[{]
None
end[}]
local_variable[type[List], jsChunkSpecs]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=chunkSpecs, selectors=[], type_arguments=None), BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator===)], member=create, postfix_operators=[], prefix_operators=[], qualifier=JsModuleSpec, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=jsChunkSpecs, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=chunkSpecs, selectors=[], type_arguments=None), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
local_variable[type[ChunkOutput], output]
if[call[jsChunkSpecs.isEmpty, parameter[]]] begin[{]
local_variable[type[List], chunks]
call[compiler.compileModules, parameter[member[.externs], member[.chunks], member[.options]]]
assign[member[.output], call[.writeChunkOutput, parameter[member[.compiler], member[.flags], member[.chunks]]]]
else begin[{]
call[compiler.compile, parameter[member[.externs], member[.jsCode], member[.options]]]
assign[member[.output], call[.writeOutput, parameter[member[.compiler], member[.flags]]]]
end[}]
assign[member[output.errors], call[.toNativeErrorArray, parameter[member[errorManager.errors]]]]
assign[member[output.warnings], call[.toNativeErrorArray, parameter[member[errorManager.warnings]]]]
return[member[.output]]
end[}]
END[}] | annotation[@] identifier[JsMethod] operator[SEP] identifier[namespace] operator[=] literal[String] operator[SEP] Keyword[public] Keyword[static] identifier[ChunkOutput] identifier[compile] operator[SEP] identifier[Flags] identifier[flags] , identifier[File] operator[SEP] operator[SEP] identifier[inputs] operator[SEP] Keyword[throws] identifier[IOException] {
identifier[phaseLogger] operator[SEP] identifier[setLevel] operator[SEP] identifier[Level] operator[SEP] identifier[OFF] operator[SEP] operator[SEP] identifier[String] operator[SEP] operator[SEP] identifier[unhandled] operator[=] identifier[updateFlags] operator[SEP] identifier[flags] , identifier[getDefaultFlags] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[unhandled] operator[SEP] identifier[length] operator[>] Other[0] operator[SEP] {
Keyword[throw] Keyword[new] identifier[RuntimeException] operator[SEP] literal[String] operator[+] identifier[unhandled] operator[SEP] Other[0] operator[SEP] operator[SEP] operator[SEP]
}
identifier[List] operator[<] identifier[SourceFile] operator[>] identifier[jsCode] operator[=] Other[null] operator[SEP] identifier[ImmutableMap] operator[<] identifier[String] , identifier[SourceMapInput] operator[>] identifier[sourceMaps] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[flags] operator[SEP] identifier[jsCode] operator[!=] Other[null] operator[SEP] {
identifier[jsCode] operator[=] identifier[fromFileArray] operator[SEP] identifier[flags] operator[SEP] identifier[jsCode] , literal[String] operator[SEP] operator[SEP] identifier[sourceMaps] operator[=] identifier[buildSourceMaps] operator[SEP] identifier[flags] operator[SEP] identifier[jsCode] , literal[String] operator[SEP] operator[SEP]
}
identifier[ImmutableMap] operator[SEP] identifier[Builder] operator[<] identifier[String] , identifier[String] operator[>] identifier[inputPathByWebpackId] operator[=] Keyword[new] identifier[ImmutableMap] operator[SEP] identifier[Builder] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[inputs] operator[!=] Other[null] operator[SEP] {
identifier[List] operator[<] identifier[SourceFile] operator[>] identifier[sourceFiles] operator[=] identifier[fromFileArray] operator[SEP] identifier[inputs] , literal[String] operator[SEP] operator[SEP] identifier[ImmutableMap] operator[<] identifier[String] , identifier[SourceMapInput] operator[>] identifier[inputSourceMaps] operator[=] identifier[buildSourceMaps] operator[SEP] identifier[inputs] , literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[jsCode] operator[==] Other[null] operator[SEP] {
identifier[jsCode] operator[=] identifier[sourceFiles] operator[SEP]
}
Keyword[else] {
identifier[jsCode] operator[SEP] identifier[addAll] operator[SEP] identifier[sourceFiles] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[sourceMaps] operator[==] Other[null] operator[SEP] {
identifier[sourceMaps] operator[=] identifier[inputSourceMaps] operator[SEP]
}
Keyword[else] {
identifier[HashMap] operator[<] identifier[String] , identifier[SourceMapInput] operator[>] identifier[tempMaps] operator[=] Keyword[new] identifier[HashMap] operator[<] operator[>] operator[SEP] identifier[sourceMaps] operator[SEP] operator[SEP] identifier[tempMaps] operator[SEP] identifier[putAll] operator[SEP] identifier[inputSourceMaps] operator[SEP] operator[SEP] identifier[sourceMaps] operator[=] identifier[ImmutableMap] operator[SEP] identifier[copyOf] operator[SEP] identifier[tempMaps] operator[SEP] operator[SEP]
}
Keyword[for] operator[SEP] identifier[GwtRunner] operator[SEP] identifier[File] identifier[element] operator[:] identifier[inputs] operator[SEP] {
Keyword[if] operator[SEP] identifier[element] operator[SEP] identifier[webpackId] operator[!=] Other[null] operator[&&] identifier[element] operator[SEP] identifier[path] operator[!=] Other[null] operator[SEP] {
identifier[inputPathByWebpackId] operator[SEP] identifier[put] operator[SEP] identifier[element] operator[SEP] identifier[webpackId] , identifier[element] operator[SEP] identifier[path] operator[SEP] operator[SEP]
}
}
}
Keyword[if] operator[SEP] identifier[flags] operator[SEP] identifier[js] operator[!=] Other[null] operator[SEP] {
identifier[File] operator[SEP] operator[SEP] identifier[jsFiles] operator[=] identifier[getJsFiles] operator[SEP] identifier[getStringArray] operator[SEP] identifier[flags] , literal[String] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[jsFiles] operator[==] Other[null] operator[SEP] {
Keyword[throw] Keyword[new] identifier[RuntimeException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[jsCode] operator[SEP] identifier[addAll] operator[SEP] identifier[fromFileArray] operator[SEP] identifier[jsFiles] , literal[String] operator[SEP] operator[SEP] operator[SEP]
}
}
identifier[Compiler] identifier[compiler] operator[=] Keyword[new] identifier[Compiler] operator[SEP] Keyword[new] identifier[NodePrintStream] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[CompilerOptions] identifier[options] operator[=] Keyword[new] identifier[CompilerOptions] operator[SEP] operator[SEP] operator[SEP] identifier[applyOptionsFromFlags] operator[SEP] identifier[options] , identifier[flags] , identifier[compiler] operator[SEP] identifier[getDiagnosticGroups] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[options] operator[SEP] identifier[setInputSourceMaps] operator[SEP] identifier[sourceMaps] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[SourceFile] operator[>] identifier[externs] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[flags] operator[SEP] identifier[externs] operator[!=] Other[null] operator[SEP] {
identifier[File] operator[SEP] operator[SEP] identifier[externFiles] operator[=] identifier[fromExternsFlag] operator[SEP] identifier[getStringArray] operator[SEP] identifier[flags] , literal[String] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[externFiles] operator[==] Other[null] operator[SEP] {
Keyword[throw] Keyword[new] identifier[RuntimeException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
identifier[externs] operator[=] identifier[fromFileArray] operator[SEP] identifier[externFiles] , literal[String] operator[SEP] operator[SEP]
}
identifier[externs] operator[SEP] identifier[addAll] operator[SEP] identifier[createExterns] operator[SEP] identifier[options] operator[SEP] identifier[getEnvironment] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[NodeErrorManager] identifier[errorManager] operator[=] Keyword[new] identifier[NodeErrorManager] operator[SEP] operator[SEP] operator[SEP] identifier[compiler] operator[SEP] identifier[initWebpackMap] operator[SEP] identifier[inputPathByWebpackId] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[compiler] operator[SEP] identifier[setErrorManager] operator[SEP] identifier[errorManager] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[String] operator[>] identifier[chunkSpecs] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[flags] operator[SEP] identifier[chunk] operator[!=] Other[null] operator[SEP] {
identifier[Collections] operator[SEP] identifier[addAll] operator[SEP] identifier[chunkSpecs] , identifier[flags] operator[SEP] identifier[chunk] operator[SEP] operator[SEP]
}
identifier[List] operator[<] identifier[JsModuleSpec] operator[>] identifier[jsChunkSpecs] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[chunkSpecs] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[++] operator[SEP] {
identifier[jsChunkSpecs] operator[SEP] identifier[add] operator[SEP] identifier[JsModuleSpec] operator[SEP] identifier[create] operator[SEP] identifier[chunkSpecs] operator[SEP] identifier[get] operator[SEP] identifier[i] operator[SEP] , identifier[i] operator[==] Other[0] operator[SEP] operator[SEP] operator[SEP]
}
identifier[ChunkOutput] identifier[output] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[jsChunkSpecs] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] {
identifier[List] operator[<] identifier[JSModule] operator[>] identifier[chunks] operator[=] identifier[createJsModules] operator[SEP] identifier[jsChunkSpecs] , identifier[jsCode] operator[SEP] operator[SEP] identifier[compiler] operator[SEP] identifier[compileModules] operator[SEP] identifier[externs] , identifier[chunks] , identifier[options] operator[SEP] operator[SEP] identifier[output] operator[=] identifier[writeChunkOutput] operator[SEP] identifier[compiler] , identifier[flags] , identifier[chunks] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[compiler] operator[SEP] identifier[compile] operator[SEP] identifier[externs] , identifier[jsCode] , identifier[options] operator[SEP] operator[SEP] identifier[output] operator[=] identifier[writeOutput] operator[SEP] identifier[compiler] , identifier[flags] operator[SEP] operator[SEP]
}
identifier[output] operator[SEP] identifier[errors] operator[=] identifier[toNativeErrorArray] operator[SEP] identifier[errorManager] operator[SEP] identifier[errors] operator[SEP] operator[SEP] identifier[output] operator[SEP] identifier[warnings] operator[=] identifier[toNativeErrorArray] operator[SEP] identifier[errorManager] operator[SEP] identifier[warnings] operator[SEP] operator[SEP] Keyword[return] identifier[output] operator[SEP]
}
|
public Any execute(DeviceImpl device, Any in_any) throws DevFailed
{
Util.out4.println("GetLoggingLevelCmd::execute(): arrived");
String[] dvsa = null;
try {
dvsa = extract_DevVarStringArray(in_any);
}
catch (DevFailed df) {
Util.out3.println("GetLoggingLevelCmd::execute() --> Wrong argument type");
Except.re_throw_exception(df,
"API_IncompatibleCmdArgumentType",
"Imcompatible command argument type, expected type is : DevVarStringArray",
"GetLoggingLevelCmd.execute");
}
Any out_any = insert(Logging.instance().get_logging_level(dvsa));
Util.out4.println("Leaving GetLoggingLevelCmd.execute()");
return out_any;
} | class class_name[name] begin[{]
method[execute, return_type[type[Any]], modifier[public], parameter[device, in_any]] begin[{]
call[Util.out4.println, parameter[literal["GetLoggingLevelCmd::execute(): arrived"]]]
local_variable[type[String], dvsa]
TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=dvsa, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=in_any, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=extract_DevVarStringArray, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="GetLoggingLevelCmd::execute() --> Wrong argument type")], member=println, postfix_operators=[], prefix_operators=[], qualifier=Util.out3, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=df, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="API_IncompatibleCmdArgumentType"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Imcompatible command argument type, expected type is : DevVarStringArray"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="GetLoggingLevelCmd.execute")], member=re_throw_exception, postfix_operators=[], prefix_operators=[], qualifier=Except, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=df, types=['DevFailed']))], finally_block=None, label=None, resources=None)
local_variable[type[Any], out_any]
call[Util.out4.println, parameter[literal["Leaving GetLoggingLevelCmd.execute()"]]]
return[member[.out_any]]
end[}]
END[}] | Keyword[public] identifier[Any] identifier[execute] operator[SEP] identifier[DeviceImpl] identifier[device] , identifier[Any] identifier[in_any] operator[SEP] Keyword[throws] identifier[DevFailed] {
identifier[Util] operator[SEP] identifier[out4] operator[SEP] identifier[println] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[String] operator[SEP] operator[SEP] identifier[dvsa] operator[=] Other[null] operator[SEP] Keyword[try] {
identifier[dvsa] operator[=] identifier[extract_DevVarStringArray] operator[SEP] identifier[in_any] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[DevFailed] identifier[df] operator[SEP] {
identifier[Util] operator[SEP] identifier[out3] operator[SEP] identifier[println] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[Except] operator[SEP] identifier[re_throw_exception] operator[SEP] identifier[df] , literal[String] , literal[String] , literal[String] operator[SEP] operator[SEP]
}
identifier[Any] identifier[out_any] operator[=] identifier[insert] operator[SEP] identifier[Logging] operator[SEP] identifier[instance] operator[SEP] operator[SEP] operator[SEP] identifier[get_logging_level] operator[SEP] identifier[dvsa] operator[SEP] operator[SEP] operator[SEP] identifier[Util] operator[SEP] identifier[out4] operator[SEP] identifier[println] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[out_any] operator[SEP]
}
|
public String getHtmlString(Record recMenu)
{
String strCellFormat = null;
if ((strCellFormat == null) || (strCellFormat.length() == 0))
{
ResourceBundle reg = ((BaseApplication)((BaseMenuScreen)this.getScreenField()).getTask().getApplication()).getResources(HtmlConstants.HTML_RESOURCE, false);
strCellFormat = reg.getString("htmlAppMenu");
}
if ((strCellFormat == null) || (strCellFormat.length() == 0))
strCellFormat = "<items columns=\"5\"><td align=center valign=\"top\"><a href=\""
+ HtmlConstants.LINK_TAG + "\"><img src=\"" + HtmlConstants.HTML_ROOT + HtmlConstants.ICON_TAG
+ "\" width=\"24\" height=\"24\"><br/>" + HtmlConstants.TITLE_TAG + "</a></td></items>";
return strCellFormat;
} | class class_name[name] begin[{]
method[getHtmlString, return_type[type[String]], modifier[public], parameter[recMenu]] begin[{]
local_variable[type[String], strCellFormat]
if[binary_operation[binary_operation[member[.strCellFormat], ==, literal[null]], ||, binary_operation[call[strCellFormat.length, parameter[]], ==, literal[0]]]] begin[{]
local_variable[type[ResourceBundle], reg]
assign[member[.strCellFormat], call[reg.getString, parameter[literal["htmlAppMenu"]]]]
else begin[{]
None
end[}]
if[binary_operation[binary_operation[member[.strCellFormat], ==, literal[null]], ||, binary_operation[call[strCellFormat.length, parameter[]], ==, literal[0]]]] begin[{]
assign[member[.strCellFormat], binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[literal["<items columns=\"5\"><td align=center valign=\"top\"><a href=\""], +, member[HtmlConstants.LINK_TAG]], +, literal["\"><img src=\""]], +, member[HtmlConstants.HTML_ROOT]], +, member[HtmlConstants.ICON_TAG]], +, literal["\" width=\"24\" height=\"24\"><br/>"]], +, member[HtmlConstants.TITLE_TAG]], +, literal["</a></td></items>"]]]
else begin[{]
None
end[}]
return[member[.strCellFormat]]
end[}]
END[}] | Keyword[public] identifier[String] identifier[getHtmlString] operator[SEP] identifier[Record] identifier[recMenu] operator[SEP] {
identifier[String] identifier[strCellFormat] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] operator[SEP] identifier[strCellFormat] operator[==] Other[null] operator[SEP] operator[||] operator[SEP] identifier[strCellFormat] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[==] Other[0] operator[SEP] operator[SEP] {
identifier[ResourceBundle] identifier[reg] operator[=] operator[SEP] operator[SEP] identifier[BaseApplication] operator[SEP] operator[SEP] operator[SEP] identifier[BaseMenuScreen] operator[SEP] Keyword[this] operator[SEP] identifier[getScreenField] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[getTask] operator[SEP] operator[SEP] operator[SEP] identifier[getApplication] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[getResources] operator[SEP] identifier[HtmlConstants] operator[SEP] identifier[HTML_RESOURCE] , literal[boolean] operator[SEP] operator[SEP] identifier[strCellFormat] operator[=] identifier[reg] operator[SEP] identifier[getString] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] operator[SEP] identifier[strCellFormat] operator[==] Other[null] operator[SEP] operator[||] operator[SEP] identifier[strCellFormat] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[==] Other[0] operator[SEP] operator[SEP] identifier[strCellFormat] operator[=] literal[String] operator[+] identifier[HtmlConstants] operator[SEP] identifier[LINK_TAG] operator[+] literal[String] operator[+] identifier[HtmlConstants] operator[SEP] identifier[HTML_ROOT] operator[+] identifier[HtmlConstants] operator[SEP] identifier[ICON_TAG] operator[+] literal[String] operator[+] identifier[HtmlConstants] operator[SEP] identifier[TITLE_TAG] operator[+] literal[String] operator[SEP] Keyword[return] identifier[strCellFormat] operator[SEP]
}
|
public void close() {
cancel = true;
try {
thread.interrupt();
waitFor();
} catch (Throwable ignore) {}
try {
is.close();
} catch (Exception ignore) {}
try {
os.close();
} catch (Exception ignore) {}
} | class class_name[name] begin[{]
method[close, return_type[void], modifier[public], parameter[]] begin[{]
assign[member[.cancel], literal[true]]
TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=interrupt, postfix_operators=[], prefix_operators=[], qualifier=thread, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=waitFor, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ignore, types=['Throwable']))], finally_block=None, label=None, resources=None)
TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=close, postfix_operators=[], prefix_operators=[], qualifier=is, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ignore, types=['Exception']))], finally_block=None, label=None, resources=None)
TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=close, postfix_operators=[], prefix_operators=[], qualifier=os, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ignore, types=['Exception']))], finally_block=None, label=None, resources=None)
end[}]
END[}] | Keyword[public] Keyword[void] identifier[close] operator[SEP] operator[SEP] {
identifier[cancel] operator[=] literal[boolean] operator[SEP] Keyword[try] {
identifier[thread] operator[SEP] identifier[interrupt] operator[SEP] operator[SEP] operator[SEP] identifier[waitFor] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Throwable] identifier[ignore] operator[SEP] {
}
Keyword[try] {
identifier[is] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Exception] identifier[ignore] operator[SEP] {
}
Keyword[try] {
identifier[os] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Exception] identifier[ignore] operator[SEP] {
}
}
|
@Override
public Iterator<Cell> iterator()
{
if (cells != null)
{
return cells.iterator();
}
else // if (pbRow != null)
{
assert pbRow != null;
return ConvertibleIteratorUtils.iterateAsCell(pbRow.getCellsList().iterator(),
// if there is no ColumnDescription what else we could do with that?
pbColumnDescriptions == null ? Collections.emptyIterator() : pbColumnDescriptions.iterator());
}
} | class class_name[name] begin[{]
method[iterator, return_type[type[Iterator]], modifier[public], parameter[]] begin[{]
if[binary_operation[member[.cells], !=, literal[null]]] begin[{]
return[call[cells.iterator, parameter[]]]
else begin[{]
AssertStatement(condition=BinaryOperation(operandl=MemberReference(member=pbRow, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), label=None, value=None)
return[call[ConvertibleIteratorUtils.iterateAsCell, parameter[call[pbRow.getCellsList, parameter[]], TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=pbColumnDescriptions, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), if_false=MethodInvocation(arguments=[], member=iterator, postfix_operators=[], prefix_operators=[], qualifier=pbColumnDescriptions, selectors=[], type_arguments=None), if_true=MethodInvocation(arguments=[], member=emptyIterator, postfix_operators=[], prefix_operators=[], qualifier=Collections, selectors=[], type_arguments=None))]]]
end[}]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] identifier[Iterator] operator[<] identifier[Cell] operator[>] identifier[iterator] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[cells] operator[!=] Other[null] operator[SEP] {
Keyword[return] identifier[cells] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] {
Keyword[assert] identifier[pbRow] operator[!=] Other[null] operator[SEP] Keyword[return] identifier[ConvertibleIteratorUtils] operator[SEP] identifier[iterateAsCell] operator[SEP] identifier[pbRow] operator[SEP] identifier[getCellsList] operator[SEP] operator[SEP] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] , identifier[pbColumnDescriptions] operator[==] Other[null] operator[?] identifier[Collections] operator[SEP] identifier[emptyIterator] operator[SEP] operator[SEP] operator[:] identifier[pbColumnDescriptions] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
}
|
protected void reportUntracedLeak(String resourceType) {
logger.error("LEAK: {}.release() was not called before it's garbage-collected. " +
"Enable advanced leak reporting to find out where the leak occurred. " +
"To enable advanced leak reporting, " +
"specify the JVM option '-D{}={}' or call {}.setLevel() " +
"See http://netty.io/wiki/reference-counted-objects.html for more information.",
resourceType, PROP_LEVEL, Level.ADVANCED.name().toLowerCase(), simpleClassName(this));
} | class class_name[name] begin[{]
method[reportUntracedLeak, return_type[void], modifier[protected], parameter[resourceType]] begin[{]
call[logger.error, parameter[binary_operation[binary_operation[binary_operation[binary_operation[literal["LEAK: {}.release() was not called before it's garbage-collected. "], +, literal["Enable advanced leak reporting to find out where the leak occurred. "]], +, literal["To enable advanced leak reporting, "]], +, literal["specify the JVM option '-D{}={}' or call {}.setLevel() "]], +, literal["See http://netty.io/wiki/reference-counted-objects.html for more information."]], member[.resourceType], member[.PROP_LEVEL], call[Level.ADVANCED.name, parameter[]], call[.simpleClassName, parameter[THIS[]]]]]
end[}]
END[}] | Keyword[protected] Keyword[void] identifier[reportUntracedLeak] operator[SEP] identifier[String] identifier[resourceType] operator[SEP] {
identifier[logger] operator[SEP] identifier[error] operator[SEP] literal[String] operator[+] literal[String] operator[+] literal[String] operator[+] literal[String] operator[+] literal[String] , identifier[resourceType] , identifier[PROP_LEVEL] , identifier[Level] operator[SEP] identifier[ADVANCED] operator[SEP] identifier[name] operator[SEP] operator[SEP] operator[SEP] identifier[toLowerCase] operator[SEP] operator[SEP] , identifier[simpleClassName] operator[SEP] Keyword[this] operator[SEP] operator[SEP] operator[SEP]
}
|
public String getCasId() {
if (ProcessingStep_Type.featOkTst && ((ProcessingStep_Type)jcasType).casFeat_casId == null)
jcasType.jcas.throwFeatMissing("casId", "edu.cmu.lti.oaqa.framework.types.ProcessingStep");
return jcasType.ll_cas.ll_getStringValue(addr, ((ProcessingStep_Type)jcasType).casFeatCode_casId);} | class class_name[name] begin[{]
method[getCasId, return_type[type[String]], modifier[public], parameter[]] begin[{]
if[binary_operation[member[ProcessingStep_Type.featOkTst], &&, binary_operation[Cast(expression=MemberReference(member=jcasType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=ProcessingStep_Type, sub_type=None)), ==, literal[null]]]] begin[{]
call[jcasType.jcas.throwFeatMissing, parameter[literal["casId"], literal["edu.cmu.lti.oaqa.framework.types.ProcessingStep"]]]
else begin[{]
None
end[}]
return[call[jcasType.ll_cas.ll_getStringValue, parameter[member[.addr], Cast(expression=MemberReference(member=jcasType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=ProcessingStep_Type, sub_type=None))]]]
end[}]
END[}] | Keyword[public] identifier[String] identifier[getCasId] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[ProcessingStep_Type] operator[SEP] identifier[featOkTst] operator[&&] operator[SEP] operator[SEP] identifier[ProcessingStep_Type] operator[SEP] identifier[jcasType] operator[SEP] operator[SEP] identifier[casFeat_casId] operator[==] Other[null] operator[SEP] identifier[jcasType] operator[SEP] identifier[jcas] operator[SEP] identifier[throwFeatMissing] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[jcasType] operator[SEP] identifier[ll_cas] operator[SEP] identifier[ll_getStringValue] operator[SEP] identifier[addr] , operator[SEP] operator[SEP] identifier[ProcessingStep_Type] operator[SEP] identifier[jcasType] operator[SEP] operator[SEP] identifier[casFeatCode_casId] operator[SEP] operator[SEP]
}
|
@Override
public void doFilter(ServletRequest request, ServletResponse response,
FilterChain chain) throws ServletException, IOException {
HttpServletRequest req = (HttpServletRequest)request;
HttpServletResponse resp = (HttpServletResponse)response;
RequestContext context = createRequestContext(req, resp);
String threadName = Thread.currentThread().getName();
logger.debug(LOG_KEY_BINGING_CONTEXT, req.getRequestURI(), threadName);
RequestContext.setCurrent(context);
try {
chain.doFilter(request, response);
} finally {
logger.debug(LOG_KEY_UNBINDING_CONTEXT, req.getRequestURI(), threadName);
RequestContext.clear();
}
} | class class_name[name] begin[{]
method[doFilter, return_type[void], modifier[public], parameter[request, response, chain]] begin[{]
local_variable[type[HttpServletRequest], req]
local_variable[type[HttpServletResponse], resp]
local_variable[type[RequestContext], context]
local_variable[type[String], threadName]
call[logger.debug, parameter[member[.LOG_KEY_BINGING_CONTEXT], call[req.getRequestURI, parameter[]], member[.threadName]]]
call[RequestContext.setCurrent, parameter[member[.context]]]
TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=request, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=response, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=doFilter, postfix_operators=[], prefix_operators=[], qualifier=chain, selectors=[], type_arguments=None), label=None)], catches=None, finally_block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=LOG_KEY_UNBINDING_CONTEXT, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getRequestURI, postfix_operators=[], prefix_operators=[], qualifier=req, selectors=[], type_arguments=None), MemberReference(member=threadName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=debug, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=clear, postfix_operators=[], prefix_operators=[], qualifier=RequestContext, selectors=[], type_arguments=None), label=None)], label=None, resources=None)
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[doFilter] operator[SEP] identifier[ServletRequest] identifier[request] , identifier[ServletResponse] identifier[response] , identifier[FilterChain] identifier[chain] operator[SEP] Keyword[throws] identifier[ServletException] , identifier[IOException] {
identifier[HttpServletRequest] identifier[req] operator[=] operator[SEP] identifier[HttpServletRequest] operator[SEP] identifier[request] operator[SEP] identifier[HttpServletResponse] identifier[resp] operator[=] operator[SEP] identifier[HttpServletResponse] operator[SEP] identifier[response] operator[SEP] identifier[RequestContext] identifier[context] operator[=] identifier[createRequestContext] operator[SEP] identifier[req] , identifier[resp] operator[SEP] operator[SEP] identifier[String] identifier[threadName] operator[=] identifier[Thread] operator[SEP] identifier[currentThread] operator[SEP] operator[SEP] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] identifier[logger] operator[SEP] identifier[debug] operator[SEP] identifier[LOG_KEY_BINGING_CONTEXT] , identifier[req] operator[SEP] identifier[getRequestURI] operator[SEP] operator[SEP] , identifier[threadName] operator[SEP] operator[SEP] identifier[RequestContext] operator[SEP] identifier[setCurrent] operator[SEP] identifier[context] operator[SEP] operator[SEP] Keyword[try] {
identifier[chain] operator[SEP] identifier[doFilter] operator[SEP] identifier[request] , identifier[response] operator[SEP] operator[SEP]
}
Keyword[finally] {
identifier[logger] operator[SEP] identifier[debug] operator[SEP] identifier[LOG_KEY_UNBINDING_CONTEXT] , identifier[req] operator[SEP] identifier[getRequestURI] operator[SEP] operator[SEP] , identifier[threadName] operator[SEP] operator[SEP] identifier[RequestContext] operator[SEP] identifier[clear] operator[SEP] operator[SEP] operator[SEP]
}
}
|
public CountDownLatchConfig findCountDownLatchConfig(String name) {
name = getBaseName(name);
CountDownLatchConfig config = lookupByPattern(configPatternMatcher, countDownLatchConfigs, name);
if (config != null) {
return config.getAsReadOnly();
}
return getCountDownLatchConfig("default").getAsReadOnly();
} | class class_name[name] begin[{]
method[findCountDownLatchConfig, return_type[type[CountDownLatchConfig]], modifier[public], parameter[name]] begin[{]
assign[member[.name], call[.getBaseName, parameter[member[.name]]]]
local_variable[type[CountDownLatchConfig], config]
if[binary_operation[member[.config], !=, literal[null]]] begin[{]
return[call[config.getAsReadOnly, parameter[]]]
else begin[{]
None
end[}]
return[call[.getCountDownLatchConfig, parameter[literal["default"]]]]
end[}]
END[}] | Keyword[public] identifier[CountDownLatchConfig] identifier[findCountDownLatchConfig] operator[SEP] identifier[String] identifier[name] operator[SEP] {
identifier[name] operator[=] identifier[getBaseName] operator[SEP] identifier[name] operator[SEP] operator[SEP] identifier[CountDownLatchConfig] identifier[config] operator[=] identifier[lookupByPattern] operator[SEP] identifier[configPatternMatcher] , identifier[countDownLatchConfigs] , identifier[name] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[config] operator[!=] Other[null] operator[SEP] {
Keyword[return] identifier[config] operator[SEP] identifier[getAsReadOnly] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] identifier[getCountDownLatchConfig] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[getAsReadOnly] operator[SEP] operator[SEP] operator[SEP]
}
|
public ConnectionListener createConnectionListener(Credential credential, ManagedConnectionPool mcp)
throws ResourceException
{
try
{
if (semaphore.tryAcquire(poolConfiguration.getBlockingTimeout(), TimeUnit.MILLISECONDS))
{
long start = getInternalStatistics().isEnabled() ? System.currentTimeMillis() : 0L;
ManagedConnection mc =
cm.getManagedConnectionFactory().createManagedConnection(credential.getSubject(),
credential.getConnectionRequestInfo());
if (getInternalStatistics().isEnabled())
{
getInternalStatistics().deltaCreatedCount();
getInternalStatistics().deltaTotalCreationTime(System.currentTimeMillis() - start);
}
if (cm.getTransactionSupport() == TransactionSupportLevel.NoTransaction)
{
return new NoTransactionConnectionListener(cm, mc, credential, mcp, cm.getPool().getFlushStrategy());
}
else if (cm.getTransactionSupport() == TransactionSupportLevel.LocalTransaction)
{
return new LocalTransactionConnectionListener(cm, mc, credential, getLocalXAResource(mc), mcp,
cm.getPool().getFlushStrategy());
}
else
{
return new XATransactionConnectionListener(cm, mc, credential, getXAResource(mc),
cm.getConnectionManagerConfiguration().getXAResourceTimeout(), mcp,
cm.getPool().getFlushStrategy());
}
}
}
catch (ResourceException re)
{
throw re;
}
catch (Exception e)
{
throw new ResourceException(e);
}
throw new ResourceException("No ConnectionListener");
} | class class_name[name] begin[{]
method[createConnectionListener, return_type[type[ConnectionListener]], modifier[public], parameter[credential, mcp]] begin[{]
TryStatement(block=[IfStatement(condition=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getBlockingTimeout, postfix_operators=[], prefix_operators=[], qualifier=poolConfiguration, selectors=[], type_arguments=None), MemberReference(member=MILLISECONDS, postfix_operators=[], prefix_operators=[], qualifier=TimeUnit, selectors=[])], member=tryAcquire, postfix_operators=[], prefix_operators=[], qualifier=semaphore, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=TernaryExpression(condition=MethodInvocation(arguments=[], member=getInternalStatistics, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[], member=isEnabled, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), if_false=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0L), if_true=MethodInvocation(arguments=[], member=currentTimeMillis, postfix_operators=[], prefix_operators=[], qualifier=System, selectors=[], type_arguments=None)), name=start)], modifiers=set(), type=BasicType(dimensions=[], name=long)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getManagedConnectionFactory, postfix_operators=[], prefix_operators=[], qualifier=cm, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getSubject, postfix_operators=[], prefix_operators=[], qualifier=credential, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getConnectionRequestInfo, postfix_operators=[], prefix_operators=[], qualifier=credential, selectors=[], type_arguments=None)], member=createManagedConnection, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=mc)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ManagedConnection, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[], member=getInternalStatistics, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[], member=isEnabled, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=getInternalStatistics, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[], member=deltaCreatedCount, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=getInternalStatistics, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[BinaryOperation(operandl=MethodInvocation(arguments=[], member=currentTimeMillis, postfix_operators=[], prefix_operators=[], qualifier=System, selectors=[], type_arguments=None), operandr=MemberReference(member=start, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=-)], member=deltaTotalCreationTime, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)])), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getTransactionSupport, postfix_operators=[], prefix_operators=[], qualifier=cm, selectors=[], type_arguments=None), operandr=MemberReference(member=NoTransaction, postfix_operators=[], prefix_operators=[], qualifier=TransactionSupportLevel, selectors=[]), operator===), else_statement=IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getTransactionSupport, postfix_operators=[], prefix_operators=[], qualifier=cm, selectors=[], type_arguments=None), operandr=MemberReference(member=LocalTransaction, postfix_operators=[], prefix_operators=[], qualifier=TransactionSupportLevel, selectors=[]), operator===), else_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=ClassCreator(arguments=[MemberReference(member=cm, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=mc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=credential, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[MemberReference(member=mc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getXAResource, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getConnectionManagerConfiguration, postfix_operators=[], prefix_operators=[], qualifier=cm, selectors=[MethodInvocation(arguments=[], member=getXAResourceTimeout, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), MemberReference(member=mcp, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getPool, postfix_operators=[], prefix_operators=[], qualifier=cm, selectors=[MethodInvocation(arguments=[], member=getFlushStrategy, 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=XATransactionConnectionListener, sub_type=None)), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=ClassCreator(arguments=[MemberReference(member=cm, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=mc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=credential, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[MemberReference(member=mc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getLocalXAResource, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), MemberReference(member=mcp, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getPool, postfix_operators=[], prefix_operators=[], qualifier=cm, selectors=[MethodInvocation(arguments=[], member=getFlushStrategy, 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=LocalTransactionConnectionListener, sub_type=None)), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=ClassCreator(arguments=[MemberReference(member=cm, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=mc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=credential, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=mcp, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getPool, postfix_operators=[], prefix_operators=[], qualifier=cm, selectors=[MethodInvocation(arguments=[], member=getFlushStrategy, 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=NoTransactionConnectionListener, sub_type=None)), label=None)]))]))], catches=[CatchClause(block=[ThrowStatement(expression=MemberReference(member=re, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=re, types=['ResourceException'])), 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=ResourceException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None)
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="No ConnectionListener")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ResourceException, sub_type=None)), label=None)
end[}]
END[}] | Keyword[public] identifier[ConnectionListener] identifier[createConnectionListener] operator[SEP] identifier[Credential] identifier[credential] , identifier[ManagedConnectionPool] identifier[mcp] operator[SEP] Keyword[throws] identifier[ResourceException] {
Keyword[try] {
Keyword[if] operator[SEP] identifier[semaphore] operator[SEP] identifier[tryAcquire] operator[SEP] identifier[poolConfiguration] operator[SEP] identifier[getBlockingTimeout] operator[SEP] operator[SEP] , identifier[TimeUnit] operator[SEP] identifier[MILLISECONDS] operator[SEP] operator[SEP] {
Keyword[long] identifier[start] operator[=] identifier[getInternalStatistics] operator[SEP] operator[SEP] operator[SEP] identifier[isEnabled] operator[SEP] operator[SEP] operator[?] identifier[System] operator[SEP] identifier[currentTimeMillis] operator[SEP] operator[SEP] operator[:] Other[0L] operator[SEP] identifier[ManagedConnection] identifier[mc] operator[=] identifier[cm] operator[SEP] identifier[getManagedConnectionFactory] operator[SEP] operator[SEP] operator[SEP] identifier[createManagedConnection] operator[SEP] identifier[credential] operator[SEP] identifier[getSubject] operator[SEP] operator[SEP] , identifier[credential] operator[SEP] identifier[getConnectionRequestInfo] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[getInternalStatistics] operator[SEP] operator[SEP] operator[SEP] identifier[isEnabled] operator[SEP] operator[SEP] operator[SEP] {
identifier[getInternalStatistics] operator[SEP] operator[SEP] operator[SEP] identifier[deltaCreatedCount] operator[SEP] operator[SEP] operator[SEP] identifier[getInternalStatistics] operator[SEP] operator[SEP] operator[SEP] identifier[deltaTotalCreationTime] operator[SEP] identifier[System] operator[SEP] identifier[currentTimeMillis] operator[SEP] operator[SEP] operator[-] identifier[start] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[cm] operator[SEP] identifier[getTransactionSupport] operator[SEP] operator[SEP] operator[==] identifier[TransactionSupportLevel] operator[SEP] identifier[NoTransaction] operator[SEP] {
Keyword[return] Keyword[new] identifier[NoTransactionConnectionListener] operator[SEP] identifier[cm] , identifier[mc] , identifier[credential] , identifier[mcp] , identifier[cm] operator[SEP] identifier[getPool] operator[SEP] operator[SEP] operator[SEP] identifier[getFlushStrategy] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[cm] operator[SEP] identifier[getTransactionSupport] operator[SEP] operator[SEP] operator[==] identifier[TransactionSupportLevel] operator[SEP] identifier[LocalTransaction] operator[SEP] {
Keyword[return] Keyword[new] identifier[LocalTransactionConnectionListener] operator[SEP] identifier[cm] , identifier[mc] , identifier[credential] , identifier[getLocalXAResource] operator[SEP] identifier[mc] operator[SEP] , identifier[mcp] , identifier[cm] operator[SEP] identifier[getPool] operator[SEP] operator[SEP] operator[SEP] identifier[getFlushStrategy] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] {
Keyword[return] Keyword[new] identifier[XATransactionConnectionListener] operator[SEP] identifier[cm] , identifier[mc] , identifier[credential] , identifier[getXAResource] operator[SEP] identifier[mc] operator[SEP] , identifier[cm] operator[SEP] identifier[getConnectionManagerConfiguration] operator[SEP] operator[SEP] operator[SEP] identifier[getXAResourceTimeout] operator[SEP] operator[SEP] , identifier[mcp] , identifier[cm] operator[SEP] identifier[getPool] operator[SEP] operator[SEP] operator[SEP] identifier[getFlushStrategy] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
}
}
Keyword[catch] operator[SEP] identifier[ResourceException] identifier[re] operator[SEP] {
Keyword[throw] identifier[re] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] {
Keyword[throw] Keyword[new] identifier[ResourceException] operator[SEP] identifier[e] operator[SEP] operator[SEP]
}
Keyword[throw] Keyword[new] identifier[ResourceException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
|
public void addDataPoint(final double DATA) {
for (DataPoint dataPoint : DATA_LIST) {
if (System.currentTimeMillis() - dataPoint.getTimeStamp() > timeFrame) {
trashList.add(dataPoint);
}
}
for (DataPoint dataPoint : trashList) {
DATA_LIST.remove(dataPoint);
}
trashList.clear();
DATA_LIST.add(new DataPoint(System.currentTimeMillis(), DATA));
init(INNER_BOUNDS.width, INNER_BOUNDS.height);
repaint(INNER_BOUNDS);
} | class class_name[name] begin[{]
method[addDataPoint, return_type[void], modifier[public], parameter[DATA]] begin[{]
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[], member=currentTimeMillis, postfix_operators=[], prefix_operators=[], qualifier=System, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[], member=getTimeStamp, postfix_operators=[], prefix_operators=[], qualifier=dataPoint, selectors=[], type_arguments=None), operator=-), operandr=MemberReference(member=timeFrame, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=>), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=dataPoint, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=trashList, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=DATA_LIST, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=dataPoint)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=DataPoint, sub_type=None))), label=None)
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=dataPoint, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=remove, postfix_operators=[], prefix_operators=[], qualifier=DATA_LIST, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=trashList, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=dataPoint)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=DataPoint, sub_type=None))), label=None)
call[trashList.clear, parameter[]]
call[DATA_LIST.add, parameter[ClassCreator(arguments=[MethodInvocation(arguments=[], member=currentTimeMillis, postfix_operators=[], prefix_operators=[], qualifier=System, selectors=[], type_arguments=None), MemberReference(member=DATA, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=DataPoint, sub_type=None))]]
call[.init, parameter[member[INNER_BOUNDS.width], member[INNER_BOUNDS.height]]]
call[.repaint, parameter[member[.INNER_BOUNDS]]]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[addDataPoint] operator[SEP] Keyword[final] Keyword[double] identifier[DATA] operator[SEP] {
Keyword[for] operator[SEP] identifier[DataPoint] identifier[dataPoint] operator[:] identifier[DATA_LIST] operator[SEP] {
Keyword[if] operator[SEP] identifier[System] operator[SEP] identifier[currentTimeMillis] operator[SEP] operator[SEP] operator[-] identifier[dataPoint] operator[SEP] identifier[getTimeStamp] operator[SEP] operator[SEP] operator[>] identifier[timeFrame] operator[SEP] {
identifier[trashList] operator[SEP] identifier[add] operator[SEP] identifier[dataPoint] operator[SEP] operator[SEP]
}
}
Keyword[for] operator[SEP] identifier[DataPoint] identifier[dataPoint] operator[:] identifier[trashList] operator[SEP] {
identifier[DATA_LIST] operator[SEP] identifier[remove] operator[SEP] identifier[dataPoint] operator[SEP] operator[SEP]
}
identifier[trashList] operator[SEP] identifier[clear] operator[SEP] operator[SEP] operator[SEP] identifier[DATA_LIST] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[DataPoint] operator[SEP] identifier[System] operator[SEP] identifier[currentTimeMillis] operator[SEP] operator[SEP] , identifier[DATA] operator[SEP] operator[SEP] operator[SEP] identifier[init] operator[SEP] identifier[INNER_BOUNDS] operator[SEP] identifier[width] , identifier[INNER_BOUNDS] operator[SEP] identifier[height] operator[SEP] operator[SEP] identifier[repaint] operator[SEP] identifier[INNER_BOUNDS] operator[SEP] operator[SEP]
}
|
public String getFirst(String name)
{
List<String> values = delegate.get(name);
if (values != null) {
if (values.size() > 0) {
return values.get(0);
}
}
return null;
} | class class_name[name] begin[{]
method[getFirst, return_type[type[String]], modifier[public], parameter[name]] begin[{]
local_variable[type[List], values]
if[binary_operation[member[.values], !=, literal[null]]] begin[{]
if[binary_operation[call[values.size, parameter[]], >, literal[0]]] begin[{]
return[call[values.get, parameter[literal[0]]]]
else begin[{]
None
end[}]
else begin[{]
None
end[}]
return[literal[null]]
end[}]
END[}] | Keyword[public] identifier[String] identifier[getFirst] operator[SEP] identifier[String] identifier[name] operator[SEP] {
identifier[List] operator[<] identifier[String] operator[>] identifier[values] operator[=] identifier[delegate] operator[SEP] identifier[get] operator[SEP] identifier[name] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[values] operator[!=] Other[null] operator[SEP] {
Keyword[if] operator[SEP] identifier[values] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] {
Keyword[return] identifier[values] operator[SEP] identifier[get] operator[SEP] Other[0] operator[SEP] operator[SEP]
}
}
Keyword[return] Other[null] operator[SEP]
}
|
private static String escape(Object val) {
if (val == null) {
return "null";
} else if (val instanceof TraceableStream) {
TraceableStream ts = (TraceableStream)val;
return ts.getStreamTracer().getStreamId().toString();
} else if (val instanceof FileStatus) {
FileStatus stat = (FileStatus)val;
String properties = "isdir=" + stat.isDir() + ",len=" + stat.getLen();
try {
return "#"+SimpleBase64.encode(properties.toString().getBytes("UTF-8"));
} catch (java.io.UnsupportedEncodingException e) {
return "CouldNotEncode";
}
} else if (val instanceof FileStatus[]) {
FileStatus stat[] = (FileStatus[])val;
return Integer.toString(stat.length);
} else if (val instanceof Long) {
return Long.toString((Long)val);
} else if (val instanceof Integer) {
return Integer.toString((Integer)val);
} else if (val instanceof Short) {
return Integer.toString((Short)val);
} else {
try {
return "#"+SimpleBase64.encode(val.toString().getBytes("UTF-8"));
} catch (java.io.UnsupportedEncodingException e) {
return "CouldNotEncode";
}
}
} | class class_name[name] begin[{]
method[escape, return_type[type[String]], modifier[private static], parameter[val]] begin[{]
if[binary_operation[member[.val], ==, literal[null]]] begin[{]
return[literal["null"]]
else begin[{]
if[binary_operation[member[.val], instanceof, type[TraceableStream]]] begin[{]
local_variable[type[TraceableStream], ts]
return[call[ts.getStreamTracer, parameter[]]]
else begin[{]
if[binary_operation[member[.val], instanceof, type[FileStatus]]] begin[{]
local_variable[type[FileStatus], stat]
local_variable[type[String], properties]
TryStatement(block=[ReturnStatement(expression=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="#"), operandr=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=properties, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="UTF-8")], member=getBytes, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=encode, postfix_operators=[], prefix_operators=[], qualifier=SimpleBase64, selectors=[], type_arguments=None), operator=+), label=None)], catches=[CatchClause(block=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="CouldNotEncode"), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['java.io.UnsupportedEncodingException']))], finally_block=None, label=None, resources=None)
else begin[{]
if[binary_operation[member[.val], instanceof, type[FileStatus]]] begin[{]
local_variable[type[FileStatus], stat]
return[call[Integer.toString, parameter[member[stat.length]]]]
else begin[{]
if[binary_operation[member[.val], instanceof, type[Long]]] begin[{]
return[call[Long.toString, parameter[Cast(expression=MemberReference(member=val, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Long, sub_type=None))]]]
else begin[{]
if[binary_operation[member[.val], instanceof, type[Integer]]] begin[{]
return[call[Integer.toString, parameter[Cast(expression=MemberReference(member=val, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Integer, sub_type=None))]]]
else begin[{]
if[binary_operation[member[.val], instanceof, type[Short]]] begin[{]
return[call[Integer.toString, parameter[Cast(expression=MemberReference(member=val, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Short, sub_type=None))]]]
else begin[{]
TryStatement(block=[ReturnStatement(expression=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="#"), operandr=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=val, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="UTF-8")], member=getBytes, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=encode, postfix_operators=[], prefix_operators=[], qualifier=SimpleBase64, selectors=[], type_arguments=None), operator=+), label=None)], catches=[CatchClause(block=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="CouldNotEncode"), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['java.io.UnsupportedEncodingException']))], finally_block=None, label=None, resources=None)
end[}]
end[}]
end[}]
end[}]
end[}]
end[}]
end[}]
end[}]
END[}] | Keyword[private] Keyword[static] identifier[String] identifier[escape] operator[SEP] identifier[Object] identifier[val] operator[SEP] {
Keyword[if] operator[SEP] identifier[val] operator[==] Other[null] operator[SEP] {
Keyword[return] literal[String] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[val] Keyword[instanceof] identifier[TraceableStream] operator[SEP] {
identifier[TraceableStream] identifier[ts] operator[=] operator[SEP] identifier[TraceableStream] operator[SEP] identifier[val] operator[SEP] Keyword[return] identifier[ts] operator[SEP] identifier[getStreamTracer] operator[SEP] operator[SEP] operator[SEP] identifier[getStreamId] operator[SEP] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[val] Keyword[instanceof] identifier[FileStatus] operator[SEP] {
identifier[FileStatus] identifier[stat] operator[=] operator[SEP] identifier[FileStatus] operator[SEP] identifier[val] operator[SEP] identifier[String] identifier[properties] operator[=] literal[String] operator[+] identifier[stat] operator[SEP] identifier[isDir] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[stat] operator[SEP] identifier[getLen] operator[SEP] operator[SEP] operator[SEP] Keyword[try] {
Keyword[return] literal[String] operator[+] identifier[SimpleBase64] operator[SEP] identifier[encode] operator[SEP] identifier[properties] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] identifier[getBytes] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[java] operator[SEP] identifier[io] operator[SEP] identifier[UnsupportedEncodingException] identifier[e] operator[SEP] {
Keyword[return] literal[String] operator[SEP]
}
}
Keyword[else] Keyword[if] operator[SEP] identifier[val] Keyword[instanceof] identifier[FileStatus] operator[SEP] operator[SEP] operator[SEP] {
identifier[FileStatus] identifier[stat] operator[SEP] operator[SEP] operator[=] operator[SEP] identifier[FileStatus] operator[SEP] operator[SEP] operator[SEP] identifier[val] operator[SEP] Keyword[return] identifier[Integer] operator[SEP] identifier[toString] operator[SEP] identifier[stat] operator[SEP] identifier[length] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[val] Keyword[instanceof] identifier[Long] operator[SEP] {
Keyword[return] identifier[Long] operator[SEP] identifier[toString] operator[SEP] operator[SEP] identifier[Long] operator[SEP] identifier[val] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[val] Keyword[instanceof] identifier[Integer] operator[SEP] {
Keyword[return] identifier[Integer] operator[SEP] identifier[toString] operator[SEP] operator[SEP] identifier[Integer] operator[SEP] identifier[val] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[val] Keyword[instanceof] identifier[Short] operator[SEP] {
Keyword[return] identifier[Integer] operator[SEP] identifier[toString] operator[SEP] operator[SEP] identifier[Short] operator[SEP] identifier[val] operator[SEP] operator[SEP]
}
Keyword[else] {
Keyword[try] {
Keyword[return] literal[String] operator[+] identifier[SimpleBase64] operator[SEP] identifier[encode] operator[SEP] identifier[val] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] identifier[getBytes] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[java] operator[SEP] identifier[io] operator[SEP] identifier[UnsupportedEncodingException] identifier[e] operator[SEP] {
Keyword[return] literal[String] operator[SEP]
}
}
}
|
public String convertIfcSimplePropertyTemplateTypeEnumToString(EDataType eDataType, Object instanceValue) {
return instanceValue == null ? null : instanceValue.toString();
} | class class_name[name] begin[{]
method[convertIfcSimplePropertyTemplateTypeEnumToString, return_type[type[String]], modifier[public], parameter[eDataType, instanceValue]] begin[{]
return[TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=instanceValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), if_false=MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=instanceValue, selectors=[], type_arguments=None), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null))]
end[}]
END[}] | Keyword[public] identifier[String] identifier[convertIfcSimplePropertyTemplateTypeEnumToString] operator[SEP] identifier[EDataType] identifier[eDataType] , identifier[Object] identifier[instanceValue] operator[SEP] {
Keyword[return] identifier[instanceValue] operator[==] Other[null] operator[?] Other[null] operator[:] identifier[instanceValue] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP]
}
|
static public Tokenizer getTokenizer(String filename) throws IOException {
if(filename.toLowerCase().endsWith("xml")) {
return new XmlTokenizer(filename);
} else {
return new BinaryTokenizer(filename);
}
} | class class_name[name] begin[{]
method[getTokenizer, return_type[type[Tokenizer]], modifier[public static], parameter[filename]] begin[{]
if[call[filename.toLowerCase, parameter[]]] begin[{]
return[ClassCreator(arguments=[MemberReference(member=filename, 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=XmlTokenizer, sub_type=None))]
else begin[{]
return[ClassCreator(arguments=[MemberReference(member=filename, 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=BinaryTokenizer, sub_type=None))]
end[}]
end[}]
END[}] | Keyword[static] Keyword[public] identifier[Tokenizer] identifier[getTokenizer] operator[SEP] identifier[String] identifier[filename] operator[SEP] Keyword[throws] identifier[IOException] {
Keyword[if] operator[SEP] identifier[filename] operator[SEP] identifier[toLowerCase] operator[SEP] operator[SEP] operator[SEP] identifier[endsWith] operator[SEP] literal[String] operator[SEP] operator[SEP] {
Keyword[return] Keyword[new] identifier[XmlTokenizer] operator[SEP] identifier[filename] operator[SEP] operator[SEP]
}
Keyword[else] {
Keyword[return] Keyword[new] identifier[BinaryTokenizer] operator[SEP] identifier[filename] operator[SEP] operator[SEP]
}
}
|
public final Filter simpleLogicalFilter() throws RecognitionException {
Filter filter = null;
Token o=null;
Filter a =null;
Filter b =null;
try {
// druidG.g:414:2: ( (a= simpleFilter ) | ( (a= simpleFilter WS o= ( AND | OR ) WS b= simpleFilter ) | (o= NOT WS b= simpleFilter ) ) )
int alt189=2;
alt189 = dfa189.predict(input);
switch (alt189) {
case 1 :
// druidG.g:415:2: (a= simpleFilter )
{
// druidG.g:415:2: (a= simpleFilter )
// druidG.g:415:3: a= simpleFilter
{
pushFollow(FOLLOW_simpleFilter_in_simpleLogicalFilter2873);
a=simpleFilter();
state._fsp--;
}
filter = a;
}
break;
case 2 :
// druidG.g:416:3: ( (a= simpleFilter WS o= ( AND | OR ) WS b= simpleFilter ) | (o= NOT WS b= simpleFilter ) )
{
// druidG.g:416:3: ( (a= simpleFilter WS o= ( AND | OR ) WS b= simpleFilter ) | (o= NOT WS b= simpleFilter ) )
int alt188=2;
int LA188_0 = input.LA(1);
if ( (LA188_0==ID) ) {
alt188=1;
}
else if ( (LA188_0==NOT) ) {
alt188=2;
}
else {
NoViableAltException nvae =
new NoViableAltException("", 188, 0, input);
throw nvae;
}
switch (alt188) {
case 1 :
// druidG.g:416:4: (a= simpleFilter WS o= ( AND | OR ) WS b= simpleFilter )
{
// druidG.g:416:4: (a= simpleFilter WS o= ( AND | OR ) WS b= simpleFilter )
// druidG.g:416:5: a= simpleFilter WS o= ( AND | OR ) WS b= simpleFilter
{
pushFollow(FOLLOW_simpleFilter_in_simpleLogicalFilter2885);
a=simpleFilter();
state._fsp--;
match(input,WS,FOLLOW_WS_in_simpleLogicalFilter2887);
o=input.LT(1);
if ( input.LA(1)==AND||input.LA(1)==OR ) {
input.consume();
state.errorRecovery=false;
}
else {
MismatchedSetException mse = new MismatchedSetException(null,input);
throw mse;
}
match(input,WS,FOLLOW_WS_in_simpleLogicalFilter2897);
pushFollow(FOLLOW_simpleFilter_in_simpleLogicalFilter2901);
b=simpleFilter();
state._fsp--;
}
}
break;
case 2 :
// druidG.g:416:55: (o= NOT WS b= simpleFilter )
{
// druidG.g:416:55: (o= NOT WS b= simpleFilter )
// druidG.g:416:56: o= NOT WS b= simpleFilter
{
o=(Token)match(input,NOT,FOLLOW_NOT_in_simpleLogicalFilter2909);
match(input,WS,FOLLOW_WS_in_simpleLogicalFilter2911);
pushFollow(FOLLOW_simpleFilter_in_simpleLogicalFilter2915);
b=simpleFilter();
state._fsp--;
}
}
break;
}
filter = new Filter((o!=null?o.getText():null).toLowerCase());
filter.fields = new ArrayList<>();
if (a != null) {
filter.fields.add(a);
}
if (b != null) {
filter.fields.add(b);
}
}
break;
}
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
}
finally {
// do for sure before leaving
}
return filter;
} | class class_name[name] begin[{]
method[simpleLogicalFilter, return_type[type[Filter]], modifier[final public], parameter[]] begin[{]
local_variable[type[Filter], filter]
local_variable[type[Token], o]
local_variable[type[Filter], a]
local_variable[type[Filter], b]
TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), name=alt189)], modifiers=set(), type=BasicType(dimensions=[], name=int)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=alt189, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=input, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=predict, postfix_operators=[], prefix_operators=[], qualifier=dfa189, selectors=[], type_arguments=None)), label=None), SwitchStatement(cases=[SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], statements=[BlockStatement(label=None, statements=[BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=FOLLOW_simpleFilter_in_simpleLogicalFilter2873, 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=a, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=simpleFilter, 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)]), StatementExpression(expression=Assignment(expressionl=MemberReference(member=filter, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=a, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)]), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2)], statements=[BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), name=alt188)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], member=LA, postfix_operators=[], prefix_operators=[], qualifier=input, selectors=[], type_arguments=None), name=LA188_0)], modifiers=set(), type=BasicType(dimensions=[], name=int)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=LA188_0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=ID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), else_statement=IfStatement(condition=BinaryOperation(operandl=MemberReference(member=LA188_0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=NOT, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), else_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=""), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=188), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), MemberReference(member=input, 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=NoViableAltException, sub_type=None)), name=nvae)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=NoViableAltException, sub_type=None)), ThrowStatement(expression=MemberReference(member=nvae, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=alt188, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2)), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=alt188, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)), label=None)])), SwitchStatement(cases=[SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], statements=[BlockStatement(label=None, statements=[BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=FOLLOW_simpleFilter_in_simpleLogicalFilter2885, 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=a, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=simpleFilter, 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), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=input, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=WS, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=FOLLOW_WS_in_simpleLogicalFilter2887, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=match, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=o, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], member=LT, postfix_operators=[], prefix_operators=[], qualifier=input, selectors=[], type_arguments=None)), label=None), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], member=LA, postfix_operators=[], prefix_operators=[], qualifier=input, selectors=[], type_arguments=None), operandr=MemberReference(member=AND, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], member=LA, postfix_operators=[], prefix_operators=[], qualifier=input, selectors=[], type_arguments=None), operandr=MemberReference(member=OR, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), operator=||), else_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), MemberReference(member=input, 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=MismatchedSetException, sub_type=None)), name=mse)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=MismatchedSetException, sub_type=None)), ThrowStatement(expression=MemberReference(member=mse, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=consume, postfix_operators=[], prefix_operators=[], qualifier=input, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=errorRecovery, postfix_operators=[], prefix_operators=[], qualifier=state, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=input, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=WS, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=FOLLOW_WS_in_simpleLogicalFilter2897, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=match, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=FOLLOW_simpleFilter_in_simpleLogicalFilter2901, 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=b, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=simpleFilter, 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)])]), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2)], statements=[BlockStatement(label=None, statements=[BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=o, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Cast(expression=MethodInvocation(arguments=[MemberReference(member=input, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=NOT, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=FOLLOW_NOT_in_simpleLogicalFilter2909, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=match, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=Token, sub_type=None))), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=input, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=WS, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=FOLLOW_WS_in_simpleLogicalFilter2911, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=match, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=FOLLOW_simpleFilter_in_simpleLogicalFilter2915, 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=b, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=simpleFilter, 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)])]), BreakStatement(goto=None, label=None)])], expression=MemberReference(member=alt188, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=filter, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=o, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), if_false=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), if_true=MethodInvocation(arguments=[], member=getText, postfix_operators=[], prefix_operators=[], qualifier=o, selectors=[], type_arguments=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Filter, sub_type=None))), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=fields, postfix_operators=[], prefix_operators=[], qualifier=filter, selectors=[]), type==, value=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=ArrayList, sub_type=None))), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=a, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=a, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=filter.fields, selectors=[], type_arguments=None), label=None)])), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=b, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=b, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=filter.fields, selectors=[], type_arguments=None), label=None)]))]), BreakStatement(goto=None, label=None)])], expression=MemberReference(member=alt189, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=re, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=reportError, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=input, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=re, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=recover, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=re, types=['RecognitionException']))], finally_block=[], label=None, resources=None)
return[member[.filter]]
end[}]
END[}] | Keyword[public] Keyword[final] identifier[Filter] identifier[simpleLogicalFilter] operator[SEP] operator[SEP] Keyword[throws] identifier[RecognitionException] {
identifier[Filter] identifier[filter] operator[=] Other[null] operator[SEP] identifier[Token] identifier[o] operator[=] Other[null] operator[SEP] identifier[Filter] identifier[a] operator[=] Other[null] operator[SEP] identifier[Filter] identifier[b] operator[=] Other[null] operator[SEP] Keyword[try] {
Keyword[int] identifier[alt189] operator[=] Other[2] operator[SEP] identifier[alt189] operator[=] identifier[dfa189] operator[SEP] identifier[predict] operator[SEP] identifier[input] operator[SEP] operator[SEP] Keyword[switch] operator[SEP] identifier[alt189] operator[SEP] {
Keyword[case] Other[1] operator[:] {
{
identifier[pushFollow] operator[SEP] identifier[FOLLOW_simpleFilter_in_simpleLogicalFilter2873] operator[SEP] operator[SEP] identifier[a] operator[=] identifier[simpleFilter] operator[SEP] operator[SEP] operator[SEP] identifier[state] operator[SEP] identifier[_fsp] operator[--] operator[SEP]
}
identifier[filter] operator[=] identifier[a] operator[SEP]
}
Keyword[break] operator[SEP] Keyword[case] Other[2] operator[:] {
Keyword[int] identifier[alt188] operator[=] Other[2] operator[SEP] Keyword[int] identifier[LA188_0] operator[=] identifier[input] operator[SEP] identifier[LA] operator[SEP] Other[1] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[SEP] identifier[LA188_0] operator[==] identifier[ID] operator[SEP] operator[SEP] {
identifier[alt188] operator[=] Other[1] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] operator[SEP] identifier[LA188_0] operator[==] identifier[NOT] operator[SEP] operator[SEP] {
identifier[alt188] operator[=] Other[2] operator[SEP]
}
Keyword[else] {
identifier[NoViableAltException] identifier[nvae] operator[=] Keyword[new] identifier[NoViableAltException] operator[SEP] literal[String] , Other[188] , Other[0] , identifier[input] operator[SEP] operator[SEP] Keyword[throw] identifier[nvae] operator[SEP]
}
Keyword[switch] operator[SEP] identifier[alt188] operator[SEP] {
Keyword[case] Other[1] operator[:] {
{
identifier[pushFollow] operator[SEP] identifier[FOLLOW_simpleFilter_in_simpleLogicalFilter2885] operator[SEP] operator[SEP] identifier[a] operator[=] identifier[simpleFilter] operator[SEP] operator[SEP] operator[SEP] identifier[state] operator[SEP] identifier[_fsp] operator[--] operator[SEP] identifier[match] operator[SEP] identifier[input] , identifier[WS] , identifier[FOLLOW_WS_in_simpleLogicalFilter2887] operator[SEP] operator[SEP] identifier[o] operator[=] identifier[input] operator[SEP] identifier[LT] operator[SEP] Other[1] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[input] operator[SEP] identifier[LA] operator[SEP] Other[1] operator[SEP] operator[==] identifier[AND] operator[||] identifier[input] operator[SEP] identifier[LA] operator[SEP] Other[1] operator[SEP] operator[==] identifier[OR] operator[SEP] {
identifier[input] operator[SEP] identifier[consume] operator[SEP] operator[SEP] operator[SEP] identifier[state] operator[SEP] identifier[errorRecovery] operator[=] literal[boolean] operator[SEP]
}
Keyword[else] {
identifier[MismatchedSetException] identifier[mse] operator[=] Keyword[new] identifier[MismatchedSetException] operator[SEP] Other[null] , identifier[input] operator[SEP] operator[SEP] Keyword[throw] identifier[mse] operator[SEP]
}
identifier[match] operator[SEP] identifier[input] , identifier[WS] , identifier[FOLLOW_WS_in_simpleLogicalFilter2897] operator[SEP] operator[SEP] identifier[pushFollow] operator[SEP] identifier[FOLLOW_simpleFilter_in_simpleLogicalFilter2901] operator[SEP] operator[SEP] identifier[b] operator[=] identifier[simpleFilter] operator[SEP] operator[SEP] operator[SEP] identifier[state] operator[SEP] identifier[_fsp] operator[--] operator[SEP]
}
}
Keyword[break] operator[SEP] Keyword[case] Other[2] operator[:] {
{
identifier[o] operator[=] operator[SEP] identifier[Token] operator[SEP] identifier[match] operator[SEP] identifier[input] , identifier[NOT] , identifier[FOLLOW_NOT_in_simpleLogicalFilter2909] operator[SEP] operator[SEP] identifier[match] operator[SEP] identifier[input] , identifier[WS] , identifier[FOLLOW_WS_in_simpleLogicalFilter2911] operator[SEP] operator[SEP] identifier[pushFollow] operator[SEP] identifier[FOLLOW_simpleFilter_in_simpleLogicalFilter2915] operator[SEP] operator[SEP] identifier[b] operator[=] identifier[simpleFilter] operator[SEP] operator[SEP] operator[SEP] identifier[state] operator[SEP] identifier[_fsp] operator[--] operator[SEP]
}
}
Keyword[break] operator[SEP]
}
identifier[filter] operator[=] Keyword[new] identifier[Filter] operator[SEP] operator[SEP] identifier[o] operator[!=] Other[null] operator[?] identifier[o] operator[SEP] identifier[getText] operator[SEP] operator[SEP] operator[:] Other[null] operator[SEP] operator[SEP] identifier[toLowerCase] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[filter] operator[SEP] identifier[fields] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[a] operator[!=] Other[null] operator[SEP] {
identifier[filter] operator[SEP] identifier[fields] operator[SEP] identifier[add] operator[SEP] identifier[a] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[b] operator[!=] Other[null] operator[SEP] {
identifier[filter] operator[SEP] identifier[fields] operator[SEP] identifier[add] operator[SEP] identifier[b] operator[SEP] operator[SEP]
}
}
Keyword[break] operator[SEP]
}
}
Keyword[catch] operator[SEP] identifier[RecognitionException] identifier[re] operator[SEP] {
identifier[reportError] operator[SEP] identifier[re] operator[SEP] operator[SEP] identifier[recover] operator[SEP] identifier[input] , identifier[re] operator[SEP] operator[SEP]
}
Keyword[finally] {
}
Keyword[return] identifier[filter] operator[SEP]
}
|
@Override
public void assignClient(long clientId) {
LOG.info("Assigning client " + clientId + " ...");
synchronized (clientModificationsLock) {
newlyAssignedClients.add(clientId);
}
} | class class_name[name] begin[{]
method[assignClient, return_type[void], modifier[public], parameter[clientId]] begin[{]
call[LOG.info, parameter[binary_operation[binary_operation[literal["Assigning client "], +, member[.clientId]], +, literal[" ..."]]]]
SYNCHRONIZED[member[.clientModificationsLock]] BEGIN[{]
call[newlyAssignedClients.add, parameter[member[.clientId]]]
END[}]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[assignClient] operator[SEP] Keyword[long] identifier[clientId] operator[SEP] {
identifier[LOG] operator[SEP] identifier[info] operator[SEP] literal[String] operator[+] identifier[clientId] operator[+] literal[String] operator[SEP] operator[SEP] Keyword[synchronized] operator[SEP] identifier[clientModificationsLock] operator[SEP] {
identifier[newlyAssignedClients] operator[SEP] identifier[add] operator[SEP] identifier[clientId] operator[SEP] operator[SEP]
}
}
|
private void readPI()
throws XMLStreamException
{
int ptr = mInputPtr;
int start = ptr;
char[] inputBuf = mInputBuffer;
int inputLen = mInputEnd;
outer_loop:
while (ptr < inputLen) {
char c = inputBuf[ptr++];
if (c < CHAR_SPACE) {
if (c == '\n') {
markLF(ptr);
} else if (c == '\r') {
if (ptr < inputLen && !mNormalizeLFs) {
if (inputBuf[ptr] == '\n') {
++ptr;
}
markLF(ptr);
} else {
--ptr; // pushback
break;
}
} else if (c != '\t') {
throwInvalidSpace(c);
}
} else if (c == '?') {
// K; now just need '>' after zero or more '?'s
while (true) {
if (ptr >= inputLen) {
/* end of buffer; need to push back at least one of
* question marks (not all, since just one is needed
* to close the PI)
*/
--ptr;
break outer_loop;
}
c = inputBuf[ptr++];
if (c == '>') {
mInputPtr = ptr;
// Need to discard trailing '?>'
mTextBuffer.resetWithShared(inputBuf, start, ptr-start-2);
return;
}
if (c != '?') {
// Not end, can continue, but need to push back last char, in case it's LF/CR
--ptr;
break;
}
}
}
}
mInputPtr = ptr;
// No point in trying to share... let's just append
mTextBuffer.resetWithCopy(inputBuf, start, ptr-start);
readPI2(mTextBuffer);
} | class class_name[name] begin[{]
method[readPI, return_type[void], modifier[private], parameter[]] begin[{]
local_variable[type[int], ptr]
local_variable[type[int], start]
local_variable[type[char], inputBuf]
local_variable[type[int], inputLen]
while[binary_operation[member[.ptr], <, member[.inputLen]]] begin[{]
local_variable[type[char], c]
if[binary_operation[member[.c], <, member[.CHAR_SPACE]]] begin[{]
if[binary_operation[member[.c], ==, literal['\n']]] begin[{]
call[.markLF, parameter[member[.ptr]]]
else begin[{]
if[binary_operation[member[.c], ==, literal['\r']]] begin[{]
if[binary_operation[binary_operation[member[.ptr], <, member[.inputLen]], &&, member[.mNormalizeLFs]]] begin[{]
if[binary_operation[member[.inputBuf], ==, literal['\n']]] begin[{]
member[.ptr]
else begin[{]
None
end[}]
call[.markLF, parameter[member[.ptr]]]
else begin[{]
member[.ptr]
BreakStatement(goto=None, label=None)
end[}]
else begin[{]
if[binary_operation[member[.c], !=, literal['\t']]] begin[{]
call[.throwInvalidSpace, parameter[member[.c]]]
else begin[{]
None
end[}]
end[}]
end[}]
else begin[{]
if[binary_operation[member[.c], ==, literal['?']]] begin[{]
while[literal[true]] begin[{]
if[binary_operation[member[.ptr], >=, member[.inputLen]]] begin[{]
member[.ptr]
BreakStatement(goto=outer_loop, label=None)
else begin[{]
None
end[}]
assign[member[.c], member[.inputBuf]]
if[binary_operation[member[.c], ==, literal['>']]] begin[{]
assign[member[.mInputPtr], member[.ptr]]
call[mTextBuffer.resetWithShared, parameter[member[.inputBuf], member[.start], binary_operation[binary_operation[member[.ptr], -, member[.start]], -, literal[2]]]]
return[None]
else begin[{]
None
end[}]
if[binary_operation[member[.c], !=, literal['?']]] begin[{]
member[.ptr]
BreakStatement(goto=None, label=None)
else begin[{]
None
end[}]
end[}]
else begin[{]
None
end[}]
end[}]
end[}]
assign[member[.mInputPtr], member[.ptr]]
call[mTextBuffer.resetWithCopy, parameter[member[.inputBuf], member[.start], binary_operation[member[.ptr], -, member[.start]]]]
call[.readPI2, parameter[member[.mTextBuffer]]]
end[}]
END[}] | Keyword[private] Keyword[void] identifier[readPI] operator[SEP] operator[SEP] Keyword[throws] identifier[XMLStreamException] {
Keyword[int] identifier[ptr] operator[=] identifier[mInputPtr] operator[SEP] Keyword[int] identifier[start] operator[=] identifier[ptr] operator[SEP] Keyword[char] operator[SEP] operator[SEP] identifier[inputBuf] operator[=] identifier[mInputBuffer] operator[SEP] Keyword[int] identifier[inputLen] operator[=] identifier[mInputEnd] operator[SEP] identifier[outer_loop] operator[:] Keyword[while] operator[SEP] identifier[ptr] operator[<] identifier[inputLen] operator[SEP] {
Keyword[char] identifier[c] operator[=] identifier[inputBuf] operator[SEP] identifier[ptr] operator[++] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[c] operator[<] identifier[CHAR_SPACE] operator[SEP] {
Keyword[if] operator[SEP] identifier[c] operator[==] literal[String] operator[SEP] {
identifier[markLF] operator[SEP] identifier[ptr] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[c] operator[==] literal[String] operator[SEP] {
Keyword[if] operator[SEP] identifier[ptr] operator[<] identifier[inputLen] operator[&&] operator[!] identifier[mNormalizeLFs] operator[SEP] {
Keyword[if] operator[SEP] identifier[inputBuf] operator[SEP] identifier[ptr] operator[SEP] operator[==] literal[String] operator[SEP] {
operator[++] identifier[ptr] operator[SEP]
}
identifier[markLF] operator[SEP] identifier[ptr] operator[SEP] operator[SEP]
}
Keyword[else] {
operator[--] identifier[ptr] operator[SEP] Keyword[break] operator[SEP]
}
}
Keyword[else] Keyword[if] operator[SEP] identifier[c] operator[!=] literal[String] operator[SEP] {
identifier[throwInvalidSpace] operator[SEP] identifier[c] operator[SEP] operator[SEP]
}
}
Keyword[else] Keyword[if] operator[SEP] identifier[c] operator[==] literal[String] operator[SEP] {
Keyword[while] operator[SEP] literal[boolean] operator[SEP] {
Keyword[if] operator[SEP] identifier[ptr] operator[>=] identifier[inputLen] operator[SEP] {
operator[--] identifier[ptr] operator[SEP] Keyword[break] identifier[outer_loop] operator[SEP]
}
identifier[c] operator[=] identifier[inputBuf] operator[SEP] identifier[ptr] operator[++] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[c] operator[==] literal[String] operator[SEP] {
identifier[mInputPtr] operator[=] identifier[ptr] operator[SEP] identifier[mTextBuffer] operator[SEP] identifier[resetWithShared] operator[SEP] identifier[inputBuf] , identifier[start] , identifier[ptr] operator[-] identifier[start] operator[-] Other[2] operator[SEP] operator[SEP] Keyword[return] operator[SEP]
}
Keyword[if] operator[SEP] identifier[c] operator[!=] literal[String] operator[SEP] {
operator[--] identifier[ptr] operator[SEP] Keyword[break] operator[SEP]
}
}
}
}
identifier[mInputPtr] operator[=] identifier[ptr] operator[SEP] identifier[mTextBuffer] operator[SEP] identifier[resetWithCopy] operator[SEP] identifier[inputBuf] , identifier[start] , identifier[ptr] operator[-] identifier[start] operator[SEP] operator[SEP] identifier[readPI2] operator[SEP] identifier[mTextBuffer] operator[SEP] operator[SEP]
}
|
public static LineGeneral2D_F64 convert( LineSegment2D_F64 src , LineGeneral2D_F64 ret )
{
return convert(src.a,src.b,ret);
} | class class_name[name] begin[{]
method[convert, return_type[type[LineGeneral2D_F64]], modifier[public static], parameter[src, ret]] begin[{]
return[call[.convert, parameter[member[src.a], member[src.b], member[.ret]]]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[LineGeneral2D_F64] identifier[convert] operator[SEP] identifier[LineSegment2D_F64] identifier[src] , identifier[LineGeneral2D_F64] identifier[ret] operator[SEP] {
Keyword[return] identifier[convert] operator[SEP] identifier[src] operator[SEP] identifier[a] , identifier[src] operator[SEP] identifier[b] , identifier[ret] operator[SEP] operator[SEP]
}
|
public BatchWriteResult withResponses(BatchWriteOperationResponse... responses) {
if (this.responses == null) {
setResponses(new java.util.ArrayList<BatchWriteOperationResponse>(responses.length));
}
for (BatchWriteOperationResponse ele : responses) {
this.responses.add(ele);
}
return this;
} | class class_name[name] begin[{]
method[withResponses, return_type[type[BatchWriteResult]], modifier[public], parameter[responses]] begin[{]
if[binary_operation[THIS[member[None.responses]], ==, literal[null]]] begin[{]
call[.setResponses, parameter[ClassCreator(arguments=[MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=responses, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=java, sub_type=ReferenceType(arguments=None, dimensions=None, name=util, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=BatchWriteOperationResponse, sub_type=None))], dimensions=None, name=ArrayList, sub_type=None))))]]
else begin[{]
None
end[}]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=responses, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[MemberReference(member=ele, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=responses, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=ele)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=BatchWriteOperationResponse, sub_type=None))), label=None)
return[THIS[]]
end[}]
END[}] | Keyword[public] identifier[BatchWriteResult] identifier[withResponses] operator[SEP] identifier[BatchWriteOperationResponse] operator[...] identifier[responses] operator[SEP] {
Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[responses] operator[==] Other[null] operator[SEP] {
identifier[setResponses] operator[SEP] Keyword[new] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[ArrayList] operator[<] identifier[BatchWriteOperationResponse] operator[>] operator[SEP] identifier[responses] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[for] operator[SEP] identifier[BatchWriteOperationResponse] identifier[ele] operator[:] identifier[responses] operator[SEP] {
Keyword[this] operator[SEP] identifier[responses] operator[SEP] identifier[add] operator[SEP] identifier[ele] operator[SEP] operator[SEP]
}
Keyword[return] Keyword[this] operator[SEP]
}
|
public static void callMethod(final Object obj, final String methodName, final Object... args) {
try {
callMethod(obj, methodName, false, args);
} catch (InvocationTargetException e) {
JK.throww(e);
}
} | class class_name[name] begin[{]
method[callMethod, return_type[void], modifier[public static], parameter[obj, methodName, args]] begin[{]
TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=obj, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=methodName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), MemberReference(member=args, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=callMethod, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=throww, postfix_operators=[], prefix_operators=[], qualifier=JK, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['InvocationTargetException']))], finally_block=None, label=None, resources=None)
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[void] identifier[callMethod] operator[SEP] Keyword[final] identifier[Object] identifier[obj] , Keyword[final] identifier[String] identifier[methodName] , Keyword[final] identifier[Object] operator[...] identifier[args] operator[SEP] {
Keyword[try] {
identifier[callMethod] operator[SEP] identifier[obj] , identifier[methodName] , literal[boolean] , identifier[args] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[InvocationTargetException] identifier[e] operator[SEP] {
identifier[JK] operator[SEP] identifier[throww] operator[SEP] identifier[e] operator[SEP] operator[SEP]
}
}
|
public static String getBeginActionURI( String requestURI )
{
// Translate this to a request for the begin action ("begin.do") for this PageFlowController.
InternalStringBuilder retVal = new InternalStringBuilder();
int lastSlash = requestURI.lastIndexOf( '/' );
if ( lastSlash != -1 )
{
retVal.append( requestURI.substring( 0, lastSlash ) );
}
retVal.append( '/' ).append( BEGIN_ACTION_NAME ).append( ACTION_EXTENSION );
return retVal.toString();
} | class class_name[name] begin[{]
method[getBeginActionURI, return_type[type[String]], modifier[public static], parameter[requestURI]] begin[{]
local_variable[type[InternalStringBuilder], retVal]
local_variable[type[int], lastSlash]
if[binary_operation[member[.lastSlash], !=, literal[1]]] begin[{]
call[retVal.append, parameter[call[requestURI.substring, parameter[literal[0], member[.lastSlash]]]]]
else begin[{]
None
end[}]
call[retVal.append, parameter[literal['/']]]
return[call[retVal.toString, parameter[]]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[String] identifier[getBeginActionURI] operator[SEP] identifier[String] identifier[requestURI] operator[SEP] {
identifier[InternalStringBuilder] identifier[retVal] operator[=] Keyword[new] identifier[InternalStringBuilder] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[lastSlash] operator[=] identifier[requestURI] operator[SEP] identifier[lastIndexOf] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[lastSlash] operator[!=] operator[-] Other[1] operator[SEP] {
identifier[retVal] operator[SEP] identifier[append] operator[SEP] identifier[requestURI] operator[SEP] identifier[substring] operator[SEP] Other[0] , identifier[lastSlash] operator[SEP] operator[SEP] operator[SEP]
}
identifier[retVal] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[BEGIN_ACTION_NAME] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[ACTION_EXTENSION] operator[SEP] operator[SEP] Keyword[return] identifier[retVal] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP]
}
|
@Override
public ActionResponse godHandPrologue(final ActionRuntime runtime) {
try {
return super.godHandPrologue(runtime);
} catch (final UserRoleLoginException e) {
return redirect(e.getActionClass());
}
} | class class_name[name] begin[{]
method[godHandPrologue, return_type[type[ActionResponse]], modifier[public], parameter[runtime]] begin[{]
TryStatement(block=[ReturnStatement(expression=SuperMethodInvocation(arguments=[MemberReference(member=runtime, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=godHandPrologue, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ReturnStatement(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getActionClass, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None)], member=redirect, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['UserRoleLoginException']))], finally_block=None, label=None, resources=None)
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] identifier[ActionResponse] identifier[godHandPrologue] operator[SEP] Keyword[final] identifier[ActionRuntime] identifier[runtime] operator[SEP] {
Keyword[try] {
Keyword[return] Keyword[super] operator[SEP] identifier[godHandPrologue] operator[SEP] identifier[runtime] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] Keyword[final] identifier[UserRoleLoginException] identifier[e] operator[SEP] {
Keyword[return] identifier[redirect] operator[SEP] identifier[e] operator[SEP] identifier[getActionClass] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
}
|
public void marshall(GetDomainNameRequest getDomainNameRequest, ProtocolMarshaller protocolMarshaller) {
if (getDomainNameRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(getDomainNameRequest.getDomainName(), DOMAINNAME_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[getDomainNameRequest, protocolMarshaller]] begin[{]
if[binary_operation[member[.getDomainNameRequest], ==, 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=getDomainName, postfix_operators=[], prefix_operators=[], qualifier=getDomainNameRequest, selectors=[], type_arguments=None), MemberReference(member=DOMAINNAME_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[GetDomainNameRequest] identifier[getDomainNameRequest] , identifier[ProtocolMarshaller] identifier[protocolMarshaller] operator[SEP] {
Keyword[if] operator[SEP] identifier[getDomainNameRequest] 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[getDomainNameRequest] operator[SEP] identifier[getDomainName] operator[SEP] operator[SEP] , identifier[DOMAINNAME_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 RegistryPoliciesInner listPolicies(String resourceGroupName, String registryName) {
return listPoliciesWithServiceResponseAsync(resourceGroupName, registryName).toBlocking().single().body();
} | class class_name[name] begin[{]
method[listPolicies, return_type[type[RegistryPoliciesInner]], modifier[public], parameter[resourceGroupName, registryName]] begin[{]
return[call[.listPoliciesWithServiceResponseAsync, parameter[member[.resourceGroupName], member[.registryName]]]]
end[}]
END[}] | Keyword[public] identifier[RegistryPoliciesInner] identifier[listPolicies] operator[SEP] identifier[String] identifier[resourceGroupName] , identifier[String] identifier[registryName] operator[SEP] {
Keyword[return] identifier[listPoliciesWithServiceResponseAsync] operator[SEP] identifier[resourceGroupName] , identifier[registryName] operator[SEP] operator[SEP] identifier[toBlocking] operator[SEP] operator[SEP] operator[SEP] identifier[single] operator[SEP] operator[SEP] operator[SEP] identifier[body] operator[SEP] operator[SEP] operator[SEP]
}
|
public com.google.api.ads.adwords.axis.v201809.cm.TrialAsyncError[] getEntries() {
return entries;
} | class class_name[name] begin[{]
method[getEntries, return_type[type[com]], modifier[public], parameter[]] begin[{]
return[member[.entries]]
end[}]
END[}] | Keyword[public] identifier[com] operator[SEP] identifier[google] operator[SEP] identifier[api] operator[SEP] identifier[ads] operator[SEP] identifier[adwords] operator[SEP] identifier[axis] operator[SEP] identifier[v201809] operator[SEP] identifier[cm] operator[SEP] identifier[TrialAsyncError] operator[SEP] operator[SEP] identifier[getEntries] operator[SEP] operator[SEP] {
Keyword[return] identifier[entries] operator[SEP]
}
|
public static String latexPreProcessing(String latex) {
LOG.debug(" Pre-Processing for: " + latex);
if (latex.contains("subarray")) {
latex = latex.replaceAll("subarray", "array");
LOG.trace(" Eval replacement of subarray: " + latex);
}
latex = latex.replaceAll(POM_BUG_AVOIDANCE_UNDERSCORE, "_{$1}");
LOG.trace("Surround underscore: " + latex);
latex = latex.replaceAll(SINGLE_AND, TMP_SINGLE_AND);
latex = HtmlEscape.unescapeHtml(latex);
latex = latex.replaceAll(TMP_SINGLE_AND, " & ");
LOG.trace("HTML Unescaped: " + latex);
latex = latex.replaceAll(LATEX_COMMENTED_LINEBREAK, "");
LOG.trace("Commented linebreaks: " + latex);
latex = latex.replaceAll(ELEMINATE_ENDINGS, "");
latex = latex.replaceAll(ELEMINATE_STARTS, "");
latex = latex.replaceAll(ELEMINATE_SIMPLE_STARTS, "");
latex = latex.replaceAll(ELEMINATE_SIMPLE_ENDS, "");
LOG.trace("Replace bad end/start:" + latex);
LOG.debug("Finalize Pre-Processing for POM-Tagger: " + latex);
return latex;
} | class class_name[name] begin[{]
method[latexPreProcessing, return_type[type[String]], modifier[public static], parameter[latex]] begin[{]
call[LOG.debug, parameter[binary_operation[literal[" Pre-Processing for: "], +, member[.latex]]]]
if[call[latex.contains, parameter[literal["subarray"]]]] begin[{]
assign[member[.latex], call[latex.replaceAll, parameter[literal["subarray"], literal["array"]]]]
call[LOG.trace, parameter[binary_operation[literal[" Eval replacement of subarray: "], +, member[.latex]]]]
else begin[{]
None
end[}]
assign[member[.latex], call[latex.replaceAll, parameter[member[.POM_BUG_AVOIDANCE_UNDERSCORE], literal["_{$1}"]]]]
call[LOG.trace, parameter[binary_operation[literal["Surround underscore: "], +, member[.latex]]]]
assign[member[.latex], call[latex.replaceAll, parameter[member[.SINGLE_AND], member[.TMP_SINGLE_AND]]]]
assign[member[.latex], call[HtmlEscape.unescapeHtml, parameter[member[.latex]]]]
assign[member[.latex], call[latex.replaceAll, parameter[member[.TMP_SINGLE_AND], literal[" & "]]]]
call[LOG.trace, parameter[binary_operation[literal["HTML Unescaped: "], +, member[.latex]]]]
assign[member[.latex], call[latex.replaceAll, parameter[member[.LATEX_COMMENTED_LINEBREAK], literal[""]]]]
call[LOG.trace, parameter[binary_operation[literal["Commented linebreaks: "], +, member[.latex]]]]
assign[member[.latex], call[latex.replaceAll, parameter[member[.ELEMINATE_ENDINGS], literal[""]]]]
assign[member[.latex], call[latex.replaceAll, parameter[member[.ELEMINATE_STARTS], literal[""]]]]
assign[member[.latex], call[latex.replaceAll, parameter[member[.ELEMINATE_SIMPLE_STARTS], literal[""]]]]
assign[member[.latex], call[latex.replaceAll, parameter[member[.ELEMINATE_SIMPLE_ENDS], literal[""]]]]
call[LOG.trace, parameter[binary_operation[literal["Replace bad end/start:"], +, member[.latex]]]]
call[LOG.debug, parameter[binary_operation[literal["Finalize Pre-Processing for POM-Tagger: "], +, member[.latex]]]]
return[member[.latex]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[String] identifier[latexPreProcessing] operator[SEP] identifier[String] identifier[latex] operator[SEP] {
identifier[LOG] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[+] identifier[latex] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[latex] operator[SEP] identifier[contains] operator[SEP] literal[String] operator[SEP] operator[SEP] {
identifier[latex] operator[=] identifier[latex] operator[SEP] identifier[replaceAll] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[LOG] operator[SEP] identifier[trace] operator[SEP] literal[String] operator[+] identifier[latex] operator[SEP] operator[SEP]
}
identifier[latex] operator[=] identifier[latex] operator[SEP] identifier[replaceAll] operator[SEP] identifier[POM_BUG_AVOIDANCE_UNDERSCORE] , literal[String] operator[SEP] operator[SEP] identifier[LOG] operator[SEP] identifier[trace] operator[SEP] literal[String] operator[+] identifier[latex] operator[SEP] operator[SEP] identifier[latex] operator[=] identifier[latex] operator[SEP] identifier[replaceAll] operator[SEP] identifier[SINGLE_AND] , identifier[TMP_SINGLE_AND] operator[SEP] operator[SEP] identifier[latex] operator[=] identifier[HtmlEscape] operator[SEP] identifier[unescapeHtml] operator[SEP] identifier[latex] operator[SEP] operator[SEP] identifier[latex] operator[=] identifier[latex] operator[SEP] identifier[replaceAll] operator[SEP] identifier[TMP_SINGLE_AND] , literal[String] operator[SEP] operator[SEP] identifier[LOG] operator[SEP] identifier[trace] operator[SEP] literal[String] operator[+] identifier[latex] operator[SEP] operator[SEP] identifier[latex] operator[=] identifier[latex] operator[SEP] identifier[replaceAll] operator[SEP] identifier[LATEX_COMMENTED_LINEBREAK] , literal[String] operator[SEP] operator[SEP] identifier[LOG] operator[SEP] identifier[trace] operator[SEP] literal[String] operator[+] identifier[latex] operator[SEP] operator[SEP] identifier[latex] operator[=] identifier[latex] operator[SEP] identifier[replaceAll] operator[SEP] identifier[ELEMINATE_ENDINGS] , literal[String] operator[SEP] operator[SEP] identifier[latex] operator[=] identifier[latex] operator[SEP] identifier[replaceAll] operator[SEP] identifier[ELEMINATE_STARTS] , literal[String] operator[SEP] operator[SEP] identifier[latex] operator[=] identifier[latex] operator[SEP] identifier[replaceAll] operator[SEP] identifier[ELEMINATE_SIMPLE_STARTS] , literal[String] operator[SEP] operator[SEP] identifier[latex] operator[=] identifier[latex] operator[SEP] identifier[replaceAll] operator[SEP] identifier[ELEMINATE_SIMPLE_ENDS] , literal[String] operator[SEP] operator[SEP] identifier[LOG] operator[SEP] identifier[trace] operator[SEP] literal[String] operator[+] identifier[latex] operator[SEP] operator[SEP] identifier[LOG] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[+] identifier[latex] operator[SEP] operator[SEP] Keyword[return] identifier[latex] operator[SEP]
}
|
@Override
public Socket createSocket(String host, int port) throws IOException {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
Tr.debug(tc, "SocketFactory attempting to create socket for host: " + host + " port: " + port);
// check for SSL addresses
if (Util.isEncodedHost(host, HOST_PROTOCOL)) {
String sslConfigName = Util.decodeHostInfo(host);
host = Util.decodeHost(host);
return createSSLSocket(host, (char) port, sslConfigName);
} else {
return createPlainSocket(host, port);
}
} | class class_name[name] begin[{]
method[createSocket, return_type[type[Socket]], modifier[public], parameter[host, port]] begin[{]
if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isDebugEnabled, parameter[]]]] begin[{]
call[Tr.debug, parameter[member[.tc], binary_operation[binary_operation[binary_operation[literal["SocketFactory attempting to create socket for host: "], +, member[.host]], +, literal[" port: "]], +, member[.port]]]]
else begin[{]
None
end[}]
if[call[Util.isEncodedHost, parameter[member[.host], member[.HOST_PROTOCOL]]]] begin[{]
local_variable[type[String], sslConfigName]
assign[member[.host], call[Util.decodeHost, parameter[member[.host]]]]
return[call[.createSSLSocket, parameter[member[.host], Cast(expression=MemberReference(member=port, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=BasicType(dimensions=[], name=char)), member[.sslConfigName]]]]
else begin[{]
return[call[.createPlainSocket, parameter[member[.host], member[.port]]]]
end[}]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] identifier[Socket] identifier[createSocket] operator[SEP] identifier[String] identifier[host] , Keyword[int] identifier[port] operator[SEP] Keyword[throws] identifier[IOException] {
Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[Tr] operator[SEP] identifier[debug] operator[SEP] identifier[tc] , literal[String] operator[+] identifier[host] operator[+] literal[String] operator[+] identifier[port] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[Util] operator[SEP] identifier[isEncodedHost] operator[SEP] identifier[host] , identifier[HOST_PROTOCOL] operator[SEP] operator[SEP] {
identifier[String] identifier[sslConfigName] operator[=] identifier[Util] operator[SEP] identifier[decodeHostInfo] operator[SEP] identifier[host] operator[SEP] operator[SEP] identifier[host] operator[=] identifier[Util] operator[SEP] identifier[decodeHost] operator[SEP] identifier[host] operator[SEP] operator[SEP] Keyword[return] identifier[createSSLSocket] operator[SEP] identifier[host] , operator[SEP] Keyword[char] operator[SEP] identifier[port] , identifier[sslConfigName] operator[SEP] operator[SEP]
}
Keyword[else] {
Keyword[return] identifier[createPlainSocket] operator[SEP] identifier[host] , identifier[port] operator[SEP] operator[SEP]
}
}
|
public Recommender buildRecommender(final DataModel dataModel, final String recType, final String facType, final int iterations, final int factors)
throws RecommenderException {
return buildRecommender(dataModel, recType, null, NO_N, factors, iterations, facType);
} | class class_name[name] begin[{]
method[buildRecommender, return_type[type[Recommender]], modifier[public], parameter[dataModel, recType, facType, iterations, factors]] begin[{]
return[call[.buildRecommender, parameter[member[.dataModel], member[.recType], literal[null], member[.NO_N], member[.factors], member[.iterations], member[.facType]]]]
end[}]
END[}] | Keyword[public] identifier[Recommender] identifier[buildRecommender] operator[SEP] Keyword[final] identifier[DataModel] identifier[dataModel] , Keyword[final] identifier[String] identifier[recType] , Keyword[final] identifier[String] identifier[facType] , Keyword[final] Keyword[int] identifier[iterations] , Keyword[final] Keyword[int] identifier[factors] operator[SEP] Keyword[throws] identifier[RecommenderException] {
Keyword[return] identifier[buildRecommender] operator[SEP] identifier[dataModel] , identifier[recType] , Other[null] , identifier[NO_N] , identifier[factors] , identifier[iterations] , identifier[facType] operator[SEP] operator[SEP]
}
|
private boolean deserialize() {
if (!apiVersionMatch()) {
// when version mismatch, even when deserialization is successful,
// we cannot guarantee data correctness. Old events containing fields that should be
// translated/mapped to the new schema will simply not be captured by the new schema.
return false;
} else if (object != null) {
// already successfully deserialized
return true;
} else {
try {
object = EventDataDeserializer.deserializeStripeObject(rawJsonObject);
return true;
} catch (JsonParseException e) {
// intentionally ignore exception to fulfill simply whether deserialization succeeds
return false;
}
}
} | class class_name[name] begin[{]
method[deserialize, return_type[type[boolean]], modifier[private], parameter[]] begin[{]
if[call[.apiVersionMatch, parameter[]]] begin[{]
return[literal[false]]
else begin[{]
if[binary_operation[member[.object], !=, literal[null]]] begin[{]
return[literal[true]]
else begin[{]
TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=object, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=rawJsonObject, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=deserializeStripeObject, postfix_operators=[], prefix_operators=[], qualifier=EventDataDeserializer, selectors=[], type_arguments=None)), label=None), ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true), label=None)], catches=[CatchClause(block=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['JsonParseException']))], finally_block=None, label=None, resources=None)
end[}]
end[}]
end[}]
END[}] | Keyword[private] Keyword[boolean] identifier[deserialize] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] operator[!] identifier[apiVersionMatch] operator[SEP] operator[SEP] operator[SEP] {
Keyword[return] literal[boolean] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[object] operator[!=] Other[null] operator[SEP] {
Keyword[return] literal[boolean] operator[SEP]
}
Keyword[else] {
Keyword[try] {
identifier[object] operator[=] identifier[EventDataDeserializer] operator[SEP] identifier[deserializeStripeObject] operator[SEP] identifier[rawJsonObject] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[JsonParseException] identifier[e] operator[SEP] {
Keyword[return] literal[boolean] operator[SEP]
}
}
}
|
public <T> T query(MethodMap methodMap, ArgMap argMap, Class<T> responseType ) throws OpenStatesException {
BufferedReader reader = null;
HttpURLConnection conn = null;
String charSet = "utf-8";
try {
if ( isCaching(methodMap, argMap) ) {
File file = getCacheFile(methodMap, argMap);
long fileLength = file.length();
logger.fine("Length of File in cache:" + fileLength + ": " + file.getName());
if ( fileLength == 0L ) {
OpenStates.cacheFileFromAPI(methodMap, argMap, file, responseType);
}
reader = new BufferedReader(new InputStreamReader(new FileInputStream(file), charSet));
} else {
conn = OpenStates.getConnectionFromAPI(methodMap, argMap);
charSet = getCharset(conn);
// better check it first
int rcode = conn.getResponseCode();
if ( rcode / 100 != 2) {
String msg = conn.getResponseMessage();
conn.disconnect();
throw new OpenStatesException(rcode, msg, methodMap, argMap, responseType);
}
reader = new BufferedReader(new InputStreamReader(conn.getInputStream(), charSet));
}
return mapper.readValue( reader, responseType );
} catch (JsonParseException e) {
throw new OpenStatesException(e, methodMap, argMap, responseType);
} catch (JsonMappingException e) {
throw new OpenStatesException(e, methodMap, argMap, responseType);
} catch (URISyntaxException e) {
throw new OpenStatesException(e, methodMap, argMap, responseType);
} catch (IOException e) {
throw new OpenStatesException(e, methodMap, argMap, responseType);
} finally {
suspendCache = false;
if ( conn != null ) conn.disconnect();
if ( reader != null ) {
try {
reader.close();
} catch (IOException e) {
throw new OpenStatesException(e, methodMap, argMap, responseType);
}
}
}
} | class class_name[name] begin[{]
method[query, return_type[type[T]], modifier[public], parameter[methodMap, argMap, responseType]] begin[{]
local_variable[type[BufferedReader], reader]
local_variable[type[HttpURLConnection], conn]
local_variable[type[String], charSet]
TryStatement(block=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=methodMap, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=argMap, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isCaching, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=conn, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=methodMap, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=argMap, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getConnectionFromAPI, postfix_operators=[], prefix_operators=[], qualifier=OpenStates, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=charSet, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=conn, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getCharset, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getResponseCode, postfix_operators=[], prefix_operators=[], qualifier=conn, selectors=[], type_arguments=None), name=rcode)], modifiers=set(), type=BasicType(dimensions=[], name=int)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=rcode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=100), operator=/), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getResponseMessage, postfix_operators=[], prefix_operators=[], qualifier=conn, selectors=[], type_arguments=None), name=msg)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[], member=disconnect, postfix_operators=[], prefix_operators=[], qualifier=conn, selectors=[], type_arguments=None), label=None), ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=rcode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=msg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=methodMap, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=argMap, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=responseType, 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=OpenStatesException, sub_type=None)), label=None)])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=reader, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[ClassCreator(arguments=[MethodInvocation(arguments=[], member=getInputStream, postfix_operators=[], prefix_operators=[], qualifier=conn, selectors=[], type_arguments=None), MemberReference(member=charSet, 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=InputStreamReader, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=BufferedReader, sub_type=None))), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=methodMap, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=argMap, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getCacheFile, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=file)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=File, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=file, selectors=[], type_arguments=None), name=fileLength)], modifiers=set(), type=BasicType(dimensions=[], name=long)), StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Length of File in cache:"), operandr=MemberReference(member=fileLength, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=": "), operator=+), operandr=MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=file, selectors=[], type_arguments=None), operator=+)], member=fine, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=fileLength, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0L), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=methodMap, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=argMap, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=file, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=responseType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=cacheFileFromAPI, postfix_operators=[], prefix_operators=[], qualifier=OpenStates, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=reader, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[ClassCreator(arguments=[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=FileInputStream, sub_type=None)), MemberReference(member=charSet, 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=InputStreamReader, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=BufferedReader, sub_type=None))), label=None)])), ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=reader, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=responseType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=readValue, postfix_operators=[], prefix_operators=[], qualifier=mapper, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=methodMap, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=argMap, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=responseType, 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=OpenStatesException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['JsonParseException'])), CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=methodMap, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=argMap, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=responseType, 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=OpenStatesException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['JsonMappingException'])), CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=methodMap, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=argMap, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=responseType, 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=OpenStatesException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['URISyntaxException'])), CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=methodMap, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=argMap, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=responseType, 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=OpenStatesException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IOException']))], finally_block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=suspendCache, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=conn, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[], member=disconnect, postfix_operators=[], prefix_operators=[], qualifier=conn, selectors=[], type_arguments=None), label=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=reader, 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=[TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=close, postfix_operators=[], prefix_operators=[], qualifier=reader, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=methodMap, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=argMap, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=responseType, 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=OpenStatesException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IOException']))], finally_block=None, label=None, resources=None)]))], label=None, resources=None)
end[}]
END[}] | Keyword[public] operator[<] identifier[T] operator[>] identifier[T] identifier[query] operator[SEP] identifier[MethodMap] identifier[methodMap] , identifier[ArgMap] identifier[argMap] , identifier[Class] operator[<] identifier[T] operator[>] identifier[responseType] operator[SEP] Keyword[throws] identifier[OpenStatesException] {
identifier[BufferedReader] identifier[reader] operator[=] Other[null] operator[SEP] identifier[HttpURLConnection] identifier[conn] operator[=] Other[null] operator[SEP] identifier[String] identifier[charSet] operator[=] literal[String] operator[SEP] Keyword[try] {
Keyword[if] operator[SEP] identifier[isCaching] operator[SEP] identifier[methodMap] , identifier[argMap] operator[SEP] operator[SEP] {
identifier[File] identifier[file] operator[=] identifier[getCacheFile] operator[SEP] identifier[methodMap] , identifier[argMap] operator[SEP] operator[SEP] Keyword[long] identifier[fileLength] operator[=] identifier[file] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] identifier[logger] operator[SEP] identifier[fine] operator[SEP] literal[String] operator[+] identifier[fileLength] operator[+] literal[String] operator[+] identifier[file] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[fileLength] operator[==] Other[0L] operator[SEP] {
identifier[OpenStates] operator[SEP] identifier[cacheFileFromAPI] operator[SEP] identifier[methodMap] , identifier[argMap] , identifier[file] , identifier[responseType] operator[SEP] operator[SEP]
}
identifier[reader] operator[=] Keyword[new] identifier[BufferedReader] operator[SEP] Keyword[new] identifier[InputStreamReader] operator[SEP] Keyword[new] identifier[FileInputStream] operator[SEP] identifier[file] operator[SEP] , identifier[charSet] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[conn] operator[=] identifier[OpenStates] operator[SEP] identifier[getConnectionFromAPI] operator[SEP] identifier[methodMap] , identifier[argMap] operator[SEP] operator[SEP] identifier[charSet] operator[=] identifier[getCharset] operator[SEP] identifier[conn] operator[SEP] operator[SEP] Keyword[int] identifier[rcode] operator[=] identifier[conn] operator[SEP] identifier[getResponseCode] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[rcode] operator[/] Other[100] operator[!=] Other[2] operator[SEP] {
identifier[String] identifier[msg] operator[=] identifier[conn] operator[SEP] identifier[getResponseMessage] operator[SEP] operator[SEP] operator[SEP] identifier[conn] operator[SEP] identifier[disconnect] operator[SEP] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[OpenStatesException] operator[SEP] identifier[rcode] , identifier[msg] , identifier[methodMap] , identifier[argMap] , identifier[responseType] operator[SEP] operator[SEP]
}
identifier[reader] operator[=] Keyword[new] identifier[BufferedReader] operator[SEP] Keyword[new] identifier[InputStreamReader] operator[SEP] identifier[conn] operator[SEP] identifier[getInputStream] operator[SEP] operator[SEP] , identifier[charSet] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] identifier[mapper] operator[SEP] identifier[readValue] operator[SEP] identifier[reader] , identifier[responseType] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[JsonParseException] identifier[e] operator[SEP] {
Keyword[throw] Keyword[new] identifier[OpenStatesException] operator[SEP] identifier[e] , identifier[methodMap] , identifier[argMap] , identifier[responseType] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[JsonMappingException] identifier[e] operator[SEP] {
Keyword[throw] Keyword[new] identifier[OpenStatesException] operator[SEP] identifier[e] , identifier[methodMap] , identifier[argMap] , identifier[responseType] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[URISyntaxException] identifier[e] operator[SEP] {
Keyword[throw] Keyword[new] identifier[OpenStatesException] operator[SEP] identifier[e] , identifier[methodMap] , identifier[argMap] , identifier[responseType] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[IOException] identifier[e] operator[SEP] {
Keyword[throw] Keyword[new] identifier[OpenStatesException] operator[SEP] identifier[e] , identifier[methodMap] , identifier[argMap] , identifier[responseType] operator[SEP] operator[SEP]
}
Keyword[finally] {
identifier[suspendCache] operator[=] literal[boolean] operator[SEP] Keyword[if] operator[SEP] identifier[conn] operator[!=] Other[null] operator[SEP] identifier[conn] operator[SEP] identifier[disconnect] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[reader] operator[!=] Other[null] operator[SEP] {
Keyword[try] {
identifier[reader] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[IOException] identifier[e] operator[SEP] {
Keyword[throw] Keyword[new] identifier[OpenStatesException] operator[SEP] identifier[e] , identifier[methodMap] , identifier[argMap] , identifier[responseType] operator[SEP] operator[SEP]
}
}
}
}
|
public static <T extends XMLObject> T transformSamlObject(final OpenSamlConfigBean configBean, final byte[] data,
final Class<T> clazz) {
try (InputStream in = new ByteArrayInputStream(data)) {
val document = configBean.getParserPool().parse(in);
val root = document.getDocumentElement();
val marshaller = configBean.getUnmarshallerFactory().getUnmarshaller(root);
if (marshaller != null) {
val result = marshaller.unmarshall(root);
if (!clazz.isAssignableFrom(result.getClass())) {
throw new ClassCastException("Result [" + result + " is of type " + result.getClass() + " when we were expecting " + clazz);
}
return (T) result;
}
} catch (final Exception e) {
throw new SamlException(e.getMessage(), e);
}
return null;
} | class class_name[name] begin[{]
method[transformSamlObject, return_type[type[T]], modifier[public static], parameter[configBean, data, clazz]] begin[{]
TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getParserPool, postfix_operators=[], prefix_operators=[], qualifier=configBean, selectors=[MethodInvocation(arguments=[MemberReference(member=in, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=parse, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=document)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=val, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getDocumentElement, postfix_operators=[], prefix_operators=[], qualifier=document, selectors=[], type_arguments=None), name=root)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=val, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getUnmarshallerFactory, postfix_operators=[], prefix_operators=[], qualifier=configBean, selectors=[MethodInvocation(arguments=[MemberReference(member=root, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getUnmarshaller, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=marshaller)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=val, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=marshaller, 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=[MemberReference(member=root, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=unmarshall, postfix_operators=[], prefix_operators=[], qualifier=marshaller, selectors=[], type_arguments=None), name=result)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=val, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getClass, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[], type_arguments=None)], member=isAssignableFrom, postfix_operators=[], prefix_operators=['!'], qualifier=clazz, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Result ["), operandr=MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" is of type "), operator=+), operandr=MethodInvocation(arguments=[], member=getClass, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" when we were expecting "), operator=+), operandr=MemberReference(member=clazz, 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=ClassCastException, sub_type=None)), label=None)])), ReturnStatement(expression=Cast(expression=MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None)), label=None)]))], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), 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=SamlException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=[TryResource(annotations=[], modifiers=set(), name=in, type=ReferenceType(arguments=None, dimensions=[], name=InputStream, sub_type=None), value=ClassCreator(arguments=[MemberReference(member=data, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ByteArrayInputStream, sub_type=None)))])
return[literal[null]]
end[}]
END[}] | Keyword[public] Keyword[static] operator[<] identifier[T] Keyword[extends] identifier[XMLObject] operator[>] identifier[T] identifier[transformSamlObject] operator[SEP] Keyword[final] identifier[OpenSamlConfigBean] identifier[configBean] , Keyword[final] Keyword[byte] operator[SEP] operator[SEP] identifier[data] , Keyword[final] identifier[Class] operator[<] identifier[T] operator[>] identifier[clazz] operator[SEP] {
Keyword[try] operator[SEP] identifier[InputStream] identifier[in] operator[=] Keyword[new] identifier[ByteArrayInputStream] operator[SEP] identifier[data] operator[SEP] operator[SEP] {
identifier[val] identifier[document] operator[=] identifier[configBean] operator[SEP] identifier[getParserPool] operator[SEP] operator[SEP] operator[SEP] identifier[parse] operator[SEP] identifier[in] operator[SEP] operator[SEP] identifier[val] identifier[root] operator[=] identifier[document] operator[SEP] identifier[getDocumentElement] operator[SEP] operator[SEP] operator[SEP] identifier[val] identifier[marshaller] operator[=] identifier[configBean] operator[SEP] identifier[getUnmarshallerFactory] operator[SEP] operator[SEP] operator[SEP] identifier[getUnmarshaller] operator[SEP] identifier[root] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[marshaller] operator[!=] Other[null] operator[SEP] {
identifier[val] identifier[result] operator[=] identifier[marshaller] operator[SEP] identifier[unmarshall] operator[SEP] identifier[root] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[clazz] operator[SEP] identifier[isAssignableFrom] operator[SEP] identifier[result] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
Keyword[throw] Keyword[new] identifier[ClassCastException] operator[SEP] literal[String] operator[+] identifier[result] operator[+] literal[String] operator[+] identifier[result] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[clazz] operator[SEP] operator[SEP]
}
Keyword[return] operator[SEP] identifier[T] operator[SEP] identifier[result] operator[SEP]
}
}
Keyword[catch] operator[SEP] Keyword[final] identifier[Exception] identifier[e] operator[SEP] {
Keyword[throw] Keyword[new] identifier[SamlException] operator[SEP] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP]
}
Keyword[return] Other[null] operator[SEP]
}
|
public static <N extends AbstractDTNode<?, ?, ?, N>, D> Iterator<D> transformingLeafIterator(N root,
Function<? super N, D> transformer) {
return Iterators.transform(leafIterator(root), transformer::apply);
} | class class_name[name] begin[{]
method[transformingLeafIterator, return_type[type[Iterator]], modifier[public static], parameter[root, transformer]] begin[{]
return[call[Iterators.transform, parameter[call[.leafIterator, parameter[member[.root]]], MethodReference(expression=MemberReference(member=transformer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), method=MemberReference(member=apply, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type_arguments=[])]]]
end[}]
END[}] | Keyword[public] Keyword[static] operator[<] identifier[N] Keyword[extends] identifier[AbstractDTNode] operator[<] operator[?] , operator[?] , operator[?] , identifier[N] operator[>] , identifier[D] operator[>] identifier[Iterator] operator[<] identifier[D] operator[>] identifier[transformingLeafIterator] operator[SEP] identifier[N] identifier[root] , identifier[Function] operator[<] operator[?] Keyword[super] identifier[N] , identifier[D] operator[>] identifier[transformer] operator[SEP] {
Keyword[return] identifier[Iterators] operator[SEP] identifier[transform] operator[SEP] identifier[leafIterator] operator[SEP] identifier[root] operator[SEP] , identifier[transformer] operator[::] identifier[apply] operator[SEP] operator[SEP]
}
|
public <T> T decode(final Decoder<T> decoder) {
BsonBinaryReader reader = createReader();
try {
return decoder.decode(reader, DecoderContext.builder().build());
} finally {
reader.close();
}
} | class class_name[name] begin[{]
method[decode, return_type[type[T]], modifier[public], parameter[decoder]] begin[{]
local_variable[type[BsonBinaryReader], reader]
TryStatement(block=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=reader, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=builder, postfix_operators=[], prefix_operators=[], qualifier=DecoderContext, selectors=[MethodInvocation(arguments=[], member=build, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=decode, postfix_operators=[], prefix_operators=[], qualifier=decoder, selectors=[], type_arguments=None), label=None)], catches=None, finally_block=[StatementExpression(expression=MethodInvocation(arguments=[], member=close, postfix_operators=[], prefix_operators=[], qualifier=reader, selectors=[], type_arguments=None), label=None)], label=None, resources=None)
end[}]
END[}] | Keyword[public] operator[<] identifier[T] operator[>] identifier[T] identifier[decode] operator[SEP] Keyword[final] identifier[Decoder] operator[<] identifier[T] operator[>] identifier[decoder] operator[SEP] {
identifier[BsonBinaryReader] identifier[reader] operator[=] identifier[createReader] operator[SEP] operator[SEP] operator[SEP] Keyword[try] {
Keyword[return] identifier[decoder] operator[SEP] identifier[decode] operator[SEP] identifier[reader] , identifier[DecoderContext] operator[SEP] identifier[builder] operator[SEP] operator[SEP] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[finally] {
identifier[reader] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP]
}
}
|
@SuppressWarnings("null")
public static boolean isEmpty(@Nullable String text, int treshold) {
// check if text block is really empty
if (StringUtils.isEmpty(text)) {
return true;
}
// check if text block has more than 20 chars
if (text.length() > treshold) {
return false;
}
// replace all whitespaces and nbsp's
String cleanedText = StringUtils.replace(text, " ", "");
cleanedText = StringUtils.replace(cleanedText, " ", "");
cleanedText = StringUtils.replace(cleanedText, " ", "");
cleanedText = StringUtils.replace(cleanedText, "\n", "");
cleanedText = StringUtils.replace(cleanedText, "\r", "");
return StringUtils.isEmpty(cleanedText) || "<p></p>".equals(cleanedText);
} | class class_name[name] begin[{]
method[isEmpty, return_type[type[boolean]], modifier[public static], parameter[text, treshold]] begin[{]
if[call[StringUtils.isEmpty, parameter[member[.text]]]] begin[{]
return[literal[true]]
else begin[{]
None
end[}]
if[binary_operation[call[text.length, parameter[]], >, member[.treshold]]] begin[{]
return[literal[false]]
else begin[{]
None
end[}]
local_variable[type[String], cleanedText]
assign[member[.cleanedText], call[StringUtils.replace, parameter[member[.cleanedText], literal[" "], literal[""]]]]
assign[member[.cleanedText], call[StringUtils.replace, parameter[member[.cleanedText], literal[" "], literal[""]]]]
assign[member[.cleanedText], call[StringUtils.replace, parameter[member[.cleanedText], literal["\n"], literal[""]]]]
assign[member[.cleanedText], call[StringUtils.replace, parameter[member[.cleanedText], literal["\r"], literal[""]]]]
return[binary_operation[call[StringUtils.isEmpty, parameter[member[.cleanedText]]], ||, literal["<p></p>"]]]
end[}]
END[}] | annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] Keyword[public] Keyword[static] Keyword[boolean] identifier[isEmpty] operator[SEP] annotation[@] identifier[Nullable] identifier[String] identifier[text] , Keyword[int] identifier[treshold] operator[SEP] {
Keyword[if] operator[SEP] identifier[StringUtils] operator[SEP] identifier[isEmpty] operator[SEP] identifier[text] operator[SEP] operator[SEP] {
Keyword[return] literal[boolean] operator[SEP]
}
Keyword[if] operator[SEP] identifier[text] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[>] identifier[treshold] operator[SEP] {
Keyword[return] literal[boolean] operator[SEP]
}
identifier[String] identifier[cleanedText] operator[=] identifier[StringUtils] operator[SEP] identifier[replace] operator[SEP] identifier[text] , literal[String] , literal[String] operator[SEP] operator[SEP] identifier[cleanedText] operator[=] identifier[StringUtils] operator[SEP] identifier[replace] operator[SEP] identifier[cleanedText] , literal[String] , literal[String] operator[SEP] operator[SEP] identifier[cleanedText] operator[=] identifier[StringUtils] operator[SEP] identifier[replace] operator[SEP] identifier[cleanedText] , literal[String] , literal[String] operator[SEP] operator[SEP] identifier[cleanedText] operator[=] identifier[StringUtils] operator[SEP] identifier[replace] operator[SEP] identifier[cleanedText] , literal[String] , literal[String] operator[SEP] operator[SEP] identifier[cleanedText] operator[=] identifier[StringUtils] operator[SEP] identifier[replace] operator[SEP] identifier[cleanedText] , literal[String] , literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[StringUtils] operator[SEP] identifier[isEmpty] operator[SEP] identifier[cleanedText] operator[SEP] operator[||] literal[String] operator[SEP] identifier[equals] operator[SEP] identifier[cleanedText] operator[SEP] operator[SEP]
}
|
@Override
protected void hideStage() {
final Stage stage = this.preloaderStage;
final ScaleTransition st = new ScaleTransition();
st.setFromX(1.0);
st.setToX(0.0);
st.setDuration(Duration.millis(400));
st.setNode(stage.getScene().getRoot());
st.setOnFinished(actionEvent -> stage.hide());
st.play();
} | class class_name[name] begin[{]
method[hideStage, return_type[void], modifier[protected], parameter[]] begin[{]
local_variable[type[Stage], stage]
local_variable[type[ScaleTransition], st]
call[st.setFromX, parameter[literal[1.0]]]
call[st.setToX, parameter[literal[0.0]]]
call[st.setDuration, parameter[call[Duration.millis, parameter[literal[400]]]]]
call[st.setNode, parameter[call[stage.getScene, parameter[]]]]
call[st.setOnFinished, parameter[LambdaExpression(body=MethodInvocation(arguments=[], member=hide, postfix_operators=[], prefix_operators=[], qualifier=stage, selectors=[], type_arguments=None), parameters=[MemberReference(member=actionEvent, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])])]]
call[st.play, parameter[]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[protected] Keyword[void] identifier[hideStage] operator[SEP] operator[SEP] {
Keyword[final] identifier[Stage] identifier[stage] operator[=] Keyword[this] operator[SEP] identifier[preloaderStage] operator[SEP] Keyword[final] identifier[ScaleTransition] identifier[st] operator[=] Keyword[new] identifier[ScaleTransition] operator[SEP] operator[SEP] operator[SEP] identifier[st] operator[SEP] identifier[setFromX] operator[SEP] literal[Float] operator[SEP] operator[SEP] identifier[st] operator[SEP] identifier[setToX] operator[SEP] literal[Float] operator[SEP] operator[SEP] identifier[st] operator[SEP] identifier[setDuration] operator[SEP] identifier[Duration] operator[SEP] identifier[millis] operator[SEP] Other[400] operator[SEP] operator[SEP] operator[SEP] identifier[st] operator[SEP] identifier[setNode] operator[SEP] identifier[stage] operator[SEP] identifier[getScene] operator[SEP] operator[SEP] operator[SEP] identifier[getRoot] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[st] operator[SEP] identifier[setOnFinished] operator[SEP] identifier[actionEvent] operator[->] identifier[stage] operator[SEP] identifier[hide] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[st] operator[SEP] identifier[play] operator[SEP] operator[SEP] operator[SEP]
}
|
@Deprecated
protected Currency getEffectiveCurrency() {
Currency c = getCurrency();
if (c == null) {
ULocale uloc = getLocale(ULocale.VALID_LOCALE);
if (uloc == null) {
uloc = ULocale.getDefault(Category.FORMAT);
}
c = Currency.getInstance(uloc);
}
return c;
} | class class_name[name] begin[{]
method[getEffectiveCurrency, return_type[type[Currency]], modifier[protected], parameter[]] begin[{]
local_variable[type[Currency], c]
if[binary_operation[member[.c], ==, literal[null]]] begin[{]
local_variable[type[ULocale], uloc]
if[binary_operation[member[.uloc], ==, literal[null]]] begin[{]
assign[member[.uloc], call[ULocale.getDefault, parameter[member[Category.FORMAT]]]]
else begin[{]
None
end[}]
assign[member[.c], call[Currency.getInstance, parameter[member[.uloc]]]]
else begin[{]
None
end[}]
return[member[.c]]
end[}]
END[}] | annotation[@] identifier[Deprecated] Keyword[protected] identifier[Currency] identifier[getEffectiveCurrency] operator[SEP] operator[SEP] {
identifier[Currency] identifier[c] operator[=] identifier[getCurrency] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[c] operator[==] Other[null] operator[SEP] {
identifier[ULocale] identifier[uloc] operator[=] identifier[getLocale] operator[SEP] identifier[ULocale] operator[SEP] identifier[VALID_LOCALE] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[uloc] operator[==] Other[null] operator[SEP] {
identifier[uloc] operator[=] identifier[ULocale] operator[SEP] identifier[getDefault] operator[SEP] identifier[Category] operator[SEP] identifier[FORMAT] operator[SEP] operator[SEP]
}
identifier[c] operator[=] identifier[Currency] operator[SEP] identifier[getInstance] operator[SEP] identifier[uloc] operator[SEP] operator[SEP]
}
Keyword[return] identifier[c] operator[SEP]
}
|
@PostConstruct
public void initialize() {
final IRI root = rdf.createIRI(TRELLIS_DATA_PREFIX);
final IRI rootAuth = rdf.createIRI(TRELLIS_DATA_PREFIX + "#auth");
try (final TrellisDataset dataset = TrellisDataset.createDataset()) {
dataset.add(rdf.createQuad(Trellis.PreferAccessControl, rootAuth, ACL.mode, ACL.Read));
dataset.add(rdf.createQuad(Trellis.PreferAccessControl, rootAuth, ACL.mode, ACL.Write));
dataset.add(rdf.createQuad(Trellis.PreferAccessControl, rootAuth, ACL.mode, ACL.Control));
dataset.add(rdf.createQuad(Trellis.PreferAccessControl, rootAuth, ACL.agentClass, FOAF.Agent));
dataset.add(rdf.createQuad(Trellis.PreferAccessControl, rootAuth, ACL.accessTo, root));
LOGGER.debug("Preparing to initialize Trellis at {}", root);
trellis.getResourceService().get(root).thenCompose(res -> initialize(root, res, dataset))
.exceptionally(err -> {
LOGGER.warn("Unable to auto-initialize Trellis: {}. See DEBUG log for more info", err.getMessage());
LOGGER.debug("Error auto-initializing Trellis", err);
return null;
}).toCompletableFuture().join();
}
} | class class_name[name] begin[{]
method[initialize, return_type[void], modifier[public], parameter[]] begin[{]
local_variable[type[IRI], root]
local_variable[type[IRI], rootAuth]
TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=PreferAccessControl, postfix_operators=[], prefix_operators=[], qualifier=Trellis, selectors=[]), MemberReference(member=rootAuth, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=mode, postfix_operators=[], prefix_operators=[], qualifier=ACL, selectors=[]), MemberReference(member=Read, postfix_operators=[], prefix_operators=[], qualifier=ACL, selectors=[])], member=createQuad, postfix_operators=[], prefix_operators=[], qualifier=rdf, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=dataset, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=PreferAccessControl, postfix_operators=[], prefix_operators=[], qualifier=Trellis, selectors=[]), MemberReference(member=rootAuth, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=mode, postfix_operators=[], prefix_operators=[], qualifier=ACL, selectors=[]), MemberReference(member=Write, postfix_operators=[], prefix_operators=[], qualifier=ACL, selectors=[])], member=createQuad, postfix_operators=[], prefix_operators=[], qualifier=rdf, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=dataset, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=PreferAccessControl, postfix_operators=[], prefix_operators=[], qualifier=Trellis, selectors=[]), MemberReference(member=rootAuth, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=mode, postfix_operators=[], prefix_operators=[], qualifier=ACL, selectors=[]), MemberReference(member=Control, postfix_operators=[], prefix_operators=[], qualifier=ACL, selectors=[])], member=createQuad, postfix_operators=[], prefix_operators=[], qualifier=rdf, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=dataset, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=PreferAccessControl, postfix_operators=[], prefix_operators=[], qualifier=Trellis, selectors=[]), MemberReference(member=rootAuth, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=agentClass, postfix_operators=[], prefix_operators=[], qualifier=ACL, selectors=[]), MemberReference(member=Agent, postfix_operators=[], prefix_operators=[], qualifier=FOAF, selectors=[])], member=createQuad, postfix_operators=[], prefix_operators=[], qualifier=rdf, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=dataset, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=PreferAccessControl, postfix_operators=[], prefix_operators=[], qualifier=Trellis, selectors=[]), MemberReference(member=rootAuth, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=accessTo, postfix_operators=[], prefix_operators=[], qualifier=ACL, selectors=[]), MemberReference(member=root, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=createQuad, postfix_operators=[], prefix_operators=[], qualifier=rdf, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=dataset, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Preparing to initialize Trellis at {}"), MemberReference(member=root, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=debug, postfix_operators=[], prefix_operators=[], qualifier=LOGGER, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=getResourceService, postfix_operators=[], prefix_operators=[], qualifier=trellis, selectors=[MethodInvocation(arguments=[MemberReference(member=root, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[LambdaExpression(body=MethodInvocation(arguments=[MemberReference(member=root, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=res, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=dataset, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=initialize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), parameters=[MemberReference(member=res, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])])], member=thenCompose, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[LambdaExpression(body=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unable to auto-initialize Trellis: {}. See DEBUG log for more info"), MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=err, selectors=[], type_arguments=None)], member=warn, postfix_operators=[], prefix_operators=[], qualifier=LOGGER, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Error auto-initializing Trellis"), MemberReference(member=err, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=debug, 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)], parameters=[MemberReference(member=err, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])])], member=exceptionally, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=toCompletableFuture, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=join, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)], catches=None, finally_block=None, label=None, resources=[TryResource(annotations=[], modifiers={'final'}, name=dataset, type=ReferenceType(arguments=None, dimensions=[], name=TrellisDataset, sub_type=None), value=MethodInvocation(arguments=[], member=createDataset, postfix_operators=[], prefix_operators=[], qualifier=TrellisDataset, selectors=[], type_arguments=None))])
end[}]
END[}] | annotation[@] identifier[PostConstruct] Keyword[public] Keyword[void] identifier[initialize] operator[SEP] operator[SEP] {
Keyword[final] identifier[IRI] identifier[root] operator[=] identifier[rdf] operator[SEP] identifier[createIRI] operator[SEP] identifier[TRELLIS_DATA_PREFIX] operator[SEP] operator[SEP] Keyword[final] identifier[IRI] identifier[rootAuth] operator[=] identifier[rdf] operator[SEP] identifier[createIRI] operator[SEP] identifier[TRELLIS_DATA_PREFIX] operator[+] literal[String] operator[SEP] operator[SEP] Keyword[try] operator[SEP] Keyword[final] identifier[TrellisDataset] identifier[dataset] operator[=] identifier[TrellisDataset] operator[SEP] identifier[createDataset] operator[SEP] operator[SEP] operator[SEP] {
identifier[dataset] operator[SEP] identifier[add] operator[SEP] identifier[rdf] operator[SEP] identifier[createQuad] operator[SEP] identifier[Trellis] operator[SEP] identifier[PreferAccessControl] , identifier[rootAuth] , identifier[ACL] operator[SEP] identifier[mode] , identifier[ACL] operator[SEP] identifier[Read] operator[SEP] operator[SEP] operator[SEP] identifier[dataset] operator[SEP] identifier[add] operator[SEP] identifier[rdf] operator[SEP] identifier[createQuad] operator[SEP] identifier[Trellis] operator[SEP] identifier[PreferAccessControl] , identifier[rootAuth] , identifier[ACL] operator[SEP] identifier[mode] , identifier[ACL] operator[SEP] identifier[Write] operator[SEP] operator[SEP] operator[SEP] identifier[dataset] operator[SEP] identifier[add] operator[SEP] identifier[rdf] operator[SEP] identifier[createQuad] operator[SEP] identifier[Trellis] operator[SEP] identifier[PreferAccessControl] , identifier[rootAuth] , identifier[ACL] operator[SEP] identifier[mode] , identifier[ACL] operator[SEP] identifier[Control] operator[SEP] operator[SEP] operator[SEP] identifier[dataset] operator[SEP] identifier[add] operator[SEP] identifier[rdf] operator[SEP] identifier[createQuad] operator[SEP] identifier[Trellis] operator[SEP] identifier[PreferAccessControl] , identifier[rootAuth] , identifier[ACL] operator[SEP] identifier[agentClass] , identifier[FOAF] operator[SEP] identifier[Agent] operator[SEP] operator[SEP] operator[SEP] identifier[dataset] operator[SEP] identifier[add] operator[SEP] identifier[rdf] operator[SEP] identifier[createQuad] operator[SEP] identifier[Trellis] operator[SEP] identifier[PreferAccessControl] , identifier[rootAuth] , identifier[ACL] operator[SEP] identifier[accessTo] , identifier[root] operator[SEP] operator[SEP] operator[SEP] identifier[LOGGER] operator[SEP] identifier[debug] operator[SEP] literal[String] , identifier[root] operator[SEP] operator[SEP] identifier[trellis] operator[SEP] identifier[getResourceService] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] identifier[root] operator[SEP] operator[SEP] identifier[thenCompose] operator[SEP] identifier[res] operator[->] identifier[initialize] operator[SEP] identifier[root] , identifier[res] , identifier[dataset] operator[SEP] operator[SEP] operator[SEP] identifier[exceptionally] operator[SEP] identifier[err] operator[->] {
identifier[LOGGER] operator[SEP] identifier[warn] operator[SEP] literal[String] , identifier[err] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[LOGGER] operator[SEP] identifier[debug] operator[SEP] literal[String] , identifier[err] operator[SEP] operator[SEP] Keyword[return] Other[null] operator[SEP]
} operator[SEP] operator[SEP] identifier[toCompletableFuture] operator[SEP] operator[SEP] operator[SEP] identifier[join] 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.