code
stringlengths
63
466k
code_sememe
stringlengths
141
3.79M
token_type
stringlengths
274
1.23M
@SuppressWarnings("unchecked") public List<Tuple2<RetrievableStateHandle<T>, String>> getAllAndLock() throws Exception { final List<Tuple2<RetrievableStateHandle<T>, String>> stateHandles = new ArrayList<>(); boolean success = false; retry: while (!success) { stateHandles.clear(); Stat stat = client.checkExists().forPath("/"); if (stat == null) { break; // Node does not exist, done. } else { // Initial cVersion (number of changes to the children of this node) int initialCVersion = stat.getCversion(); List<String> children = client.getChildren().forPath("/"); for (String path : children) { path = "/" + path; try { final RetrievableStateHandle<T> stateHandle = getAndLock(path); stateHandles.add(new Tuple2<>(stateHandle, path)); } catch (KeeperException.NoNodeException ignored) { // Concurrent deletion, retry continue retry; } catch (IOException ioException) { LOG.warn("Could not get all ZooKeeper children. Node {} contained " + "corrupted data. Ignoring this node.", path, ioException); } } int finalCVersion = client.checkExists().forPath("/").getCversion(); // Check for concurrent modifications success = initialCVersion == finalCVersion; } } return stateHandles; }
class class_name[name] begin[{] method[getAllAndLock, return_type[type[List]], modifier[public], parameter[]] begin[{] local_variable[type[List], stateHandles] local_variable[type[boolean], success] while[member[.success]] begin[{] call[stateHandles.clear, parameter[]] local_variable[type[Stat], stat] if[binary_operation[member[.stat], ==, literal[null]]] begin[{] BreakStatement(goto=None, label=None) else begin[{] local_variable[type[int], initialCVersion] local_variable[type[List], children] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=path, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="/"), operandr=MemberReference(member=path, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)), label=None), TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=path, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getAndLock, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=stateHandle)], modifiers={'final'}, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None))], dimensions=[], name=RetrievableStateHandle, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[ClassCreator(arguments=[MemberReference(member=stateHandle, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=path, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=Tuple2, sub_type=None))], member=add, postfix_operators=[], prefix_operators=[], qualifier=stateHandles, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ContinueStatement(goto=retry, label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ignored, types=['KeeperException.NoNodeException'])), CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Could not get all ZooKeeper children. Node {} contained "), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="corrupted data. Ignoring this node."), operator=+), MemberReference(member=path, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=ioException, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=warn, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ioException, types=['IOException']))], finally_block=None, label=None, resources=None)]), control=EnhancedForControl(iterable=MemberReference(member=children, 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) local_variable[type[int], finalCVersion] assign[member[.success], binary_operation[member[.initialCVersion], ==, member[.finalCVersion]]] end[}] end[}] return[member[.stateHandles]] end[}] END[}]
annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] Keyword[public] identifier[List] operator[<] identifier[Tuple2] operator[<] identifier[RetrievableStateHandle] operator[<] identifier[T] operator[>] , identifier[String] operator[>] operator[>] identifier[getAllAndLock] operator[SEP] operator[SEP] Keyword[throws] identifier[Exception] { Keyword[final] identifier[List] operator[<] identifier[Tuple2] operator[<] identifier[RetrievableStateHandle] operator[<] identifier[T] operator[>] , identifier[String] operator[>] operator[>] identifier[stateHandles] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[boolean] identifier[success] operator[=] literal[boolean] operator[SEP] identifier[retry] operator[:] Keyword[while] operator[SEP] operator[!] identifier[success] operator[SEP] { identifier[stateHandles] operator[SEP] identifier[clear] operator[SEP] operator[SEP] operator[SEP] identifier[Stat] identifier[stat] operator[=] identifier[client] operator[SEP] identifier[checkExists] operator[SEP] operator[SEP] operator[SEP] identifier[forPath] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[stat] operator[==] Other[null] operator[SEP] { Keyword[break] operator[SEP] } Keyword[else] { Keyword[int] identifier[initialCVersion] operator[=] identifier[stat] operator[SEP] identifier[getCversion] operator[SEP] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[String] operator[>] identifier[children] operator[=] identifier[client] operator[SEP] identifier[getChildren] operator[SEP] operator[SEP] operator[SEP] identifier[forPath] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[String] identifier[path] operator[:] identifier[children] operator[SEP] { identifier[path] operator[=] literal[String] operator[+] identifier[path] operator[SEP] Keyword[try] { Keyword[final] identifier[RetrievableStateHandle] operator[<] identifier[T] operator[>] identifier[stateHandle] operator[=] identifier[getAndLock] operator[SEP] identifier[path] operator[SEP] operator[SEP] identifier[stateHandles] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[Tuple2] operator[<] operator[>] operator[SEP] identifier[stateHandle] , identifier[path] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[KeeperException] operator[SEP] identifier[NoNodeException] identifier[ignored] operator[SEP] { Keyword[continue] identifier[retry] operator[SEP] } Keyword[catch] operator[SEP] identifier[IOException] identifier[ioException] operator[SEP] { identifier[LOG] operator[SEP] identifier[warn] operator[SEP] literal[String] operator[+] literal[String] , identifier[path] , identifier[ioException] operator[SEP] operator[SEP] } } Keyword[int] identifier[finalCVersion] operator[=] identifier[client] operator[SEP] identifier[checkExists] operator[SEP] operator[SEP] operator[SEP] identifier[forPath] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[getCversion] operator[SEP] operator[SEP] operator[SEP] identifier[success] operator[=] identifier[initialCVersion] operator[==] identifier[finalCVersion] operator[SEP] } } Keyword[return] identifier[stateHandles] operator[SEP] }
public void append(final NamespaceEntry e) throws IOException { final byte[] ebytes = nsrec.write(e); append(ebytes); }
class class_name[name] begin[{] method[append, return_type[void], modifier[public], parameter[e]] begin[{] local_variable[type[byte], ebytes] call[.append, parameter[member[.ebytes]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[append] operator[SEP] Keyword[final] identifier[NamespaceEntry] identifier[e] operator[SEP] Keyword[throws] identifier[IOException] { Keyword[final] Keyword[byte] operator[SEP] operator[SEP] identifier[ebytes] operator[=] identifier[nsrec] operator[SEP] identifier[write] operator[SEP] identifier[e] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[ebytes] operator[SEP] operator[SEP] }
private List<IDirectory> addFromManifestClassPath( List<IDirectory> classpath ) { if( classpath == null ) { return classpath; } ArrayList<IDirectory> newClasspath = new ArrayList<>(); for( IDirectory root : classpath ) { //add the root JAR itself first, preserving ordering if( !newClasspath.contains( root ) ) { newClasspath.add( root ); } if( root instanceof JarFileDirectoryImpl ) { JarFile jarFile = ((JarFileDirectoryImpl)root).getJarFile(); try { Manifest manifest = jarFile.getManifest(); if( manifest != null ) { Attributes man = manifest.getMainAttributes(); String paths = man.getValue( Attributes.Name.CLASS_PATH ); if( paths != null && !paths.isEmpty() ) { // We found a Jar with a Class-Path listing. // Note sometimes happens when running from IntelliJ where the // classpath would otherwise make the command line to java.exe // too long. for( String j : paths.split( " " ) ) { // Add each of the paths to our classpath URL url; try { url = new URL( j ); } catch (MalformedURLException e) { //Class-Path contained an invalid URL, skip it continue; } File dirOrJar = new File( url.toURI() ); IDirectory idir = CommonServices.getFileSystem().getIDirectory( dirOrJar ); if( !newClasspath.contains( idir ) ) { newClasspath.add( idir ); } } } } } catch( Exception e ) { throw GosuExceptionUtil.forceThrow( e ); } } } return newClasspath; }
class class_name[name] begin[{] method[addFromManifestClassPath, return_type[type[List]], modifier[private], parameter[classpath]] begin[{] if[binary_operation[member[.classpath], ==, literal[null]]] begin[{] return[member[.classpath]] else begin[{] None end[}] local_variable[type[ArrayList], newClasspath] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=root, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=contains, postfix_operators=[], prefix_operators=['!'], qualifier=newClasspath, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=root, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=newClasspath, selectors=[], type_arguments=None), label=None)])), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=root, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=JarFileDirectoryImpl, sub_type=None), operator=instanceof), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MemberReference(member=root, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=JarFileDirectoryImpl, sub_type=None)), name=jarFile)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=JarFile, sub_type=None)), TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getManifest, postfix_operators=[], prefix_operators=[], qualifier=jarFile, selectors=[], type_arguments=None), name=manifest)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Manifest, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=manifest, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getMainAttributes, postfix_operators=[], prefix_operators=[], qualifier=manifest, selectors=[], type_arguments=None), name=man)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Attributes, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=CLASS_PATH, postfix_operators=[], prefix_operators=[], qualifier=Attributes.Name, selectors=[])], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=man, selectors=[], type_arguments=None), name=paths)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=paths, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operandr=MethodInvocation(arguments=[], member=isEmpty, postfix_operators=[], prefix_operators=['!'], qualifier=paths, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=None, name=url)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=URL, sub_type=None)), TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=url, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=URL, sub_type=None))), label=None)], catches=[CatchClause(block=[ContinueStatement(goto=None, label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['MalformedURLException']))], finally_block=None, label=None, resources=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MethodInvocation(arguments=[], member=toURI, postfix_operators=[], prefix_operators=[], qualifier=url, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=File, sub_type=None)), name=dirOrJar)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=File, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getFileSystem, postfix_operators=[], prefix_operators=[], qualifier=CommonServices, selectors=[MethodInvocation(arguments=[MemberReference(member=dirOrJar, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getIDirectory, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=idir)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=IDirectory, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=idir, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=contains, postfix_operators=[], prefix_operators=['!'], qualifier=newClasspath, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=idir, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=newClasspath, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" ")], member=split, postfix_operators=[], prefix_operators=[], qualifier=paths, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=j)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None)]))]))], catches=[CatchClause(block=[ThrowStatement(expression=MethodInvocation(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=forceThrow, postfix_operators=[], prefix_operators=[], qualifier=GosuExceptionUtil, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=classpath, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=root)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=IDirectory, sub_type=None))), label=None) return[member[.newClasspath]] end[}] END[}]
Keyword[private] identifier[List] operator[<] identifier[IDirectory] operator[>] identifier[addFromManifestClassPath] operator[SEP] identifier[List] operator[<] identifier[IDirectory] operator[>] identifier[classpath] operator[SEP] { Keyword[if] operator[SEP] identifier[classpath] operator[==] Other[null] operator[SEP] { Keyword[return] identifier[classpath] operator[SEP] } identifier[ArrayList] operator[<] identifier[IDirectory] operator[>] identifier[newClasspath] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[IDirectory] identifier[root] operator[:] identifier[classpath] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[newClasspath] operator[SEP] identifier[contains] operator[SEP] identifier[root] operator[SEP] operator[SEP] { identifier[newClasspath] operator[SEP] identifier[add] operator[SEP] identifier[root] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[root] Keyword[instanceof] identifier[JarFileDirectoryImpl] operator[SEP] { identifier[JarFile] identifier[jarFile] operator[=] operator[SEP] operator[SEP] identifier[JarFileDirectoryImpl] operator[SEP] identifier[root] operator[SEP] operator[SEP] identifier[getJarFile] operator[SEP] operator[SEP] operator[SEP] Keyword[try] { identifier[Manifest] identifier[manifest] operator[=] identifier[jarFile] operator[SEP] identifier[getManifest] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[manifest] operator[!=] Other[null] operator[SEP] { identifier[Attributes] identifier[man] operator[=] identifier[manifest] operator[SEP] identifier[getMainAttributes] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[paths] operator[=] identifier[man] operator[SEP] identifier[getValue] operator[SEP] identifier[Attributes] operator[SEP] identifier[Name] operator[SEP] identifier[CLASS_PATH] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[paths] operator[!=] Other[null] operator[&&] operator[!] identifier[paths] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { Keyword[for] operator[SEP] identifier[String] identifier[j] operator[:] identifier[paths] operator[SEP] identifier[split] operator[SEP] literal[String] operator[SEP] operator[SEP] { identifier[URL] identifier[url] operator[SEP] Keyword[try] { identifier[url] operator[=] Keyword[new] identifier[URL] operator[SEP] identifier[j] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[MalformedURLException] identifier[e] operator[SEP] { Keyword[continue] operator[SEP] } identifier[File] identifier[dirOrJar] operator[=] Keyword[new] identifier[File] operator[SEP] identifier[url] operator[SEP] identifier[toURI] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[IDirectory] identifier[idir] operator[=] identifier[CommonServices] operator[SEP] identifier[getFileSystem] operator[SEP] operator[SEP] operator[SEP] identifier[getIDirectory] operator[SEP] identifier[dirOrJar] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[newClasspath] operator[SEP] identifier[contains] operator[SEP] identifier[idir] operator[SEP] operator[SEP] { identifier[newClasspath] operator[SEP] identifier[add] operator[SEP] identifier[idir] operator[SEP] operator[SEP] } } } } } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { Keyword[throw] identifier[GosuExceptionUtil] operator[SEP] identifier[forceThrow] operator[SEP] identifier[e] operator[SEP] operator[SEP] } } } Keyword[return] identifier[newClasspath] operator[SEP] }
@Override public final void visit(final PersonDocumentMongo document) { gedObject = new Person(parent, new ObjectId(document.getString())); }
class class_name[name] begin[{] method[visit, return_type[void], modifier[final public], parameter[document]] begin[{] assign[member[.gedObject], ClassCreator(arguments=[MemberReference(member=parent, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), ClassCreator(arguments=[MethodInvocation(arguments=[], member=getString, postfix_operators=[], prefix_operators=[], qualifier=document, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ObjectId, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Person, sub_type=None))] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[final] Keyword[void] identifier[visit] operator[SEP] Keyword[final] identifier[PersonDocumentMongo] identifier[document] operator[SEP] { identifier[gedObject] operator[=] Keyword[new] identifier[Person] operator[SEP] identifier[parent] , Keyword[new] identifier[ObjectId] operator[SEP] identifier[document] operator[SEP] identifier[getString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
protected static void checkAndFixType(ParaObject obj) { if (obj != null) { if (StringUtils.startsWith(obj.getType(), SPECIAL_PREFIX)) { obj.setType(obj.getType().replaceAll("^[" + SPECIAL_PREFIX + "]*", "")); } if (StringUtils.contains(obj.getType(), "#")) { // ElasticSearch doesn't allow # in type mappings obj.setType(obj.getType().replaceAll("#", "")); } if (StringUtils.contains(obj.getType(), "/")) { // type must not contain "/" obj.setType(obj.getType().replaceAll("/", "")); } if (obj.getType().isEmpty()) { obj.setType(Utils.type(Sysprop.class)); } } }
class class_name[name] begin[{] method[checkAndFixType, return_type[void], modifier[static protected], parameter[obj]] begin[{] if[binary_operation[member[.obj], !=, literal[null]]] begin[{] if[call[StringUtils.startsWith, parameter[call[obj.getType, parameter[]], member[.SPECIAL_PREFIX]]]] begin[{] call[obj.setType, parameter[call[obj.getType, parameter[]]]] else begin[{] None end[}] if[call[StringUtils.contains, parameter[call[obj.getType, parameter[]], literal["#"]]]] begin[{] call[obj.setType, parameter[call[obj.getType, parameter[]]]] else begin[{] None end[}] if[call[StringUtils.contains, parameter[call[obj.getType, parameter[]], literal["/"]]]] begin[{] call[obj.setType, parameter[call[obj.getType, parameter[]]]] else begin[{] None end[}] if[call[obj.getType, parameter[]]] begin[{] call[obj.setType, parameter[call[Utils.type, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Sysprop, sub_type=None))]]]] else begin[{] None end[}] else begin[{] None end[}] end[}] END[}]
Keyword[protected] Keyword[static] Keyword[void] identifier[checkAndFixType] operator[SEP] identifier[ParaObject] identifier[obj] operator[SEP] { Keyword[if] operator[SEP] identifier[obj] operator[!=] Other[null] operator[SEP] { Keyword[if] operator[SEP] identifier[StringUtils] operator[SEP] identifier[startsWith] operator[SEP] identifier[obj] operator[SEP] identifier[getType] operator[SEP] operator[SEP] , identifier[SPECIAL_PREFIX] operator[SEP] operator[SEP] { identifier[obj] operator[SEP] identifier[setType] operator[SEP] identifier[obj] operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[SEP] identifier[replaceAll] operator[SEP] literal[String] operator[+] identifier[SPECIAL_PREFIX] operator[+] literal[String] , literal[String] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[StringUtils] operator[SEP] identifier[contains] operator[SEP] identifier[obj] operator[SEP] identifier[getType] operator[SEP] operator[SEP] , literal[String] operator[SEP] operator[SEP] { identifier[obj] operator[SEP] identifier[setType] operator[SEP] identifier[obj] operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[SEP] identifier[replaceAll] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[StringUtils] operator[SEP] identifier[contains] operator[SEP] identifier[obj] operator[SEP] identifier[getType] operator[SEP] operator[SEP] , literal[String] operator[SEP] operator[SEP] { identifier[obj] operator[SEP] identifier[setType] operator[SEP] identifier[obj] operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[SEP] identifier[replaceAll] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[obj] operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { identifier[obj] operator[SEP] identifier[setType] operator[SEP] identifier[Utils] operator[SEP] identifier[type] operator[SEP] identifier[Sysprop] operator[SEP] Keyword[class] operator[SEP] operator[SEP] operator[SEP] } } }
public static Field[] getFields(Class<?> beanClass) throws SecurityException { Field[] allFields = FIELDS_CACHE.get(beanClass); if (null != allFields) { return allFields; } allFields = getFieldsDirectly(beanClass, true); return FIELDS_CACHE.put(beanClass, allFields); }
class class_name[name] begin[{] method[getFields, return_type[type[Field]], modifier[public static], parameter[beanClass]] begin[{] local_variable[type[Field], allFields] if[binary_operation[literal[null], !=, member[.allFields]]] begin[{] return[member[.allFields]] else begin[{] None end[}] assign[member[.allFields], call[.getFieldsDirectly, parameter[member[.beanClass], literal[true]]]] return[call[FIELDS_CACHE.put, parameter[member[.beanClass], member[.allFields]]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[Field] operator[SEP] operator[SEP] identifier[getFields] operator[SEP] identifier[Class] operator[<] operator[?] operator[>] identifier[beanClass] operator[SEP] Keyword[throws] identifier[SecurityException] { identifier[Field] operator[SEP] operator[SEP] identifier[allFields] operator[=] identifier[FIELDS_CACHE] operator[SEP] identifier[get] operator[SEP] identifier[beanClass] operator[SEP] operator[SEP] Keyword[if] operator[SEP] Other[null] operator[!=] identifier[allFields] operator[SEP] { Keyword[return] identifier[allFields] operator[SEP] } identifier[allFields] operator[=] identifier[getFieldsDirectly] operator[SEP] identifier[beanClass] , literal[boolean] operator[SEP] operator[SEP] Keyword[return] identifier[FIELDS_CACHE] operator[SEP] identifier[put] operator[SEP] identifier[beanClass] , identifier[allFields] operator[SEP] operator[SEP] }
@Override public void visit(NodeVisitor v) { if (v.visit(this)) { getTarget().visit(v); getProperty().visit(v); } }
class class_name[name] begin[{] method[visit, return_type[void], modifier[public], parameter[v]] begin[{] if[call[v.visit, parameter[THIS[]]]] begin[{] call[.getTarget, parameter[]] call[.getProperty, parameter[]] else begin[{] None end[}] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[visit] operator[SEP] identifier[NodeVisitor] identifier[v] operator[SEP] { Keyword[if] operator[SEP] identifier[v] operator[SEP] identifier[visit] operator[SEP] Keyword[this] operator[SEP] operator[SEP] { identifier[getTarget] operator[SEP] operator[SEP] operator[SEP] identifier[visit] operator[SEP] identifier[v] operator[SEP] operator[SEP] identifier[getProperty] operator[SEP] operator[SEP] operator[SEP] identifier[visit] operator[SEP] identifier[v] operator[SEP] operator[SEP] } }
public int getColumnDisplaySize(int column) throws SQLException { sourceResultSet.checkColumnBounds(column); VoltType type = sourceResultSet.table.getColumnType(column - 1); switch(type) { case TINYINT: return (new Byte(Byte.MIN_VALUE)).toString().length(); case SMALLINT: return (new Short(Short.MIN_VALUE)).toString().length(); case INTEGER: return (new Integer(Integer.MIN_VALUE)).toString().length(); case BIGINT: return (new Long(Long.MIN_VALUE)).toString().length(); case FLOAT: return (new Double(Double.MIN_VALUE)).toString().length(); case DECIMAL: return 40; case TIMESTAMP: return 32; case GEOGRAPHY_POINT: return GeographyPointValue.getValueDisplaySize(); case STRING: case VARBINARY: case GEOGRAPHY: return 128; // That is wrong: should be length in bytes / 3 (max bytes per char for UTF8), but we don't receive the length! default: throw SQLError.get(SQLError.TRANSLATION_NOT_FOUND, type); } }
class class_name[name] begin[{] method[getColumnDisplaySize, return_type[type[int]], modifier[public], parameter[column]] begin[{] call[sourceResultSet.checkColumnBounds, parameter[member[.column]]] local_variable[type[VoltType], type] SwitchStatement(cases=[SwitchStatementCase(case=['TINYINT'], statements=[ReturnStatement(expression=ClassCreator(arguments=[MemberReference(member=MIN_VALUE, postfix_operators=[], prefix_operators=[], qualifier=Byte, selectors=[])], 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), MethodInvocation(arguments=[], member=length, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=Byte, sub_type=None)), label=None)]), SwitchStatementCase(case=['SMALLINT'], statements=[ReturnStatement(expression=ClassCreator(arguments=[MemberReference(member=MIN_VALUE, postfix_operators=[], prefix_operators=[], qualifier=Short, selectors=[])], 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), MethodInvocation(arguments=[], member=length, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=Short, sub_type=None)), label=None)]), SwitchStatementCase(case=['INTEGER'], statements=[ReturnStatement(expression=ClassCreator(arguments=[MemberReference(member=MIN_VALUE, postfix_operators=[], prefix_operators=[], qualifier=Integer, selectors=[])], 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), MethodInvocation(arguments=[], member=length, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=Integer, sub_type=None)), label=None)]), SwitchStatementCase(case=['BIGINT'], statements=[ReturnStatement(expression=ClassCreator(arguments=[MemberReference(member=MIN_VALUE, postfix_operators=[], prefix_operators=[], qualifier=Long, selectors=[])], 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), MethodInvocation(arguments=[], member=length, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=Long, sub_type=None)), label=None)]), SwitchStatementCase(case=['FLOAT'], statements=[ReturnStatement(expression=ClassCreator(arguments=[MemberReference(member=MIN_VALUE, postfix_operators=[], prefix_operators=[], qualifier=Double, selectors=[])], 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), MethodInvocation(arguments=[], member=length, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=Double, sub_type=None)), label=None)]), SwitchStatementCase(case=['DECIMAL'], statements=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=40), label=None)]), SwitchStatementCase(case=['TIMESTAMP'], statements=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=32), label=None)]), SwitchStatementCase(case=['GEOGRAPHY_POINT'], statements=[ReturnStatement(expression=MethodInvocation(arguments=[], member=getValueDisplaySize, postfix_operators=[], prefix_operators=[], qualifier=GeographyPointValue, selectors=[], type_arguments=None), label=None)]), SwitchStatementCase(case=['STRING', 'VARBINARY', 'GEOGRAPHY'], statements=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=128), label=None)]), SwitchStatementCase(case=[], statements=[ThrowStatement(expression=MethodInvocation(arguments=[MemberReference(member=TRANSLATION_NOT_FOUND, postfix_operators=[], prefix_operators=[], qualifier=SQLError, selectors=[]), MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=SQLError, selectors=[], type_arguments=None), label=None)])], expression=MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None) end[}] END[}]
Keyword[public] Keyword[int] identifier[getColumnDisplaySize] operator[SEP] Keyword[int] identifier[column] operator[SEP] Keyword[throws] identifier[SQLException] { identifier[sourceResultSet] operator[SEP] identifier[checkColumnBounds] operator[SEP] identifier[column] operator[SEP] operator[SEP] identifier[VoltType] identifier[type] operator[=] identifier[sourceResultSet] operator[SEP] identifier[table] operator[SEP] identifier[getColumnType] operator[SEP] identifier[column] operator[-] Other[1] operator[SEP] operator[SEP] Keyword[switch] operator[SEP] identifier[type] operator[SEP] { Keyword[case] identifier[TINYINT] operator[:] Keyword[return] operator[SEP] Keyword[new] identifier[Byte] operator[SEP] identifier[Byte] operator[SEP] identifier[MIN_VALUE] operator[SEP] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] Keyword[case] identifier[SMALLINT] operator[:] Keyword[return] operator[SEP] Keyword[new] identifier[Short] operator[SEP] identifier[Short] operator[SEP] identifier[MIN_VALUE] operator[SEP] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] Keyword[case] identifier[INTEGER] operator[:] Keyword[return] operator[SEP] Keyword[new] identifier[Integer] operator[SEP] identifier[Integer] operator[SEP] identifier[MIN_VALUE] operator[SEP] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] Keyword[case] identifier[BIGINT] operator[:] Keyword[return] operator[SEP] Keyword[new] identifier[Long] operator[SEP] identifier[Long] operator[SEP] identifier[MIN_VALUE] operator[SEP] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] Keyword[case] identifier[FLOAT] operator[:] Keyword[return] operator[SEP] Keyword[new] identifier[Double] operator[SEP] identifier[Double] operator[SEP] identifier[MIN_VALUE] operator[SEP] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] Keyword[case] identifier[DECIMAL] operator[:] Keyword[return] Other[40] operator[SEP] Keyword[case] identifier[TIMESTAMP] operator[:] Keyword[return] Other[32] operator[SEP] Keyword[case] identifier[GEOGRAPHY_POINT] operator[:] Keyword[return] identifier[GeographyPointValue] operator[SEP] identifier[getValueDisplaySize] operator[SEP] operator[SEP] operator[SEP] Keyword[case] identifier[STRING] operator[:] Keyword[case] identifier[VARBINARY] operator[:] Keyword[case] identifier[GEOGRAPHY] operator[:] Keyword[return] Other[128] operator[SEP] Keyword[default] operator[:] Keyword[throw] identifier[SQLError] operator[SEP] identifier[get] operator[SEP] identifier[SQLError] operator[SEP] identifier[TRANSLATION_NOT_FOUND] , identifier[type] operator[SEP] operator[SEP] } }
@Override public CommerceShippingMethod fetchByPrimaryKey(Serializable primaryKey) { Serializable serializable = entityCache.getResult(CommerceShippingMethodModelImpl.ENTITY_CACHE_ENABLED, CommerceShippingMethodImpl.class, primaryKey); if (serializable == nullModel) { return null; } CommerceShippingMethod commerceShippingMethod = (CommerceShippingMethod)serializable; if (commerceShippingMethod == null) { Session session = null; try { session = openSession(); commerceShippingMethod = (CommerceShippingMethod)session.get(CommerceShippingMethodImpl.class, primaryKey); if (commerceShippingMethod != null) { cacheResult(commerceShippingMethod); } else { entityCache.putResult(CommerceShippingMethodModelImpl.ENTITY_CACHE_ENABLED, CommerceShippingMethodImpl.class, primaryKey, nullModel); } } catch (Exception e) { entityCache.removeResult(CommerceShippingMethodModelImpl.ENTITY_CACHE_ENABLED, CommerceShippingMethodImpl.class, primaryKey); throw processException(e); } finally { closeSession(session); } } return commerceShippingMethod; }
class class_name[name] begin[{] method[fetchByPrimaryKey, return_type[type[CommerceShippingMethod]], modifier[public], parameter[primaryKey]] begin[{] local_variable[type[Serializable], serializable] if[binary_operation[member[.serializable], ==, member[.nullModel]]] begin[{] return[literal[null]] else begin[{] None end[}] local_variable[type[CommerceShippingMethod], commerceShippingMethod] if[binary_operation[member[.commerceShippingMethod], ==, literal[null]]] begin[{] local_variable[type[Session], session] TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=session, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=openSession, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=commerceShippingMethod, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Cast(expression=MethodInvocation(arguments=[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=CommerceShippingMethodImpl, sub_type=None)), MemberReference(member=primaryKey, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=session, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=CommerceShippingMethod, sub_type=None))), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=commerceShippingMethod, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=ENTITY_CACHE_ENABLED, postfix_operators=[], prefix_operators=[], qualifier=CommerceShippingMethodModelImpl, selectors=[]), ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=CommerceShippingMethodImpl, sub_type=None)), MemberReference(member=primaryKey, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=nullModel, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=putResult, postfix_operators=[], prefix_operators=[], qualifier=entityCache, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=commerceShippingMethod, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=cacheResult, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]))], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=ENTITY_CACHE_ENABLED, postfix_operators=[], prefix_operators=[], qualifier=CommerceShippingMethodModelImpl, selectors=[]), ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=CommerceShippingMethodImpl, sub_type=None)), MemberReference(member=primaryKey, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=removeResult, postfix_operators=[], prefix_operators=[], qualifier=entityCache, selectors=[], type_arguments=None), label=None), ThrowStatement(expression=MethodInvocation(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=processException, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=session, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=closeSession, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], label=None, resources=None) else begin[{] None end[}] return[member[.commerceShippingMethod]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[CommerceShippingMethod] identifier[fetchByPrimaryKey] operator[SEP] identifier[Serializable] identifier[primaryKey] operator[SEP] { identifier[Serializable] identifier[serializable] operator[=] identifier[entityCache] operator[SEP] identifier[getResult] operator[SEP] identifier[CommerceShippingMethodModelImpl] operator[SEP] identifier[ENTITY_CACHE_ENABLED] , identifier[CommerceShippingMethodImpl] operator[SEP] Keyword[class] , identifier[primaryKey] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[serializable] operator[==] identifier[nullModel] operator[SEP] { Keyword[return] Other[null] operator[SEP] } identifier[CommerceShippingMethod] identifier[commerceShippingMethod] operator[=] operator[SEP] identifier[CommerceShippingMethod] operator[SEP] identifier[serializable] operator[SEP] Keyword[if] operator[SEP] identifier[commerceShippingMethod] operator[==] Other[null] operator[SEP] { identifier[Session] identifier[session] operator[=] Other[null] operator[SEP] Keyword[try] { identifier[session] operator[=] identifier[openSession] operator[SEP] operator[SEP] operator[SEP] identifier[commerceShippingMethod] operator[=] operator[SEP] identifier[CommerceShippingMethod] operator[SEP] identifier[session] operator[SEP] identifier[get] operator[SEP] identifier[CommerceShippingMethodImpl] operator[SEP] Keyword[class] , identifier[primaryKey] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[commerceShippingMethod] operator[!=] Other[null] operator[SEP] { identifier[cacheResult] operator[SEP] identifier[commerceShippingMethod] operator[SEP] operator[SEP] } Keyword[else] { identifier[entityCache] operator[SEP] identifier[putResult] operator[SEP] identifier[CommerceShippingMethodModelImpl] operator[SEP] identifier[ENTITY_CACHE_ENABLED] , identifier[CommerceShippingMethodImpl] operator[SEP] Keyword[class] , identifier[primaryKey] , identifier[nullModel] operator[SEP] operator[SEP] } } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { identifier[entityCache] operator[SEP] identifier[removeResult] operator[SEP] identifier[CommerceShippingMethodModelImpl] operator[SEP] identifier[ENTITY_CACHE_ENABLED] , identifier[CommerceShippingMethodImpl] operator[SEP] Keyword[class] , identifier[primaryKey] operator[SEP] operator[SEP] Keyword[throw] identifier[processException] operator[SEP] identifier[e] operator[SEP] operator[SEP] } Keyword[finally] { identifier[closeSession] operator[SEP] identifier[session] operator[SEP] operator[SEP] } } Keyword[return] identifier[commerceShippingMethod] operator[SEP] }
private void configureTag(Tag tag, Map attributes) throws JellyException { if ( tag instanceof DynaTag ) { DynaTag dynaTag = (DynaTag) tag; for (Object o : attributes.entrySet()) { Entry entry = (Entry) o; String name = (String) entry.getKey(); if(name.equals("xmlns")) continue; // we'll process this by ourselves Object value = getValue(entry, dynaTag.getAttributeType(name)); dynaTag.setAttribute(name, value); } } else { // treat the tag as a bean DynaBean dynaBean = new ConvertingWrapDynaBean( tag ); for (Object o : attributes.entrySet()) { Entry entry = (Entry) o; String name = (String) entry.getKey(); if(name.equals("xmlns")) continue; // we'll process this by ourselves DynaProperty property = dynaBean.getDynaClass().getDynaProperty(name); if (property == null) { throw new JellyException("This tag does not understand the '" + name + "' attribute"); } dynaBean.set(name, getValue(entry,property.getType())); } } }
class class_name[name] begin[{] method[configureTag, return_type[void], modifier[private], parameter[tag, attributes]] begin[{] if[binary_operation[member[.tag], instanceof, type[DynaTag]]] begin[{] local_variable[type[DynaTag], dynaTag] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MemberReference(member=o, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Entry, sub_type=None)), name=entry)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Entry, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MethodInvocation(arguments=[], member=getKey, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), name=name)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="xmlns")], member=equals, postfix_operators=[], prefix_operators=[], qualifier=name, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=ContinueStatement(goto=None, label=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=entry, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getAttributeType, postfix_operators=[], prefix_operators=[], qualifier=dynaTag, selectors=[], type_arguments=None)], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=value)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setAttribute, postfix_operators=[], prefix_operators=[], qualifier=dynaTag, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=entrySet, postfix_operators=[], prefix_operators=[], qualifier=attributes, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=o)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))), label=None) else begin[{] local_variable[type[DynaBean], dynaBean] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MemberReference(member=o, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Entry, sub_type=None)), name=entry)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Entry, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MethodInvocation(arguments=[], member=getKey, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), name=name)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="xmlns")], member=equals, postfix_operators=[], prefix_operators=[], qualifier=name, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=ContinueStatement(goto=None, label=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getDynaClass, postfix_operators=[], prefix_operators=[], qualifier=dynaBean, selectors=[MethodInvocation(arguments=[MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getDynaProperty, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=property)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=DynaProperty, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=property, 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=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="This tag does not understand the '"), operandr=MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="' attribute"), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=JellyException, sub_type=None)), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[MemberReference(member=entry, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getType, postfix_operators=[], prefix_operators=[], qualifier=property, selectors=[], type_arguments=None)], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=set, postfix_operators=[], prefix_operators=[], qualifier=dynaBean, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=entrySet, postfix_operators=[], prefix_operators=[], qualifier=attributes, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=o)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))), label=None) end[}] end[}] END[}]
Keyword[private] Keyword[void] identifier[configureTag] operator[SEP] identifier[Tag] identifier[tag] , identifier[Map] identifier[attributes] operator[SEP] Keyword[throws] identifier[JellyException] { Keyword[if] operator[SEP] identifier[tag] Keyword[instanceof] identifier[DynaTag] operator[SEP] { identifier[DynaTag] identifier[dynaTag] operator[=] operator[SEP] identifier[DynaTag] operator[SEP] identifier[tag] operator[SEP] Keyword[for] operator[SEP] identifier[Object] identifier[o] operator[:] identifier[attributes] operator[SEP] identifier[entrySet] operator[SEP] operator[SEP] operator[SEP] { identifier[Entry] identifier[entry] operator[=] operator[SEP] identifier[Entry] operator[SEP] identifier[o] operator[SEP] identifier[String] identifier[name] operator[=] operator[SEP] identifier[String] operator[SEP] identifier[entry] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[name] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[continue] operator[SEP] identifier[Object] identifier[value] operator[=] identifier[getValue] operator[SEP] identifier[entry] , identifier[dynaTag] operator[SEP] identifier[getAttributeType] operator[SEP] identifier[name] operator[SEP] operator[SEP] operator[SEP] identifier[dynaTag] operator[SEP] identifier[setAttribute] operator[SEP] identifier[name] , identifier[value] operator[SEP] operator[SEP] } } Keyword[else] { identifier[DynaBean] identifier[dynaBean] operator[=] Keyword[new] identifier[ConvertingWrapDynaBean] operator[SEP] identifier[tag] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Object] identifier[o] operator[:] identifier[attributes] operator[SEP] identifier[entrySet] operator[SEP] operator[SEP] operator[SEP] { identifier[Entry] identifier[entry] operator[=] operator[SEP] identifier[Entry] operator[SEP] identifier[o] operator[SEP] identifier[String] identifier[name] operator[=] operator[SEP] identifier[String] operator[SEP] identifier[entry] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[name] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[continue] operator[SEP] identifier[DynaProperty] identifier[property] operator[=] identifier[dynaBean] operator[SEP] identifier[getDynaClass] operator[SEP] operator[SEP] operator[SEP] identifier[getDynaProperty] operator[SEP] identifier[name] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[property] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[JellyException] operator[SEP] literal[String] operator[+] identifier[name] operator[+] literal[String] operator[SEP] operator[SEP] } identifier[dynaBean] operator[SEP] identifier[set] operator[SEP] identifier[name] , identifier[getValue] operator[SEP] identifier[entry] , identifier[property] operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } }
public RadarSeries setLineStyle(BasicStroke basicStroke) { stroke = basicStroke; if (this.lineWidth > 0.0f) { stroke = new BasicStroke( lineWidth, this.stroke.getEndCap(), this.stroke.getLineJoin(), this.stroke.getMiterLimit(), this.stroke.getDashArray(), this.stroke.getDashPhase()); } return this; }
class class_name[name] begin[{] method[setLineStyle, return_type[type[RadarSeries]], modifier[public], parameter[basicStroke]] begin[{] assign[member[.stroke], member[.basicStroke]] if[binary_operation[THIS[member[None.lineWidth]], >, literal[0.0f]]] begin[{] assign[member[.stroke], ClassCreator(arguments=[MemberReference(member=lineWidth, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=stroke, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[], member=getEndCap, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=stroke, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[], member=getLineJoin, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=stroke, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[], member=getMiterLimit, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=stroke, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[], member=getDashArray, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=stroke, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[], member=getDashPhase, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=BasicStroke, sub_type=None))] else begin[{] None end[}] return[THIS[]] end[}] END[}]
Keyword[public] identifier[RadarSeries] identifier[setLineStyle] operator[SEP] identifier[BasicStroke] identifier[basicStroke] operator[SEP] { identifier[stroke] operator[=] identifier[basicStroke] operator[SEP] Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[lineWidth] operator[>] literal[Float] operator[SEP] { identifier[stroke] operator[=] Keyword[new] identifier[BasicStroke] operator[SEP] identifier[lineWidth] , Keyword[this] operator[SEP] identifier[stroke] operator[SEP] identifier[getEndCap] operator[SEP] operator[SEP] , Keyword[this] operator[SEP] identifier[stroke] operator[SEP] identifier[getLineJoin] operator[SEP] operator[SEP] , Keyword[this] operator[SEP] identifier[stroke] operator[SEP] identifier[getMiterLimit] operator[SEP] operator[SEP] , Keyword[this] operator[SEP] identifier[stroke] operator[SEP] identifier[getDashArray] operator[SEP] operator[SEP] , Keyword[this] operator[SEP] identifier[stroke] operator[SEP] identifier[getDashPhase] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] Keyword[this] operator[SEP] }
protected void renderARIAInvalid(FacesContext context, UIInput component) throws IOException { if (!component.isValid()) { ResponseWriter writer = context.getResponseWriter(); writer.writeAttribute(HTML.ARIA_INVALID, "true", null); } }
class class_name[name] begin[{] method[renderARIAInvalid, return_type[void], modifier[protected], parameter[context, component]] begin[{] if[call[component.isValid, parameter[]]] begin[{] local_variable[type[ResponseWriter], writer] call[writer.writeAttribute, parameter[member[HTML.ARIA_INVALID], literal["true"], literal[null]]] else begin[{] None end[}] end[}] END[}]
Keyword[protected] Keyword[void] identifier[renderARIAInvalid] operator[SEP] identifier[FacesContext] identifier[context] , identifier[UIInput] identifier[component] operator[SEP] Keyword[throws] identifier[IOException] { Keyword[if] operator[SEP] operator[!] identifier[component] operator[SEP] identifier[isValid] operator[SEP] operator[SEP] operator[SEP] { identifier[ResponseWriter] identifier[writer] operator[=] identifier[context] operator[SEP] identifier[getResponseWriter] operator[SEP] operator[SEP] operator[SEP] identifier[writer] operator[SEP] identifier[writeAttribute] operator[SEP] identifier[HTML] operator[SEP] identifier[ARIA_INVALID] , literal[String] , Other[null] operator[SEP] operator[SEP] } }
public static l2param get(nitro_service service) throws Exception{ l2param obj = new l2param(); l2param[] response = (l2param[])obj.get_resources(service); return response[0]; }
class class_name[name] begin[{] method[get, return_type[type[l2param]], modifier[public static], parameter[service]] begin[{] local_variable[type[l2param], obj] local_variable[type[l2param], response] return[member[.response]] end[}] END[}]
Keyword[public] Keyword[static] identifier[l2param] identifier[get] operator[SEP] identifier[nitro_service] identifier[service] operator[SEP] Keyword[throws] identifier[Exception] { identifier[l2param] identifier[obj] operator[=] Keyword[new] identifier[l2param] operator[SEP] operator[SEP] operator[SEP] identifier[l2param] operator[SEP] operator[SEP] identifier[response] operator[=] operator[SEP] identifier[l2param] operator[SEP] operator[SEP] operator[SEP] identifier[obj] operator[SEP] identifier[get_resources] operator[SEP] identifier[service] operator[SEP] operator[SEP] Keyword[return] identifier[response] operator[SEP] Other[0] operator[SEP] operator[SEP] }
public List<Object> getEntities() { List<Object> entitiesList = new LinkedList<Object>(); for (Result result : results) { entitiesList.add(result.getObject()); } return entitiesList; }
class class_name[name] begin[{] method[getEntities, return_type[type[List]], modifier[public], parameter[]] begin[{] local_variable[type[List], entitiesList] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getObject, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=entitiesList, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=results, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=result)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Result, sub_type=None))), label=None) return[member[.entitiesList]] end[}] END[}]
Keyword[public] identifier[List] operator[<] identifier[Object] operator[>] identifier[getEntities] operator[SEP] operator[SEP] { identifier[List] operator[<] identifier[Object] operator[>] identifier[entitiesList] operator[=] Keyword[new] identifier[LinkedList] operator[<] identifier[Object] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Result] identifier[result] operator[:] identifier[results] operator[SEP] { identifier[entitiesList] operator[SEP] identifier[add] operator[SEP] identifier[result] operator[SEP] identifier[getObject] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[entitiesList] operator[SEP] }
@Nonnull @Override public AffinityGroup create(@Nonnull AffinityGroupCreateOptions options) throws InternalException, CloudException { if(options == null || options.getName() == null) throw new InternalException("Cannot create AffinityGroup. Create options or affinity group name cannot be null."); CreateAffinityGroupModel createAffinityGroupModel = new CreateAffinityGroupModel(); createAffinityGroupModel.setName(options.getName()); createAffinityGroupModel.setDescription(options.getDescription()); createAffinityGroupModel.setLocation(provider.getContext().getRegionId()); createAffinityGroupModel.setLabel(new String(Base64.encodeBase64(options.getName().getBytes()))); AzureMethod azureMethod = new AzureMethod(this.provider); try { azureMethod.post(RESOURCE_AFFINITYGROUPS, createAffinityGroupModel); } catch (JAXBException e) { logger.error(e.getMessage()); throw new InternalException(e); } return AffinityGroup.getInstance(createAffinityGroupModel.getName(), createAffinityGroupModel.getName(), createAffinityGroupModel.getDescription(), createAffinityGroupModel.getLocation(), null); }
class class_name[name] begin[{] method[create, return_type[type[AffinityGroup]], modifier[public], parameter[options]] begin[{] if[binary_operation[binary_operation[member[.options], ==, literal[null]], ||, binary_operation[call[options.getName, parameter[]], ==, literal[null]]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Cannot create AffinityGroup. Create options or affinity group name cannot be null.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=InternalException, sub_type=None)), label=None) else begin[{] None end[}] local_variable[type[CreateAffinityGroupModel], createAffinityGroupModel] call[createAffinityGroupModel.setName, parameter[call[options.getName, parameter[]]]] call[createAffinityGroupModel.setDescription, parameter[call[options.getDescription, parameter[]]]] call[createAffinityGroupModel.setLocation, parameter[call[provider.getContext, parameter[]]]] call[createAffinityGroupModel.setLabel, parameter[ClassCreator(arguments=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=options, selectors=[MethodInvocation(arguments=[], member=getBytes, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=encodeBase64, postfix_operators=[], prefix_operators=[], qualifier=Base64, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=String, sub_type=None))]] local_variable[type[AzureMethod], azureMethod] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=RESOURCE_AFFINITYGROUPS, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=createAffinityGroupModel, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=post, postfix_operators=[], prefix_operators=[], qualifier=azureMethod, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None)], member=error, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), label=None), 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=InternalException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['JAXBException']))], finally_block=None, label=None, resources=None) return[call[AffinityGroup.getInstance, parameter[call[createAffinityGroupModel.getName, parameter[]], call[createAffinityGroupModel.getName, parameter[]], call[createAffinityGroupModel.getDescription, parameter[]], call[createAffinityGroupModel.getLocation, parameter[]], literal[null]]]] end[}] END[}]
annotation[@] identifier[Nonnull] annotation[@] identifier[Override] Keyword[public] identifier[AffinityGroup] identifier[create] operator[SEP] annotation[@] identifier[Nonnull] identifier[AffinityGroupCreateOptions] identifier[options] operator[SEP] Keyword[throws] identifier[InternalException] , identifier[CloudException] { Keyword[if] operator[SEP] identifier[options] operator[==] Other[null] operator[||] identifier[options] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[==] Other[null] operator[SEP] Keyword[throw] Keyword[new] identifier[InternalException] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[CreateAffinityGroupModel] identifier[createAffinityGroupModel] operator[=] Keyword[new] identifier[CreateAffinityGroupModel] operator[SEP] operator[SEP] operator[SEP] identifier[createAffinityGroupModel] operator[SEP] identifier[setName] operator[SEP] identifier[options] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[createAffinityGroupModel] operator[SEP] identifier[setDescription] operator[SEP] identifier[options] operator[SEP] identifier[getDescription] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[createAffinityGroupModel] operator[SEP] identifier[setLocation] operator[SEP] identifier[provider] operator[SEP] identifier[getContext] operator[SEP] operator[SEP] operator[SEP] identifier[getRegionId] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[createAffinityGroupModel] operator[SEP] identifier[setLabel] operator[SEP] Keyword[new] identifier[String] operator[SEP] identifier[Base64] operator[SEP] identifier[encodeBase64] operator[SEP] identifier[options] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] identifier[getBytes] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[AzureMethod] identifier[azureMethod] operator[=] Keyword[new] identifier[AzureMethod] operator[SEP] Keyword[this] operator[SEP] identifier[provider] operator[SEP] operator[SEP] Keyword[try] { identifier[azureMethod] operator[SEP] identifier[post] operator[SEP] identifier[RESOURCE_AFFINITYGROUPS] , identifier[createAffinityGroupModel] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[JAXBException] identifier[e] operator[SEP] { identifier[logger] operator[SEP] identifier[error] operator[SEP] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[InternalException] operator[SEP] identifier[e] operator[SEP] operator[SEP] } Keyword[return] identifier[AffinityGroup] operator[SEP] identifier[getInstance] operator[SEP] identifier[createAffinityGroupModel] operator[SEP] identifier[getName] operator[SEP] operator[SEP] , identifier[createAffinityGroupModel] operator[SEP] identifier[getName] operator[SEP] operator[SEP] , identifier[createAffinityGroupModel] operator[SEP] identifier[getDescription] operator[SEP] operator[SEP] , identifier[createAffinityGroupModel] operator[SEP] identifier[getLocation] operator[SEP] operator[SEP] , Other[null] operator[SEP] operator[SEP] }
public void unsubscribeAllDeletedResources(CmsObject cms, long deletedTo) throws CmsException { if (!isEnabled()) { throw new CmsRuntimeException(Messages.get().container(Messages.ERR_SUBSCRIPTION_MANAGER_DISABLED_0)); } m_securityManager.unsubscribeAllDeletedResources(cms.getRequestContext(), getPoolName(), deletedTo); }
class class_name[name] begin[{] method[unsubscribeAllDeletedResources, return_type[void], modifier[public], parameter[cms, deletedTo]] begin[{] if[call[.isEnabled, parameter[]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[], member=get, postfix_operators=[], prefix_operators=[], qualifier=Messages, selectors=[MethodInvocation(arguments=[MemberReference(member=ERR_SUBSCRIPTION_MANAGER_DISABLED_0, postfix_operators=[], prefix_operators=[], qualifier=Messages, 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=CmsRuntimeException, sub_type=None)), label=None) else begin[{] None end[}] call[m_securityManager.unsubscribeAllDeletedResources, parameter[call[cms.getRequestContext, parameter[]], call[.getPoolName, parameter[]], member[.deletedTo]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[unsubscribeAllDeletedResources] operator[SEP] identifier[CmsObject] identifier[cms] , Keyword[long] identifier[deletedTo] operator[SEP] Keyword[throws] identifier[CmsException] { Keyword[if] operator[SEP] operator[!] identifier[isEnabled] operator[SEP] operator[SEP] operator[SEP] { Keyword[throw] Keyword[new] identifier[CmsRuntimeException] operator[SEP] identifier[Messages] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[container] operator[SEP] identifier[Messages] operator[SEP] identifier[ERR_SUBSCRIPTION_MANAGER_DISABLED_0] operator[SEP] operator[SEP] operator[SEP] } identifier[m_securityManager] operator[SEP] identifier[unsubscribeAllDeletedResources] operator[SEP] identifier[cms] operator[SEP] identifier[getRequestContext] operator[SEP] operator[SEP] , identifier[getPoolName] operator[SEP] operator[SEP] , identifier[deletedTo] operator[SEP] operator[SEP] }
public EnvironmentPlatform withLanguages(EnvironmentLanguage... languages) { if (this.languages == null) { setLanguages(new java.util.ArrayList<EnvironmentLanguage>(languages.length)); } for (EnvironmentLanguage ele : languages) { this.languages.add(ele); } return this; }
class class_name[name] begin[{] method[withLanguages, return_type[type[EnvironmentPlatform]], modifier[public], parameter[languages]] begin[{] if[binary_operation[THIS[member[None.languages]], ==, literal[null]]] begin[{] call[.setLanguages, parameter[ClassCreator(arguments=[MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=languages, 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=EnvironmentLanguage, 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=languages, 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=languages, 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=EnvironmentLanguage, sub_type=None))), label=None) return[THIS[]] end[}] END[}]
Keyword[public] identifier[EnvironmentPlatform] identifier[withLanguages] operator[SEP] identifier[EnvironmentLanguage] operator[...] identifier[languages] operator[SEP] { Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[languages] operator[==] Other[null] operator[SEP] { identifier[setLanguages] operator[SEP] Keyword[new] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[ArrayList] operator[<] identifier[EnvironmentLanguage] operator[>] operator[SEP] identifier[languages] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] } Keyword[for] operator[SEP] identifier[EnvironmentLanguage] identifier[ele] operator[:] identifier[languages] operator[SEP] { Keyword[this] operator[SEP] identifier[languages] operator[SEP] identifier[add] operator[SEP] identifier[ele] operator[SEP] operator[SEP] } Keyword[return] Keyword[this] operator[SEP] }
public void info(Throwable error, Map<String, Object> custom, String description) { log(error, custom, description, Level.INFO); }
class class_name[name] begin[{] method[info, return_type[void], modifier[public], parameter[error, custom, description]] begin[{] call[.log, parameter[member[.error], member[.custom], member[.description], member[Level.INFO]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[info] operator[SEP] identifier[Throwable] identifier[error] , identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] identifier[custom] , identifier[String] identifier[description] operator[SEP] { identifier[log] operator[SEP] identifier[error] , identifier[custom] , identifier[description] , identifier[Level] operator[SEP] identifier[INFO] operator[SEP] operator[SEP] }
public static void printNodes(Document doc) { NodeList children = doc.getChildNodes(); for (int i = 0; i < children.getLength(); i++) { Node node = children.item(i); if (node instanceof Element) printNode((Element) node); } }
class class_name[name] begin[{] method[printNodes, return_type[void], modifier[public static], parameter[doc]] begin[{] local_variable[type[NodeList], children] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=item, postfix_operators=[], prefix_operators=[], qualifier=children, selectors=[], type_arguments=None), name=node)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Node, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=node, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=Element, sub_type=None), operator=instanceof), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[Cast(expression=MemberReference(member=node, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Element, sub_type=None))], member=printNode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=getLength, postfix_operators=[], prefix_operators=[], qualifier=children, selectors=[], type_arguments=None), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[printNodes] operator[SEP] identifier[Document] identifier[doc] operator[SEP] { identifier[NodeList] identifier[children] operator[=] identifier[doc] operator[SEP] identifier[getChildNodes] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[children] operator[SEP] identifier[getLength] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[Node] identifier[node] operator[=] identifier[children] operator[SEP] identifier[item] operator[SEP] identifier[i] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[node] Keyword[instanceof] identifier[Element] operator[SEP] identifier[printNode] operator[SEP] operator[SEP] identifier[Element] operator[SEP] identifier[node] operator[SEP] operator[SEP] } }
public void loadVfsEntryBean( final String siteRoot, final String filter, final AsyncCallback<CmsVfsEntryBean> asyncCallback) { CmsRpcAction<CmsVfsEntryBean> action = new CmsRpcAction<CmsVfsEntryBean>() { @Override public void execute() { start(200, false); getGalleryService().loadVfsEntryBean(siteRoot, filter, this); } @Override public void onResponse(CmsVfsEntryBean result) { stop(false); asyncCallback.onSuccess(result); } }; action.execute(); }
class class_name[name] begin[{] method[loadVfsEntryBean, return_type[void], modifier[public], parameter[siteRoot, filter, asyncCallback]] begin[{] local_variable[type[CmsRpcAction], action] call[action.execute, parameter[]] end[}] END[}]
Keyword[public] Keyword[void] identifier[loadVfsEntryBean] operator[SEP] Keyword[final] identifier[String] identifier[siteRoot] , Keyword[final] identifier[String] identifier[filter] , Keyword[final] identifier[AsyncCallback] operator[<] identifier[CmsVfsEntryBean] operator[>] identifier[asyncCallback] operator[SEP] { identifier[CmsRpcAction] operator[<] identifier[CmsVfsEntryBean] operator[>] identifier[action] operator[=] Keyword[new] identifier[CmsRpcAction] operator[<] identifier[CmsVfsEntryBean] operator[>] operator[SEP] operator[SEP] { annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[execute] operator[SEP] operator[SEP] { identifier[start] operator[SEP] Other[200] , literal[boolean] operator[SEP] operator[SEP] identifier[getGalleryService] operator[SEP] operator[SEP] operator[SEP] identifier[loadVfsEntryBean] operator[SEP] identifier[siteRoot] , identifier[filter] , Keyword[this] operator[SEP] operator[SEP] } annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[onResponse] operator[SEP] identifier[CmsVfsEntryBean] identifier[result] operator[SEP] { identifier[stop] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[asyncCallback] operator[SEP] identifier[onSuccess] operator[SEP] identifier[result] operator[SEP] operator[SEP] } } operator[SEP] identifier[action] operator[SEP] identifier[execute] operator[SEP] operator[SEP] operator[SEP] }
@Override public DisableRuleResult disableRule(DisableRuleRequest request) { request = beforeClientExecution(request); return executeDisableRule(request); }
class class_name[name] begin[{] method[disableRule, return_type[type[DisableRuleResult]], modifier[public], parameter[request]] begin[{] assign[member[.request], call[.beforeClientExecution, parameter[member[.request]]]] return[call[.executeDisableRule, parameter[member[.request]]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[DisableRuleResult] identifier[disableRule] operator[SEP] identifier[DisableRuleRequest] identifier[request] operator[SEP] { identifier[request] operator[=] identifier[beforeClientExecution] operator[SEP] identifier[request] operator[SEP] operator[SEP] Keyword[return] identifier[executeDisableRule] operator[SEP] identifier[request] operator[SEP] operator[SEP] }
static String getAccessDevname() { // Check if already done if (access_devname==null) if ((access_devname=System.getProperty("ACCESS_DEVNAME"))==null) // From JVM property if ((access_devname=System.getenv("ACCESS_DEVNAME"))==null) // From Environment property access_devname = getFromEnvFile("ACCESS_DEVNAME"); // From Environment file // else return access_devname; }
class class_name[name] begin[{] method[getAccessDevname, return_type[type[String]], modifier[static], parameter[]] begin[{] if[binary_operation[member[.access_devname], ==, literal[null]]] begin[{] if[binary_operation[assign[member[.access_devname], call[System.getProperty, parameter[literal["ACCESS_DEVNAME"]]]], ==, literal[null]]] begin[{] if[binary_operation[assign[member[.access_devname], call[System.getenv, parameter[literal["ACCESS_DEVNAME"]]]], ==, literal[null]]] begin[{] assign[member[.access_devname], call[.getFromEnvFile, parameter[literal["ACCESS_DEVNAME"]]]] else begin[{] None end[}] else begin[{] None end[}] else begin[{] None end[}] return[member[.access_devname]] end[}] END[}]
Keyword[static] identifier[String] identifier[getAccessDevname] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[access_devname] operator[==] Other[null] operator[SEP] Keyword[if] operator[SEP] operator[SEP] identifier[access_devname] operator[=] identifier[System] operator[SEP] identifier[getProperty] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[==] Other[null] operator[SEP] Keyword[if] operator[SEP] operator[SEP] identifier[access_devname] operator[=] identifier[System] operator[SEP] identifier[getenv] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[==] Other[null] operator[SEP] identifier[access_devname] operator[=] identifier[getFromEnvFile] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[access_devname] operator[SEP] }
@Override public GetSegmentResult getSegment(GetSegmentRequest request) { request = beforeClientExecution(request); return executeGetSegment(request); }
class class_name[name] begin[{] method[getSegment, return_type[type[GetSegmentResult]], modifier[public], parameter[request]] begin[{] assign[member[.request], call[.beforeClientExecution, parameter[member[.request]]]] return[call[.executeGetSegment, parameter[member[.request]]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[GetSegmentResult] identifier[getSegment] operator[SEP] identifier[GetSegmentRequest] identifier[request] operator[SEP] { identifier[request] operator[=] identifier[beforeClientExecution] operator[SEP] identifier[request] operator[SEP] operator[SEP] Keyword[return] identifier[executeGetSegment] operator[SEP] identifier[request] operator[SEP] operator[SEP] }
public static BigInteger factorial(BigInteger n) { BigInteger nFac = BigInteger.ONE; while(n.compareTo(BigInteger.ONE) > 0) { nFac = nFac.multiply(n); n = n.subtract(BigInteger.ONE); } return nFac; }
class class_name[name] begin[{] method[factorial, return_type[type[BigInteger]], modifier[public static], parameter[n]] begin[{] local_variable[type[BigInteger], nFac] while[binary_operation[call[n.compareTo, parameter[member[BigInteger.ONE]]], >, literal[0]]] begin[{] assign[member[.nFac], call[nFac.multiply, parameter[member[.n]]]] assign[member[.n], call[n.subtract, parameter[member[BigInteger.ONE]]]] end[}] return[member[.nFac]] end[}] END[}]
Keyword[public] Keyword[static] identifier[BigInteger] identifier[factorial] operator[SEP] identifier[BigInteger] identifier[n] operator[SEP] { identifier[BigInteger] identifier[nFac] operator[=] identifier[BigInteger] operator[SEP] identifier[ONE] operator[SEP] Keyword[while] operator[SEP] identifier[n] operator[SEP] identifier[compareTo] operator[SEP] identifier[BigInteger] operator[SEP] identifier[ONE] operator[SEP] operator[>] Other[0] operator[SEP] { identifier[nFac] operator[=] identifier[nFac] operator[SEP] identifier[multiply] operator[SEP] identifier[n] operator[SEP] operator[SEP] identifier[n] operator[=] identifier[n] operator[SEP] identifier[subtract] operator[SEP] identifier[BigInteger] operator[SEP] identifier[ONE] operator[SEP] operator[SEP] } Keyword[return] identifier[nFac] operator[SEP] }
public LibraryTypeEnum getType() { if (isReference()) { final LibrarySet master = (LibrarySet) getCheckedRef(LibrarySet.class, "LibrarySet"); return master.getType(); } return this.libraryType; }
class class_name[name] begin[{] method[getType, return_type[type[LibraryTypeEnum]], modifier[public], parameter[]] begin[{] if[call[.isReference, parameter[]]] begin[{] local_variable[type[LibrarySet], master] return[call[master.getType, parameter[]]] else begin[{] None end[}] return[THIS[member[None.libraryType]]] end[}] END[}]
Keyword[public] identifier[LibraryTypeEnum] identifier[getType] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[isReference] operator[SEP] operator[SEP] operator[SEP] { Keyword[final] identifier[LibrarySet] identifier[master] operator[=] operator[SEP] identifier[LibrarySet] operator[SEP] identifier[getCheckedRef] operator[SEP] identifier[LibrarySet] operator[SEP] Keyword[class] , literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[master] operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] Keyword[this] operator[SEP] identifier[libraryType] operator[SEP] }
public static void shuffleSelectedLeftRowsToRightTableModel(final JTable table, final GenericShuffleTableModel<?> shuffleTableModel) throws NoRowsSelectedException { final int[] selectedRows = table.getSelectedRows(); if (selectedRows.length != 0) { shuffleTableModel.shuffleSelectedLeftRowsToRightTableModel(selectedRows); } else { throw new NoRowsSelectedException("No rows selected."); } }
class class_name[name] begin[{] method[shuffleSelectedLeftRowsToRightTableModel, return_type[void], modifier[public static], parameter[table, shuffleTableModel]] begin[{] local_variable[type[int], selectedRows] if[binary_operation[member[selectedRows.length], !=, literal[0]]] begin[{] call[shuffleTableModel.shuffleSelectedLeftRowsToRightTableModel, parameter[member[.selectedRows]]] else begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="No rows selected.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=NoRowsSelectedException, sub_type=None)), label=None) end[}] end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[shuffleSelectedLeftRowsToRightTableModel] operator[SEP] Keyword[final] identifier[JTable] identifier[table] , Keyword[final] identifier[GenericShuffleTableModel] operator[<] operator[?] operator[>] identifier[shuffleTableModel] operator[SEP] Keyword[throws] identifier[NoRowsSelectedException] { Keyword[final] Keyword[int] operator[SEP] operator[SEP] identifier[selectedRows] operator[=] identifier[table] operator[SEP] identifier[getSelectedRows] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[selectedRows] operator[SEP] identifier[length] operator[!=] Other[0] operator[SEP] { identifier[shuffleTableModel] operator[SEP] identifier[shuffleSelectedLeftRowsToRightTableModel] operator[SEP] identifier[selectedRows] operator[SEP] operator[SEP] } Keyword[else] { Keyword[throw] Keyword[new] identifier[NoRowsSelectedException] operator[SEP] literal[String] operator[SEP] operator[SEP] } }
private boolean setUnauthenticatedSubjectIfNeeded(Subject invokedSubject, Subject receivedSubject) { if ((invokedSubject == null) && (receivedSubject == null)) { // create the unauthenticated subject and set as the invocation subject subjectManager.setInvocationSubject(unauthenticatedSubjectServiceRef.getService().getUnauthenticatedSubject()); return true; } return false; }
class class_name[name] begin[{] method[setUnauthenticatedSubjectIfNeeded, return_type[type[boolean]], modifier[private], parameter[invokedSubject, receivedSubject]] begin[{] if[binary_operation[binary_operation[member[.invokedSubject], ==, literal[null]], &&, binary_operation[member[.receivedSubject], ==, literal[null]]]] begin[{] call[subjectManager.setInvocationSubject, parameter[call[unauthenticatedSubjectServiceRef.getService, parameter[]]]] return[literal[true]] else begin[{] None end[}] return[literal[false]] end[}] END[}]
Keyword[private] Keyword[boolean] identifier[setUnauthenticatedSubjectIfNeeded] operator[SEP] identifier[Subject] identifier[invokedSubject] , identifier[Subject] identifier[receivedSubject] operator[SEP] { Keyword[if] operator[SEP] operator[SEP] identifier[invokedSubject] operator[==] Other[null] operator[SEP] operator[&&] operator[SEP] identifier[receivedSubject] operator[==] Other[null] operator[SEP] operator[SEP] { identifier[subjectManager] operator[SEP] identifier[setInvocationSubject] operator[SEP] identifier[unauthenticatedSubjectServiceRef] operator[SEP] identifier[getService] operator[SEP] operator[SEP] operator[SEP] identifier[getUnauthenticatedSubject] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP] } Keyword[return] literal[boolean] operator[SEP] }
public Token next() throws IOException { // skip whitespace while (Character.isWhitespace((char)lastChar)) { readChar(); } // handle punctuation switch (lastChar) { case -1: readChar(); return Token.TokenEOF; case '{': readChar(); return Token.TokenBraceL; case '}': readChar(); return Token.TokenBraceR; case '[': readChar(); return Token.TokenBrackL; case ']': readChar(); return Token.TokenBrackR; case ':': readChar(); return Token.TokenColon; case ',': readChar(); return Token.TokenComma; case '"': case '\'': String stringValue = readString(); return new Token(stringValue); case '-': case '.': case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': Number numberValue = readNumber(); return new Token(numberValue); case 'n': case 't': case 'f': String ident = readIdentifier(); if (ident.equals("null")) return Token.TokenNull; if (ident.equals("true")) return Token.TokenTrue; if (ident.equals("false")) return Token.TokenFalse; throw new IOException("Unexpected identifier '" + ident + "' " + onLineCol()); default: throw new IOException("Unexpected character '" + (char)lastChar + "' " + onLineCol()); } }
class class_name[name] begin[{] method[next, return_type[type[Token]], modifier[public], parameter[]] begin[{] while[call[Character.isWhitespace, parameter[Cast(expression=MemberReference(member=lastChar, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=BasicType(dimensions=[], name=char))]]] begin[{] call[.readChar, parameter[]] end[}] SwitchStatement(cases=[SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=1)], statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=readChar, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=MemberReference(member=TokenEOF, postfix_operators=[], prefix_operators=[], qualifier=Token, selectors=[]), label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='{')], statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=readChar, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=MemberReference(member=TokenBraceL, postfix_operators=[], prefix_operators=[], qualifier=Token, selectors=[]), label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='}')], statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=readChar, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=MemberReference(member=TokenBraceR, postfix_operators=[], prefix_operators=[], qualifier=Token, selectors=[]), label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='[')], statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=readChar, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=MemberReference(member=TokenBrackL, postfix_operators=[], prefix_operators=[], qualifier=Token, selectors=[]), label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=']')], statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=readChar, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=MemberReference(member=TokenBrackR, postfix_operators=[], prefix_operators=[], qualifier=Token, selectors=[]), label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=':')], statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=readChar, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=MemberReference(member=TokenColon, postfix_operators=[], prefix_operators=[], qualifier=Token, selectors=[]), label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=',')], statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=readChar, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=MemberReference(member=TokenComma, postfix_operators=[], prefix_operators=[], qualifier=Token, selectors=[]), label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='"'), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='\'')], statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=readString, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=stringValue)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), ReturnStatement(expression=ClassCreator(arguments=[MemberReference(member=stringValue, 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=Token, sub_type=None)), label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='-'), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='.'), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='0'), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='1'), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='2'), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='3'), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='4'), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='5'), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='6'), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='7'), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='8'), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='9')], statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=readNumber, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=numberValue)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Number, sub_type=None)), ReturnStatement(expression=ClassCreator(arguments=[MemberReference(member=numberValue, 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=Token, sub_type=None)), label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='n'), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='t'), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='f')], statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=readIdentifier, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=ident)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="null")], member=equals, postfix_operators=[], prefix_operators=[], qualifier=ident, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=ReturnStatement(expression=MemberReference(member=TokenNull, postfix_operators=[], prefix_operators=[], qualifier=Token, selectors=[]), label=None)), IfStatement(condition=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="true")], member=equals, postfix_operators=[], prefix_operators=[], qualifier=ident, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=ReturnStatement(expression=MemberReference(member=TokenTrue, postfix_operators=[], prefix_operators=[], qualifier=Token, selectors=[]), label=None)), IfStatement(condition=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="false")], member=equals, postfix_operators=[], prefix_operators=[], qualifier=ident, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=ReturnStatement(expression=MemberReference(member=TokenFalse, postfix_operators=[], prefix_operators=[], qualifier=Token, selectors=[]), label=None)), ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unexpected identifier '"), operandr=MemberReference(member=ident, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="' "), operator=+), operandr=MethodInvocation(arguments=[], member=onLineCol, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IOException, sub_type=None)), label=None)]), SwitchStatementCase(case=[], statements=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unexpected character '"), operandr=Cast(expression=MemberReference(member=lastChar, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=BasicType(dimensions=[], name=char)), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="' "), operator=+), operandr=MethodInvocation(arguments=[], member=onLineCol, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IOException, sub_type=None)), label=None)])], expression=MemberReference(member=lastChar, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None) end[}] END[}]
Keyword[public] identifier[Token] identifier[next] operator[SEP] operator[SEP] Keyword[throws] identifier[IOException] { Keyword[while] operator[SEP] identifier[Character] operator[SEP] identifier[isWhitespace] operator[SEP] operator[SEP] Keyword[char] operator[SEP] identifier[lastChar] operator[SEP] operator[SEP] { identifier[readChar] operator[SEP] operator[SEP] operator[SEP] } Keyword[switch] operator[SEP] identifier[lastChar] operator[SEP] { Keyword[case] operator[-] Other[1] operator[:] identifier[readChar] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[Token] operator[SEP] identifier[TokenEOF] operator[SEP] Keyword[case] literal[String] operator[:] identifier[readChar] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[Token] operator[SEP] identifier[TokenBraceL] operator[SEP] Keyword[case] literal[String] operator[:] identifier[readChar] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[Token] operator[SEP] identifier[TokenBraceR] operator[SEP] Keyword[case] literal[String] operator[:] identifier[readChar] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[Token] operator[SEP] identifier[TokenBrackL] operator[SEP] Keyword[case] literal[String] operator[:] identifier[readChar] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[Token] operator[SEP] identifier[TokenBrackR] operator[SEP] Keyword[case] literal[String] operator[:] identifier[readChar] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[Token] operator[SEP] identifier[TokenColon] operator[SEP] Keyword[case] literal[String] operator[:] identifier[readChar] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[Token] operator[SEP] identifier[TokenComma] operator[SEP] Keyword[case] literal[String] operator[:] Keyword[case] literal[String] operator[:] identifier[String] identifier[stringValue] operator[=] identifier[readString] operator[SEP] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[Token] operator[SEP] identifier[stringValue] operator[SEP] operator[SEP] Keyword[case] literal[String] operator[:] Keyword[case] literal[String] operator[:] Keyword[case] literal[String] operator[:] Keyword[case] literal[String] operator[:] Keyword[case] literal[String] operator[:] Keyword[case] literal[String] operator[:] Keyword[case] literal[String] operator[:] Keyword[case] literal[String] operator[:] Keyword[case] literal[String] operator[:] Keyword[case] literal[String] operator[:] Keyword[case] literal[String] operator[:] Keyword[case] literal[String] operator[:] identifier[Number] identifier[numberValue] operator[=] identifier[readNumber] operator[SEP] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[Token] operator[SEP] identifier[numberValue] operator[SEP] operator[SEP] Keyword[case] literal[String] operator[:] Keyword[case] literal[String] operator[:] Keyword[case] literal[String] operator[:] identifier[String] identifier[ident] operator[=] identifier[readIdentifier] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[ident] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[Token] operator[SEP] identifier[TokenNull] operator[SEP] Keyword[if] operator[SEP] identifier[ident] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[Token] operator[SEP] identifier[TokenTrue] operator[SEP] Keyword[if] operator[SEP] identifier[ident] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[Token] operator[SEP] identifier[TokenFalse] operator[SEP] Keyword[throw] Keyword[new] identifier[IOException] operator[SEP] literal[String] operator[+] identifier[ident] operator[+] literal[String] operator[+] identifier[onLineCol] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[default] operator[:] Keyword[throw] Keyword[new] identifier[IOException] operator[SEP] literal[String] operator[+] operator[SEP] Keyword[char] operator[SEP] identifier[lastChar] operator[+] literal[String] operator[+] identifier[onLineCol] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } }
public java.util.List<ResourceComplianceSummaryItem> getResourceComplianceSummaryItems() { if (resourceComplianceSummaryItems == null) { resourceComplianceSummaryItems = new com.amazonaws.internal.SdkInternalList<ResourceComplianceSummaryItem>(); } return resourceComplianceSummaryItems; }
class class_name[name] begin[{] method[getResourceComplianceSummaryItems, return_type[type[java]], modifier[public], parameter[]] begin[{] if[binary_operation[member[.resourceComplianceSummaryItems], ==, literal[null]]] begin[{] assign[member[.resourceComplianceSummaryItems], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=com, sub_type=ReferenceType(arguments=None, dimensions=None, name=amazonaws, sub_type=ReferenceType(arguments=None, dimensions=None, name=internal, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=ResourceComplianceSummaryItem, sub_type=None))], dimensions=None, name=SdkInternalList, sub_type=None)))))] else begin[{] None end[}] return[member[.resourceComplianceSummaryItems]] end[}] END[}]
Keyword[public] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[List] operator[<] identifier[ResourceComplianceSummaryItem] operator[>] identifier[getResourceComplianceSummaryItems] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[resourceComplianceSummaryItems] operator[==] Other[null] operator[SEP] { identifier[resourceComplianceSummaryItems] operator[=] Keyword[new] identifier[com] operator[SEP] identifier[amazonaws] operator[SEP] identifier[internal] operator[SEP] identifier[SdkInternalList] operator[<] identifier[ResourceComplianceSummaryItem] operator[>] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[resourceComplianceSummaryItems] operator[SEP] }
public MMAXAnnotation getTargetList(int i) { if (MMAXPointer_Type.featOkTst && ((MMAXPointer_Type)jcasType).casFeat_targetList == null) jcasType.jcas.throwFeatMissing("targetList", "de.julielab.jules.types.mmax.MMAXPointer"); jcasType.jcas.checkArrayBounds(jcasType.ll_cas.ll_getRefValue(addr, ((MMAXPointer_Type)jcasType).casFeatCode_targetList), i); return (MMAXAnnotation)(jcasType.ll_cas.ll_getFSForRef(jcasType.ll_cas.ll_getRefArrayValue(jcasType.ll_cas.ll_getRefValue(addr, ((MMAXPointer_Type)jcasType).casFeatCode_targetList), i)));}
class class_name[name] begin[{] method[getTargetList, return_type[type[MMAXAnnotation]], modifier[public], parameter[i]] begin[{] if[binary_operation[member[MMAXPointer_Type.featOkTst], &&, binary_operation[Cast(expression=MemberReference(member=jcasType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=MMAXPointer_Type, sub_type=None)), ==, literal[null]]]] begin[{] call[jcasType.jcas.throwFeatMissing, parameter[literal["targetList"], literal["de.julielab.jules.types.mmax.MMAXPointer"]]] else begin[{] None end[}] call[jcasType.jcas.checkArrayBounds, parameter[call[jcasType.ll_cas.ll_getRefValue, parameter[member[.addr], Cast(expression=MemberReference(member=jcasType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=MMAXPointer_Type, sub_type=None))]], member[.i]]] return[Cast(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=addr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Cast(expression=MemberReference(member=jcasType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=MMAXPointer_Type, sub_type=None))], member=ll_getRefValue, postfix_operators=[], prefix_operators=[], qualifier=jcasType.ll_cas, selectors=[], type_arguments=None), MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=ll_getRefArrayValue, postfix_operators=[], prefix_operators=[], qualifier=jcasType.ll_cas, selectors=[], type_arguments=None)], member=ll_getFSForRef, postfix_operators=[], prefix_operators=[], qualifier=jcasType.ll_cas, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=MMAXAnnotation, sub_type=None))] end[}] END[}]
Keyword[public] identifier[MMAXAnnotation] identifier[getTargetList] operator[SEP] Keyword[int] identifier[i] operator[SEP] { Keyword[if] operator[SEP] identifier[MMAXPointer_Type] operator[SEP] identifier[featOkTst] operator[&&] operator[SEP] operator[SEP] identifier[MMAXPointer_Type] operator[SEP] identifier[jcasType] operator[SEP] operator[SEP] identifier[casFeat_targetList] 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] identifier[jcasType] operator[SEP] identifier[jcas] operator[SEP] identifier[checkArrayBounds] operator[SEP] identifier[jcasType] operator[SEP] identifier[ll_cas] operator[SEP] identifier[ll_getRefValue] operator[SEP] identifier[addr] , operator[SEP] operator[SEP] identifier[MMAXPointer_Type] operator[SEP] identifier[jcasType] operator[SEP] operator[SEP] identifier[casFeatCode_targetList] operator[SEP] , identifier[i] operator[SEP] operator[SEP] Keyword[return] operator[SEP] identifier[MMAXAnnotation] operator[SEP] operator[SEP] identifier[jcasType] operator[SEP] identifier[ll_cas] operator[SEP] identifier[ll_getFSForRef] operator[SEP] identifier[jcasType] operator[SEP] identifier[ll_cas] operator[SEP] identifier[ll_getRefArrayValue] operator[SEP] identifier[jcasType] operator[SEP] identifier[ll_cas] operator[SEP] identifier[ll_getRefValue] operator[SEP] identifier[addr] , operator[SEP] operator[SEP] identifier[MMAXPointer_Type] operator[SEP] identifier[jcasType] operator[SEP] operator[SEP] identifier[casFeatCode_targetList] operator[SEP] , identifier[i] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
public CloseableHttpResponse copyHeaders(OutgoingRequest outgoingRequest, HttpEntityEnclosingRequest incomingRequest, HttpResponse httpClientResponse) { HttpResponse result = new BasicHttpResponse(httpClientResponse.getStatusLine()); result.setEntity(httpClientResponse.getEntity()); String originalUri = incomingRequest.getRequestLine().getUri(); String baseUrl = outgoingRequest.getBaseUrl().toString(); String visibleBaseUrl = outgoingRequest.getOriginalRequest().getVisibleBaseUrl(); for (Header header : httpClientResponse.getAllHeaders()) { String name = header.getName(); String value = header.getValue(); try { // Ignore Content-Encoding and Content-Type as these headers are // set in HttpEntity if (!HttpHeaders.CONTENT_ENCODING.equalsIgnoreCase(name)) { if (isForwardedResponseHeader(name)) { // Some headers containing an URI have to be rewritten if (HttpHeaders.LOCATION.equalsIgnoreCase(name) || HttpHeaders.CONTENT_LOCATION.equalsIgnoreCase(name)) { // Header contains only an url value = urlRewriter.rewriteUrl(value, originalUri, baseUrl, visibleBaseUrl, true); value = HttpResponseUtils.removeSessionId(value, httpClientResponse); result.addHeader(name, value); } else if ("Link".equalsIgnoreCase(name)) { // Header has the following format // Link: </feed>; rel="alternate" if (value.startsWith("<") && value.contains(">")) { String urlValue = value.substring(1, value.indexOf(">")); String targetUrlValue = urlRewriter.rewriteUrl(urlValue, originalUri, baseUrl, visibleBaseUrl, true); targetUrlValue = HttpResponseUtils.removeSessionId(targetUrlValue, httpClientResponse); value = value.replace("<" + urlValue + ">", "<" + targetUrlValue + ">"); } result.addHeader(name, value); } else if ("Refresh".equalsIgnoreCase(name)) { // Header has the following format // Refresh: 5; url=http://www.example.com int urlPosition = value.indexOf("url="); if (urlPosition >= 0) { value = urlRewriter.rewriteRefresh(value, originalUri, baseUrl, visibleBaseUrl); value = HttpResponseUtils.removeSessionId(value, httpClientResponse); } result.addHeader(name, value); } else if ("P3p".equalsIgnoreCase(name)) { // Do not translate url yet. // P3P is used with a default fixed url most of the // time. result.addHeader(name, value); } else { result.addHeader(header.getName(), header.getValue()); } } } } catch (Exception e1) { // It's important not to fail here. // An application can always send corrupted headers, and we // should not crash LOG.error("Error while copying headers", e1); result.addHeader("X-Esigate-Error", "Error processing header " + name + ": " + value); } } return BasicCloseableHttpResponse.adapt(result); }
class class_name[name] begin[{] method[copyHeaders, return_type[type[CloseableHttpResponse]], modifier[public], parameter[outgoingRequest, incomingRequest, httpClientResponse]] begin[{] local_variable[type[HttpResponse], result] call[result.setEntity, parameter[call[httpClientResponse.getEntity, parameter[]]]] local_variable[type[String], originalUri] local_variable[type[String], baseUrl] local_variable[type[String], visibleBaseUrl] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=header, selectors=[], type_arguments=None), name=name)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=header, selectors=[], type_arguments=None), name=value)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TryStatement(block=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equalsIgnoreCase, postfix_operators=[], prefix_operators=['!'], qualifier=HttpHeaders.CONTENT_ENCODING, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isForwardedResponseHeader, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equalsIgnoreCase, postfix_operators=[], prefix_operators=[], qualifier=HttpHeaders.LOCATION, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equalsIgnoreCase, postfix_operators=[], prefix_operators=[], qualifier=HttpHeaders.CONTENT_LOCATION, selectors=[], type_arguments=None), operator=||), else_statement=IfStatement(condition=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equalsIgnoreCase, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], value="Link"), else_statement=IfStatement(condition=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equalsIgnoreCase, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], value="Refresh"), else_statement=IfStatement(condition=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equalsIgnoreCase, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], value="P3p"), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=header, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=header, selectors=[], type_arguments=None)], member=addHeader, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addHeader, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[], type_arguments=None), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="url=")], member=indexOf, postfix_operators=[], prefix_operators=[], qualifier=value, selectors=[], type_arguments=None), name=urlPosition)], modifiers=set(), type=BasicType(dimensions=[], name=int)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=urlPosition, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=originalUri, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=baseUrl, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=visibleBaseUrl, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=rewriteRefresh, postfix_operators=[], prefix_operators=[], qualifier=urlRewriter, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=httpClientResponse, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=removeSessionId, postfix_operators=[], prefix_operators=[], qualifier=HttpResponseUtils, selectors=[], type_arguments=None)), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addHeader, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[], type_arguments=None), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="<")], member=startsWith, postfix_operators=[], prefix_operators=[], qualifier=value, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=">")], member=contains, postfix_operators=[], prefix_operators=[], qualifier=value, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=">")], member=indexOf, postfix_operators=[], prefix_operators=[], qualifier=value, selectors=[], type_arguments=None)], member=substring, postfix_operators=[], prefix_operators=[], qualifier=value, selectors=[], type_arguments=None), name=urlValue)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=urlValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=originalUri, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=baseUrl, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=visibleBaseUrl, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], member=rewriteUrl, postfix_operators=[], prefix_operators=[], qualifier=urlRewriter, selectors=[], type_arguments=None), name=targetUrlValue)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=targetUrlValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=targetUrlValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=httpClientResponse, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=removeSessionId, postfix_operators=[], prefix_operators=[], qualifier=HttpResponseUtils, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="<"), operandr=MemberReference(member=urlValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=">"), operator=+), BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="<"), operandr=MemberReference(member=targetUrlValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=">"), operator=+)], member=replace, postfix_operators=[], prefix_operators=[], qualifier=value, selectors=[], type_arguments=None)), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addHeader, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[], type_arguments=None), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=originalUri, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=baseUrl, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=visibleBaseUrl, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], member=rewriteUrl, postfix_operators=[], prefix_operators=[], qualifier=urlRewriter, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=httpClientResponse, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=removeSessionId, postfix_operators=[], prefix_operators=[], qualifier=HttpResponseUtils, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addHeader, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[], type_arguments=None), label=None)]))]))]))], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Error while copying headers"), MemberReference(member=e1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="X-Esigate-Error"), BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Error processing header "), operandr=MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=": "), operator=+), operandr=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=addHeader, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e1, types=['Exception']))], finally_block=None, label=None, resources=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getAllHeaders, postfix_operators=[], prefix_operators=[], qualifier=httpClientResponse, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=header)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Header, sub_type=None))), label=None) return[call[BasicCloseableHttpResponse.adapt, parameter[member[.result]]]] end[}] END[}]
Keyword[public] identifier[CloseableHttpResponse] identifier[copyHeaders] operator[SEP] identifier[OutgoingRequest] identifier[outgoingRequest] , identifier[HttpEntityEnclosingRequest] identifier[incomingRequest] , identifier[HttpResponse] identifier[httpClientResponse] operator[SEP] { identifier[HttpResponse] identifier[result] operator[=] Keyword[new] identifier[BasicHttpResponse] operator[SEP] identifier[httpClientResponse] operator[SEP] identifier[getStatusLine] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[setEntity] operator[SEP] identifier[httpClientResponse] operator[SEP] identifier[getEntity] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[originalUri] operator[=] identifier[incomingRequest] operator[SEP] identifier[getRequestLine] operator[SEP] operator[SEP] operator[SEP] identifier[getUri] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[baseUrl] operator[=] identifier[outgoingRequest] operator[SEP] identifier[getBaseUrl] operator[SEP] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[visibleBaseUrl] operator[=] identifier[outgoingRequest] operator[SEP] identifier[getOriginalRequest] operator[SEP] operator[SEP] operator[SEP] identifier[getVisibleBaseUrl] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Header] identifier[header] operator[:] identifier[httpClientResponse] operator[SEP] identifier[getAllHeaders] operator[SEP] operator[SEP] operator[SEP] { identifier[String] identifier[name] operator[=] identifier[header] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[value] operator[=] identifier[header] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] Keyword[try] { Keyword[if] operator[SEP] operator[!] identifier[HttpHeaders] operator[SEP] identifier[CONTENT_ENCODING] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] identifier[name] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[isForwardedResponseHeader] operator[SEP] identifier[name] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[HttpHeaders] operator[SEP] identifier[LOCATION] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] identifier[name] operator[SEP] operator[||] identifier[HttpHeaders] operator[SEP] identifier[CONTENT_LOCATION] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] identifier[name] operator[SEP] operator[SEP] { identifier[value] operator[=] identifier[urlRewriter] operator[SEP] identifier[rewriteUrl] operator[SEP] identifier[value] , identifier[originalUri] , identifier[baseUrl] , identifier[visibleBaseUrl] , literal[boolean] operator[SEP] operator[SEP] identifier[value] operator[=] identifier[HttpResponseUtils] operator[SEP] identifier[removeSessionId] operator[SEP] identifier[value] , identifier[httpClientResponse] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[addHeader] operator[SEP] identifier[name] , identifier[value] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] literal[String] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] identifier[name] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[value] operator[SEP] identifier[startsWith] operator[SEP] literal[String] operator[SEP] operator[&&] identifier[value] operator[SEP] identifier[contains] operator[SEP] literal[String] operator[SEP] operator[SEP] { identifier[String] identifier[urlValue] operator[=] identifier[value] operator[SEP] identifier[substring] operator[SEP] Other[1] , identifier[value] operator[SEP] identifier[indexOf] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[targetUrlValue] operator[=] identifier[urlRewriter] operator[SEP] identifier[rewriteUrl] operator[SEP] identifier[urlValue] , identifier[originalUri] , identifier[baseUrl] , identifier[visibleBaseUrl] , literal[boolean] operator[SEP] operator[SEP] identifier[targetUrlValue] operator[=] identifier[HttpResponseUtils] operator[SEP] identifier[removeSessionId] operator[SEP] identifier[targetUrlValue] , identifier[httpClientResponse] operator[SEP] operator[SEP] identifier[value] operator[=] identifier[value] operator[SEP] identifier[replace] operator[SEP] literal[String] operator[+] identifier[urlValue] operator[+] literal[String] , literal[String] operator[+] identifier[targetUrlValue] operator[+] literal[String] operator[SEP] operator[SEP] } identifier[result] operator[SEP] identifier[addHeader] operator[SEP] identifier[name] , identifier[value] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] literal[String] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] identifier[name] operator[SEP] operator[SEP] { Keyword[int] identifier[urlPosition] operator[=] identifier[value] operator[SEP] identifier[indexOf] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[urlPosition] operator[>=] Other[0] operator[SEP] { identifier[value] operator[=] identifier[urlRewriter] operator[SEP] identifier[rewriteRefresh] operator[SEP] identifier[value] , identifier[originalUri] , identifier[baseUrl] , identifier[visibleBaseUrl] operator[SEP] operator[SEP] identifier[value] operator[=] identifier[HttpResponseUtils] operator[SEP] identifier[removeSessionId] operator[SEP] identifier[value] , identifier[httpClientResponse] operator[SEP] operator[SEP] } identifier[result] operator[SEP] identifier[addHeader] operator[SEP] identifier[name] , identifier[value] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] literal[String] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] identifier[name] operator[SEP] operator[SEP] { identifier[result] operator[SEP] identifier[addHeader] operator[SEP] identifier[name] , identifier[value] operator[SEP] operator[SEP] } Keyword[else] { identifier[result] operator[SEP] identifier[addHeader] operator[SEP] identifier[header] operator[SEP] identifier[getName] operator[SEP] operator[SEP] , identifier[header] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } } } Keyword[catch] operator[SEP] identifier[Exception] identifier[e1] operator[SEP] { identifier[LOG] operator[SEP] identifier[error] operator[SEP] literal[String] , identifier[e1] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[addHeader] operator[SEP] literal[String] , literal[String] operator[+] identifier[name] operator[+] literal[String] operator[+] identifier[value] operator[SEP] operator[SEP] } } Keyword[return] identifier[BasicCloseableHttpResponse] operator[SEP] identifier[adapt] operator[SEP] identifier[result] operator[SEP] operator[SEP] }
private double naiveQueryDense(NumberVector obj, WritableDoubleDataStore scores, HashSetModifiableDBIDs cands) { double len = 0.; // Length of query object, for final normalization for(int dim = 0, max = obj.getDimensionality(); dim < max; dim++) { final double val = obj.doubleValue(dim); if(val == 0. || val != val) { continue; } len += val * val; // No matching documents in index: if(dim >= index.size()) { continue; } ModifiableDoubleDBIDList column = index.get(dim); for(DoubleDBIDListIter n = column.iter(); n.valid(); n.advance()) { scores.increment(n, n.doubleValue() * val); cands.add(n); } } return FastMath.sqrt(len); }
class class_name[name] begin[{] method[naiveQueryDense, return_type[type[double]], modifier[private], parameter[obj, scores, cands]] begin[{] local_variable[type[double], len] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=dim, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=doubleValue, postfix_operators=[], prefix_operators=[], qualifier=obj, selectors=[], type_arguments=None), name=val)], modifiers={'final'}, type=BasicType(dimensions=[], name=double)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=val, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0.), operator===), operandr=BinaryOperation(operandl=MemberReference(member=val, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=val, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=!=), operator=||), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ContinueStatement(goto=None, label=None)])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=len, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=BinaryOperation(operandl=MemberReference(member=val, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=val, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=*)), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=dim, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=index, selectors=[], type_arguments=None), operator=>=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ContinueStatement(goto=None, label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=dim, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=index, selectors=[], type_arguments=None), name=column)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ModifiableDoubleDBIDList, sub_type=None)), ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=n, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=MethodInvocation(arguments=[], member=doubleValue, postfix_operators=[], prefix_operators=[], qualifier=n, selectors=[], type_arguments=None), operandr=MemberReference(member=val, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=*)], member=increment, postfix_operators=[], prefix_operators=[], qualifier=scores, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=n, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=cands, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=MethodInvocation(arguments=[], member=valid, postfix_operators=[], prefix_operators=[], qualifier=n, selectors=[], type_arguments=None), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=MethodInvocation(arguments=[], member=iter, postfix_operators=[], prefix_operators=[], qualifier=column, selectors=[], type_arguments=None), name=n)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=DoubleDBIDListIter, sub_type=None)), update=[MethodInvocation(arguments=[], member=advance, postfix_operators=[], prefix_operators=[], qualifier=n, selectors=[], type_arguments=None)]), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=dim, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=max, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=dim), VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getDimensionality, postfix_operators=[], prefix_operators=[], qualifier=obj, selectors=[], type_arguments=None), name=max)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=dim, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) return[call[FastMath.sqrt, parameter[member[.len]]]] end[}] END[}]
Keyword[private] Keyword[double] identifier[naiveQueryDense] operator[SEP] identifier[NumberVector] identifier[obj] , identifier[WritableDoubleDataStore] identifier[scores] , identifier[HashSetModifiableDBIDs] identifier[cands] operator[SEP] { Keyword[double] identifier[len] operator[=] literal[Float] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[dim] operator[=] Other[0] , identifier[max] operator[=] identifier[obj] operator[SEP] identifier[getDimensionality] operator[SEP] operator[SEP] operator[SEP] identifier[dim] operator[<] identifier[max] operator[SEP] identifier[dim] operator[++] operator[SEP] { Keyword[final] Keyword[double] identifier[val] operator[=] identifier[obj] operator[SEP] identifier[doubleValue] operator[SEP] identifier[dim] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[val] operator[==] literal[Float] operator[||] identifier[val] operator[!=] identifier[val] operator[SEP] { Keyword[continue] operator[SEP] } identifier[len] operator[+=] identifier[val] operator[*] identifier[val] operator[SEP] Keyword[if] operator[SEP] identifier[dim] operator[>=] identifier[index] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] { Keyword[continue] operator[SEP] } identifier[ModifiableDoubleDBIDList] identifier[column] operator[=] identifier[index] operator[SEP] identifier[get] operator[SEP] identifier[dim] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[DoubleDBIDListIter] identifier[n] operator[=] identifier[column] operator[SEP] identifier[iter] operator[SEP] operator[SEP] operator[SEP] identifier[n] operator[SEP] identifier[valid] operator[SEP] operator[SEP] operator[SEP] identifier[n] operator[SEP] identifier[advance] operator[SEP] operator[SEP] operator[SEP] { identifier[scores] operator[SEP] identifier[increment] operator[SEP] identifier[n] , identifier[n] operator[SEP] identifier[doubleValue] operator[SEP] operator[SEP] operator[*] identifier[val] operator[SEP] operator[SEP] identifier[cands] operator[SEP] identifier[add] operator[SEP] identifier[n] operator[SEP] operator[SEP] } } Keyword[return] identifier[FastMath] operator[SEP] identifier[sqrt] operator[SEP] identifier[len] operator[SEP] operator[SEP] }
private static String trim(String string) { String result = string.trim(); if (result.startsWith("\"") && result.endsWith("\"") && result.length() > 1) { result = result.substring(1, result.length() - 1); } return result; }
class class_name[name] begin[{] method[trim, return_type[type[String]], modifier[private static], parameter[string]] begin[{] local_variable[type[String], result] if[binary_operation[binary_operation[call[result.startsWith, parameter[literal["\""]]], &&, call[result.endsWith, parameter[literal["\""]]]], &&, binary_operation[call[result.length, parameter[]], >, literal[1]]]] begin[{] assign[member[.result], call[result.substring, parameter[literal[1], binary_operation[call[result.length, parameter[]], -, literal[1]]]]] else begin[{] None end[}] return[member[.result]] end[}] END[}]
Keyword[private] Keyword[static] identifier[String] identifier[trim] operator[SEP] identifier[String] identifier[string] operator[SEP] { identifier[String] identifier[result] operator[=] identifier[string] operator[SEP] identifier[trim] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[result] operator[SEP] identifier[startsWith] operator[SEP] literal[String] operator[SEP] operator[&&] identifier[result] operator[SEP] identifier[endsWith] operator[SEP] literal[String] operator[SEP] operator[&&] identifier[result] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[>] Other[1] operator[SEP] { identifier[result] operator[=] identifier[result] operator[SEP] identifier[substring] operator[SEP] Other[1] , identifier[result] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[-] Other[1] operator[SEP] operator[SEP] } Keyword[return] identifier[result] operator[SEP] }
public static float[] toFloat(int[] array) { float[] n = new float[array.length]; for (int i = 0; i < array.length; i++) { n[i] = (float) array[i]; } return n; }
class class_name[name] begin[{] method[toFloat, return_type[type[float]], modifier[public static], parameter[array]] begin[{] local_variable[type[float], n] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=n, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=Cast(expression=MemberReference(member=array, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type=BasicType(dimensions=[], name=float))), 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=array, 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[.n]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[float] operator[SEP] operator[SEP] identifier[toFloat] operator[SEP] Keyword[int] operator[SEP] operator[SEP] identifier[array] operator[SEP] { Keyword[float] operator[SEP] operator[SEP] identifier[n] operator[=] Keyword[new] Keyword[float] operator[SEP] identifier[array] 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[array] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[n] operator[SEP] identifier[i] operator[SEP] operator[=] operator[SEP] Keyword[float] operator[SEP] identifier[array] operator[SEP] identifier[i] operator[SEP] operator[SEP] } Keyword[return] identifier[n] operator[SEP] }
@Pure public static Point2d L4_EL2(double x, double y) { final Point2d ntfLambdaPhi = NTFLambert_NTFLambdaPhi(x, y, LAMBERT_4_N, LAMBERT_4_C, LAMBERT_4_XS, LAMBERT_4_YS); return NTFLambdaPhi_NTFLambert( ntfLambdaPhi.getX(), ntfLambdaPhi.getY(), LAMBERT_2E_N, LAMBERT_2E_C, LAMBERT_2E_XS, LAMBERT_2E_YS); }
class class_name[name] begin[{] method[L4_EL2, return_type[type[Point2d]], modifier[public static], parameter[x, y]] begin[{] local_variable[type[Point2d], ntfLambdaPhi] return[call[.NTFLambdaPhi_NTFLambert, parameter[call[ntfLambdaPhi.getX, parameter[]], call[ntfLambdaPhi.getY, parameter[]], member[.LAMBERT_2E_N], member[.LAMBERT_2E_C], member[.LAMBERT_2E_XS], member[.LAMBERT_2E_YS]]]] end[}] END[}]
annotation[@] identifier[Pure] Keyword[public] Keyword[static] identifier[Point2d] identifier[L4_EL2] operator[SEP] Keyword[double] identifier[x] , Keyword[double] identifier[y] operator[SEP] { Keyword[final] identifier[Point2d] identifier[ntfLambdaPhi] operator[=] identifier[NTFLambert_NTFLambdaPhi] operator[SEP] identifier[x] , identifier[y] , identifier[LAMBERT_4_N] , identifier[LAMBERT_4_C] , identifier[LAMBERT_4_XS] , identifier[LAMBERT_4_YS] operator[SEP] operator[SEP] Keyword[return] identifier[NTFLambdaPhi_NTFLambert] operator[SEP] identifier[ntfLambdaPhi] operator[SEP] identifier[getX] operator[SEP] operator[SEP] , identifier[ntfLambdaPhi] operator[SEP] identifier[getY] operator[SEP] operator[SEP] , identifier[LAMBERT_2E_N] , identifier[LAMBERT_2E_C] , identifier[LAMBERT_2E_XS] , identifier[LAMBERT_2E_YS] operator[SEP] operator[SEP] }
private List<String> pruneSuggestions(final List<String> suggestions) { List<String> prunedSuggestions = new ArrayList<>(suggestions.size()); for (final String suggestion : suggestions) { if (suggestion.indexOf(' ') == -1) { prunedSuggestions.add(suggestion); } else { String[] complexSug = suggestion.split(" "); if (!bannedSuffixes.contains(complexSug[1])) { prunedSuggestions.add(suggestion); } } } return prunedSuggestions; }
class class_name[name] begin[{] method[pruneSuggestions, return_type[type[List]], modifier[private], parameter[suggestions]] begin[{] local_variable[type[List], prunedSuggestions] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=' ')], member=indexOf, postfix_operators=[], prefix_operators=[], qualifier=suggestion, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=1), operator===), else_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" ")], member=split, postfix_operators=[], prefix_operators=[], qualifier=suggestion, selectors=[], type_arguments=None), name=complexSug)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[None], name=String, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=complexSug, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1))])], member=contains, postfix_operators=[], prefix_operators=['!'], qualifier=bannedSuffixes, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=suggestion, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=prunedSuggestions, selectors=[], type_arguments=None), label=None)]))]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=suggestion, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=prunedSuggestions, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=suggestions, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=suggestion)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None) return[member[.prunedSuggestions]] end[}] END[}]
Keyword[private] identifier[List] operator[<] identifier[String] operator[>] identifier[pruneSuggestions] operator[SEP] Keyword[final] identifier[List] operator[<] identifier[String] operator[>] identifier[suggestions] operator[SEP] { identifier[List] operator[<] identifier[String] operator[>] identifier[prunedSuggestions] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] identifier[suggestions] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[final] identifier[String] identifier[suggestion] operator[:] identifier[suggestions] operator[SEP] { Keyword[if] operator[SEP] identifier[suggestion] operator[SEP] identifier[indexOf] operator[SEP] literal[String] operator[SEP] operator[==] operator[-] Other[1] operator[SEP] { identifier[prunedSuggestions] operator[SEP] identifier[add] operator[SEP] identifier[suggestion] operator[SEP] operator[SEP] } Keyword[else] { identifier[String] operator[SEP] operator[SEP] identifier[complexSug] operator[=] identifier[suggestion] operator[SEP] identifier[split] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[bannedSuffixes] operator[SEP] identifier[contains] operator[SEP] identifier[complexSug] operator[SEP] Other[1] operator[SEP] operator[SEP] operator[SEP] { identifier[prunedSuggestions] operator[SEP] identifier[add] operator[SEP] identifier[suggestion] operator[SEP] operator[SEP] } } } Keyword[return] identifier[prunedSuggestions] operator[SEP] }
public void initialize() { if (cacheSize <= 0) {// 不考虑cacheSize为0的情况,强制使用LRU cache机制 cacheSize = DEFAULT_CACHE_SIZE; } functions = new HashMap<String, Object>(); engine = new ScriptJexlEngine(); engine.setCache(cacheSize); engine.setSilent(true); engine.setFunctions(functions); // 注册functions }
class class_name[name] begin[{] method[initialize, return_type[void], modifier[public], parameter[]] begin[{] if[binary_operation[member[.cacheSize], <=, literal[0]]] begin[{] assign[member[.cacheSize], member[.DEFAULT_CACHE_SIZE]] else begin[{] None end[}] assign[member[.functions], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))], dimensions=None, name=HashMap, sub_type=None))] assign[member[.engine], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ScriptJexlEngine, sub_type=None))] call[engine.setCache, parameter[member[.cacheSize]]] call[engine.setSilent, parameter[literal[true]]] call[engine.setFunctions, parameter[member[.functions]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[initialize] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[cacheSize] operator[<=] Other[0] operator[SEP] { identifier[cacheSize] operator[=] identifier[DEFAULT_CACHE_SIZE] operator[SEP] } identifier[functions] operator[=] Keyword[new] identifier[HashMap] operator[<] identifier[String] , identifier[Object] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[engine] operator[=] Keyword[new] identifier[ScriptJexlEngine] operator[SEP] operator[SEP] operator[SEP] identifier[engine] operator[SEP] identifier[setCache] operator[SEP] identifier[cacheSize] operator[SEP] operator[SEP] identifier[engine] operator[SEP] identifier[setSilent] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[engine] operator[SEP] identifier[setFunctions] operator[SEP] identifier[functions] operator[SEP] operator[SEP] }
@Override public Daft toObject() throws JAXBException { this.upgradeToLatestVersion(); return (Daft) DaftIeUtils.createUnmarshaller().unmarshal(this.getDocument()); }
class class_name[name] begin[{] method[toObject, return_type[type[Daft]], modifier[public], parameter[]] begin[{] THIS[call[None.upgradeToLatestVersion, parameter[]]] return[Cast(expression=MethodInvocation(arguments=[], member=createUnmarshaller, postfix_operators=[], prefix_operators=[], qualifier=DaftIeUtils, selectors=[MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[], member=getDocument, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)])], member=unmarshal, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=Daft, sub_type=None))] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[Daft] identifier[toObject] operator[SEP] operator[SEP] Keyword[throws] identifier[JAXBException] { Keyword[this] operator[SEP] identifier[upgradeToLatestVersion] operator[SEP] operator[SEP] operator[SEP] Keyword[return] operator[SEP] identifier[Daft] operator[SEP] identifier[DaftIeUtils] operator[SEP] identifier[createUnmarshaller] operator[SEP] operator[SEP] operator[SEP] identifier[unmarshal] operator[SEP] Keyword[this] operator[SEP] identifier[getDocument] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
protected void put(ParameterizedType type, T result) { Class<?> rawType = (Class<?>) type.getRawType(); ClassLoader cl = SecurityActions.getClassLoader(rawType); Map<String, T> classLoaderCache = getClassLoaderCache(cl); synchronized (classLoaderCache) { // TODO JBMICROCONT-131 something better than toString()? classLoaderCache.put(type.toString(), result); } }
class class_name[name] begin[{] method[put, return_type[void], modifier[protected], parameter[type, result]] begin[{] local_variable[type[Class], rawType] local_variable[type[ClassLoader], cl] local_variable[type[Map], classLoaderCache] SYNCHRONIZED[member[.classLoaderCache]] BEGIN[{] call[classLoaderCache.put, parameter[call[type.toString, parameter[]], member[.result]]] END[}] end[}] END[}]
Keyword[protected] Keyword[void] identifier[put] operator[SEP] identifier[ParameterizedType] identifier[type] , identifier[T] identifier[result] operator[SEP] { identifier[Class] operator[<] operator[?] operator[>] identifier[rawType] operator[=] operator[SEP] identifier[Class] operator[<] operator[?] operator[>] operator[SEP] identifier[type] operator[SEP] identifier[getRawType] operator[SEP] operator[SEP] operator[SEP] identifier[ClassLoader] identifier[cl] operator[=] identifier[SecurityActions] operator[SEP] identifier[getClassLoader] operator[SEP] identifier[rawType] operator[SEP] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[T] operator[>] identifier[classLoaderCache] operator[=] identifier[getClassLoaderCache] operator[SEP] identifier[cl] operator[SEP] operator[SEP] Keyword[synchronized] operator[SEP] identifier[classLoaderCache] operator[SEP] { identifier[classLoaderCache] operator[SEP] identifier[put] operator[SEP] identifier[type] operator[SEP] identifier[toString] operator[SEP] operator[SEP] , identifier[result] operator[SEP] operator[SEP] } }
public static MozuUrl updateProductVariationLocalizedDeltaPriceUrl(String currencyCode, String productCode, String responseFields, String variationKey) { UrlFormatter formatter = new UrlFormatter("/api/commerce/catalog/admin/products/{productCode}/variations/{variationKey}/localizedDeltaPrice/{currencyCode}?responseFields={responseFields}"); formatter.formatUrl("currencyCode", currencyCode); formatter.formatUrl("productCode", productCode); formatter.formatUrl("responseFields", responseFields); formatter.formatUrl("variationKey", variationKey); return new MozuUrl(formatter.getResourceUrl(), MozuUrl.UrlLocation.TENANT_POD) ; }
class class_name[name] begin[{] method[updateProductVariationLocalizedDeltaPriceUrl, return_type[type[MozuUrl]], modifier[public static], parameter[currencyCode, productCode, responseFields, variationKey]] begin[{] local_variable[type[UrlFormatter], formatter] call[formatter.formatUrl, parameter[literal["currencyCode"], member[.currencyCode]]] call[formatter.formatUrl, parameter[literal["productCode"], member[.productCode]]] call[formatter.formatUrl, parameter[literal["responseFields"], member[.responseFields]]] call[formatter.formatUrl, parameter[literal["variationKey"], member[.variationKey]]] return[ClassCreator(arguments=[MethodInvocation(arguments=[], member=getResourceUrl, postfix_operators=[], prefix_operators=[], qualifier=formatter, selectors=[], type_arguments=None), MemberReference(member=TENANT_POD, postfix_operators=[], prefix_operators=[], qualifier=MozuUrl.UrlLocation, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=MozuUrl, sub_type=None))] end[}] END[}]
Keyword[public] Keyword[static] identifier[MozuUrl] identifier[updateProductVariationLocalizedDeltaPriceUrl] operator[SEP] identifier[String] identifier[currencyCode] , identifier[String] identifier[productCode] , identifier[String] identifier[responseFields] , identifier[String] identifier[variationKey] operator[SEP] { identifier[UrlFormatter] identifier[formatter] operator[=] Keyword[new] identifier[UrlFormatter] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[formatter] operator[SEP] identifier[formatUrl] operator[SEP] literal[String] , identifier[currencyCode] operator[SEP] operator[SEP] identifier[formatter] operator[SEP] identifier[formatUrl] operator[SEP] literal[String] , identifier[productCode] operator[SEP] operator[SEP] identifier[formatter] operator[SEP] identifier[formatUrl] operator[SEP] literal[String] , identifier[responseFields] operator[SEP] operator[SEP] identifier[formatter] operator[SEP] identifier[formatUrl] operator[SEP] literal[String] , identifier[variationKey] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[MozuUrl] operator[SEP] identifier[formatter] operator[SEP] identifier[getResourceUrl] operator[SEP] operator[SEP] , identifier[MozuUrl] operator[SEP] identifier[UrlLocation] operator[SEP] identifier[TENANT_POD] operator[SEP] operator[SEP] }
public static ServerSocket createSocketFromPorts(Iterator<Integer> portsIterator, SocketFactory factory) { while (portsIterator.hasNext()) { int port = portsIterator.next(); LOG.debug("Trying to open socket on port {}", port); try { return factory.createSocket(port); } catch (IOException | IllegalArgumentException e) { if (LOG.isDebugEnabled()) { LOG.debug("Unable to allocate socket on port", e); } else { LOG.info("Unable to allocate on port {}, due to error: {}", port, e.getMessage()); } } } return null; }
class class_name[name] begin[{] method[createSocketFromPorts, return_type[type[ServerSocket]], modifier[public static], parameter[portsIterator, factory]] begin[{] while[call[portsIterator.hasNext, parameter[]]] begin[{] local_variable[type[int], port] call[LOG.debug, parameter[literal["Trying to open socket on port {}"], member[.port]]] TryStatement(block=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=port, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=createSocket, postfix_operators=[], prefix_operators=[], qualifier=factory, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[IfStatement(condition=MethodInvocation(arguments=[], member=isDebugEnabled, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unable to allocate on port {}, due to error: {}"), MemberReference(member=port, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None)], member=info, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unable to allocate socket on port"), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=debug, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), label=None)]))], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IOException', 'IllegalArgumentException']))], finally_block=None, label=None, resources=None) end[}] return[literal[null]] end[}] END[}]
Keyword[public] Keyword[static] identifier[ServerSocket] identifier[createSocketFromPorts] operator[SEP] identifier[Iterator] operator[<] identifier[Integer] operator[>] identifier[portsIterator] , identifier[SocketFactory] identifier[factory] operator[SEP] { Keyword[while] operator[SEP] identifier[portsIterator] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] { Keyword[int] identifier[port] operator[=] identifier[portsIterator] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] identifier[LOG] operator[SEP] identifier[debug] operator[SEP] literal[String] , identifier[port] operator[SEP] operator[SEP] Keyword[try] { Keyword[return] identifier[factory] operator[SEP] identifier[createSocket] operator[SEP] identifier[port] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[IOException] operator[|] identifier[IllegalArgumentException] identifier[e] operator[SEP] { Keyword[if] operator[SEP] identifier[LOG] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] { identifier[LOG] operator[SEP] identifier[debug] operator[SEP] literal[String] , identifier[e] operator[SEP] operator[SEP] } Keyword[else] { identifier[LOG] operator[SEP] identifier[info] operator[SEP] literal[String] , identifier[port] , identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } } Keyword[return] Other[null] operator[SEP] }
@Override public <T> T asObject(String string, Class<T> valueType) { // at this point value type is guaranteed to be a File return (T) new File(string); }
class class_name[name] begin[{] method[asObject, return_type[type[T]], modifier[public], parameter[string, valueType]] begin[{] return[Cast(expression=ClassCreator(arguments=[MemberReference(member=string, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=File, sub_type=None)), type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None))] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] operator[<] identifier[T] operator[>] identifier[T] identifier[asObject] operator[SEP] identifier[String] identifier[string] , identifier[Class] operator[<] identifier[T] operator[>] identifier[valueType] operator[SEP] { Keyword[return] operator[SEP] identifier[T] operator[SEP] Keyword[new] identifier[File] operator[SEP] identifier[string] operator[SEP] operator[SEP] }
public void add(Date date) { final Calendar cal = Calendar.getInstance(); cal.setTime(date); add(cal); date.setTime(cal.getTime().getTime()); }
class class_name[name] begin[{] method[add, return_type[void], modifier[public], parameter[date]] begin[{] local_variable[type[Calendar], cal] call[cal.setTime, parameter[member[.date]]] call[.add, parameter[member[.cal]]] call[date.setTime, parameter[call[cal.getTime, parameter[]]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[add] operator[SEP] identifier[Date] identifier[date] operator[SEP] { Keyword[final] identifier[Calendar] identifier[cal] operator[=] identifier[Calendar] operator[SEP] identifier[getInstance] operator[SEP] operator[SEP] operator[SEP] identifier[cal] operator[SEP] identifier[setTime] operator[SEP] identifier[date] operator[SEP] operator[SEP] identifier[add] operator[SEP] identifier[cal] operator[SEP] operator[SEP] identifier[date] operator[SEP] identifier[setTime] operator[SEP] identifier[cal] operator[SEP] identifier[getTime] operator[SEP] operator[SEP] operator[SEP] identifier[getTime] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
public WvWMatch getWvWMatchInfo(int worldID, WvWMatch.Endpoint type) throws GuildWars2Exception { if (type == null) return getWvWMatchInfoUsingWorld(worldID); try { switch (type) { case All: return getWvWMatchInfoUsingWorld(worldID); case Overview: Response<WvWMatchOverview> overview = gw2API.getWvWMatchOverviewUsingWorld(Integer.toString(worldID)).execute(); if (!overview.isSuccessful()) throwError(overview.code(), overview.errorBody()); return overview.body(); case Stat: Response<WvWMatchStat> stat = gw2API.getWvWMatchStatUsingWorld(Integer.toString(worldID)).execute(); if (!stat.isSuccessful()) throwError(stat.code(), stat.errorBody()); return stat.body(); case Score: Response<WvWMatchScore> score = gw2API.getWvWMatchScoreUsingWorld(Integer.toString(worldID)).execute(); if (!score.isSuccessful()) throwError(score.code(), score.errorBody()); return score.body(); default: return getWvWMatchInfoUsingWorld(worldID); } } catch (IOException e) { throw new GuildWars2Exception(ErrorCode.Network, "Network Error: " + e.getMessage()); } }
class class_name[name] begin[{] method[getWvWMatchInfo, return_type[type[WvWMatch]], modifier[public], parameter[worldID, type]] begin[{] if[binary_operation[member[.type], ==, literal[null]]] begin[{] return[call[.getWvWMatchInfoUsingWorld, parameter[member[.worldID]]]] else begin[{] None end[}] TryStatement(block=[SwitchStatement(cases=[SwitchStatementCase(case=['All'], statements=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=worldID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getWvWMatchInfoUsingWorld, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), SwitchStatementCase(case=['Overview'], statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=worldID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=toString, postfix_operators=[], prefix_operators=[], qualifier=Integer, selectors=[], type_arguments=None)], member=getWvWMatchOverviewUsingWorld, postfix_operators=[], prefix_operators=[], qualifier=gw2API, selectors=[MethodInvocation(arguments=[], member=execute, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=overview)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=WvWMatchOverview, sub_type=None))], dimensions=[], name=Response, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[], member=isSuccessful, postfix_operators=[], prefix_operators=['!'], qualifier=overview, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=code, postfix_operators=[], prefix_operators=[], qualifier=overview, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=errorBody, postfix_operators=[], prefix_operators=[], qualifier=overview, selectors=[], type_arguments=None)], member=throwError, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)), ReturnStatement(expression=MethodInvocation(arguments=[], member=body, postfix_operators=[], prefix_operators=[], qualifier=overview, selectors=[], type_arguments=None), label=None)]), SwitchStatementCase(case=['Stat'], statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=worldID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=toString, postfix_operators=[], prefix_operators=[], qualifier=Integer, selectors=[], type_arguments=None)], member=getWvWMatchStatUsingWorld, postfix_operators=[], prefix_operators=[], qualifier=gw2API, selectors=[MethodInvocation(arguments=[], member=execute, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=stat)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=WvWMatchStat, sub_type=None))], dimensions=[], name=Response, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[], member=isSuccessful, postfix_operators=[], prefix_operators=['!'], qualifier=stat, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=code, postfix_operators=[], prefix_operators=[], qualifier=stat, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=errorBody, postfix_operators=[], prefix_operators=[], qualifier=stat, selectors=[], type_arguments=None)], member=throwError, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)), ReturnStatement(expression=MethodInvocation(arguments=[], member=body, postfix_operators=[], prefix_operators=[], qualifier=stat, selectors=[], type_arguments=None), label=None)]), SwitchStatementCase(case=['Score'], statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=worldID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=toString, postfix_operators=[], prefix_operators=[], qualifier=Integer, selectors=[], type_arguments=None)], member=getWvWMatchScoreUsingWorld, postfix_operators=[], prefix_operators=[], qualifier=gw2API, selectors=[MethodInvocation(arguments=[], member=execute, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=score)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=WvWMatchScore, sub_type=None))], dimensions=[], name=Response, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[], member=isSuccessful, postfix_operators=[], prefix_operators=['!'], qualifier=score, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=code, postfix_operators=[], prefix_operators=[], qualifier=score, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=errorBody, postfix_operators=[], prefix_operators=[], qualifier=score, selectors=[], type_arguments=None)], member=throwError, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)), ReturnStatement(expression=MethodInvocation(arguments=[], member=body, postfix_operators=[], prefix_operators=[], qualifier=score, selectors=[], type_arguments=None), label=None)]), SwitchStatementCase(case=[], statements=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=worldID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getWvWMatchInfoUsingWorld, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)])], expression=MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=Network, postfix_operators=[], prefix_operators=[], qualifier=ErrorCode, selectors=[]), BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Network Error: "), operandr=MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=GuildWars2Exception, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IOException']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[public] identifier[WvWMatch] identifier[getWvWMatchInfo] operator[SEP] Keyword[int] identifier[worldID] , identifier[WvWMatch] operator[SEP] identifier[Endpoint] identifier[type] operator[SEP] Keyword[throws] identifier[GuildWars2Exception] { Keyword[if] operator[SEP] identifier[type] operator[==] Other[null] operator[SEP] Keyword[return] identifier[getWvWMatchInfoUsingWorld] operator[SEP] identifier[worldID] operator[SEP] operator[SEP] Keyword[try] { Keyword[switch] operator[SEP] identifier[type] operator[SEP] { Keyword[case] identifier[All] operator[:] Keyword[return] identifier[getWvWMatchInfoUsingWorld] operator[SEP] identifier[worldID] operator[SEP] operator[SEP] Keyword[case] identifier[Overview] operator[:] identifier[Response] operator[<] identifier[WvWMatchOverview] operator[>] identifier[overview] operator[=] identifier[gw2API] operator[SEP] identifier[getWvWMatchOverviewUsingWorld] operator[SEP] identifier[Integer] operator[SEP] identifier[toString] operator[SEP] identifier[worldID] operator[SEP] operator[SEP] operator[SEP] identifier[execute] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[overview] operator[SEP] identifier[isSuccessful] operator[SEP] operator[SEP] operator[SEP] identifier[throwError] operator[SEP] identifier[overview] operator[SEP] identifier[code] operator[SEP] operator[SEP] , identifier[overview] operator[SEP] identifier[errorBody] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[overview] operator[SEP] identifier[body] operator[SEP] operator[SEP] operator[SEP] Keyword[case] identifier[Stat] operator[:] identifier[Response] operator[<] identifier[WvWMatchStat] operator[>] identifier[stat] operator[=] identifier[gw2API] operator[SEP] identifier[getWvWMatchStatUsingWorld] operator[SEP] identifier[Integer] operator[SEP] identifier[toString] operator[SEP] identifier[worldID] operator[SEP] operator[SEP] operator[SEP] identifier[execute] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[stat] operator[SEP] identifier[isSuccessful] operator[SEP] operator[SEP] operator[SEP] identifier[throwError] operator[SEP] identifier[stat] operator[SEP] identifier[code] operator[SEP] operator[SEP] , identifier[stat] operator[SEP] identifier[errorBody] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[stat] operator[SEP] identifier[body] operator[SEP] operator[SEP] operator[SEP] Keyword[case] identifier[Score] operator[:] identifier[Response] operator[<] identifier[WvWMatchScore] operator[>] identifier[score] operator[=] identifier[gw2API] operator[SEP] identifier[getWvWMatchScoreUsingWorld] operator[SEP] identifier[Integer] operator[SEP] identifier[toString] operator[SEP] identifier[worldID] operator[SEP] operator[SEP] operator[SEP] identifier[execute] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[score] operator[SEP] identifier[isSuccessful] operator[SEP] operator[SEP] operator[SEP] identifier[throwError] operator[SEP] identifier[score] operator[SEP] identifier[code] operator[SEP] operator[SEP] , identifier[score] operator[SEP] identifier[errorBody] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[score] operator[SEP] identifier[body] operator[SEP] operator[SEP] operator[SEP] Keyword[default] operator[:] Keyword[return] identifier[getWvWMatchInfoUsingWorld] operator[SEP] identifier[worldID] operator[SEP] operator[SEP] } } Keyword[catch] operator[SEP] identifier[IOException] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[GuildWars2Exception] operator[SEP] identifier[ErrorCode] operator[SEP] identifier[Network] , literal[String] operator[+] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } }
private void resolveTableColumns(Table table) { HsqlList set = new HsqlArrayList(); collectAllColumnExpressions(set); for (int i = 0; i < set.size(); i++) { ExpressionColumn array_element = (ExpressionColumn)set.get(i); ColumnSchema column = table.getColumn(table.getColumnIndex(array_element.getAlias())); array_element.setAttributesAsColumn(column, false); } }
class class_name[name] begin[{] method[resolveTableColumns, return_type[void], modifier[private], parameter[table]] begin[{] local_variable[type[HsqlList], set] call[.collectAllColumnExpressions, parameter[member[.set]]] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=set, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=ExpressionColumn, sub_type=None)), name=array_element)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ExpressionColumn, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getAlias, postfix_operators=[], prefix_operators=[], qualifier=array_element, selectors=[], type_arguments=None)], member=getColumnIndex, postfix_operators=[], prefix_operators=[], qualifier=table, selectors=[], type_arguments=None)], member=getColumn, postfix_operators=[], prefix_operators=[], qualifier=table, selectors=[], type_arguments=None), name=column)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ColumnSchema, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=column, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)], member=setAttributesAsColumn, postfix_operators=[], prefix_operators=[], qualifier=array_element, 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=set, 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) end[}] END[}]
Keyword[private] Keyword[void] identifier[resolveTableColumns] operator[SEP] identifier[Table] identifier[table] operator[SEP] { identifier[HsqlList] identifier[set] operator[=] Keyword[new] identifier[HsqlArrayList] operator[SEP] operator[SEP] operator[SEP] identifier[collectAllColumnExpressions] operator[SEP] identifier[set] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[set] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[ExpressionColumn] identifier[array_element] operator[=] operator[SEP] identifier[ExpressionColumn] operator[SEP] identifier[set] operator[SEP] identifier[get] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[ColumnSchema] identifier[column] operator[=] identifier[table] operator[SEP] identifier[getColumn] operator[SEP] identifier[table] operator[SEP] identifier[getColumnIndex] operator[SEP] identifier[array_element] operator[SEP] identifier[getAlias] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[array_element] operator[SEP] identifier[setAttributesAsColumn] operator[SEP] identifier[column] , literal[boolean] operator[SEP] operator[SEP] } }
private double handleCase4() { if( bracket ) { return SearchInterpolate.cubic2(fp, gp, stp, fy, gy, sty); } else if( stp > stx ) { return stmax; // see comment in case 3 about stmax and stmin } else { return stmin; } }
class class_name[name] begin[{] method[handleCase4, return_type[type[double]], modifier[private], parameter[]] begin[{] if[member[.bracket]] begin[{] return[call[SearchInterpolate.cubic2, parameter[member[.fp], member[.gp], member[.stp], member[.fy], member[.gy], member[.sty]]]] else begin[{] if[binary_operation[member[.stp], >, member[.stx]]] begin[{] return[member[.stmax]] else begin[{] return[member[.stmin]] end[}] end[}] end[}] END[}]
Keyword[private] Keyword[double] identifier[handleCase4] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[bracket] operator[SEP] { Keyword[return] identifier[SearchInterpolate] operator[SEP] identifier[cubic2] operator[SEP] identifier[fp] , identifier[gp] , identifier[stp] , identifier[fy] , identifier[gy] , identifier[sty] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[stp] operator[>] identifier[stx] operator[SEP] { Keyword[return] identifier[stmax] operator[SEP] } Keyword[else] { Keyword[return] identifier[stmin] operator[SEP] } }
protected boolean canBeUTF8( String str) { for (int i = str.length() - 1; i >= 0; i--) { if (str.charAt(i) > 0x00ff) { return false; } } return true; }
class class_name[name] begin[{] method[canBeUTF8, return_type[type[boolean]], modifier[protected], parameter[str]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=charAt, postfix_operators=[], prefix_operators=[], qualifier=str, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0x00ff), operator=>), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>=), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=BinaryOperation(operandl=MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=str, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['--'], prefix_operators=[], qualifier=, selectors=[])]), label=None) return[literal[true]] end[}] END[}]
Keyword[protected] Keyword[boolean] identifier[canBeUTF8] operator[SEP] identifier[String] identifier[str] operator[SEP] { Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] identifier[str] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[-] Other[1] operator[SEP] identifier[i] operator[>=] Other[0] operator[SEP] identifier[i] operator[--] operator[SEP] { Keyword[if] operator[SEP] identifier[str] operator[SEP] identifier[charAt] operator[SEP] identifier[i] operator[SEP] operator[>] literal[Integer] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } } Keyword[return] literal[boolean] operator[SEP] }
@Override public boolean execute(String sql) throws SQLException { checkClosed(); VoltSQL query = VoltSQL.parseSQL(sql); return this.execute(query); }
class class_name[name] begin[{] method[execute, return_type[type[boolean]], modifier[public], parameter[sql]] begin[{] call[.checkClosed, parameter[]] local_variable[type[VoltSQL], query] return[THIS[call[None.execute, parameter[member[.query]]]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[boolean] identifier[execute] operator[SEP] identifier[String] identifier[sql] operator[SEP] Keyword[throws] identifier[SQLException] { identifier[checkClosed] operator[SEP] operator[SEP] operator[SEP] identifier[VoltSQL] identifier[query] operator[=] identifier[VoltSQL] operator[SEP] identifier[parseSQL] operator[SEP] identifier[sql] operator[SEP] operator[SEP] Keyword[return] Keyword[this] operator[SEP] identifier[execute] operator[SEP] identifier[query] operator[SEP] operator[SEP] }
public static void appendTo(Formatter formatter, int width, int precision, boolean leftJustified, String out) { try { Appendable appendable = formatter.out(); if (precision > -1 && out.length() > precision) { appendable.append(Helpers.truncate(out, precision)); return; } if (leftJustified) appendable.append(Helpers.rightPad(out, width)); else appendable.append(Helpers.leftPad(out, width)); } catch (IOException e) { throw new AssertionError(e); } }
class class_name[name] begin[{] method[appendTo, return_type[void], modifier[public static], parameter[formatter, width, precision, leftJustified, out]] begin[{] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=out, postfix_operators=[], prefix_operators=[], qualifier=formatter, selectors=[], type_arguments=None), name=appendable)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Appendable, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=precision, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=1), operator=>), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=out, selectors=[], type_arguments=None), operandr=MemberReference(member=precision, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=>), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=out, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=precision, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=truncate, postfix_operators=[], prefix_operators=[], qualifier=Helpers, selectors=[], type_arguments=None)], member=append, postfix_operators=[], prefix_operators=[], qualifier=appendable, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=None, label=None)])), IfStatement(condition=MemberReference(member=leftJustified, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=out, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=width, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=leftPad, postfix_operators=[], prefix_operators=[], qualifier=Helpers, selectors=[], type_arguments=None)], member=append, postfix_operators=[], prefix_operators=[], qualifier=appendable, selectors=[], type_arguments=None), label=None), label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=out, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=width, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=rightPad, postfix_operators=[], prefix_operators=[], qualifier=Helpers, selectors=[], type_arguments=None)], member=append, postfix_operators=[], prefix_operators=[], qualifier=appendable, selectors=[], type_arguments=None), label=None))], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=AssertionError, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IOException']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[appendTo] operator[SEP] identifier[Formatter] identifier[formatter] , Keyword[int] identifier[width] , Keyword[int] identifier[precision] , Keyword[boolean] identifier[leftJustified] , identifier[String] identifier[out] operator[SEP] { Keyword[try] { identifier[Appendable] identifier[appendable] operator[=] identifier[formatter] operator[SEP] identifier[out] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[precision] operator[>] operator[-] Other[1] operator[&&] identifier[out] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[>] identifier[precision] operator[SEP] { identifier[appendable] operator[SEP] identifier[append] operator[SEP] identifier[Helpers] operator[SEP] identifier[truncate] operator[SEP] identifier[out] , identifier[precision] operator[SEP] operator[SEP] operator[SEP] Keyword[return] operator[SEP] } Keyword[if] operator[SEP] identifier[leftJustified] operator[SEP] identifier[appendable] operator[SEP] identifier[append] operator[SEP] identifier[Helpers] operator[SEP] identifier[rightPad] operator[SEP] identifier[out] , identifier[width] operator[SEP] operator[SEP] operator[SEP] Keyword[else] identifier[appendable] operator[SEP] identifier[append] operator[SEP] identifier[Helpers] operator[SEP] identifier[leftPad] operator[SEP] identifier[out] , identifier[width] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[IOException] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[AssertionError] operator[SEP] identifier[e] operator[SEP] operator[SEP] } }
private void percolateDown(int pos) { int p = pos; int y = this.heap.get(p); while (left(p) < this.heap.size()) { int child = right(p) < this.heap.size() && this.s.lt(this.heap.get(right(p)), this.heap.get(left(p))) ? right(p) : left(p); if (!this.s.lt(this.heap.get(child), y)) break; this.heap.set(p, this.heap.get(child)); this.indices.set(this.heap.get(p), p); p = child; } this.heap.set(p, y); this.indices.set(y, p); }
class class_name[name] begin[{] method[percolateDown, return_type[void], modifier[private], parameter[pos]] begin[{] local_variable[type[int], p] local_variable[type[int], y] while[binary_operation[call[.left, parameter[member[.p]]], <, THIS[member[None.heap]call[None.size, parameter[]]]]] begin[{] local_variable[type[int], child] if[THIS[member[None.s]call[None.lt, parameter[THIS[member[None.heap]call[None.get, parameter[member[.child]]]], member[.y]]]]] begin[{] BreakStatement(goto=None, label=None) else begin[{] None end[}] THIS[member[None.heap]call[None.set, parameter[member[.p], THIS[member[None.heap]call[None.get, parameter[member[.child]]]]]]] THIS[member[None.indices]call[None.set, parameter[THIS[member[None.heap]call[None.get, parameter[member[.p]]]], member[.p]]]] assign[member[.p], member[.child]] end[}] THIS[member[None.heap]call[None.set, parameter[member[.p], member[.y]]]] THIS[member[None.indices]call[None.set, parameter[member[.y], member[.p]]]] end[}] END[}]
Keyword[private] Keyword[void] identifier[percolateDown] operator[SEP] Keyword[int] identifier[pos] operator[SEP] { Keyword[int] identifier[p] operator[=] identifier[pos] operator[SEP] Keyword[int] identifier[y] operator[=] Keyword[this] operator[SEP] identifier[heap] operator[SEP] identifier[get] operator[SEP] identifier[p] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[left] operator[SEP] identifier[p] operator[SEP] operator[<] Keyword[this] operator[SEP] identifier[heap] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] { Keyword[int] identifier[child] operator[=] identifier[right] operator[SEP] identifier[p] operator[SEP] operator[<] Keyword[this] operator[SEP] identifier[heap] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[&&] Keyword[this] operator[SEP] identifier[s] operator[SEP] identifier[lt] operator[SEP] Keyword[this] operator[SEP] identifier[heap] operator[SEP] identifier[get] operator[SEP] identifier[right] operator[SEP] identifier[p] operator[SEP] operator[SEP] , Keyword[this] operator[SEP] identifier[heap] operator[SEP] identifier[get] operator[SEP] identifier[left] operator[SEP] identifier[p] operator[SEP] operator[SEP] operator[SEP] operator[?] identifier[right] operator[SEP] identifier[p] operator[SEP] operator[:] identifier[left] operator[SEP] identifier[p] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] Keyword[this] operator[SEP] identifier[s] operator[SEP] identifier[lt] operator[SEP] Keyword[this] operator[SEP] identifier[heap] operator[SEP] identifier[get] operator[SEP] identifier[child] operator[SEP] , identifier[y] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[this] operator[SEP] identifier[heap] operator[SEP] identifier[set] operator[SEP] identifier[p] , Keyword[this] operator[SEP] identifier[heap] operator[SEP] identifier[get] operator[SEP] identifier[child] operator[SEP] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[indices] operator[SEP] identifier[set] operator[SEP] Keyword[this] operator[SEP] identifier[heap] operator[SEP] identifier[get] operator[SEP] identifier[p] operator[SEP] , identifier[p] operator[SEP] operator[SEP] identifier[p] operator[=] identifier[child] operator[SEP] } Keyword[this] operator[SEP] identifier[heap] operator[SEP] identifier[set] operator[SEP] identifier[p] , identifier[y] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[indices] operator[SEP] identifier[set] operator[SEP] identifier[y] , identifier[p] operator[SEP] operator[SEP] }
public double getConditionalProbability(A first, B second) { return getCount(first, second) / conditionalCounts.get(first); }
class class_name[name] begin[{] method[getConditionalProbability, return_type[type[double]], modifier[public], parameter[first, second]] begin[{] return[binary_operation[call[.getCount, parameter[member[.first], member[.second]]], /, call[conditionalCounts.get, parameter[member[.first]]]]] end[}] END[}]
Keyword[public] Keyword[double] identifier[getConditionalProbability] operator[SEP] identifier[A] identifier[first] , identifier[B] identifier[second] operator[SEP] { Keyword[return] identifier[getCount] operator[SEP] identifier[first] , identifier[second] operator[SEP] operator[/] identifier[conditionalCounts] operator[SEP] identifier[get] operator[SEP] identifier[first] operator[SEP] operator[SEP] }
public static boolean isCallableConstructor(ExecutableElement constructor) { if (constructor.getModifiers().contains(Modifier.PRIVATE)) { return false; } TypeElement type = (TypeElement) constructor.getEnclosingElement(); return type.getEnclosingElement().getKind() == ElementKind.PACKAGE || type.getModifiers().contains(Modifier.STATIC); }
class class_name[name] begin[{] method[isCallableConstructor, return_type[type[boolean]], modifier[public static], parameter[constructor]] begin[{] if[call[constructor.getModifiers, parameter[]]] begin[{] return[literal[false]] else begin[{] None end[}] local_variable[type[TypeElement], type] return[binary_operation[binary_operation[call[type.getEnclosingElement, parameter[]], ==, member[ElementKind.PACKAGE]], ||, call[type.getModifiers, parameter[]]]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[boolean] identifier[isCallableConstructor] operator[SEP] identifier[ExecutableElement] identifier[constructor] operator[SEP] { Keyword[if] operator[SEP] identifier[constructor] operator[SEP] identifier[getModifiers] operator[SEP] operator[SEP] operator[SEP] identifier[contains] operator[SEP] identifier[Modifier] operator[SEP] identifier[PRIVATE] operator[SEP] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } identifier[TypeElement] identifier[type] operator[=] operator[SEP] identifier[TypeElement] operator[SEP] identifier[constructor] operator[SEP] identifier[getEnclosingElement] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[type] operator[SEP] identifier[getEnclosingElement] operator[SEP] operator[SEP] operator[SEP] identifier[getKind] operator[SEP] operator[SEP] operator[==] identifier[ElementKind] operator[SEP] identifier[PACKAGE] operator[||] identifier[type] operator[SEP] identifier[getModifiers] operator[SEP] operator[SEP] operator[SEP] identifier[contains] operator[SEP] identifier[Modifier] operator[SEP] identifier[STATIC] operator[SEP] operator[SEP] }
@SuppressWarnings("unchecked") public void restoreState(FacesContext context, Object state) { if (context == null) { throw new NullPointerException(); } if (state != null) { // Unchecked cast from Object to List<BehaviorListener> listeners = (List<BehaviorListener>)UIComponentBase.restoreAttachedState(context, state); // If we saved state last time, save state again next time. clearInitialState(); } }
class class_name[name] begin[{] method[restoreState, return_type[void], modifier[public], parameter[context, state]] begin[{] if[binary_operation[member[.context], ==, 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[.state], !=, literal[null]]] begin[{] assign[member[.listeners], Cast(expression=MethodInvocation(arguments=[MemberReference(member=context, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=state, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=restoreAttachedState, postfix_operators=[], prefix_operators=[], qualifier=UIComponentBase, selectors=[], type_arguments=None), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=BehaviorListener, sub_type=None))], dimensions=[], name=List, sub_type=None))] call[.clearInitialState, parameter[]] else begin[{] None end[}] end[}] END[}]
annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] Keyword[public] Keyword[void] identifier[restoreState] operator[SEP] identifier[FacesContext] identifier[context] , identifier[Object] identifier[state] operator[SEP] { Keyword[if] operator[SEP] identifier[context] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[NullPointerException] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[state] operator[!=] Other[null] operator[SEP] { identifier[listeners] operator[=] operator[SEP] identifier[List] operator[<] identifier[BehaviorListener] operator[>] operator[SEP] identifier[UIComponentBase] operator[SEP] identifier[restoreAttachedState] operator[SEP] identifier[context] , identifier[state] operator[SEP] operator[SEP] identifier[clearInitialState] operator[SEP] operator[SEP] operator[SEP] } }
public static <D> File toJsonFile(D dataObject, File returnJsonFile) { try { jsonMapper.writeValue(returnJsonFile, dataObject); return returnJsonFile; } catch (Exception e) { return JMExceptionManager.handleExceptionAndReturnNull(log, e, "toJsonFile", dataObject); } }
class class_name[name] begin[{] method[toJsonFile, return_type[type[File]], modifier[public static], parameter[dataObject, returnJsonFile]] begin[{] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=returnJsonFile, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=dataObject, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=writeValue, postfix_operators=[], prefix_operators=[], qualifier=jsonMapper, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=MemberReference(member=returnJsonFile, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], catches=[CatchClause(block=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=log, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="toJsonFile"), MemberReference(member=dataObject, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=handleExceptionAndReturnNull, postfix_operators=[], prefix_operators=[], qualifier=JMExceptionManager, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[public] Keyword[static] operator[<] identifier[D] operator[>] identifier[File] identifier[toJsonFile] operator[SEP] identifier[D] identifier[dataObject] , identifier[File] identifier[returnJsonFile] operator[SEP] { Keyword[try] { identifier[jsonMapper] operator[SEP] identifier[writeValue] operator[SEP] identifier[returnJsonFile] , identifier[dataObject] operator[SEP] operator[SEP] Keyword[return] identifier[returnJsonFile] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { Keyword[return] identifier[JMExceptionManager] operator[SEP] identifier[handleExceptionAndReturnNull] operator[SEP] identifier[log] , identifier[e] , literal[String] , identifier[dataObject] operator[SEP] operator[SEP] } }
@Override public long[] executeLargeBatch() throws SQLException { checkClose(); int size; if (batchQueries == null || (size = batchQueries.size()) == 0) { return new long[0]; } lock.lock(); try { internalBatchExecution(size); return results.getCmdInformation().getLargeUpdateCounts(); } catch (SQLException initialSqlEx) { throw executeBatchExceptionEpilogue(initialSqlEx, size); } finally { executeBatchEpilogue(); lock.unlock(); } }
class class_name[name] begin[{] method[executeLargeBatch, return_type[type[long]], modifier[public], parameter[]] begin[{] call[.checkClose, parameter[]] local_variable[type[int], size] if[binary_operation[binary_operation[member[.batchQueries], ==, literal[null]], ||, binary_operation[assign[member[.size], call[batchQueries.size, parameter[]]], ==, literal[0]]]] begin[{] return[ArrayCreator(dimensions=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=None, name=long))] else begin[{] None end[}] call[lock.lock, parameter[]] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=size, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=internalBatchExecution, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=MethodInvocation(arguments=[], member=getCmdInformation, postfix_operators=[], prefix_operators=[], qualifier=results, selectors=[MethodInvocation(arguments=[], member=getLargeUpdateCounts, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=MethodInvocation(arguments=[MemberReference(member=initialSqlEx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=size, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=executeBatchExceptionEpilogue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=initialSqlEx, types=['SQLException']))], finally_block=[StatementExpression(expression=MethodInvocation(arguments=[], member=executeBatchEpilogue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=unlock, postfix_operators=[], prefix_operators=[], qualifier=lock, selectors=[], type_arguments=None), label=None)], label=None, resources=None) end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[long] operator[SEP] operator[SEP] identifier[executeLargeBatch] operator[SEP] operator[SEP] Keyword[throws] identifier[SQLException] { identifier[checkClose] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[size] operator[SEP] Keyword[if] operator[SEP] identifier[batchQueries] operator[==] Other[null] operator[||] operator[SEP] identifier[size] operator[=] identifier[batchQueries] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[==] Other[0] operator[SEP] { Keyword[return] Keyword[new] Keyword[long] operator[SEP] Other[0] operator[SEP] operator[SEP] } identifier[lock] operator[SEP] identifier[lock] operator[SEP] operator[SEP] operator[SEP] Keyword[try] { identifier[internalBatchExecution] operator[SEP] identifier[size] operator[SEP] operator[SEP] Keyword[return] identifier[results] operator[SEP] identifier[getCmdInformation] operator[SEP] operator[SEP] operator[SEP] identifier[getLargeUpdateCounts] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[SQLException] identifier[initialSqlEx] operator[SEP] { Keyword[throw] identifier[executeBatchExceptionEpilogue] operator[SEP] identifier[initialSqlEx] , identifier[size] operator[SEP] operator[SEP] } Keyword[finally] { identifier[executeBatchEpilogue] operator[SEP] operator[SEP] operator[SEP] identifier[lock] operator[SEP] identifier[unlock] operator[SEP] operator[SEP] operator[SEP] } }
@Override public void clearCache() { entityCache.clearCache(CommercePaymentMethodGroupRelImpl.class); finderCache.clearCache(FINDER_CLASS_NAME_ENTITY); finderCache.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION); finderCache.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION); }
class class_name[name] begin[{] method[clearCache, return_type[void], modifier[public], parameter[]] begin[{] call[entityCache.clearCache, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=CommercePaymentMethodGroupRelImpl, sub_type=None))]] call[finderCache.clearCache, parameter[member[.FINDER_CLASS_NAME_ENTITY]]] call[finderCache.clearCache, parameter[member[.FINDER_CLASS_NAME_LIST_WITH_PAGINATION]]] call[finderCache.clearCache, parameter[member[.FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[clearCache] operator[SEP] operator[SEP] { identifier[entityCache] operator[SEP] identifier[clearCache] operator[SEP] identifier[CommercePaymentMethodGroupRelImpl] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[finderCache] operator[SEP] identifier[clearCache] operator[SEP] identifier[FINDER_CLASS_NAME_ENTITY] operator[SEP] operator[SEP] identifier[finderCache] operator[SEP] identifier[clearCache] operator[SEP] identifier[FINDER_CLASS_NAME_LIST_WITH_PAGINATION] operator[SEP] operator[SEP] identifier[finderCache] operator[SEP] identifier[clearCache] operator[SEP] identifier[FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION] operator[SEP] operator[SEP] }
public static CertStore fromSignedData(final CMSSignedData signedData) { CertificateFactory factory; try { factory = CertificateFactory.getInstance("X509"); } catch (CertificateException e) { throw new RuntimeException(e); } Store certStore = signedData.getCertificates(); Store crlStore = signedData.getCRLs(); @SuppressWarnings("unchecked") Collection<X509CertificateHolder> certs = certStore.getMatches(null); @SuppressWarnings("unchecked") Collection<X509CRLHolder> crls = crlStore.getMatches(null); Collection<Object> certsAndCrls = new ArrayList<Object>(); for (X509CertificateHolder cert : certs) { ByteArrayInputStream byteIn; try { byteIn = new ByteArrayInputStream(cert.getEncoded()); } catch (IOException e) { LOGGER.error("Error encoding certificate", e); continue; } try { certsAndCrls.add(factory.generateCertificate(byteIn)); } catch (CertificateException e) { LOGGER.error("Error generating certificate", e); } } for (X509CRLHolder crl : crls) { ByteArrayInputStream byteIn; try { byteIn = new ByteArrayInputStream(crl.getEncoded()); } catch (IOException e) { LOGGER.error("Error encoding crl", e); continue; } try { certsAndCrls.add(factory.generateCRL(byteIn)); } catch (CRLException e) { LOGGER.error("Error generating certificate", e); } } try { return CertStore.getInstance("Collection", new CollectionCertStoreParameters(certsAndCrls)); } catch (GeneralSecurityException e) { throw new RuntimeException(e); } }
class class_name[name] begin[{] method[fromSignedData, return_type[type[CertStore]], modifier[public static], parameter[signedData]] begin[{] local_variable[type[CertificateFactory], factory] TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=factory, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="X509")], member=getInstance, postfix_operators=[], prefix_operators=[], qualifier=CertificateFactory, selectors=[], type_arguments=None)), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=RuntimeException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['CertificateException']))], finally_block=None, label=None, resources=None) local_variable[type[Store], certStore] local_variable[type[Store], crlStore] local_variable[type[Collection], certs] local_variable[type[Collection], crls] local_variable[type[Collection], certsAndCrls] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=None, name=byteIn)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ByteArrayInputStream, sub_type=None)), TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=byteIn, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[MethodInvocation(arguments=[], member=getEncoded, postfix_operators=[], prefix_operators=[], qualifier=cert, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ByteArrayInputStream, sub_type=None))), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Error encoding certificate"), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=LOGGER, selectors=[], type_arguments=None), label=None), ContinueStatement(goto=None, label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IOException']))], finally_block=None, label=None, resources=None), TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=byteIn, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=generateCertificate, postfix_operators=[], prefix_operators=[], qualifier=factory, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=certsAndCrls, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Error generating certificate"), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=LOGGER, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['CertificateException']))], finally_block=None, label=None, resources=None)]), control=EnhancedForControl(iterable=MemberReference(member=certs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=cert)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=X509CertificateHolder, sub_type=None))), label=None) ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=None, name=byteIn)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ByteArrayInputStream, sub_type=None)), TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=byteIn, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[MethodInvocation(arguments=[], member=getEncoded, postfix_operators=[], prefix_operators=[], qualifier=crl, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ByteArrayInputStream, sub_type=None))), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Error encoding crl"), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=LOGGER, selectors=[], type_arguments=None), label=None), ContinueStatement(goto=None, label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IOException']))], finally_block=None, label=None, resources=None), TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=byteIn, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=generateCRL, postfix_operators=[], prefix_operators=[], qualifier=factory, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=certsAndCrls, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Error generating certificate"), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=LOGGER, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['CRLException']))], finally_block=None, label=None, resources=None)]), control=EnhancedForControl(iterable=MemberReference(member=crls, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=crl)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=X509CRLHolder, sub_type=None))), label=None) TryStatement(block=[ReturnStatement(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Collection"), ClassCreator(arguments=[MemberReference(member=certsAndCrls, 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=CollectionCertStoreParameters, sub_type=None))], member=getInstance, postfix_operators=[], prefix_operators=[], qualifier=CertStore, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=RuntimeException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['GeneralSecurityException']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[public] Keyword[static] identifier[CertStore] identifier[fromSignedData] operator[SEP] Keyword[final] identifier[CMSSignedData] identifier[signedData] operator[SEP] { identifier[CertificateFactory] identifier[factory] operator[SEP] Keyword[try] { identifier[factory] operator[=] identifier[CertificateFactory] operator[SEP] identifier[getInstance] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[CertificateException] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[RuntimeException] operator[SEP] identifier[e] operator[SEP] operator[SEP] } identifier[Store] identifier[certStore] operator[=] identifier[signedData] operator[SEP] identifier[getCertificates] operator[SEP] operator[SEP] operator[SEP] identifier[Store] identifier[crlStore] operator[=] identifier[signedData] operator[SEP] identifier[getCRLs] operator[SEP] operator[SEP] operator[SEP] annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] identifier[Collection] operator[<] identifier[X509CertificateHolder] operator[>] identifier[certs] operator[=] identifier[certStore] operator[SEP] identifier[getMatches] operator[SEP] Other[null] operator[SEP] operator[SEP] annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] identifier[Collection] operator[<] identifier[X509CRLHolder] operator[>] identifier[crls] operator[=] identifier[crlStore] operator[SEP] identifier[getMatches] operator[SEP] Other[null] operator[SEP] operator[SEP] identifier[Collection] operator[<] identifier[Object] operator[>] identifier[certsAndCrls] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[Object] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[X509CertificateHolder] identifier[cert] operator[:] identifier[certs] operator[SEP] { identifier[ByteArrayInputStream] identifier[byteIn] operator[SEP] Keyword[try] { identifier[byteIn] operator[=] Keyword[new] identifier[ByteArrayInputStream] operator[SEP] identifier[cert] operator[SEP] identifier[getEncoded] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[IOException] identifier[e] operator[SEP] { identifier[LOGGER] operator[SEP] identifier[error] operator[SEP] literal[String] , identifier[e] operator[SEP] operator[SEP] Keyword[continue] operator[SEP] } Keyword[try] { identifier[certsAndCrls] operator[SEP] identifier[add] operator[SEP] identifier[factory] operator[SEP] identifier[generateCertificate] operator[SEP] identifier[byteIn] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[CertificateException] identifier[e] operator[SEP] { identifier[LOGGER] operator[SEP] identifier[error] operator[SEP] literal[String] , identifier[e] operator[SEP] operator[SEP] } } Keyword[for] operator[SEP] identifier[X509CRLHolder] identifier[crl] operator[:] identifier[crls] operator[SEP] { identifier[ByteArrayInputStream] identifier[byteIn] operator[SEP] Keyword[try] { identifier[byteIn] operator[=] Keyword[new] identifier[ByteArrayInputStream] operator[SEP] identifier[crl] operator[SEP] identifier[getEncoded] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[IOException] identifier[e] operator[SEP] { identifier[LOGGER] operator[SEP] identifier[error] operator[SEP] literal[String] , identifier[e] operator[SEP] operator[SEP] Keyword[continue] operator[SEP] } Keyword[try] { identifier[certsAndCrls] operator[SEP] identifier[add] operator[SEP] identifier[factory] operator[SEP] identifier[generateCRL] operator[SEP] identifier[byteIn] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[CRLException] identifier[e] operator[SEP] { identifier[LOGGER] operator[SEP] identifier[error] operator[SEP] literal[String] , identifier[e] operator[SEP] operator[SEP] } } Keyword[try] { Keyword[return] identifier[CertStore] operator[SEP] identifier[getInstance] operator[SEP] literal[String] , Keyword[new] identifier[CollectionCertStoreParameters] operator[SEP] identifier[certsAndCrls] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[GeneralSecurityException] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[RuntimeException] operator[SEP] identifier[e] operator[SEP] operator[SEP] } }
public Key getKey(String alias, String password) { try { return keyStore.getKey(alias, password.toCharArray()); } catch (GeneralSecurityException e) { throw new IllegalStateException(e); } }
class class_name[name] begin[{] method[getKey, return_type[type[Key]], modifier[public], parameter[alias, password]] begin[{] TryStatement(block=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=alias, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=toCharArray, postfix_operators=[], prefix_operators=[], qualifier=password, selectors=[], type_arguments=None)], member=getKey, postfix_operators=[], prefix_operators=[], qualifier=keyStore, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalStateException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['GeneralSecurityException']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[public] identifier[Key] identifier[getKey] operator[SEP] identifier[String] identifier[alias] , identifier[String] identifier[password] operator[SEP] { Keyword[try] { Keyword[return] identifier[keyStore] operator[SEP] identifier[getKey] operator[SEP] identifier[alias] , identifier[password] operator[SEP] identifier[toCharArray] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[GeneralSecurityException] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] identifier[e] operator[SEP] operator[SEP] } }
private void startElementNode(final Attributes attributes) { LOG.debug("Found node"); try { this.nodeStack.push(this.newNode(this.nodeStack.peek(), attributes)); } catch (final RepositoryException e) { throw new AssertionError("Could not create node", e); } }
class class_name[name] begin[{] method[startElementNode, return_type[void], modifier[private], parameter[attributes]] begin[{] call[LOG.debug, parameter[literal["Found node"]]] TryStatement(block=[StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=nodeStack, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=nodeStack, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[], member=peek, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), MemberReference(member=attributes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=newNode, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)])], member=push, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Could not create node"), 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=AssertionError, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['RepositoryException']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[private] Keyword[void] identifier[startElementNode] operator[SEP] Keyword[final] identifier[Attributes] identifier[attributes] operator[SEP] { identifier[LOG] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[try] { Keyword[this] operator[SEP] identifier[nodeStack] operator[SEP] identifier[push] operator[SEP] Keyword[this] operator[SEP] identifier[newNode] operator[SEP] Keyword[this] operator[SEP] identifier[nodeStack] operator[SEP] identifier[peek] operator[SEP] operator[SEP] , identifier[attributes] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] Keyword[final] identifier[RepositoryException] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[AssertionError] operator[SEP] literal[String] , identifier[e] operator[SEP] operator[SEP] } }
public boolean block(long time) { synchronized (this.lock) { // see if we've already canceled the IO if (!this.active) { return true; } // see if the cancel missed and the IO complete path was triggered if (this.failed) { this.active = false; return false; } try { this.lock.wait(time); } catch (InterruptedException ie) { // no FFDC required } // now check whether it worked, failed, or timed out if (this.active) { this.active = false; return false; } } // end-sync return true; }
class class_name[name] begin[{] method[block, return_type[type[boolean]], modifier[public], parameter[time]] begin[{] SYNCHRONIZED[THIS[member[None.lock]]] BEGIN[{] if[THIS[member[None.active]]] begin[{] return[literal[true]] else begin[{] None end[}] if[THIS[member[None.failed]]] begin[{] assign[THIS[member[None.active]], literal[false]] return[literal[false]] else begin[{] None end[}] TryStatement(block=[StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=lock, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[MemberReference(member=time, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=wait, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None)], catches=[CatchClause(block=[], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ie, types=['InterruptedException']))], finally_block=None, label=None, resources=None) if[THIS[member[None.active]]] begin[{] assign[THIS[member[None.active]], literal[false]] return[literal[false]] else begin[{] None end[}] END[}] return[literal[true]] end[}] END[}]
Keyword[public] Keyword[boolean] identifier[block] operator[SEP] Keyword[long] identifier[time] operator[SEP] { Keyword[synchronized] operator[SEP] Keyword[this] operator[SEP] identifier[lock] operator[SEP] { Keyword[if] operator[SEP] operator[!] Keyword[this] operator[SEP] identifier[active] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[failed] operator[SEP] { Keyword[this] operator[SEP] identifier[active] operator[=] literal[boolean] operator[SEP] Keyword[return] literal[boolean] operator[SEP] } Keyword[try] { Keyword[this] operator[SEP] identifier[lock] operator[SEP] identifier[wait] operator[SEP] identifier[time] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[InterruptedException] identifier[ie] operator[SEP] { } Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[active] operator[SEP] { Keyword[this] operator[SEP] identifier[active] operator[=] literal[boolean] operator[SEP] Keyword[return] literal[boolean] operator[SEP] } } Keyword[return] literal[boolean] operator[SEP] }
protected static String reportURL(String type) throws EasyPostException { try { String urlType = URLEncoder.encode(type, "UTF-8").toLowerCase(); return String.format("%s/reports/%s/", EasyPost.API_BASE, urlType); } catch (java.io.UnsupportedEncodingException e) { throw new EasyPostException("Undetermined Report Type"); } }
class class_name[name] begin[{] method[reportURL, return_type[type[String]], modifier[static protected], parameter[type]] begin[{] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="UTF-8")], member=encode, postfix_operators=[], prefix_operators=[], qualifier=URLEncoder, selectors=[MethodInvocation(arguments=[], member=toLowerCase, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=urlType)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), ReturnStatement(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="%s/reports/%s/"), MemberReference(member=API_BASE, postfix_operators=[], prefix_operators=[], qualifier=EasyPost, selectors=[]), MemberReference(member=urlType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=format, postfix_operators=[], prefix_operators=[], qualifier=String, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Undetermined Report Type")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=EasyPostException, sub_type=None)), 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[}]
Keyword[protected] Keyword[static] identifier[String] identifier[reportURL] operator[SEP] identifier[String] identifier[type] operator[SEP] Keyword[throws] identifier[EasyPostException] { Keyword[try] { identifier[String] identifier[urlType] operator[=] identifier[URLEncoder] operator[SEP] identifier[encode] operator[SEP] identifier[type] , literal[String] operator[SEP] operator[SEP] identifier[toLowerCase] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[EasyPost] operator[SEP] identifier[API_BASE] , identifier[urlType] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[java] operator[SEP] identifier[io] operator[SEP] identifier[UnsupportedEncodingException] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[EasyPostException] operator[SEP] literal[String] operator[SEP] operator[SEP] } }
@Override public Iterator<Object[]> getDataByFilter(DataProviderFilter dataFilter) { logger.entering(new Object[] { resource, dataFilter }); List<Object[]> allObjs = getDataListByFilter(dataFilter); return allObjs.iterator(); }
class class_name[name] begin[{] method[getDataByFilter, return_type[type[Iterator]], modifier[public], parameter[dataFilter]] begin[{] call[logger.entering, parameter[ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MemberReference(member=resource, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=dataFilter, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Object, sub_type=None))]] local_variable[type[List], allObjs] return[call[allObjs.iterator, parameter[]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[Iterator] operator[<] identifier[Object] operator[SEP] operator[SEP] operator[>] identifier[getDataByFilter] operator[SEP] identifier[DataProviderFilter] identifier[dataFilter] operator[SEP] { identifier[logger] operator[SEP] identifier[entering] operator[SEP] Keyword[new] identifier[Object] operator[SEP] operator[SEP] { identifier[resource] , identifier[dataFilter] } operator[SEP] operator[SEP] identifier[List] operator[<] identifier[Object] operator[SEP] operator[SEP] operator[>] identifier[allObjs] operator[=] identifier[getDataListByFilter] operator[SEP] identifier[dataFilter] operator[SEP] operator[SEP] Keyword[return] identifier[allObjs] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] }
protected void unlockAbandonedLock(final String mutexName) { this.executeIgnoreRollback( new TransactionCallbackWithoutResult() { @Override protected void doInTransactionWithoutResult(TransactionStatus status) { final EntityManager entityManager = getEntityManager(); final ClusterMutex clusterMutex = getClusterMutex(mutexName); if (!isLockAbandoned(clusterMutex)) { // No longer abandoned return; } logger.warn("Unlocking abandoned " + clusterMutex); clusterMutex.unlock(); entityManager.persist(clusterMutex); try { entityManager.flush(); } catch (OptimisticLockException e) { logger.trace( "Abandoned mutex {} was cleared by another thread or server", mutexName); } } }); }
class class_name[name] begin[{] method[unlockAbandonedLock, return_type[void], modifier[protected], parameter[mutexName]] begin[{] THIS[call[None.executeIgnoreRollback, parameter[ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getEntityManager, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=entityManager)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=EntityManager, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=mutexName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getClusterMutex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=clusterMutex)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=ClusterMutex, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=clusterMutex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isLockAbandoned, postfix_operators=[], prefix_operators=['!'], qualifier=, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=None, label=None)])), StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unlocking abandoned "), operandr=MemberReference(member=clusterMutex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=warn, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=unlock, postfix_operators=[], prefix_operators=[], qualifier=clusterMutex, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=clusterMutex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=persist, postfix_operators=[], prefix_operators=[], qualifier=entityManager, selectors=[], type_arguments=None), label=None), TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=flush, postfix_operators=[], prefix_operators=[], qualifier=entityManager, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Abandoned mutex {} was cleared by another thread or server"), MemberReference(member=mutexName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=trace, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['OptimisticLockException']))], finally_block=None, label=None, resources=None)], documentation=None, modifiers={'protected'}, name=doInTransactionWithoutResult, parameters=[FormalParameter(annotations=[], modifiers=set(), name=status, type=ReferenceType(arguments=None, dimensions=[], name=TransactionStatus, sub_type=None), varargs=False)], return_type=None, throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=TransactionCallbackWithoutResult, sub_type=None))]]] end[}] END[}]
Keyword[protected] Keyword[void] identifier[unlockAbandonedLock] operator[SEP] Keyword[final] identifier[String] identifier[mutexName] operator[SEP] { Keyword[this] operator[SEP] identifier[executeIgnoreRollback] operator[SEP] Keyword[new] identifier[TransactionCallbackWithoutResult] operator[SEP] operator[SEP] { annotation[@] identifier[Override] Keyword[protected] Keyword[void] identifier[doInTransactionWithoutResult] operator[SEP] identifier[TransactionStatus] identifier[status] operator[SEP] { Keyword[final] identifier[EntityManager] identifier[entityManager] operator[=] identifier[getEntityManager] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[ClusterMutex] identifier[clusterMutex] operator[=] identifier[getClusterMutex] operator[SEP] identifier[mutexName] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[isLockAbandoned] operator[SEP] identifier[clusterMutex] operator[SEP] operator[SEP] { Keyword[return] operator[SEP] } identifier[logger] operator[SEP] identifier[warn] operator[SEP] literal[String] operator[+] identifier[clusterMutex] operator[SEP] operator[SEP] identifier[clusterMutex] operator[SEP] identifier[unlock] operator[SEP] operator[SEP] operator[SEP] identifier[entityManager] operator[SEP] identifier[persist] operator[SEP] identifier[clusterMutex] operator[SEP] operator[SEP] Keyword[try] { identifier[entityManager] operator[SEP] identifier[flush] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[OptimisticLockException] identifier[e] operator[SEP] { identifier[logger] operator[SEP] identifier[trace] operator[SEP] literal[String] , identifier[mutexName] operator[SEP] operator[SEP] } } } operator[SEP] operator[SEP] }
public static Object withOutputStream(File file, @ClosureParams(value = SimpleType.class, options = "java.io.OutputStream") Closure closure) throws IOException { return IOGroovyMethods.withStream(newOutputStream(file), closure); }
class class_name[name] begin[{] method[withOutputStream, return_type[type[Object]], modifier[public static], parameter[file, closure]] begin[{] return[call[IOGroovyMethods.withStream, parameter[call[.newOutputStream, parameter[member[.file]]], member[.closure]]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[Object] identifier[withOutputStream] operator[SEP] identifier[File] identifier[file] , annotation[@] identifier[ClosureParams] operator[SEP] identifier[value] operator[=] identifier[SimpleType] operator[SEP] Keyword[class] , identifier[options] operator[=] literal[String] operator[SEP] identifier[Closure] identifier[closure] operator[SEP] Keyword[throws] identifier[IOException] { Keyword[return] identifier[IOGroovyMethods] operator[SEP] identifier[withStream] operator[SEP] identifier[newOutputStream] operator[SEP] identifier[file] operator[SEP] , identifier[closure] operator[SEP] operator[SEP] }
@Override public Properties getConfiguration(Environment environment) { if (cachedConfigurationPerEnvironment.containsKey(environment.getName())) { return cachedConfigurationPerEnvironment.get(environment.getName()); } else { throw new MissingEnvironmentException(environment.getName()); } }
class class_name[name] begin[{] method[getConfiguration, return_type[type[Properties]], modifier[public], parameter[environment]] begin[{] if[call[cachedConfigurationPerEnvironment.containsKey, parameter[call[environment.getName, parameter[]]]]] begin[{] return[call[cachedConfigurationPerEnvironment.get, parameter[call[environment.getName, parameter[]]]]] else begin[{] ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=environment, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=MissingEnvironmentException, sub_type=None)), label=None) end[}] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[Properties] identifier[getConfiguration] operator[SEP] identifier[Environment] identifier[environment] operator[SEP] { Keyword[if] operator[SEP] identifier[cachedConfigurationPerEnvironment] operator[SEP] identifier[containsKey] operator[SEP] identifier[environment] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] identifier[cachedConfigurationPerEnvironment] operator[SEP] identifier[get] operator[SEP] identifier[environment] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { Keyword[throw] Keyword[new] identifier[MissingEnvironmentException] operator[SEP] identifier[environment] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } }
public CMAArray<CMAApiKey> fetchAll(String spaceId, Map<String, String> query) { assertNotNull(spaceId, "spaceId"); return service.fetchAll(spaceId, query).blockingFirst(); }
class class_name[name] begin[{] method[fetchAll, return_type[type[CMAArray]], modifier[public], parameter[spaceId, query]] begin[{] call[.assertNotNull, parameter[member[.spaceId], literal["spaceId"]]] return[call[service.fetchAll, parameter[member[.spaceId], member[.query]]]] end[}] END[}]
Keyword[public] identifier[CMAArray] operator[<] identifier[CMAApiKey] operator[>] identifier[fetchAll] operator[SEP] identifier[String] identifier[spaceId] , identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[query] operator[SEP] { identifier[assertNotNull] operator[SEP] identifier[spaceId] , literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[service] operator[SEP] identifier[fetchAll] operator[SEP] identifier[spaceId] , identifier[query] operator[SEP] operator[SEP] identifier[blockingFirst] operator[SEP] operator[SEP] operator[SEP] }
public Weight invertSign() { if (isInfinity) { if (posOrNeg) { return WeightFactory.NEG_INFINITY; } else { return WeightFactory.POS_INFINITY; } } return new Weight(-val); }
class class_name[name] begin[{] method[invertSign, return_type[type[Weight]], modifier[public], parameter[]] begin[{] if[member[.isInfinity]] begin[{] if[member[.posOrNeg]] begin[{] return[member[WeightFactory.NEG_INFINITY]] else begin[{] return[member[WeightFactory.POS_INFINITY]] end[}] else begin[{] None end[}] return[ClassCreator(arguments=[MemberReference(member=val, 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=Weight, sub_type=None))] end[}] END[}]
Keyword[public] identifier[Weight] identifier[invertSign] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[isInfinity] operator[SEP] { Keyword[if] operator[SEP] identifier[posOrNeg] operator[SEP] { Keyword[return] identifier[WeightFactory] operator[SEP] identifier[NEG_INFINITY] operator[SEP] } Keyword[else] { Keyword[return] identifier[WeightFactory] operator[SEP] identifier[POS_INFINITY] operator[SEP] } } Keyword[return] Keyword[new] identifier[Weight] operator[SEP] operator[-] identifier[val] operator[SEP] operator[SEP] }
public Vertigo undeployNetwork(String cluster, NetworkConfig network) { return undeployNetwork(cluster, network, null); }
class class_name[name] begin[{] method[undeployNetwork, return_type[type[Vertigo]], modifier[public], parameter[cluster, network]] begin[{] return[call[.undeployNetwork, parameter[member[.cluster], member[.network], literal[null]]]] end[}] END[}]
Keyword[public] identifier[Vertigo] identifier[undeployNetwork] operator[SEP] identifier[String] identifier[cluster] , identifier[NetworkConfig] identifier[network] operator[SEP] { Keyword[return] identifier[undeployNetwork] operator[SEP] identifier[cluster] , identifier[network] , Other[null] operator[SEP] operator[SEP] }
private void init (String publicId, String systemId, int lineNumber, int columnNumber) { this.publicId = publicId; this.systemId = systemId; this.lineNumber = lineNumber; this.columnNumber = columnNumber; }
class class_name[name] begin[{] method[init, return_type[void], modifier[private], parameter[publicId, systemId, lineNumber, columnNumber]] begin[{] assign[THIS[member[None.publicId]], member[.publicId]] assign[THIS[member[None.systemId]], member[.systemId]] assign[THIS[member[None.lineNumber]], member[.lineNumber]] assign[THIS[member[None.columnNumber]], member[.columnNumber]] end[}] END[}]
Keyword[private] Keyword[void] identifier[init] operator[SEP] identifier[String] identifier[publicId] , identifier[String] identifier[systemId] , Keyword[int] identifier[lineNumber] , Keyword[int] identifier[columnNumber] operator[SEP] { Keyword[this] operator[SEP] identifier[publicId] operator[=] identifier[publicId] operator[SEP] Keyword[this] operator[SEP] identifier[systemId] operator[=] identifier[systemId] operator[SEP] Keyword[this] operator[SEP] identifier[lineNumber] operator[=] identifier[lineNumber] operator[SEP] Keyword[this] operator[SEP] identifier[columnNumber] operator[=] identifier[columnNumber] operator[SEP] }
public void marshall(CommandInvocation commandInvocation, ProtocolMarshaller protocolMarshaller) { if (commandInvocation == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(commandInvocation.getCommandId(), COMMANDID_BINDING); protocolMarshaller.marshall(commandInvocation.getInstanceId(), INSTANCEID_BINDING); protocolMarshaller.marshall(commandInvocation.getInstanceName(), INSTANCENAME_BINDING); protocolMarshaller.marshall(commandInvocation.getComment(), COMMENT_BINDING); protocolMarshaller.marshall(commandInvocation.getDocumentName(), DOCUMENTNAME_BINDING); protocolMarshaller.marshall(commandInvocation.getDocumentVersion(), DOCUMENTVERSION_BINDING); protocolMarshaller.marshall(commandInvocation.getRequestedDateTime(), REQUESTEDDATETIME_BINDING); protocolMarshaller.marshall(commandInvocation.getStatus(), STATUS_BINDING); protocolMarshaller.marshall(commandInvocation.getStatusDetails(), STATUSDETAILS_BINDING); protocolMarshaller.marshall(commandInvocation.getTraceOutput(), TRACEOUTPUT_BINDING); protocolMarshaller.marshall(commandInvocation.getStandardOutputUrl(), STANDARDOUTPUTURL_BINDING); protocolMarshaller.marshall(commandInvocation.getStandardErrorUrl(), STANDARDERRORURL_BINDING); protocolMarshaller.marshall(commandInvocation.getCommandPlugins(), COMMANDPLUGINS_BINDING); protocolMarshaller.marshall(commandInvocation.getServiceRole(), SERVICEROLE_BINDING); protocolMarshaller.marshall(commandInvocation.getNotificationConfig(), NOTIFICATIONCONFIG_BINDING); protocolMarshaller.marshall(commandInvocation.getCloudWatchOutputConfig(), CLOUDWATCHOUTPUTCONFIG_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[commandInvocation, protocolMarshaller]] begin[{] if[binary_operation[member[.commandInvocation], ==, 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=getCommandId, postfix_operators=[], prefix_operators=[], qualifier=commandInvocation, selectors=[], type_arguments=None), MemberReference(member=COMMANDID_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getInstanceId, postfix_operators=[], prefix_operators=[], qualifier=commandInvocation, selectors=[], type_arguments=None), MemberReference(member=INSTANCEID_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getInstanceName, postfix_operators=[], prefix_operators=[], qualifier=commandInvocation, selectors=[], type_arguments=None), MemberReference(member=INSTANCENAME_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getComment, postfix_operators=[], prefix_operators=[], qualifier=commandInvocation, selectors=[], type_arguments=None), MemberReference(member=COMMENT_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getDocumentName, postfix_operators=[], prefix_operators=[], qualifier=commandInvocation, selectors=[], type_arguments=None), MemberReference(member=DOCUMENTNAME_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getDocumentVersion, postfix_operators=[], prefix_operators=[], qualifier=commandInvocation, selectors=[], type_arguments=None), MemberReference(member=DOCUMENTVERSION_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getRequestedDateTime, postfix_operators=[], prefix_operators=[], qualifier=commandInvocation, selectors=[], type_arguments=None), MemberReference(member=REQUESTEDDATETIME_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getStatus, postfix_operators=[], prefix_operators=[], qualifier=commandInvocation, selectors=[], type_arguments=None), MemberReference(member=STATUS_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getStatusDetails, postfix_operators=[], prefix_operators=[], qualifier=commandInvocation, selectors=[], type_arguments=None), MemberReference(member=STATUSDETAILS_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getTraceOutput, postfix_operators=[], prefix_operators=[], qualifier=commandInvocation, selectors=[], type_arguments=None), MemberReference(member=TRACEOUTPUT_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getStandardOutputUrl, postfix_operators=[], prefix_operators=[], qualifier=commandInvocation, selectors=[], type_arguments=None), MemberReference(member=STANDARDOUTPUTURL_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getStandardErrorUrl, postfix_operators=[], prefix_operators=[], qualifier=commandInvocation, selectors=[], type_arguments=None), MemberReference(member=STANDARDERRORURL_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getCommandPlugins, postfix_operators=[], prefix_operators=[], qualifier=commandInvocation, selectors=[], type_arguments=None), MemberReference(member=COMMANDPLUGINS_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getServiceRole, postfix_operators=[], prefix_operators=[], qualifier=commandInvocation, selectors=[], type_arguments=None), MemberReference(member=SERVICEROLE_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getNotificationConfig, postfix_operators=[], prefix_operators=[], qualifier=commandInvocation, selectors=[], type_arguments=None), MemberReference(member=NOTIFICATIONCONFIG_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getCloudWatchOutputConfig, postfix_operators=[], prefix_operators=[], qualifier=commandInvocation, selectors=[], type_arguments=None), MemberReference(member=CLOUDWATCHOUTPUTCONFIG_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[CommandInvocation] identifier[commandInvocation] , identifier[ProtocolMarshaller] identifier[protocolMarshaller] operator[SEP] { Keyword[if] operator[SEP] identifier[commandInvocation] 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[commandInvocation] operator[SEP] identifier[getCommandId] operator[SEP] operator[SEP] , identifier[COMMANDID_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[commandInvocation] operator[SEP] identifier[getInstanceId] operator[SEP] operator[SEP] , identifier[INSTANCEID_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[commandInvocation] operator[SEP] identifier[getInstanceName] operator[SEP] operator[SEP] , identifier[INSTANCENAME_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[commandInvocation] operator[SEP] identifier[getComment] operator[SEP] operator[SEP] , identifier[COMMENT_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[commandInvocation] operator[SEP] identifier[getDocumentName] operator[SEP] operator[SEP] , identifier[DOCUMENTNAME_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[commandInvocation] operator[SEP] identifier[getDocumentVersion] operator[SEP] operator[SEP] , identifier[DOCUMENTVERSION_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[commandInvocation] operator[SEP] identifier[getRequestedDateTime] operator[SEP] operator[SEP] , identifier[REQUESTEDDATETIME_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[commandInvocation] operator[SEP] identifier[getStatus] operator[SEP] operator[SEP] , identifier[STATUS_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[commandInvocation] operator[SEP] identifier[getStatusDetails] operator[SEP] operator[SEP] , identifier[STATUSDETAILS_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[commandInvocation] operator[SEP] identifier[getTraceOutput] operator[SEP] operator[SEP] , identifier[TRACEOUTPUT_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[commandInvocation] operator[SEP] identifier[getStandardOutputUrl] operator[SEP] operator[SEP] , identifier[STANDARDOUTPUTURL_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[commandInvocation] operator[SEP] identifier[getStandardErrorUrl] operator[SEP] operator[SEP] , identifier[STANDARDERRORURL_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[commandInvocation] operator[SEP] identifier[getCommandPlugins] operator[SEP] operator[SEP] , identifier[COMMANDPLUGINS_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[commandInvocation] operator[SEP] identifier[getServiceRole] operator[SEP] operator[SEP] , identifier[SERVICEROLE_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[commandInvocation] operator[SEP] identifier[getNotificationConfig] operator[SEP] operator[SEP] , identifier[NOTIFICATIONCONFIG_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[commandInvocation] operator[SEP] identifier[getCloudWatchOutputConfig] operator[SEP] operator[SEP] , identifier[CLOUDWATCHOUTPUTCONFIG_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 List<Export> getExports(UUID projectId, UUID iterationId) { return getExportsWithServiceResponseAsync(projectId, iterationId).toBlocking().single().body(); }
class class_name[name] begin[{] method[getExports, return_type[type[List]], modifier[public], parameter[projectId, iterationId]] begin[{] return[call[.getExportsWithServiceResponseAsync, parameter[member[.projectId], member[.iterationId]]]] end[}] END[}]
Keyword[public] identifier[List] operator[<] identifier[Export] operator[>] identifier[getExports] operator[SEP] identifier[UUID] identifier[projectId] , identifier[UUID] identifier[iterationId] operator[SEP] { Keyword[return] identifier[getExportsWithServiceResponseAsync] operator[SEP] identifier[projectId] , identifier[iterationId] 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] }
@Trivial public static String typeToString(MediaType type, List<String> ignoreParams) { if (type == null) { throw new IllegalArgumentException("MediaType parameter is null"); } StringBuilder sb = new StringBuilder(); sb.append(type.getType()).append('/').append(type.getSubtype()); Map<String, String> params = type.getParameters(); if (params != null) { for (Iterator<Map.Entry<String, String>> iter = params.entrySet().iterator(); iter.hasNext();) { Map.Entry<String, String> entry = iter.next(); if (ignoreParams != null && ignoreParams.contains(entry.getKey())) { continue; } sb.append(';').append(entry.getKey()).append('=').append(entry.getValue()); } } return sb.toString(); }
class class_name[name] begin[{] method[typeToString, return_type[type[String]], modifier[public static], parameter[type, ignoreParams]] begin[{] if[binary_operation[member[.type], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="MediaType parameter is null")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None) else begin[{] None end[}] local_variable[type[StringBuilder], sb] call[sb.append, parameter[call[type.getType, parameter[]]]] local_variable[type[Map], params] if[binary_operation[member[.params], !=, literal[null]]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=next, postfix_operators=[], prefix_operators=[], qualifier=iter, selectors=[], type_arguments=None), name=entry)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Map, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=None, name=Entry, sub_type=None))), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=ignoreParams, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operandr=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getKey, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None)], member=contains, postfix_operators=[], prefix_operators=[], qualifier=ignoreParams, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ContinueStatement(goto=None, label=None)])), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=';')], member=append, postfix_operators=[], prefix_operators=[], qualifier=sb, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getKey, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None)], member=append, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='=')], member=append, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None)], member=append, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)]), control=ForControl(condition=MethodInvocation(arguments=[], member=hasNext, postfix_operators=[], prefix_operators=[], qualifier=iter, selectors=[], type_arguments=None), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=MethodInvocation(arguments=[], member=entrySet, postfix_operators=[], prefix_operators=[], qualifier=params, selectors=[MethodInvocation(arguments=[], member=iterator, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=iter)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Map, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=None, name=Entry, sub_type=None)))], dimensions=[], name=Iterator, sub_type=None)), update=None), label=None) else begin[{] None end[}] return[call[sb.toString, parameter[]]] end[}] END[}]
annotation[@] identifier[Trivial] Keyword[public] Keyword[static] identifier[String] identifier[typeToString] operator[SEP] identifier[MediaType] identifier[type] , identifier[List] operator[<] identifier[String] operator[>] identifier[ignoreParams] operator[SEP] { Keyword[if] operator[SEP] identifier[type] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] } identifier[StringBuilder] identifier[sb] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[sb] operator[SEP] identifier[append] operator[SEP] identifier[type] operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[type] operator[SEP] identifier[getSubtype] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[params] operator[=] identifier[type] operator[SEP] identifier[getParameters] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[params] operator[!=] Other[null] operator[SEP] { Keyword[for] operator[SEP] identifier[Iterator] operator[<] identifier[Map] operator[SEP] identifier[Entry] operator[<] identifier[String] , identifier[String] operator[>] operator[>] identifier[iter] operator[=] identifier[params] operator[SEP] identifier[entrySet] operator[SEP] operator[SEP] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] identifier[iter] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { identifier[Map] operator[SEP] identifier[Entry] operator[<] identifier[String] , identifier[String] operator[>] identifier[entry] operator[=] identifier[iter] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[ignoreParams] operator[!=] Other[null] operator[&&] identifier[ignoreParams] operator[SEP] identifier[contains] operator[SEP] identifier[entry] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { Keyword[continue] operator[SEP] } identifier[sb] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[entry] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[entry] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } Keyword[return] identifier[sb] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] }
public void setUserDateCreated(String userDateCreated) { try { m_userDateCreated = convertTimestamp(userDateCreated); } catch (Throwable e) { setThrowable(e); } }
class class_name[name] begin[{] method[setUserDateCreated, return_type[void], modifier[public], parameter[userDateCreated]] begin[{] TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=m_userDateCreated, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=userDateCreated, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=convertTimestamp, 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=setThrowable, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Throwable']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[public] Keyword[void] identifier[setUserDateCreated] operator[SEP] identifier[String] identifier[userDateCreated] operator[SEP] { Keyword[try] { identifier[m_userDateCreated] operator[=] identifier[convertTimestamp] operator[SEP] identifier[userDateCreated] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Throwable] identifier[e] operator[SEP] { identifier[setThrowable] operator[SEP] identifier[e] operator[SEP] operator[SEP] } }
@Override public <T> List<T> executeSelect(IRowMapper<T> rowMapper, Connection conn, String sql, Object... bindValues) { long timestampStart = System.currentTimeMillis(); try { try (PreparedStatement pstm = conn.prepareStatement(sql, ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY)) { int fetchSize = getDefaultFetchSize(); pstm.setFetchSize(fetchSize < 0 ? Integer.MIN_VALUE : fetchSize); JdbcHelper.bindParams(pstm, bindValues); try (ResultSet rs = pstm.executeQuery()) { List<T> result = new ArrayList<>(); int rowNum = 0; while (rs.next()) { result.add(rowMapper.mapRow(rs, rowNum)); rowNum++; } return result; } } } catch (SQLException e) { throw translateSQLException(conn, "executeSelect", sql, e); } finally { BaseDao.addProfiling(timestampStart, sql, System.currentTimeMillis() - timestampStart); } }
class class_name[name] begin[{] method[executeSelect, return_type[type[List]], modifier[public], parameter[rowMapper, conn, sql, bindValues]] begin[{] local_variable[type[long], timestampStart] TryStatement(block=[TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getDefaultFetchSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=fetchSize)], modifiers=set(), type=BasicType(dimensions=[], name=int)), StatementExpression(expression=MethodInvocation(arguments=[TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=fetchSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=<), if_false=MemberReference(member=fetchSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_true=MemberReference(member=MIN_VALUE, postfix_operators=[], prefix_operators=[], qualifier=Integer, selectors=[]))], member=setFetchSize, postfix_operators=[], prefix_operators=[], qualifier=pstm, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=pstm, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=bindValues, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=bindParams, postfix_operators=[], prefix_operators=[], qualifier=JdbcHelper, selectors=[], type_arguments=None), label=None), TryStatement(block=[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=result)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None))], dimensions=[], name=List, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=rowNum)], modifiers=set(), type=BasicType(dimensions=[], name=int)), WhileStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=rs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=rowNum, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=mapRow, postfix_operators=[], prefix_operators=[], qualifier=rowMapper, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MemberReference(member=rowNum, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]), label=None)]), condition=MethodInvocation(arguments=[], member=next, postfix_operators=[], prefix_operators=[], qualifier=rs, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], catches=None, finally_block=None, label=None, resources=[TryResource(annotations=[], modifiers=set(), name=rs, type=ReferenceType(arguments=None, dimensions=[], name=ResultSet, sub_type=None), value=MethodInvocation(arguments=[], member=executeQuery, postfix_operators=[], prefix_operators=[], qualifier=pstm, selectors=[], type_arguments=None))])], catches=None, finally_block=None, label=None, resources=[TryResource(annotations=[], modifiers=set(), name=pstm, type=ReferenceType(arguments=None, dimensions=[], name=PreparedStatement, sub_type=None), value=MethodInvocation(arguments=[MemberReference(member=sql, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=TYPE_FORWARD_ONLY, postfix_operators=[], prefix_operators=[], qualifier=ResultSet, selectors=[]), MemberReference(member=CONCUR_READ_ONLY, postfix_operators=[], prefix_operators=[], qualifier=ResultSet, selectors=[])], member=prepareStatement, postfix_operators=[], prefix_operators=[], qualifier=conn, selectors=[], type_arguments=None))])], catches=[CatchClause(block=[ThrowStatement(expression=MethodInvocation(arguments=[MemberReference(member=conn, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="executeSelect"), MemberReference(member=sql, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=translateSQLException, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['SQLException']))], finally_block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=timestampStart, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=sql, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=MethodInvocation(arguments=[], member=currentTimeMillis, postfix_operators=[], prefix_operators=[], qualifier=System, selectors=[], type_arguments=None), operandr=MemberReference(member=timestampStart, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=-)], member=addProfiling, postfix_operators=[], prefix_operators=[], qualifier=BaseDao, selectors=[], type_arguments=None), label=None)], label=None, resources=None) end[}] END[}]
annotation[@] identifier[Override] Keyword[public] operator[<] identifier[T] operator[>] identifier[List] operator[<] identifier[T] operator[>] identifier[executeSelect] operator[SEP] identifier[IRowMapper] operator[<] identifier[T] operator[>] identifier[rowMapper] , identifier[Connection] identifier[conn] , identifier[String] identifier[sql] , identifier[Object] operator[...] identifier[bindValues] operator[SEP] { Keyword[long] identifier[timestampStart] operator[=] identifier[System] operator[SEP] identifier[currentTimeMillis] operator[SEP] operator[SEP] operator[SEP] Keyword[try] { Keyword[try] operator[SEP] identifier[PreparedStatement] identifier[pstm] operator[=] identifier[conn] operator[SEP] identifier[prepareStatement] operator[SEP] identifier[sql] , identifier[ResultSet] operator[SEP] identifier[TYPE_FORWARD_ONLY] , identifier[ResultSet] operator[SEP] identifier[CONCUR_READ_ONLY] operator[SEP] operator[SEP] { Keyword[int] identifier[fetchSize] operator[=] identifier[getDefaultFetchSize] operator[SEP] operator[SEP] operator[SEP] identifier[pstm] operator[SEP] identifier[setFetchSize] operator[SEP] identifier[fetchSize] operator[<] Other[0] operator[?] identifier[Integer] operator[SEP] identifier[MIN_VALUE] operator[:] identifier[fetchSize] operator[SEP] operator[SEP] identifier[JdbcHelper] operator[SEP] identifier[bindParams] operator[SEP] identifier[pstm] , identifier[bindValues] operator[SEP] operator[SEP] Keyword[try] operator[SEP] identifier[ResultSet] identifier[rs] operator[=] identifier[pstm] operator[SEP] identifier[executeQuery] operator[SEP] operator[SEP] operator[SEP] { identifier[List] operator[<] identifier[T] operator[>] identifier[result] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[rowNum] operator[=] Other[0] operator[SEP] Keyword[while] operator[SEP] identifier[rs] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] { identifier[result] operator[SEP] identifier[add] operator[SEP] identifier[rowMapper] operator[SEP] identifier[mapRow] operator[SEP] identifier[rs] , identifier[rowNum] operator[SEP] operator[SEP] operator[SEP] identifier[rowNum] operator[++] operator[SEP] } Keyword[return] identifier[result] operator[SEP] } } } Keyword[catch] operator[SEP] identifier[SQLException] identifier[e] operator[SEP] { Keyword[throw] identifier[translateSQLException] operator[SEP] identifier[conn] , literal[String] , identifier[sql] , identifier[e] operator[SEP] operator[SEP] } Keyword[finally] { identifier[BaseDao] operator[SEP] identifier[addProfiling] operator[SEP] identifier[timestampStart] , identifier[sql] , identifier[System] operator[SEP] identifier[currentTimeMillis] operator[SEP] operator[SEP] operator[-] identifier[timestampStart] operator[SEP] operator[SEP] } }
static int getArrayLengthOfTheField(FieldDefinition fd, BufferObjectDataInput in, int offset) throws IOException { int originalPos = in.position(); try { int pos = getStreamPositionOfTheField(fd, in, offset); in.position(pos); return in.readInt(); } finally { in.position(originalPos); } }
class class_name[name] begin[{] method[getArrayLengthOfTheField, return_type[type[int]], modifier[static], parameter[fd, in, offset]] begin[{] local_variable[type[int], originalPos] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=fd, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=in, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=offset, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getStreamPositionOfTheField, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=pos)], modifiers=set(), type=BasicType(dimensions=[], name=int)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=pos, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=position, postfix_operators=[], prefix_operators=[], qualifier=in, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=MethodInvocation(arguments=[], member=readInt, postfix_operators=[], prefix_operators=[], qualifier=in, selectors=[], type_arguments=None), label=None)], catches=None, finally_block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=originalPos, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=position, postfix_operators=[], prefix_operators=[], qualifier=in, selectors=[], type_arguments=None), label=None)], label=None, resources=None) end[}] END[}]
Keyword[static] Keyword[int] identifier[getArrayLengthOfTheField] operator[SEP] identifier[FieldDefinition] identifier[fd] , identifier[BufferObjectDataInput] identifier[in] , Keyword[int] identifier[offset] operator[SEP] Keyword[throws] identifier[IOException] { Keyword[int] identifier[originalPos] operator[=] identifier[in] operator[SEP] identifier[position] operator[SEP] operator[SEP] operator[SEP] Keyword[try] { Keyword[int] identifier[pos] operator[=] identifier[getStreamPositionOfTheField] operator[SEP] identifier[fd] , identifier[in] , identifier[offset] operator[SEP] operator[SEP] identifier[in] operator[SEP] identifier[position] operator[SEP] identifier[pos] operator[SEP] operator[SEP] Keyword[return] identifier[in] operator[SEP] identifier[readInt] operator[SEP] operator[SEP] operator[SEP] } Keyword[finally] { identifier[in] operator[SEP] identifier[position] operator[SEP] identifier[originalPos] operator[SEP] operator[SEP] } }
public void setLinearLowerLimits(float limitX, float limitY, float limitZ) { Native3DGenericConstraint.setLinearLowerLimits(getNative(), limitX, limitY, limitZ); }
class class_name[name] begin[{] method[setLinearLowerLimits, return_type[void], modifier[public], parameter[limitX, limitY, limitZ]] begin[{] call[Native3DGenericConstraint.setLinearLowerLimits, parameter[call[.getNative, parameter[]], member[.limitX], member[.limitY], member[.limitZ]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[setLinearLowerLimits] operator[SEP] Keyword[float] identifier[limitX] , Keyword[float] identifier[limitY] , Keyword[float] identifier[limitZ] operator[SEP] { identifier[Native3DGenericConstraint] operator[SEP] identifier[setLinearLowerLimits] operator[SEP] identifier[getNative] operator[SEP] operator[SEP] , identifier[limitX] , identifier[limitY] , identifier[limitZ] operator[SEP] operator[SEP] }
@Override public R visitReturn(ReturnTree node, P p) { return scan(node.getExpression(), p); }
class class_name[name] begin[{] method[visitReturn, return_type[type[R]], modifier[public], parameter[node, p]] begin[{] return[call[.scan, parameter[call[node.getExpression, parameter[]], member[.p]]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[R] identifier[visitReturn] operator[SEP] identifier[ReturnTree] identifier[node] , identifier[P] identifier[p] operator[SEP] { Keyword[return] identifier[scan] operator[SEP] identifier[node] operator[SEP] identifier[getExpression] operator[SEP] operator[SEP] , identifier[p] operator[SEP] operator[SEP] }
public static String join(Object[] args, String separator, Integer limit) { if (separator == null || separator.equalsIgnoreCase("")) { throw new IllegalArgumentException("Missing separator!"); } if (args != null && args.length > 0) { List<Object> array = Arrays.asList(args); return join(array, separator, limit); } return ""; }
class class_name[name] begin[{] method[join, return_type[type[String]], modifier[public static], parameter[args, separator, limit]] begin[{] if[binary_operation[binary_operation[member[.separator], ==, literal[null]], ||, call[separator.equalsIgnoreCase, parameter[literal[""]]]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Missing separator!")], 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[.args], !=, literal[null]], &&, binary_operation[member[args.length], >, literal[0]]]] begin[{] local_variable[type[List], array] return[call[.join, parameter[member[.array], member[.separator], member[.limit]]]] else begin[{] None end[}] return[literal[""]] end[}] END[}]
Keyword[public] Keyword[static] identifier[String] identifier[join] operator[SEP] identifier[Object] operator[SEP] operator[SEP] identifier[args] , identifier[String] identifier[separator] , identifier[Integer] identifier[limit] operator[SEP] { Keyword[if] operator[SEP] identifier[separator] operator[==] Other[null] operator[||] identifier[separator] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] literal[String] operator[SEP] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[args] operator[!=] Other[null] operator[&&] identifier[args] operator[SEP] identifier[length] operator[>] Other[0] operator[SEP] { identifier[List] operator[<] identifier[Object] operator[>] identifier[array] operator[=] identifier[Arrays] operator[SEP] identifier[asList] operator[SEP] identifier[args] operator[SEP] operator[SEP] Keyword[return] identifier[join] operator[SEP] identifier[array] , identifier[separator] , identifier[limit] operator[SEP] operator[SEP] } Keyword[return] literal[String] operator[SEP] }
public static <T> T readObjectFromFile(String path, Class<T> type, SparkContext sc) throws IOException { FileSystem fileSystem = FileSystem.get(sc.hadoopConfiguration()); try (ObjectInputStream ois = new ObjectInputStream(new BufferedInputStream(fileSystem.open(new Path(path))))) { Object o; try { o = ois.readObject(); } catch (ClassNotFoundException e) { throw new RuntimeException(e); } return (T) o; } }
class class_name[name] begin[{] method[readObjectFromFile, return_type[type[T]], modifier[public static], parameter[path, type, sc]] begin[{] local_variable[type[FileSystem], fileSystem] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=None, name=o)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None)), TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=o, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=readObject, postfix_operators=[], prefix_operators=[], qualifier=ois, selectors=[], type_arguments=None)), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=RuntimeException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['ClassNotFoundException']))], finally_block=None, label=None, resources=None), ReturnStatement(expression=Cast(expression=MemberReference(member=o, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None)), label=None)], catches=None, finally_block=None, label=None, resources=[TryResource(annotations=[], modifiers=set(), name=ois, type=ReferenceType(arguments=None, dimensions=[], name=ObjectInputStream, sub_type=None), value=ClassCreator(arguments=[ClassCreator(arguments=[MethodInvocation(arguments=[ClassCreator(arguments=[MemberReference(member=path, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Path, sub_type=None))], member=open, postfix_operators=[], prefix_operators=[], qualifier=fileSystem, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=BufferedInputStream, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ObjectInputStream, sub_type=None)))]) end[}] END[}]
Keyword[public] Keyword[static] operator[<] identifier[T] operator[>] identifier[T] identifier[readObjectFromFile] operator[SEP] identifier[String] identifier[path] , identifier[Class] operator[<] identifier[T] operator[>] identifier[type] , identifier[SparkContext] identifier[sc] operator[SEP] Keyword[throws] identifier[IOException] { identifier[FileSystem] identifier[fileSystem] operator[=] identifier[FileSystem] operator[SEP] identifier[get] operator[SEP] identifier[sc] operator[SEP] identifier[hadoopConfiguration] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[try] operator[SEP] identifier[ObjectInputStream] identifier[ois] operator[=] Keyword[new] identifier[ObjectInputStream] operator[SEP] Keyword[new] identifier[BufferedInputStream] operator[SEP] identifier[fileSystem] operator[SEP] identifier[open] operator[SEP] Keyword[new] identifier[Path] operator[SEP] identifier[path] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { identifier[Object] identifier[o] operator[SEP] Keyword[try] { identifier[o] operator[=] identifier[ois] operator[SEP] identifier[readObject] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[ClassNotFoundException] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[RuntimeException] operator[SEP] identifier[e] operator[SEP] operator[SEP] } Keyword[return] operator[SEP] identifier[T] operator[SEP] identifier[o] operator[SEP] } }
public void key( String skey ) throws jsqlite.Exception { synchronized (this) { byte ekey[] = null; if (skey != null && skey.length() > 0) { ekey = new byte[skey.length()]; for( int i = 0; i < skey.length(); i++ ) { char c = skey.charAt(i); ekey[i] = (byte) ((c & 0xff) ^ (c >> 8)); } } _key(ekey); } }
class class_name[name] begin[{] method[key, return_type[void], modifier[public], parameter[skey]] begin[{] SYNCHRONIZED[THIS[]] BEGIN[{] local_variable[type[byte], ekey] if[binary_operation[binary_operation[member[.skey], !=, literal[null]], &&, binary_operation[call[skey.length, parameter[]], >, literal[0]]]] begin[{] assign[member[.ekey], ArrayCreator(dimensions=[MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=skey, selectors=[], type_arguments=None)], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=None, name=byte))] 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=skey, selectors=[], type_arguments=None), name=c)], modifiers=set(), type=BasicType(dimensions=[], name=char)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=ekey, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=Cast(expression=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0xff), operator=&), operandr=BinaryOperation(operandl=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=8), operator=>>), operator=^), type=BasicType(dimensions=[], name=byte))), 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=skey, 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) else begin[{] None end[}] call[._key, parameter[member[.ekey]]] END[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[key] operator[SEP] identifier[String] identifier[skey] operator[SEP] Keyword[throws] identifier[jsqlite] operator[SEP] identifier[Exception] { Keyword[synchronized] operator[SEP] Keyword[this] operator[SEP] { Keyword[byte] identifier[ekey] operator[SEP] operator[SEP] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[skey] operator[!=] Other[null] operator[&&] identifier[skey] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] { identifier[ekey] operator[=] Keyword[new] Keyword[byte] operator[SEP] identifier[skey] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[skey] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[++] operator[SEP] { Keyword[char] identifier[c] operator[=] identifier[skey] operator[SEP] identifier[charAt] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[ekey] operator[SEP] identifier[i] operator[SEP] operator[=] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] operator[SEP] identifier[c] operator[&] literal[Integer] operator[SEP] operator[^] operator[SEP] identifier[c] operator[>] operator[>] Other[8] operator[SEP] operator[SEP] operator[SEP] } } identifier[_key] operator[SEP] identifier[ekey] operator[SEP] operator[SEP] } }
public static base_response disable(nitro_service client) throws Exception { reporting disableresource = new reporting(); return disableresource.perform_operation(client,"disable"); }
class class_name[name] begin[{] method[disable, return_type[type[base_response]], modifier[public static], parameter[client]] begin[{] local_variable[type[reporting], disableresource] return[call[disableresource.perform_operation, parameter[member[.client], literal["disable"]]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[base_response] identifier[disable] operator[SEP] identifier[nitro_service] identifier[client] operator[SEP] Keyword[throws] identifier[Exception] { identifier[reporting] identifier[disableresource] operator[=] Keyword[new] identifier[reporting] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[disableresource] operator[SEP] identifier[perform_operation] operator[SEP] identifier[client] , literal[String] operator[SEP] operator[SEP] }
public void adaptHeightToChildren() { DividableGridAdapter adapter = (DividableGridAdapter) getAdapter(); if (adapter != null) { int height = getPaddingTop() + getPaddingBottom(); for (int i = 0; i < adapter.getCount(); i += adapter.getColumnCount()) { AbstractItem item = adapter.getItem(i); if (item instanceof Divider) { height += getResources().getDimensionPixelSize( TextUtils.isEmpty(item.getTitle()) ? R.dimen.bottom_sheet_divider_height : R.dimen.bottom_sheet_divider_title_height); } else { height += getResources().getDimensionPixelSize( adapter.getStyle() == BottomSheet.Style.GRID ? R.dimen.bottom_sheet_grid_item_size : R.dimen.bottom_sheet_list_item_height); } } ViewGroup.LayoutParams params = getLayoutParams(); params.height = height; setLayoutParams(params); requestLayout(); } }
class class_name[name] begin[{] method[adaptHeightToChildren, return_type[void], modifier[public], parameter[]] begin[{] local_variable[type[DividableGridAdapter], adapter] if[binary_operation[member[.adapter], !=, literal[null]]] begin[{] local_variable[type[int], height] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getItem, postfix_operators=[], prefix_operators=[], qualifier=adapter, selectors=[], type_arguments=None), name=item)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=AbstractItem, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=item, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=Divider, sub_type=None), operator=instanceof), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=height, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=MethodInvocation(arguments=[], member=getResources, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[TernaryExpression(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getStyle, postfix_operators=[], prefix_operators=[], qualifier=adapter, selectors=[], type_arguments=None), operandr=MemberReference(member=GRID, postfix_operators=[], prefix_operators=[], qualifier=BottomSheet.Style, selectors=[]), operator===), if_false=MemberReference(member=bottom_sheet_list_item_height, postfix_operators=[], prefix_operators=[], qualifier=R.dimen, selectors=[]), if_true=MemberReference(member=bottom_sheet_grid_item_size, postfix_operators=[], prefix_operators=[], qualifier=R.dimen, selectors=[]))], member=getDimensionPixelSize, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=height, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=MethodInvocation(arguments=[], member=getResources, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[TernaryExpression(condition=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getTitle, postfix_operators=[], prefix_operators=[], qualifier=item, selectors=[], type_arguments=None)], member=isEmpty, postfix_operators=[], prefix_operators=[], qualifier=TextUtils, selectors=[], type_arguments=None), if_false=MemberReference(member=bottom_sheet_divider_title_height, postfix_operators=[], prefix_operators=[], qualifier=R.dimen, selectors=[]), if_true=MemberReference(member=bottom_sheet_divider_height, postfix_operators=[], prefix_operators=[], qualifier=R.dimen, selectors=[]))], member=getDimensionPixelSize, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=getCount, postfix_operators=[], prefix_operators=[], qualifier=adapter, 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=[Assignment(expressionl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=MethodInvocation(arguments=[], member=getColumnCount, postfix_operators=[], prefix_operators=[], qualifier=adapter, selectors=[], type_arguments=None))]), label=None) local_variable[type[ViewGroup], params] assign[member[params.height], member[.height]] call[.setLayoutParams, parameter[member[.params]]] call[.requestLayout, parameter[]] else begin[{] None end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[adaptHeightToChildren] operator[SEP] operator[SEP] { identifier[DividableGridAdapter] identifier[adapter] operator[=] operator[SEP] identifier[DividableGridAdapter] operator[SEP] identifier[getAdapter] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[adapter] operator[!=] Other[null] operator[SEP] { Keyword[int] identifier[height] operator[=] identifier[getPaddingTop] operator[SEP] operator[SEP] operator[+] identifier[getPaddingBottom] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[adapter] operator[SEP] identifier[getCount] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[+=] identifier[adapter] operator[SEP] identifier[getColumnCount] operator[SEP] operator[SEP] operator[SEP] { identifier[AbstractItem] identifier[item] operator[=] identifier[adapter] operator[SEP] identifier[getItem] operator[SEP] identifier[i] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[item] Keyword[instanceof] identifier[Divider] operator[SEP] { identifier[height] operator[+=] identifier[getResources] operator[SEP] operator[SEP] operator[SEP] identifier[getDimensionPixelSize] operator[SEP] identifier[TextUtils] operator[SEP] identifier[isEmpty] operator[SEP] identifier[item] operator[SEP] identifier[getTitle] operator[SEP] operator[SEP] operator[SEP] operator[?] identifier[R] operator[SEP] identifier[dimen] operator[SEP] identifier[bottom_sheet_divider_height] operator[:] identifier[R] operator[SEP] identifier[dimen] operator[SEP] identifier[bottom_sheet_divider_title_height] operator[SEP] operator[SEP] } Keyword[else] { identifier[height] operator[+=] identifier[getResources] operator[SEP] operator[SEP] operator[SEP] identifier[getDimensionPixelSize] operator[SEP] identifier[adapter] operator[SEP] identifier[getStyle] operator[SEP] operator[SEP] operator[==] identifier[BottomSheet] operator[SEP] identifier[Style] operator[SEP] identifier[GRID] operator[?] identifier[R] operator[SEP] identifier[dimen] operator[SEP] identifier[bottom_sheet_grid_item_size] operator[:] identifier[R] operator[SEP] identifier[dimen] operator[SEP] identifier[bottom_sheet_list_item_height] operator[SEP] operator[SEP] } } identifier[ViewGroup] operator[SEP] identifier[LayoutParams] identifier[params] operator[=] identifier[getLayoutParams] operator[SEP] operator[SEP] operator[SEP] identifier[params] operator[SEP] identifier[height] operator[=] identifier[height] operator[SEP] identifier[setLayoutParams] operator[SEP] identifier[params] operator[SEP] operator[SEP] identifier[requestLayout] operator[SEP] operator[SEP] operator[SEP] } }
static boolean isBshAssignable( Class toType, Class fromType ) { try { return castObject( toType, fromType, null/*fromValue*/, ASSIGNMENT, true/*checkOnly*/ ) == VALID_CAST; } catch ( UtilEvalError e ) { // This should not happen with checkOnly true throw new InterpreterError("err in cast check: "+e, e); } }
class class_name[name] begin[{] method[isBshAssignable, return_type[type[boolean]], modifier[static], parameter[toType, fromType]] begin[{] TryStatement(block=[ReturnStatement(expression=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=toType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=fromType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), MemberReference(member=ASSIGNMENT, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], member=castObject, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), operandr=MemberReference(member=VALID_CAST, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="err in cast check: "), operandr=MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=InterpreterError, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['UtilEvalError']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[static] Keyword[boolean] identifier[isBshAssignable] operator[SEP] identifier[Class] identifier[toType] , identifier[Class] identifier[fromType] operator[SEP] { Keyword[try] { Keyword[return] identifier[castObject] operator[SEP] identifier[toType] , identifier[fromType] , Other[null] , identifier[ASSIGNMENT] , literal[boolean] operator[SEP] operator[==] identifier[VALID_CAST] operator[SEP] } Keyword[catch] operator[SEP] identifier[UtilEvalError] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[InterpreterError] operator[SEP] literal[String] operator[+] identifier[e] , identifier[e] operator[SEP] operator[SEP] } }
public void reset() { state = BreakerState.CLOSED; isHardTrip = false; byPass = false; isAttemptLive = false; notifyBreakerStateChange(getStatus()); }
class class_name[name] begin[{] method[reset, return_type[void], modifier[public], parameter[]] begin[{] assign[member[.state], member[BreakerState.CLOSED]] assign[member[.isHardTrip], literal[false]] assign[member[.byPass], literal[false]] assign[member[.isAttemptLive], literal[false]] call[.notifyBreakerStateChange, parameter[call[.getStatus, parameter[]]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[reset] operator[SEP] operator[SEP] { identifier[state] operator[=] identifier[BreakerState] operator[SEP] identifier[CLOSED] operator[SEP] identifier[isHardTrip] operator[=] literal[boolean] operator[SEP] identifier[byPass] operator[=] literal[boolean] operator[SEP] identifier[isAttemptLive] operator[=] literal[boolean] operator[SEP] identifier[notifyBreakerStateChange] operator[SEP] identifier[getStatus] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
public static NamingContextable getParentNamingContext(final WComponent component) { if (component == null) { return null; } WComponent child = component; NamingContextable parent = null; while (true) { NamingContextable naming = WebUtilities.getAncestorOfClass(NamingContextable.class, child); if (naming == null) { break; } if (WebUtilities.isActiveNamingContext(naming)) { parent = naming; break; } child = naming; } return parent; }
class class_name[name] begin[{] method[getParentNamingContext, return_type[type[NamingContextable]], modifier[public static], parameter[component]] begin[{] if[binary_operation[member[.component], ==, literal[null]]] begin[{] return[literal[null]] else begin[{] None end[}] local_variable[type[WComponent], child] local_variable[type[NamingContextable], parent] while[literal[true]] begin[{] local_variable[type[NamingContextable], naming] if[binary_operation[member[.naming], ==, literal[null]]] begin[{] BreakStatement(goto=None, label=None) else begin[{] None end[}] if[call[WebUtilities.isActiveNamingContext, parameter[member[.naming]]]] begin[{] assign[member[.parent], member[.naming]] BreakStatement(goto=None, label=None) else begin[{] None end[}] assign[member[.child], member[.naming]] end[}] return[member[.parent]] end[}] END[}]
Keyword[public] Keyword[static] identifier[NamingContextable] identifier[getParentNamingContext] operator[SEP] Keyword[final] identifier[WComponent] identifier[component] operator[SEP] { Keyword[if] operator[SEP] identifier[component] operator[==] Other[null] operator[SEP] { Keyword[return] Other[null] operator[SEP] } identifier[WComponent] identifier[child] operator[=] identifier[component] operator[SEP] identifier[NamingContextable] identifier[parent] operator[=] Other[null] operator[SEP] Keyword[while] operator[SEP] literal[boolean] operator[SEP] { identifier[NamingContextable] identifier[naming] operator[=] identifier[WebUtilities] operator[SEP] identifier[getAncestorOfClass] operator[SEP] identifier[NamingContextable] operator[SEP] Keyword[class] , identifier[child] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[naming] operator[==] Other[null] operator[SEP] { Keyword[break] operator[SEP] } Keyword[if] operator[SEP] identifier[WebUtilities] operator[SEP] identifier[isActiveNamingContext] operator[SEP] identifier[naming] operator[SEP] operator[SEP] { identifier[parent] operator[=] identifier[naming] operator[SEP] Keyword[break] operator[SEP] } identifier[child] operator[=] identifier[naming] operator[SEP] } Keyword[return] identifier[parent] operator[SEP] }
@SuppressWarnings("unchecked") public TreeNode<T> findByPath(T... path) { return findByPath(Arrays.asList(path)); }
class class_name[name] begin[{] method[findByPath, return_type[type[TreeNode]], modifier[public], parameter[path]] begin[{] return[call[.findByPath, parameter[call[Arrays.asList, parameter[member[.path]]]]]] end[}] END[}]
annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] Keyword[public] identifier[TreeNode] operator[<] identifier[T] operator[>] identifier[findByPath] operator[SEP] identifier[T] operator[...] identifier[path] operator[SEP] { Keyword[return] identifier[findByPath] operator[SEP] identifier[Arrays] operator[SEP] identifier[asList] operator[SEP] identifier[path] operator[SEP] operator[SEP] operator[SEP] }
public static java.sql.Time rollTime(java.util.Date startDate, int period, int amount) { GregorianCalendar gc = new GregorianCalendar(); gc.setTime(startDate); gc.add(period, amount); return new java.sql.Time(gc.getTime().getTime()); }
class class_name[name] begin[{] method[rollTime, return_type[type[java]], modifier[public static], parameter[startDate, period, amount]] begin[{] local_variable[type[GregorianCalendar], gc] call[gc.setTime, parameter[member[.startDate]]] call[gc.add, parameter[member[.period], member[.amount]]] return[ClassCreator(arguments=[MethodInvocation(arguments=[], member=getTime, postfix_operators=[], prefix_operators=[], qualifier=gc, selectors=[MethodInvocation(arguments=[], member=getTime, 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=java, sub_type=ReferenceType(arguments=None, dimensions=None, name=sql, sub_type=ReferenceType(arguments=None, dimensions=None, name=Time, sub_type=None))))] end[}] END[}]
Keyword[public] Keyword[static] identifier[java] operator[SEP] identifier[sql] operator[SEP] identifier[Time] identifier[rollTime] operator[SEP] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[Date] identifier[startDate] , Keyword[int] identifier[period] , Keyword[int] identifier[amount] operator[SEP] { identifier[GregorianCalendar] identifier[gc] operator[=] Keyword[new] identifier[GregorianCalendar] operator[SEP] operator[SEP] operator[SEP] identifier[gc] operator[SEP] identifier[setTime] operator[SEP] identifier[startDate] operator[SEP] operator[SEP] identifier[gc] operator[SEP] identifier[add] operator[SEP] identifier[period] , identifier[amount] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[java] operator[SEP] identifier[sql] operator[SEP] identifier[Time] operator[SEP] identifier[gc] operator[SEP] identifier[getTime] operator[SEP] operator[SEP] operator[SEP] identifier[getTime] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
public static boolean kill(int processId) { String killCommand = String.format("%s %d", (SystemUtils.isWindows() ? WINDOWS_KILL_COMMAND : UNIX_KILL_COMMAND), processId); try { Process killProcess = Runtime.getRuntime().exec(killCommand); return killProcess.waitFor(KILL_WAIT_TIMEOUT, KILL_WAIT_TIME_UNIT); } catch (Throwable ignore) { return false; } }
class class_name[name] begin[{] method[kill, return_type[type[boolean]], modifier[public static], parameter[processId]] begin[{] local_variable[type[String], killCommand] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getRuntime, postfix_operators=[], prefix_operators=[], qualifier=Runtime, selectors=[MethodInvocation(arguments=[MemberReference(member=killCommand, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=exec, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=killProcess)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Process, sub_type=None)), ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=KILL_WAIT_TIMEOUT, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=KILL_WAIT_TIME_UNIT, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=waitFor, postfix_operators=[], prefix_operators=[], qualifier=killProcess, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ignore, types=['Throwable']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[public] Keyword[static] Keyword[boolean] identifier[kill] operator[SEP] Keyword[int] identifier[processId] operator[SEP] { identifier[String] identifier[killCommand] operator[=] identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] , operator[SEP] identifier[SystemUtils] operator[SEP] identifier[isWindows] operator[SEP] operator[SEP] operator[?] identifier[WINDOWS_KILL_COMMAND] operator[:] identifier[UNIX_KILL_COMMAND] operator[SEP] , identifier[processId] operator[SEP] operator[SEP] Keyword[try] { identifier[Process] identifier[killProcess] operator[=] identifier[Runtime] operator[SEP] identifier[getRuntime] operator[SEP] operator[SEP] operator[SEP] identifier[exec] operator[SEP] identifier[killCommand] operator[SEP] operator[SEP] Keyword[return] identifier[killProcess] operator[SEP] identifier[waitFor] operator[SEP] identifier[KILL_WAIT_TIMEOUT] , identifier[KILL_WAIT_TIME_UNIT] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Throwable] identifier[ignore] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } }
private static List<Token> removeFalsePositiveVersionRanges(List<Token> tokens) { List<Token> result = new ArrayList<Token>(); for (int i = 0; i < tokens.size(); i++) { Token token = tokens.get(i); if (thereIsFalsePositiveVersionRange(tokens, i)) { token = new Token(TokenType.VERSION, token.value + '-' + tokens.get(i + 2).value); i += 2; } result.add(token); } return result; }
class class_name[name] begin[{] method[removeFalsePositiveVersionRanges, return_type[type[List]], modifier[private static], parameter[tokens]] begin[{] local_variable[type[List], result] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=tokens, selectors=[], type_arguments=None), name=token)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Token, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=tokens, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=thereIsFalsePositiveVersionRange, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=token, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[MemberReference(member=VERSION, postfix_operators=[], prefix_operators=[], qualifier=TokenType, selectors=[]), BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=token, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='-'), operator=+), operandr=MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), operator=+)], member=get, postfix_operators=[], prefix_operators=[], qualifier=tokens, selectors=[MemberReference(member=value, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)], type_arguments=None), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Token, sub_type=None))), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2)), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=token, 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=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=tokens, 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[member[.result]] end[}] END[}]
Keyword[private] Keyword[static] identifier[List] operator[<] identifier[Token] operator[>] identifier[removeFalsePositiveVersionRanges] operator[SEP] identifier[List] operator[<] identifier[Token] operator[>] identifier[tokens] operator[SEP] { identifier[List] operator[<] identifier[Token] operator[>] identifier[result] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[Token] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[tokens] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[Token] identifier[token] operator[=] identifier[tokens] operator[SEP] identifier[get] operator[SEP] identifier[i] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[thereIsFalsePositiveVersionRange] operator[SEP] identifier[tokens] , identifier[i] operator[SEP] operator[SEP] { identifier[token] operator[=] Keyword[new] identifier[Token] operator[SEP] identifier[TokenType] operator[SEP] identifier[VERSION] , identifier[token] operator[SEP] identifier[value] operator[+] literal[String] operator[+] identifier[tokens] operator[SEP] identifier[get] operator[SEP] identifier[i] operator[+] Other[2] operator[SEP] operator[SEP] identifier[value] operator[SEP] operator[SEP] identifier[i] operator[+=] Other[2] operator[SEP] } identifier[result] operator[SEP] identifier[add] operator[SEP] identifier[token] operator[SEP] operator[SEP] } Keyword[return] identifier[result] operator[SEP] }
@Override public void delete(String spaceId, String key, IDeleteCallback callback) throws IOException { kdStorage.delete(spaceId, key, new IDeleteCallback() { @Override public void onSuccess(String spaceId, String key) { // invalidate cache upon successful deletion invalidateCacheEntry(spaceId, key); // invoke callback callback.onSuccess(spaceId, key); } @Override public void onError(String spaceId, String key, Throwable t) { // invoke callback callback.onError(spaceId, key, t); } }); }
class class_name[name] begin[{] method[delete, return_type[void], modifier[public], parameter[spaceId, key, callback]] begin[{] call[kdStorage.delete, parameter[member[.spaceId], member[.key], ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=spaceId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=invalidateCacheEntry, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=spaceId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=onSuccess, postfix_operators=[], prefix_operators=[], qualifier=callback, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=onSuccess, parameters=[FormalParameter(annotations=[], modifiers=set(), name=spaceId, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None), varargs=False), FormalParameter(annotations=[], modifiers=set(), name=key, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None), varargs=False)], return_type=None, throws=None, type_parameters=None), MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=spaceId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=t, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=onError, postfix_operators=[], prefix_operators=[], qualifier=callback, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=onError, parameters=[FormalParameter(annotations=[], modifiers=set(), name=spaceId, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None), varargs=False), FormalParameter(annotations=[], modifiers=set(), name=key, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None), varargs=False), FormalParameter(annotations=[], modifiers=set(), name=t, type=ReferenceType(arguments=None, dimensions=[], name=Throwable, sub_type=None), varargs=False)], return_type=None, throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IDeleteCallback, sub_type=None))]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[delete] operator[SEP] identifier[String] identifier[spaceId] , identifier[String] identifier[key] , identifier[IDeleteCallback] identifier[callback] operator[SEP] Keyword[throws] identifier[IOException] { identifier[kdStorage] operator[SEP] identifier[delete] operator[SEP] identifier[spaceId] , identifier[key] , Keyword[new] identifier[IDeleteCallback] operator[SEP] operator[SEP] { annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[onSuccess] operator[SEP] identifier[String] identifier[spaceId] , identifier[String] identifier[key] operator[SEP] { identifier[invalidateCacheEntry] operator[SEP] identifier[spaceId] , identifier[key] operator[SEP] operator[SEP] identifier[callback] operator[SEP] identifier[onSuccess] operator[SEP] identifier[spaceId] , identifier[key] operator[SEP] operator[SEP] } annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[onError] operator[SEP] identifier[String] identifier[spaceId] , identifier[String] identifier[key] , identifier[Throwable] identifier[t] operator[SEP] { identifier[callback] operator[SEP] identifier[onError] operator[SEP] identifier[spaceId] , identifier[key] , identifier[t] operator[SEP] operator[SEP] } } operator[SEP] operator[SEP] }
protected BufferedImage rotate(double angle) { BufferedImage target = new BufferedImage(height, width, awt.getType()); Graphics2D g2 = (Graphics2D) target.getGraphics(); final int offsetx, offsety; if (angle < 0) { offsetx = 0; offsety = width; } else if (angle > 0) { offsetx = height; offsety = 0; } else { offsetx = 0; offsety = 0; } g2.translate(offsetx, offsety); g2.rotate(angle); g2.drawImage(awt, 0, 0, null); g2.dispose(); return target; }
class class_name[name] begin[{] method[rotate, return_type[type[BufferedImage]], modifier[protected], parameter[angle]] begin[{] local_variable[type[BufferedImage], target] local_variable[type[Graphics2D], g2] local_variable[type[int], offsetx] if[binary_operation[member[.angle], <, literal[0]]] begin[{] assign[member[.offsetx], literal[0]] assign[member[.offsety], member[.width]] else begin[{] if[binary_operation[member[.angle], >, literal[0]]] begin[{] assign[member[.offsetx], member[.height]] assign[member[.offsety], literal[0]] else begin[{] assign[member[.offsetx], literal[0]] assign[member[.offsety], literal[0]] end[}] end[}] call[g2.translate, parameter[member[.offsetx], member[.offsety]]] call[g2.rotate, parameter[member[.angle]]] call[g2.drawImage, parameter[member[.awt], literal[0], literal[0], literal[null]]] call[g2.dispose, parameter[]] return[member[.target]] end[}] END[}]
Keyword[protected] identifier[BufferedImage] identifier[rotate] operator[SEP] Keyword[double] identifier[angle] operator[SEP] { identifier[BufferedImage] identifier[target] operator[=] Keyword[new] identifier[BufferedImage] operator[SEP] identifier[height] , identifier[width] , identifier[awt] operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[Graphics2D] identifier[g2] operator[=] operator[SEP] identifier[Graphics2D] operator[SEP] identifier[target] operator[SEP] identifier[getGraphics] operator[SEP] operator[SEP] operator[SEP] Keyword[final] Keyword[int] identifier[offsetx] , identifier[offsety] operator[SEP] Keyword[if] operator[SEP] identifier[angle] operator[<] Other[0] operator[SEP] { identifier[offsetx] operator[=] Other[0] operator[SEP] identifier[offsety] operator[=] identifier[width] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[angle] operator[>] Other[0] operator[SEP] { identifier[offsetx] operator[=] identifier[height] operator[SEP] identifier[offsety] operator[=] Other[0] operator[SEP] } Keyword[else] { identifier[offsetx] operator[=] Other[0] operator[SEP] identifier[offsety] operator[=] Other[0] operator[SEP] } identifier[g2] operator[SEP] identifier[translate] operator[SEP] identifier[offsetx] , identifier[offsety] operator[SEP] operator[SEP] identifier[g2] operator[SEP] identifier[rotate] operator[SEP] identifier[angle] operator[SEP] operator[SEP] identifier[g2] operator[SEP] identifier[drawImage] operator[SEP] identifier[awt] , Other[0] , Other[0] , Other[null] operator[SEP] operator[SEP] identifier[g2] operator[SEP] identifier[dispose] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[target] operator[SEP] }
private void handleSortRequest(final Request request) { String sortColStr = request.getParameter(getId() + ".sort"); String sortDescStr = request.getParameter(getId() + ".sortDesc"); if (sortColStr != null) { if ("".equals(sortColStr)) { // Reset sort setSort(-1, false); getOrCreateComponentModel().rowIndexMapping = null; } else { try { int sortCol = Integer.parseInt(sortColStr); // Allow for column order int[] cols = getColumnOrder(); if (cols != null) { sortCol = cols[sortCol]; } boolean sortAsc = !"true".equalsIgnoreCase(sortDescStr); // Only process the sort request if it differs from the current sort order if (sortCol != getSortColumnIndex() || sortAsc != isSortAscending()) { sort(sortCol, sortAsc); setFocussed(); } } catch (NumberFormatException e) { LOG.warn("Invalid sort column: " + sortColStr); } } } }
class class_name[name] begin[{] method[handleSortRequest, return_type[void], modifier[private], parameter[request]] begin[{] local_variable[type[String], sortColStr] local_variable[type[String], sortDescStr] if[binary_operation[member[.sortColStr], !=, literal[null]]] begin[{] if[literal[""]] begin[{] call[.setSort, parameter[literal[1], literal[false]]] assign[call[.getOrCreateComponentModel, parameter[]], literal[null]] else begin[{] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=sortColStr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=parseInt, postfix_operators=[], prefix_operators=[], qualifier=Integer, selectors=[], type_arguments=None), name=sortCol)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getColumnOrder, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=cols)], modifiers=set(), type=BasicType(dimensions=[None], name=int)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=cols, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=sortCol, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=cols, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=sortCol, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])), label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=['!'], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=sortDescStr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equalsIgnoreCase, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], value="true"), name=sortAsc)], modifiers=set(), type=BasicType(dimensions=[], name=boolean)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=sortCol, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=getSortColumnIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), operator=!=), operandr=BinaryOperation(operandl=MemberReference(member=sortAsc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=isSortAscending, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), operator=!=), operator=||), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=sortCol, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=sortAsc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=sort, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=setFocussed, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]))], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Invalid sort column: "), operandr=MemberReference(member=sortColStr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=warn, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['NumberFormatException']))], finally_block=None, label=None, resources=None) end[}] else begin[{] None end[}] end[}] END[}]
Keyword[private] Keyword[void] identifier[handleSortRequest] operator[SEP] Keyword[final] identifier[Request] identifier[request] operator[SEP] { identifier[String] identifier[sortColStr] operator[=] identifier[request] operator[SEP] identifier[getParameter] operator[SEP] identifier[getId] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] identifier[String] identifier[sortDescStr] operator[=] identifier[request] operator[SEP] identifier[getParameter] operator[SEP] identifier[getId] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[sortColStr] operator[!=] Other[null] operator[SEP] { Keyword[if] operator[SEP] literal[String] operator[SEP] identifier[equals] operator[SEP] identifier[sortColStr] operator[SEP] operator[SEP] { identifier[setSort] operator[SEP] operator[-] Other[1] , literal[boolean] operator[SEP] operator[SEP] identifier[getOrCreateComponentModel] operator[SEP] operator[SEP] operator[SEP] identifier[rowIndexMapping] operator[=] Other[null] operator[SEP] } Keyword[else] { Keyword[try] { Keyword[int] identifier[sortCol] operator[=] identifier[Integer] operator[SEP] identifier[parseInt] operator[SEP] identifier[sortColStr] operator[SEP] operator[SEP] Keyword[int] operator[SEP] operator[SEP] identifier[cols] operator[=] identifier[getColumnOrder] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[cols] operator[!=] Other[null] operator[SEP] { identifier[sortCol] operator[=] identifier[cols] operator[SEP] identifier[sortCol] operator[SEP] operator[SEP] } Keyword[boolean] identifier[sortAsc] operator[=] operator[!] literal[String] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] identifier[sortDescStr] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[sortCol] operator[!=] identifier[getSortColumnIndex] operator[SEP] operator[SEP] operator[||] identifier[sortAsc] operator[!=] identifier[isSortAscending] operator[SEP] operator[SEP] operator[SEP] { identifier[sort] operator[SEP] identifier[sortCol] , identifier[sortAsc] operator[SEP] operator[SEP] identifier[setFocussed] operator[SEP] operator[SEP] operator[SEP] } } Keyword[catch] operator[SEP] identifier[NumberFormatException] identifier[e] operator[SEP] { identifier[LOG] operator[SEP] identifier[warn] operator[SEP] literal[String] operator[+] identifier[sortColStr] operator[SEP] operator[SEP] } } } }
protected String getCharsetFromBytes(byte buffer[], int len) throws IOException { String charsetName = null; UniversalDetector detector = new UniversalDetector(null); detector.handleData(buffer, 0, len); detector.dataEnd(); charsetName = detector.getDetectedCharset(); detector.reset(); if(isCharsetSupported(charsetName)) { return mapCharset(charsetName); } return null; }
class class_name[name] begin[{] method[getCharsetFromBytes, return_type[type[String]], modifier[protected], parameter[buffer, len]] begin[{] local_variable[type[String], charsetName] local_variable[type[UniversalDetector], detector] call[detector.handleData, parameter[member[.buffer], literal[0], member[.len]]] call[detector.dataEnd, parameter[]] assign[member[.charsetName], call[detector.getDetectedCharset, parameter[]]] call[detector.reset, parameter[]] if[call[.isCharsetSupported, parameter[member[.charsetName]]]] begin[{] return[call[.mapCharset, parameter[member[.charsetName]]]] else begin[{] None end[}] return[literal[null]] end[}] END[}]
Keyword[protected] identifier[String] identifier[getCharsetFromBytes] operator[SEP] Keyword[byte] identifier[buffer] operator[SEP] operator[SEP] , Keyword[int] identifier[len] operator[SEP] Keyword[throws] identifier[IOException] { identifier[String] identifier[charsetName] operator[=] Other[null] operator[SEP] identifier[UniversalDetector] identifier[detector] operator[=] Keyword[new] identifier[UniversalDetector] operator[SEP] Other[null] operator[SEP] operator[SEP] identifier[detector] operator[SEP] identifier[handleData] operator[SEP] identifier[buffer] , Other[0] , identifier[len] operator[SEP] operator[SEP] identifier[detector] operator[SEP] identifier[dataEnd] operator[SEP] operator[SEP] operator[SEP] identifier[charsetName] operator[=] identifier[detector] operator[SEP] identifier[getDetectedCharset] operator[SEP] operator[SEP] operator[SEP] identifier[detector] operator[SEP] identifier[reset] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[isCharsetSupported] operator[SEP] identifier[charsetName] operator[SEP] operator[SEP] { Keyword[return] identifier[mapCharset] operator[SEP] identifier[charsetName] operator[SEP] operator[SEP] } Keyword[return] Other[null] operator[SEP] }
public QueryTreeElement removeQuery(String query_id) { for (QueryTreeElement query : queries) { if (query.getID().equals(query_id)) { queries.remove(query); return query; } } return null; }
class class_name[name] begin[{] method[removeQuery, return_type[type[QueryTreeElement]], modifier[public], parameter[query_id]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[], member=getID, postfix_operators=[], prefix_operators=[], qualifier=query, selectors=[MethodInvocation(arguments=[MemberReference(member=query_id, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=query, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=remove, postfix_operators=[], prefix_operators=[], qualifier=queries, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=MemberReference(member=query, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=queries, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=query)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=QueryTreeElement, sub_type=None))), label=None) return[literal[null]] end[}] END[}]
Keyword[public] identifier[QueryTreeElement] identifier[removeQuery] operator[SEP] identifier[String] identifier[query_id] operator[SEP] { Keyword[for] operator[SEP] identifier[QueryTreeElement] identifier[query] operator[:] identifier[queries] operator[SEP] { Keyword[if] operator[SEP] identifier[query] operator[SEP] identifier[getID] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[query_id] operator[SEP] operator[SEP] { identifier[queries] operator[SEP] identifier[remove] operator[SEP] identifier[query] operator[SEP] operator[SEP] Keyword[return] identifier[query] operator[SEP] } } Keyword[return] Other[null] operator[SEP] }
public void modifyingRequest( final String requestId ) { if ( _log.isDebugEnabled() ) { _log.debug( "Registering modifying request: " + requestId ); } incrementOrPut( _blacklist, requestId ); _readOnlyRequests.remove( requestId ); }
class class_name[name] begin[{] method[modifyingRequest, return_type[void], modifier[public], parameter[requestId]] begin[{] if[call[_log.isDebugEnabled, parameter[]]] begin[{] call[_log.debug, parameter[binary_operation[literal["Registering modifying request: "], +, member[.requestId]]]] else begin[{] None end[}] call[.incrementOrPut, parameter[member[._blacklist], member[.requestId]]] call[_readOnlyRequests.remove, parameter[member[.requestId]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[modifyingRequest] operator[SEP] Keyword[final] identifier[String] identifier[requestId] operator[SEP] { Keyword[if] operator[SEP] identifier[_log] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] { identifier[_log] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[+] identifier[requestId] operator[SEP] operator[SEP] } identifier[incrementOrPut] operator[SEP] identifier[_blacklist] , identifier[requestId] operator[SEP] operator[SEP] identifier[_readOnlyRequests] operator[SEP] identifier[remove] operator[SEP] identifier[requestId] operator[SEP] operator[SEP] }
protected void beforeDelivery(final SIBusMessage message, final MessageEndpoint endpoint) throws ResourceException { final String methodName = "beforeDelivery"; if (TRACE.isEntryEnabled()) { SibTr.entry(this, TRACE, methodName, new Object [] { message, endpoint }); } // This will call before delivery on the endpoint beforeDelivery (endpoint); /* * Delete the message under the transaction */ deleteMessage(message, getTransactionForDelete ()); }
class class_name[name] begin[{] method[beforeDelivery, return_type[void], modifier[protected], parameter[message, endpoint]] begin[{] local_variable[type[String], methodName] if[call[TRACE.isEntryEnabled, parameter[]]] begin[{] call[SibTr.entry, parameter[THIS[], member[.TRACE], member[.methodName], ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MemberReference(member=message, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=endpoint, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Object, sub_type=None))]] else begin[{] None end[}] call[.beforeDelivery, parameter[member[.endpoint]]] call[.deleteMessage, parameter[member[.message], call[.getTransactionForDelete, parameter[]]]] end[}] END[}]
Keyword[protected] Keyword[void] identifier[beforeDelivery] operator[SEP] Keyword[final] identifier[SIBusMessage] identifier[message] , Keyword[final] identifier[MessageEndpoint] identifier[endpoint] operator[SEP] Keyword[throws] identifier[ResourceException] { Keyword[final] identifier[String] identifier[methodName] operator[=] literal[String] operator[SEP] Keyword[if] operator[SEP] identifier[TRACE] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] { identifier[SibTr] operator[SEP] identifier[entry] operator[SEP] Keyword[this] , identifier[TRACE] , identifier[methodName] , Keyword[new] identifier[Object] operator[SEP] operator[SEP] { identifier[message] , identifier[endpoint] } operator[SEP] operator[SEP] } identifier[beforeDelivery] operator[SEP] identifier[endpoint] operator[SEP] operator[SEP] identifier[deleteMessage] operator[SEP] identifier[message] , identifier[getTransactionForDelete] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
protected void writeQuerySizeEntry(StringBuilder sb, ExecutionInfo execInfo, List<QueryInfo> queryInfoList) { sb.append("\"querySize\":"); sb.append(queryInfoList.size()); sb.append(", "); }
class class_name[name] begin[{] method[writeQuerySizeEntry, return_type[void], modifier[protected], parameter[sb, execInfo, queryInfoList]] begin[{] call[sb.append, parameter[literal["\"querySize\":"]]] call[sb.append, parameter[call[queryInfoList.size, parameter[]]]] call[sb.append, parameter[literal[", "]]] end[}] END[}]
Keyword[protected] Keyword[void] identifier[writeQuerySizeEntry] operator[SEP] identifier[StringBuilder] identifier[sb] , identifier[ExecutionInfo] identifier[execInfo] , identifier[List] operator[<] identifier[QueryInfo] operator[>] identifier[queryInfoList] operator[SEP] { identifier[sb] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[sb] operator[SEP] identifier[append] operator[SEP] identifier[queryInfoList] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[sb] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] }
protected void writeCache() throws IOException { if (this.cache != null) { byte[] data = this.data == null ? null : this.data.get(); if (data == null) { return; } this.cache.write(resourceId, data); } }
class class_name[name] begin[{] method[writeCache, return_type[void], modifier[protected], parameter[]] begin[{] if[binary_operation[THIS[member[None.cache]], !=, literal[null]]] begin[{] local_variable[type[byte], data] if[binary_operation[member[.data], ==, literal[null]]] begin[{] return[None] else begin[{] None end[}] THIS[member[None.cache]call[None.write, parameter[member[.resourceId], member[.data]]]] else begin[{] None end[}] end[}] END[}]
Keyword[protected] Keyword[void] identifier[writeCache] operator[SEP] operator[SEP] Keyword[throws] identifier[IOException] { Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[cache] operator[!=] Other[null] operator[SEP] { Keyword[byte] operator[SEP] operator[SEP] identifier[data] operator[=] Keyword[this] operator[SEP] identifier[data] operator[==] Other[null] operator[?] Other[null] operator[:] Keyword[this] operator[SEP] identifier[data] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[data] operator[==] Other[null] operator[SEP] { Keyword[return] operator[SEP] } Keyword[this] operator[SEP] identifier[cache] operator[SEP] identifier[write] operator[SEP] identifier[resourceId] , identifier[data] operator[SEP] operator[SEP] } }
public static <T extends Cloneable> ValueHolder<T> withImmutableValue(final T value) { return new ValueHolder<T>(ObjectUtils.clone(value)) { @Override public T getValue() { return ObjectUtils.clone(super.getValue()); } @Override public void setValue(final T value) { super.setValue(ObjectUtils.clone(value)); } }; }
class class_name[name] begin[{] method[withImmutableValue, return_type[type[ValueHolder]], modifier[public static], parameter[value]] begin[{] return[ClassCreator(arguments=[MethodInvocation(arguments=[MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=clone, postfix_operators=[], prefix_operators=[], qualifier=ObjectUtils, selectors=[], type_arguments=None)], body=[MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[ReturnStatement(expression=MethodInvocation(arguments=[SuperMethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None)], member=clone, postfix_operators=[], prefix_operators=[], qualifier=ObjectUtils, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=getValue, parameters=[], return_type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None), throws=None, type_parameters=None), MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[StatementExpression(expression=SuperMethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=clone, postfix_operators=[], prefix_operators=[], qualifier=ObjectUtils, selectors=[], type_arguments=None)], member=setValue, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=setValue, parameters=[FormalParameter(annotations=[], modifiers={'final'}, name=value, type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None), varargs=False)], return_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=T, sub_type=None))], dimensions=None, name=ValueHolder, sub_type=None))] end[}] END[}]
Keyword[public] Keyword[static] operator[<] identifier[T] Keyword[extends] identifier[Cloneable] operator[>] identifier[ValueHolder] operator[<] identifier[T] operator[>] identifier[withImmutableValue] operator[SEP] Keyword[final] identifier[T] identifier[value] operator[SEP] { Keyword[return] Keyword[new] identifier[ValueHolder] operator[<] identifier[T] operator[>] operator[SEP] identifier[ObjectUtils] operator[SEP] identifier[clone] operator[SEP] identifier[value] operator[SEP] operator[SEP] { annotation[@] identifier[Override] Keyword[public] identifier[T] identifier[getValue] operator[SEP] operator[SEP] { Keyword[return] identifier[ObjectUtils] operator[SEP] identifier[clone] operator[SEP] Keyword[super] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[setValue] operator[SEP] Keyword[final] identifier[T] identifier[value] operator[SEP] { Keyword[super] operator[SEP] identifier[setValue] operator[SEP] identifier[ObjectUtils] operator[SEP] identifier[clone] operator[SEP] identifier[value] operator[SEP] operator[SEP] operator[SEP] } } operator[SEP] }
@Override public boolean importGeoPackage(String name, URL url, boolean override, GeoPackageProgress progress) { boolean success = false; HttpURLConnection connection = null; try { connection = (HttpURLConnection) url.openConnection(); connection.connect(); int responseCode = connection.getResponseCode(); if (responseCode == HttpURLConnection.HTTP_MOVED_PERM || responseCode == HttpURLConnection.HTTP_MOVED_TEMP || responseCode == HttpURLConnection.HTTP_SEE_OTHER) { String redirect = connection.getHeaderField("Location"); connection.disconnect(); url = new URL(redirect); connection = (HttpURLConnection) url.openConnection(); connection.connect(); } if (connection.getResponseCode() != HttpURLConnection.HTTP_OK) { throw new GeoPackageException("Failed to import GeoPackage " + name + " from URL: '" + url.toString() + "'. HTTP " + connection.getResponseCode() + " " + connection.getResponseMessage()); } int fileLength = connection.getContentLength(); if (fileLength != -1 && progress != null) { progress.setMax(fileLength); } InputStream geoPackageStream = connection.getInputStream(); success = importGeoPackage(name, override, geoPackageStream, progress); } catch (IOException e) { throw new GeoPackageException("Failed to import GeoPackage " + name + " from URL: '" + url.toString() + "'", e); } finally { if (connection != null) { connection.disconnect(); } } return success; }
class class_name[name] begin[{] method[importGeoPackage, return_type[type[boolean]], modifier[public], parameter[name, url, override, progress]] begin[{] local_variable[type[boolean], success] local_variable[type[HttpURLConnection], connection] TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=connection, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Cast(expression=MethodInvocation(arguments=[], member=openConnection, postfix_operators=[], prefix_operators=[], qualifier=url, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=HttpURLConnection, sub_type=None))), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=connect, postfix_operators=[], prefix_operators=[], qualifier=connection, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getResponseCode, postfix_operators=[], prefix_operators=[], qualifier=connection, selectors=[], type_arguments=None), name=responseCode)], modifiers=set(), type=BasicType(dimensions=[], name=int)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=responseCode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=HTTP_MOVED_PERM, postfix_operators=[], prefix_operators=[], qualifier=HttpURLConnection, selectors=[]), operator===), operandr=BinaryOperation(operandl=MemberReference(member=responseCode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=HTTP_MOVED_TEMP, postfix_operators=[], prefix_operators=[], qualifier=HttpURLConnection, selectors=[]), operator===), operator=||), operandr=BinaryOperation(operandl=MemberReference(member=responseCode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=HTTP_SEE_OTHER, postfix_operators=[], prefix_operators=[], qualifier=HttpURLConnection, selectors=[]), operator===), operator=||), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Location")], member=getHeaderField, postfix_operators=[], prefix_operators=[], qualifier=connection, selectors=[], type_arguments=None), name=redirect)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[], member=disconnect, postfix_operators=[], prefix_operators=[], qualifier=connection, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=url, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[MemberReference(member=redirect, 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=URL, sub_type=None))), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=connection, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Cast(expression=MethodInvocation(arguments=[], member=openConnection, postfix_operators=[], prefix_operators=[], qualifier=url, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=HttpURLConnection, sub_type=None))), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=connect, postfix_operators=[], prefix_operators=[], qualifier=connection, selectors=[], type_arguments=None), label=None)])), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getResponseCode, postfix_operators=[], prefix_operators=[], qualifier=connection, selectors=[], type_arguments=None), operandr=MemberReference(member=HTTP_OK, postfix_operators=[], prefix_operators=[], qualifier=HttpURLConnection, selectors=[]), operator=!=), 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=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Failed to import GeoPackage "), operandr=MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" from URL: '"), operator=+), operandr=MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=url, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="'. HTTP "), operator=+), operandr=MethodInvocation(arguments=[], member=getResponseCode, postfix_operators=[], prefix_operators=[], qualifier=connection, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" "), operator=+), operandr=MethodInvocation(arguments=[], member=getResponseMessage, postfix_operators=[], prefix_operators=[], qualifier=connection, selectors=[], type_arguments=None), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=GeoPackageException, sub_type=None)), label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getContentLength, postfix_operators=[], prefix_operators=[], qualifier=connection, selectors=[], type_arguments=None), name=fileLength)], modifiers=set(), type=BasicType(dimensions=[], name=int)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=fileLength, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=1), operator=!=), operandr=BinaryOperation(operandl=MemberReference(member=progress, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=fileLength, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setMax, postfix_operators=[], prefix_operators=[], qualifier=progress, selectors=[], type_arguments=None), label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getInputStream, postfix_operators=[], prefix_operators=[], qualifier=connection, selectors=[], type_arguments=None), name=geoPackageStream)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=InputStream, sub_type=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=success, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=override, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=geoPackageStream, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=progress, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=importGeoPackage, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Failed to import GeoPackage "), operandr=MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" from URL: '"), operator=+), operandr=MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=url, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="'"), 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=GeoPackageException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IOException']))], finally_block=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=connection, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=disconnect, postfix_operators=[], prefix_operators=[], qualifier=connection, selectors=[], type_arguments=None), label=None)]))], label=None, resources=None) return[member[.success]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[boolean] identifier[importGeoPackage] operator[SEP] identifier[String] identifier[name] , identifier[URL] identifier[url] , Keyword[boolean] identifier[override] , identifier[GeoPackageProgress] identifier[progress] operator[SEP] { Keyword[boolean] identifier[success] operator[=] literal[boolean] operator[SEP] identifier[HttpURLConnection] identifier[connection] operator[=] Other[null] operator[SEP] Keyword[try] { identifier[connection] operator[=] operator[SEP] identifier[HttpURLConnection] operator[SEP] identifier[url] operator[SEP] identifier[openConnection] operator[SEP] operator[SEP] operator[SEP] identifier[connection] operator[SEP] identifier[connect] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[responseCode] operator[=] identifier[connection] operator[SEP] identifier[getResponseCode] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[responseCode] operator[==] identifier[HttpURLConnection] operator[SEP] identifier[HTTP_MOVED_PERM] operator[||] identifier[responseCode] operator[==] identifier[HttpURLConnection] operator[SEP] identifier[HTTP_MOVED_TEMP] operator[||] identifier[responseCode] operator[==] identifier[HttpURLConnection] operator[SEP] identifier[HTTP_SEE_OTHER] operator[SEP] { identifier[String] identifier[redirect] operator[=] identifier[connection] operator[SEP] identifier[getHeaderField] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[connection] operator[SEP] identifier[disconnect] operator[SEP] operator[SEP] operator[SEP] identifier[url] operator[=] Keyword[new] identifier[URL] operator[SEP] identifier[redirect] operator[SEP] operator[SEP] identifier[connection] operator[=] operator[SEP] identifier[HttpURLConnection] operator[SEP] identifier[url] operator[SEP] identifier[openConnection] operator[SEP] operator[SEP] operator[SEP] identifier[connection] operator[SEP] identifier[connect] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[connection] operator[SEP] identifier[getResponseCode] operator[SEP] operator[SEP] operator[!=] identifier[HttpURLConnection] operator[SEP] identifier[HTTP_OK] operator[SEP] { Keyword[throw] Keyword[new] identifier[GeoPackageException] operator[SEP] literal[String] operator[+] identifier[name] operator[+] literal[String] operator[+] identifier[url] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[connection] operator[SEP] identifier[getResponseCode] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[connection] operator[SEP] identifier[getResponseMessage] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[int] identifier[fileLength] operator[=] identifier[connection] operator[SEP] identifier[getContentLength] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[fileLength] operator[!=] operator[-] Other[1] operator[&&] identifier[progress] operator[!=] Other[null] operator[SEP] { identifier[progress] operator[SEP] identifier[setMax] operator[SEP] identifier[fileLength] operator[SEP] operator[SEP] } identifier[InputStream] identifier[geoPackageStream] operator[=] identifier[connection] operator[SEP] identifier[getInputStream] operator[SEP] operator[SEP] operator[SEP] identifier[success] operator[=] identifier[importGeoPackage] operator[SEP] identifier[name] , identifier[override] , identifier[geoPackageStream] , identifier[progress] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[IOException] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[GeoPackageException] operator[SEP] literal[String] operator[+] identifier[name] operator[+] literal[String] operator[+] identifier[url] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[+] literal[String] , identifier[e] operator[SEP] operator[SEP] } Keyword[finally] { Keyword[if] operator[SEP] identifier[connection] operator[!=] Other[null] operator[SEP] { identifier[connection] operator[SEP] identifier[disconnect] operator[SEP] operator[SEP] operator[SEP] } } Keyword[return] identifier[success] operator[SEP] }