code
stringlengths
63
466k
code_sememe
stringlengths
141
3.79M
token_type
stringlengths
274
1.23M
private void updateList(final File filename) { try { final URI reletivePath = toURI(filename.getAbsolutePath().substring(new File(normalize(tempDir.toString())).getPath().length() + 1)); final FileInfo f = job.getOrCreateFileInfo(reletivePath); if (hasConref) { f.hasConref = true; } if (hasKeyref) { f.hasKeyref = true; } job.write(); } catch (final RuntimeException e) { throw e; } catch (final Exception e) { logger.error(e.getMessage(), e) ; } }
class class_name[name] begin[{] method[updateList, return_type[void], modifier[private], parameter[filename]] begin[{] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getAbsolutePath, postfix_operators=[], prefix_operators=[], qualifier=filename, selectors=[MethodInvocation(arguments=[BinaryOperation(operandl=ClassCreator(arguments=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=tempDir, selectors=[], type_arguments=None)], member=normalize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[], member=getPath, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=length, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=File, sub_type=None)), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+)], member=substring, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=toURI, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=reletivePath)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=URI, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=reletivePath, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getOrCreateFileInfo, postfix_operators=[], prefix_operators=[], qualifier=job, selectors=[], type_arguments=None), name=f)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=FileInfo, sub_type=None)), IfStatement(condition=MemberReference(member=hasConref, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=hasConref, postfix_operators=[], prefix_operators=[], qualifier=f, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)), label=None)])), IfStatement(condition=MemberReference(member=hasKeyref, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=hasKeyref, postfix_operators=[], prefix_operators=[], qualifier=f, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[], member=write, postfix_operators=[], prefix_operators=[], qualifier=job, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['RuntimeException'])), CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[private] Keyword[void] identifier[updateList] operator[SEP] Keyword[final] identifier[File] identifier[filename] operator[SEP] { Keyword[try] { Keyword[final] identifier[URI] identifier[reletivePath] operator[=] identifier[toURI] operator[SEP] identifier[filename] operator[SEP] identifier[getAbsolutePath] operator[SEP] operator[SEP] operator[SEP] identifier[substring] operator[SEP] Keyword[new] identifier[File] operator[SEP] identifier[normalize] operator[SEP] identifier[tempDir] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[getPath] operator[SEP] operator[SEP] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[+] Other[1] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[FileInfo] identifier[f] operator[=] identifier[job] operator[SEP] identifier[getOrCreateFileInfo] operator[SEP] identifier[reletivePath] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[hasConref] operator[SEP] { identifier[f] operator[SEP] identifier[hasConref] operator[=] literal[boolean] operator[SEP] } Keyword[if] operator[SEP] identifier[hasKeyref] operator[SEP] { identifier[f] operator[SEP] identifier[hasKeyref] operator[=] literal[boolean] operator[SEP] } identifier[job] operator[SEP] identifier[write] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] Keyword[final] identifier[RuntimeException] identifier[e] operator[SEP] { Keyword[throw] identifier[e] operator[SEP] } Keyword[catch] operator[SEP] Keyword[final] identifier[Exception] identifier[e] operator[SEP] { identifier[logger] operator[SEP] identifier[error] operator[SEP] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP] } }
public static void setParameterValue( PreparedStatement ps, int paramIndex, int sqlType, Object inValue) throws SQLException { setParameterValueInternal(ps, paramIndex, sqlType, null, null, inValue); }
class class_name[name] begin[{] method[setParameterValue, return_type[void], modifier[public static], parameter[ps, paramIndex, sqlType, inValue]] begin[{] call[.setParameterValueInternal, parameter[member[.ps], member[.paramIndex], member[.sqlType], literal[null], literal[null], member[.inValue]]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[setParameterValue] operator[SEP] identifier[PreparedStatement] identifier[ps] , Keyword[int] identifier[paramIndex] , Keyword[int] identifier[sqlType] , identifier[Object] identifier[inValue] operator[SEP] Keyword[throws] identifier[SQLException] { identifier[setParameterValueInternal] operator[SEP] identifier[ps] , identifier[paramIndex] , identifier[sqlType] , Other[null] , Other[null] , identifier[inValue] operator[SEP] operator[SEP] }
private RemoteBundleContext getRemoteBundleContext() { if( m_remoteBundleContext == null ) { long startedTrying = System.currentTimeMillis(); //!! Absolutely necesary for RMI class loading to work // TODO maybe use ContextClassLoaderUtils.doWithClassLoader Thread.currentThread().setContextClassLoader( this.getClass().getClassLoader() ); Throwable reason = null; try { final Registry registry = LocateRegistry.getRegistry( m_rmiPort ); do { try { m_remoteBundleContext = (RemoteBundleContext) registry.lookup( RemoteBundleContext.class.getName() ); } catch( ConnectException e ) { reason = e; } catch( NotBoundException e ) { reason = e; } } while( m_remoteBundleContext == null && ( m_rmiLookupTimeout == Constants.WAIT_FOREVER || System.currentTimeMillis() < startedTrying + m_rmiLookupTimeout ) ); } catch( RemoteException e ) { reason = e; } if( m_remoteBundleContext == null ) { throw new TestContainerException( "Cannot get the remote bundle context", reason ); } LOG.info( "Remote bundle context found after " + ( System.currentTimeMillis() - startedTrying ) + " millis" ); } return m_remoteBundleContext; }
class class_name[name] begin[{] method[getRemoteBundleContext, return_type[type[RemoteBundleContext]], modifier[private], parameter[]] begin[{] if[binary_operation[member[.m_remoteBundleContext], ==, literal[null]]] begin[{] local_variable[type[long], startedTrying] call[Thread.currentThread, parameter[]] local_variable[type[Throwable], reason] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=m_rmiPort, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getRegistry, postfix_operators=[], prefix_operators=[], qualifier=LocateRegistry, selectors=[], type_arguments=None), name=registry)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=Registry, sub_type=None)), DoStatement(body=BlockStatement(label=None, statements=[TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=m_remoteBundleContext, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Cast(expression=MethodInvocation(arguments=[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[], member=getName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=RemoteBundleContext, sub_type=None))], member=lookup, postfix_operators=[], prefix_operators=[], qualifier=registry, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=RemoteBundleContext, sub_type=None))), label=None)], catches=[CatchClause(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=reason, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['ConnectException'])), CatchClause(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=reason, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['NotBoundException']))], finally_block=None, label=None, resources=None)]), condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=m_remoteBundleContext, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), operandr=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=m_rmiLookupTimeout, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=WAIT_FOREVER, postfix_operators=[], prefix_operators=[], qualifier=Constants, selectors=[]), operator===), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[], member=currentTimeMillis, postfix_operators=[], prefix_operators=[], qualifier=System, selectors=[], type_arguments=None), operandr=BinaryOperation(operandl=MemberReference(member=startedTrying, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=m_rmiLookupTimeout, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operator=<), operator=||), operator=&&), label=None)], catches=[CatchClause(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=reason, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['RemoteException']))], finally_block=None, label=None, resources=None) if[binary_operation[member[.m_remoteBundleContext], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Cannot get the remote bundle context"), MemberReference(member=reason, 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=TestContainerException, sub_type=None)), label=None) else begin[{] None end[}] call[LOG.info, parameter[binary_operation[binary_operation[literal["Remote bundle context found after "], +, binary_operation[call[System.currentTimeMillis, parameter[]], -, member[.startedTrying]]], +, literal[" millis"]]]] else begin[{] None end[}] return[member[.m_remoteBundleContext]] end[}] END[}]
Keyword[private] identifier[RemoteBundleContext] identifier[getRemoteBundleContext] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[m_remoteBundleContext] operator[==] Other[null] operator[SEP] { Keyword[long] identifier[startedTrying] operator[=] identifier[System] operator[SEP] identifier[currentTimeMillis] operator[SEP] operator[SEP] operator[SEP] identifier[Thread] operator[SEP] identifier[currentThread] operator[SEP] operator[SEP] operator[SEP] identifier[setContextClassLoader] operator[SEP] Keyword[this] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] identifier[getClassLoader] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[Throwable] identifier[reason] operator[=] Other[null] operator[SEP] Keyword[try] { Keyword[final] identifier[Registry] identifier[registry] operator[=] identifier[LocateRegistry] operator[SEP] identifier[getRegistry] operator[SEP] identifier[m_rmiPort] operator[SEP] operator[SEP] Keyword[do] { Keyword[try] { identifier[m_remoteBundleContext] operator[=] operator[SEP] identifier[RemoteBundleContext] operator[SEP] identifier[registry] operator[SEP] identifier[lookup] operator[SEP] identifier[RemoteBundleContext] operator[SEP] Keyword[class] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[ConnectException] identifier[e] operator[SEP] { identifier[reason] operator[=] identifier[e] operator[SEP] } Keyword[catch] operator[SEP] identifier[NotBoundException] identifier[e] operator[SEP] { identifier[reason] operator[=] identifier[e] operator[SEP] } } Keyword[while] operator[SEP] identifier[m_remoteBundleContext] operator[==] Other[null] operator[&&] operator[SEP] identifier[m_rmiLookupTimeout] operator[==] identifier[Constants] operator[SEP] identifier[WAIT_FOREVER] operator[||] identifier[System] operator[SEP] identifier[currentTimeMillis] operator[SEP] operator[SEP] operator[<] identifier[startedTrying] operator[+] identifier[m_rmiLookupTimeout] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[RemoteException] identifier[e] operator[SEP] { identifier[reason] operator[=] identifier[e] operator[SEP] } Keyword[if] operator[SEP] identifier[m_remoteBundleContext] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[TestContainerException] operator[SEP] literal[String] , identifier[reason] operator[SEP] operator[SEP] } identifier[LOG] operator[SEP] identifier[info] operator[SEP] literal[String] operator[+] operator[SEP] identifier[System] operator[SEP] identifier[currentTimeMillis] operator[SEP] operator[SEP] operator[-] identifier[startedTrying] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] } Keyword[return] identifier[m_remoteBundleContext] operator[SEP] }
@Override public Organization org() { if(org==null) { try { if((org = OrganizationFactory.obtain(env(), user()))==null) { org = Organization.NULL; } } catch (Exception e) { org = Organization.NULL; } } return org; }
class class_name[name] begin[{] method[org, return_type[type[Organization]], modifier[public], parameter[]] begin[{] if[binary_operation[member[.org], ==, literal[null]]] begin[{] TryStatement(block=[IfStatement(condition=BinaryOperation(operandl=Assignment(expressionl=MemberReference(member=org, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=env, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=user, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=obtain, postfix_operators=[], prefix_operators=[], qualifier=OrganizationFactory, selectors=[], type_arguments=None)), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=org, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=NULL, postfix_operators=[], prefix_operators=[], qualifier=Organization, selectors=[])), label=None)]))], catches=[CatchClause(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=org, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=NULL, postfix_operators=[], prefix_operators=[], qualifier=Organization, selectors=[])), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None) else begin[{] None end[}] return[member[.org]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[Organization] identifier[org] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[org] operator[==] Other[null] operator[SEP] { Keyword[try] { Keyword[if] operator[SEP] operator[SEP] identifier[org] operator[=] identifier[OrganizationFactory] operator[SEP] identifier[obtain] operator[SEP] identifier[env] operator[SEP] operator[SEP] , identifier[user] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[==] Other[null] operator[SEP] { identifier[org] operator[=] identifier[Organization] operator[SEP] identifier[NULL] operator[SEP] } } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { identifier[org] operator[=] identifier[Organization] operator[SEP] identifier[NULL] operator[SEP] } } Keyword[return] identifier[org] operator[SEP] }
public static void scale( double alpha , DMatrixD1 a ) { // on very small matrices (2 by 2) the call to getNumElements() can slow it down // slightly compared to other libraries since it involves an extra multiplication. final int size = a.getNumElements(); for( int i = 0; i < size; i++ ) { a.data[i] *= alpha; } }
class class_name[name] begin[{] method[scale, return_type[void], modifier[public static], parameter[alpha, a]] begin[{] local_variable[type[int], size] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=data, postfix_operators=[], prefix_operators=[], qualifier=a, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type=*=, value=MemberReference(member=alpha, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=size, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[scale] operator[SEP] Keyword[double] identifier[alpha] , identifier[DMatrixD1] identifier[a] operator[SEP] { Keyword[final] Keyword[int] identifier[size] operator[=] identifier[a] operator[SEP] identifier[getNumElements] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[size] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[a] operator[SEP] identifier[data] operator[SEP] identifier[i] operator[SEP] operator[*=] identifier[alpha] operator[SEP] } }
public JsonPath param(String key, Object value) { JsonPath newP = new JsonPath(this, config); if (newP.params == null) { newP.params = new HashMap<String, Object>(); } newP.params.put(key, value); return newP; }
class class_name[name] begin[{] method[param, return_type[type[JsonPath]], modifier[public], parameter[key, value]] begin[{] local_variable[type[JsonPath], newP] if[binary_operation[member[newP.params], ==, literal[null]]] begin[{] assign[member[newP.params], 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))] else begin[{] None end[}] call[newP.params.put, parameter[member[.key], member[.value]]] return[member[.newP]] end[}] END[}]
Keyword[public] identifier[JsonPath] identifier[param] operator[SEP] identifier[String] identifier[key] , identifier[Object] identifier[value] operator[SEP] { identifier[JsonPath] identifier[newP] operator[=] Keyword[new] identifier[JsonPath] operator[SEP] Keyword[this] , identifier[config] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[newP] operator[SEP] identifier[params] operator[==] Other[null] operator[SEP] { identifier[newP] operator[SEP] identifier[params] operator[=] Keyword[new] identifier[HashMap] operator[<] identifier[String] , identifier[Object] operator[>] operator[SEP] operator[SEP] operator[SEP] } identifier[newP] operator[SEP] identifier[params] operator[SEP] identifier[put] operator[SEP] identifier[key] , identifier[value] operator[SEP] operator[SEP] Keyword[return] identifier[newP] operator[SEP] }
public void report(LintLogger logger) { if (currentPos == IMMEDIATE_POSITION) { logger.report(); } else { ListBuffer<LintLogger> loggers = loggersQueue.get(currentPos); if (loggers == null) { loggersQueue.put(currentPos, loggers = new ListBuffer<>()); } loggers.append(logger); } }
class class_name[name] begin[{] method[report, return_type[void], modifier[public], parameter[logger]] begin[{] if[binary_operation[member[.currentPos], ==, member[.IMMEDIATE_POSITION]]] begin[{] call[logger.report, parameter[]] else begin[{] local_variable[type[ListBuffer], loggers] if[binary_operation[member[.loggers], ==, literal[null]]] begin[{] call[loggersQueue.put, parameter[member[.currentPos], assign[member[.loggers], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=ListBuffer, sub_type=None))]]] else begin[{] None end[}] call[loggers.append, parameter[member[.logger]]] end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[report] operator[SEP] identifier[LintLogger] identifier[logger] operator[SEP] { Keyword[if] operator[SEP] identifier[currentPos] operator[==] identifier[IMMEDIATE_POSITION] operator[SEP] { identifier[logger] operator[SEP] identifier[report] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[ListBuffer] operator[<] identifier[LintLogger] operator[>] identifier[loggers] operator[=] identifier[loggersQueue] operator[SEP] identifier[get] operator[SEP] identifier[currentPos] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[loggers] operator[==] Other[null] operator[SEP] { identifier[loggersQueue] operator[SEP] identifier[put] operator[SEP] identifier[currentPos] , identifier[loggers] operator[=] Keyword[new] identifier[ListBuffer] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[loggers] operator[SEP] identifier[append] operator[SEP] identifier[logger] operator[SEP] operator[SEP] } }
private List<Coordinate> sortY(List<Coordinate> coordinates) { List<Coordinate> sorted = new ArrayList<Coordinate>(coordinates); Collections.sort(sorted, new YComparator()); return sorted; }
class class_name[name] begin[{] method[sortY, return_type[type[List]], modifier[private], parameter[coordinates]] begin[{] local_variable[type[List], sorted] call[Collections.sort, parameter[member[.sorted], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=YComparator, sub_type=None))]] return[member[.sorted]] end[}] END[}]
Keyword[private] identifier[List] operator[<] identifier[Coordinate] operator[>] identifier[sortY] operator[SEP] identifier[List] operator[<] identifier[Coordinate] operator[>] identifier[coordinates] operator[SEP] { identifier[List] operator[<] identifier[Coordinate] operator[>] identifier[sorted] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[Coordinate] operator[>] operator[SEP] identifier[coordinates] operator[SEP] operator[SEP] identifier[Collections] operator[SEP] identifier[sort] operator[SEP] identifier[sorted] , Keyword[new] identifier[YComparator] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[sorted] operator[SEP] }
public synchronized final void initialize() throws RepositoryException { if (!initialized) { try { doInitialize(); initialized = true; } catch (RuntimeException e) { throw new RepositoryException(e); } } }
class class_name[name] begin[{] method[initialize, return_type[void], modifier[synchronized final public], parameter[]] begin[{] if[member[.initialized]] begin[{] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=doInitialize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=initialized, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=RepositoryException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['RuntimeException']))], finally_block=None, label=None, resources=None) else begin[{] None end[}] end[}] END[}]
Keyword[public] Keyword[synchronized] Keyword[final] Keyword[void] identifier[initialize] operator[SEP] operator[SEP] Keyword[throws] identifier[RepositoryException] { Keyword[if] operator[SEP] operator[!] identifier[initialized] operator[SEP] { Keyword[try] { identifier[doInitialize] operator[SEP] operator[SEP] operator[SEP] identifier[initialized] operator[=] literal[boolean] operator[SEP] } Keyword[catch] operator[SEP] identifier[RuntimeException] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[RepositoryException] operator[SEP] identifier[e] operator[SEP] operator[SEP] } } }
public String getKeyByIndex(int index) { Set<String> keySet = keyIndexs.keySet(); for (String key : keySet) { int idx = keyIndexs.get(key); if (index == idx) { return key; } } return null; }
class class_name[name] begin[{] method[getKeyByIndex, return_type[type[String]], modifier[public], parameter[index]] begin[{] local_variable[type[Set], keySet] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=keyIndexs, selectors=[], type_arguments=None), name=idx)], modifiers=set(), type=BasicType(dimensions=[], name=int)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=idx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=keySet, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=key)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None) return[literal[null]] end[}] END[}]
Keyword[public] identifier[String] identifier[getKeyByIndex] operator[SEP] Keyword[int] identifier[index] operator[SEP] { identifier[Set] operator[<] identifier[String] operator[>] identifier[keySet] operator[=] identifier[keyIndexs] operator[SEP] identifier[keySet] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[String] identifier[key] operator[:] identifier[keySet] operator[SEP] { Keyword[int] identifier[idx] operator[=] identifier[keyIndexs] operator[SEP] identifier[get] operator[SEP] identifier[key] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[index] operator[==] identifier[idx] operator[SEP] { Keyword[return] identifier[key] operator[SEP] } } Keyword[return] Other[null] operator[SEP] }
public static String postResponseAsString(String uri, Header header, HttpEntity httpEntity) { HttpPost httpPost = new HttpPost(uri); httpPost.setHeader(header); httpPost.setEntity(httpEntity); return request(httpPost); }
class class_name[name] begin[{] method[postResponseAsString, return_type[type[String]], modifier[public static], parameter[uri, header, httpEntity]] begin[{] local_variable[type[HttpPost], httpPost] call[httpPost.setHeader, parameter[member[.header]]] call[httpPost.setEntity, parameter[member[.httpEntity]]] return[call[.request, parameter[member[.httpPost]]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[String] identifier[postResponseAsString] operator[SEP] identifier[String] identifier[uri] , identifier[Header] identifier[header] , identifier[HttpEntity] identifier[httpEntity] operator[SEP] { identifier[HttpPost] identifier[httpPost] operator[=] Keyword[new] identifier[HttpPost] operator[SEP] identifier[uri] operator[SEP] operator[SEP] identifier[httpPost] operator[SEP] identifier[setHeader] operator[SEP] identifier[header] operator[SEP] operator[SEP] identifier[httpPost] operator[SEP] identifier[setEntity] operator[SEP] identifier[httpEntity] operator[SEP] operator[SEP] Keyword[return] identifier[request] operator[SEP] identifier[httpPost] operator[SEP] operator[SEP] }
public double scoreTB(IntDependency dependency) { return op.testOptions.depWeight * Math.log(probTB(dependency)); }
class class_name[name] begin[{] method[scoreTB, return_type[type[double]], modifier[public], parameter[dependency]] begin[{] return[binary_operation[member[op.testOptions.depWeight], *, call[Math.log, parameter[call[.probTB, parameter[member[.dependency]]]]]]] end[}] END[}]
Keyword[public] Keyword[double] identifier[scoreTB] operator[SEP] identifier[IntDependency] identifier[dependency] operator[SEP] { Keyword[return] identifier[op] operator[SEP] identifier[testOptions] operator[SEP] identifier[depWeight] operator[*] identifier[Math] operator[SEP] identifier[log] operator[SEP] identifier[probTB] operator[SEP] identifier[dependency] operator[SEP] operator[SEP] operator[SEP] }
public void updateComputeNodeUser(String poolId, String nodeId, String userName, String sshPublicKey) throws BatchErrorException, IOException { updateComputeNodeUser(poolId, nodeId, userName, sshPublicKey, (Iterable<BatchClientBehavior>) null); }
class class_name[name] begin[{] method[updateComputeNodeUser, return_type[void], modifier[public], parameter[poolId, nodeId, userName, sshPublicKey]] begin[{] call[.updateComputeNodeUser, parameter[member[.poolId], member[.nodeId], member[.userName], member[.sshPublicKey], Cast(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=BatchClientBehavior, sub_type=None))], dimensions=[], name=Iterable, sub_type=None))]] end[}] END[}]
Keyword[public] Keyword[void] identifier[updateComputeNodeUser] operator[SEP] identifier[String] identifier[poolId] , identifier[String] identifier[nodeId] , identifier[String] identifier[userName] , identifier[String] identifier[sshPublicKey] operator[SEP] Keyword[throws] identifier[BatchErrorException] , identifier[IOException] { identifier[updateComputeNodeUser] operator[SEP] identifier[poolId] , identifier[nodeId] , identifier[userName] , identifier[sshPublicKey] , operator[SEP] identifier[Iterable] operator[<] identifier[BatchClientBehavior] operator[>] operator[SEP] Other[null] operator[SEP] operator[SEP] }
public void apply(Vector x, int i1, int i2) { double temp = c * x.get(i1) + s * x.get(i2); x.set(i2, -s * x.get(i1) + c * x.get(i2)); x.set(i1, temp); }
class class_name[name] begin[{] method[apply, return_type[void], modifier[public], parameter[x, i1, i2]] begin[{] local_variable[type[double], temp] call[x.set, parameter[member[.i2], binary_operation[binary_operation[member[.s], *, call[x.get, parameter[member[.i1]]]], +, binary_operation[member[.c], *, call[x.get, parameter[member[.i2]]]]]]] call[x.set, parameter[member[.i1], member[.temp]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[apply] operator[SEP] identifier[Vector] identifier[x] , Keyword[int] identifier[i1] , Keyword[int] identifier[i2] operator[SEP] { Keyword[double] identifier[temp] operator[=] identifier[c] operator[*] identifier[x] operator[SEP] identifier[get] operator[SEP] identifier[i1] operator[SEP] operator[+] identifier[s] operator[*] identifier[x] operator[SEP] identifier[get] operator[SEP] identifier[i2] operator[SEP] operator[SEP] identifier[x] operator[SEP] identifier[set] operator[SEP] identifier[i2] , operator[-] identifier[s] operator[*] identifier[x] operator[SEP] identifier[get] operator[SEP] identifier[i1] operator[SEP] operator[+] identifier[c] operator[*] identifier[x] operator[SEP] identifier[get] operator[SEP] identifier[i2] operator[SEP] operator[SEP] operator[SEP] identifier[x] operator[SEP] identifier[set] operator[SEP] identifier[i1] , identifier[temp] operator[SEP] operator[SEP] }
public UnicodeSet compact() { checkFrozen(); if (len != list.length) { int[] temp = new int[len]; System.arraycopy(list, 0, temp, 0, len); list = temp; } rangeList = null; buffer = null; return this; }
class class_name[name] begin[{] method[compact, return_type[type[UnicodeSet]], modifier[public], parameter[]] begin[{] call[.checkFrozen, parameter[]] if[binary_operation[member[.len], !=, member[list.length]]] begin[{] local_variable[type[int], temp] call[System.arraycopy, parameter[member[.list], literal[0], member[.temp], literal[0], member[.len]]] assign[member[.list], member[.temp]] else begin[{] None end[}] assign[member[.rangeList], literal[null]] assign[member[.buffer], literal[null]] return[THIS[]] end[}] END[}]
Keyword[public] identifier[UnicodeSet] identifier[compact] operator[SEP] operator[SEP] { identifier[checkFrozen] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[len] operator[!=] identifier[list] operator[SEP] identifier[length] operator[SEP] { Keyword[int] operator[SEP] operator[SEP] identifier[temp] operator[=] Keyword[new] Keyword[int] operator[SEP] identifier[len] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[arraycopy] operator[SEP] identifier[list] , Other[0] , identifier[temp] , Other[0] , identifier[len] operator[SEP] operator[SEP] identifier[list] operator[=] identifier[temp] operator[SEP] } identifier[rangeList] operator[=] Other[null] operator[SEP] identifier[buffer] operator[=] Other[null] operator[SEP] Keyword[return] Keyword[this] operator[SEP] }
public static <T extends java.util.Date> T setHours(final T date, final int amount) { return set(date, Calendar.HOUR_OF_DAY, amount); }
class class_name[name] begin[{] method[setHours, return_type[type[T]], modifier[public static], parameter[date, amount]] begin[{] return[call[.set, parameter[member[.date], member[Calendar.HOUR_OF_DAY], member[.amount]]]] end[}] END[}]
Keyword[public] Keyword[static] operator[<] identifier[T] Keyword[extends] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[Date] operator[>] identifier[T] identifier[setHours] operator[SEP] Keyword[final] identifier[T] identifier[date] , Keyword[final] Keyword[int] identifier[amount] operator[SEP] { Keyword[return] identifier[set] operator[SEP] identifier[date] , identifier[Calendar] operator[SEP] identifier[HOUR_OF_DAY] , identifier[amount] operator[SEP] operator[SEP] }
public ServiceCall<Configuration> updateConfiguration(UpdateConfigurationOptions updateConfigurationOptions) { Validator.notNull(updateConfigurationOptions, "updateConfigurationOptions cannot be null"); String[] pathSegments = { "v1/environments", "configurations" }; String[] pathParameters = { updateConfigurationOptions.environmentId(), updateConfigurationOptions .configurationId() }; RequestBuilder builder = RequestBuilder.put(RequestBuilder.constructHttpUrl(getEndPoint(), pathSegments, pathParameters)); builder.query("version", versionDate); Map<String, String> sdkHeaders = SdkCommon.getSdkHeaders("discovery", "v1", "updateConfiguration"); for (Entry<String, String> header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); final JsonObject contentJson = new JsonObject(); contentJson.addProperty("name", updateConfigurationOptions.name()); if (updateConfigurationOptions.description() != null) { contentJson.addProperty("description", updateConfigurationOptions.description()); } if (updateConfigurationOptions.conversions() != null) { contentJson.add("conversions", GsonSingleton.getGson().toJsonTree(updateConfigurationOptions.conversions())); } if (updateConfigurationOptions.enrichments() != null) { contentJson.add("enrichments", GsonSingleton.getGson().toJsonTree(updateConfigurationOptions.enrichments())); } if (updateConfigurationOptions.normalizations() != null) { contentJson.add("normalizations", GsonSingleton.getGson().toJsonTree(updateConfigurationOptions .normalizations())); } if (updateConfigurationOptions.source() != null) { contentJson.add("source", GsonSingleton.getGson().toJsonTree(updateConfigurationOptions.source())); } builder.bodyJson(contentJson); return createServiceCall(builder.build(), ResponseConverterUtils.getObject(Configuration.class)); }
class class_name[name] begin[{] method[updateConfiguration, return_type[type[ServiceCall]], modifier[public], parameter[updateConfigurationOptions]] begin[{] call[Validator.notNull, parameter[member[.updateConfigurationOptions], literal["updateConfigurationOptions cannot be null"]]] local_variable[type[String], pathSegments] local_variable[type[String], pathParameters] local_variable[type[RequestBuilder], builder] call[builder.query, parameter[literal["version"], member[.versionDate]]] local_variable[type[Map], sdkHeaders] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getKey, 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=header, postfix_operators=[], prefix_operators=[], qualifier=builder, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=entrySet, postfix_operators=[], prefix_operators=[], qualifier=sdkHeaders, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=header)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=[], name=Entry, sub_type=None))), label=None) call[builder.header, parameter[literal["Accept"], literal["application/json"]]] local_variable[type[JsonObject], contentJson] call[contentJson.addProperty, parameter[literal["name"], call[updateConfigurationOptions.name, parameter[]]]] if[binary_operation[call[updateConfigurationOptions.description, parameter[]], !=, literal[null]]] begin[{] call[contentJson.addProperty, parameter[literal["description"], call[updateConfigurationOptions.description, parameter[]]]] else begin[{] None end[}] if[binary_operation[call[updateConfigurationOptions.conversions, parameter[]], !=, literal[null]]] begin[{] call[contentJson.add, parameter[literal["conversions"], call[GsonSingleton.getGson, parameter[]]]] else begin[{] None end[}] if[binary_operation[call[updateConfigurationOptions.enrichments, parameter[]], !=, literal[null]]] begin[{] call[contentJson.add, parameter[literal["enrichments"], call[GsonSingleton.getGson, parameter[]]]] else begin[{] None end[}] if[binary_operation[call[updateConfigurationOptions.normalizations, parameter[]], !=, literal[null]]] begin[{] call[contentJson.add, parameter[literal["normalizations"], call[GsonSingleton.getGson, parameter[]]]] else begin[{] None end[}] if[binary_operation[call[updateConfigurationOptions.source, parameter[]], !=, literal[null]]] begin[{] call[contentJson.add, parameter[literal["source"], call[GsonSingleton.getGson, parameter[]]]] else begin[{] None end[}] call[builder.bodyJson, parameter[member[.contentJson]]] return[call[.createServiceCall, parameter[call[builder.build, parameter[]], call[ResponseConverterUtils.getObject, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Configuration, sub_type=None))]]]]] end[}] END[}]
Keyword[public] identifier[ServiceCall] operator[<] identifier[Configuration] operator[>] identifier[updateConfiguration] operator[SEP] identifier[UpdateConfigurationOptions] identifier[updateConfigurationOptions] operator[SEP] { identifier[Validator] operator[SEP] identifier[notNull] operator[SEP] identifier[updateConfigurationOptions] , literal[String] operator[SEP] operator[SEP] identifier[String] operator[SEP] operator[SEP] identifier[pathSegments] operator[=] { literal[String] , literal[String] } operator[SEP] identifier[String] operator[SEP] operator[SEP] identifier[pathParameters] operator[=] { identifier[updateConfigurationOptions] operator[SEP] identifier[environmentId] operator[SEP] operator[SEP] , identifier[updateConfigurationOptions] operator[SEP] identifier[configurationId] operator[SEP] operator[SEP] } operator[SEP] identifier[RequestBuilder] identifier[builder] operator[=] identifier[RequestBuilder] operator[SEP] identifier[put] operator[SEP] identifier[RequestBuilder] operator[SEP] identifier[constructHttpUrl] operator[SEP] identifier[getEndPoint] operator[SEP] operator[SEP] , identifier[pathSegments] , identifier[pathParameters] operator[SEP] operator[SEP] operator[SEP] identifier[builder] operator[SEP] identifier[query] operator[SEP] literal[String] , identifier[versionDate] operator[SEP] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[sdkHeaders] operator[=] identifier[SdkCommon] operator[SEP] identifier[getSdkHeaders] operator[SEP] literal[String] , literal[String] , literal[String] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Entry] operator[<] identifier[String] , identifier[String] operator[>] identifier[header] operator[:] identifier[sdkHeaders] operator[SEP] identifier[entrySet] operator[SEP] operator[SEP] operator[SEP] { identifier[builder] operator[SEP] identifier[header] operator[SEP] identifier[header] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] , identifier[header] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[builder] operator[SEP] identifier[header] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] Keyword[final] identifier[JsonObject] identifier[contentJson] operator[=] Keyword[new] identifier[JsonObject] operator[SEP] operator[SEP] operator[SEP] identifier[contentJson] operator[SEP] identifier[addProperty] operator[SEP] literal[String] , identifier[updateConfigurationOptions] operator[SEP] identifier[name] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[updateConfigurationOptions] operator[SEP] identifier[description] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] { identifier[contentJson] operator[SEP] identifier[addProperty] operator[SEP] literal[String] , identifier[updateConfigurationOptions] operator[SEP] identifier[description] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[updateConfigurationOptions] operator[SEP] identifier[conversions] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] { identifier[contentJson] operator[SEP] identifier[add] operator[SEP] literal[String] , identifier[GsonSingleton] operator[SEP] identifier[getGson] operator[SEP] operator[SEP] operator[SEP] identifier[toJsonTree] operator[SEP] identifier[updateConfigurationOptions] operator[SEP] identifier[conversions] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[updateConfigurationOptions] operator[SEP] identifier[enrichments] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] { identifier[contentJson] operator[SEP] identifier[add] operator[SEP] literal[String] , identifier[GsonSingleton] operator[SEP] identifier[getGson] operator[SEP] operator[SEP] operator[SEP] identifier[toJsonTree] operator[SEP] identifier[updateConfigurationOptions] operator[SEP] identifier[enrichments] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[updateConfigurationOptions] operator[SEP] identifier[normalizations] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] { identifier[contentJson] operator[SEP] identifier[add] operator[SEP] literal[String] , identifier[GsonSingleton] operator[SEP] identifier[getGson] operator[SEP] operator[SEP] operator[SEP] identifier[toJsonTree] operator[SEP] identifier[updateConfigurationOptions] operator[SEP] identifier[normalizations] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[updateConfigurationOptions] operator[SEP] identifier[source] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] { identifier[contentJson] operator[SEP] identifier[add] operator[SEP] literal[String] , identifier[GsonSingleton] operator[SEP] identifier[getGson] operator[SEP] operator[SEP] operator[SEP] identifier[toJsonTree] operator[SEP] identifier[updateConfigurationOptions] operator[SEP] identifier[source] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[builder] operator[SEP] identifier[bodyJson] operator[SEP] identifier[contentJson] operator[SEP] operator[SEP] Keyword[return] identifier[createServiceCall] operator[SEP] identifier[builder] operator[SEP] identifier[build] operator[SEP] operator[SEP] , identifier[ResponseConverterUtils] operator[SEP] identifier[getObject] operator[SEP] identifier[Configuration] operator[SEP] Keyword[class] operator[SEP] operator[SEP] operator[SEP] }
public static RandomVariable getSwapAnnuity(TimeDiscretization tenor, ForwardCurveInterface forwardCurve) { return getSwapAnnuity(new RegularSchedule(tenor), forwardCurve); }
class class_name[name] begin[{] method[getSwapAnnuity, return_type[type[RandomVariable]], modifier[public static], parameter[tenor, forwardCurve]] begin[{] return[call[.getSwapAnnuity, parameter[ClassCreator(arguments=[MemberReference(member=tenor, 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=RegularSchedule, sub_type=None)), member[.forwardCurve]]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[RandomVariable] identifier[getSwapAnnuity] operator[SEP] identifier[TimeDiscretization] identifier[tenor] , identifier[ForwardCurveInterface] identifier[forwardCurve] operator[SEP] { Keyword[return] identifier[getSwapAnnuity] operator[SEP] Keyword[new] identifier[RegularSchedule] operator[SEP] identifier[tenor] operator[SEP] , identifier[forwardCurve] operator[SEP] operator[SEP] }
@Override public final String unescapeXml(final String pSource) throws Exception { StringBuffer sb = new StringBuffer(); StringBuffer sbEsc = new StringBuffer(); boolean isStartEsc = false; for (int i = 0; i < pSource.length(); i++) { char ch = pSource.charAt(i); if (!isStartEsc && ch == '&') { isStartEsc = true; sbEsc.append(ch); continue; } else if (isStartEsc) { sbEsc.append(ch); if (ch == ';') { sb.append(xmlUnescape(sbEsc.toString())); sbEsc.delete(0, sbEsc.length()); isStartEsc = false; } } else { sb.append(ch); } } return sb.toString(); }
class class_name[name] begin[{] method[unescapeXml, return_type[type[String]], modifier[final public], parameter[pSource]] begin[{] local_variable[type[StringBuffer], sb] local_variable[type[StringBuffer], sbEsc] local_variable[type[boolean], isStartEsc] 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=pSource, selectors=[], type_arguments=None), name=ch)], modifiers=set(), type=BasicType(dimensions=[], name=char)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=isStartEsc, postfix_operators=[], prefix_operators=['!'], qualifier=, selectors=[]), operandr=BinaryOperation(operandl=MemberReference(member=ch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='&'), operator===), operator=&&), else_statement=IfStatement(condition=MemberReference(member=isStartEsc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=ch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=append, postfix_operators=[], prefix_operators=[], qualifier=sb, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=ch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=append, postfix_operators=[], prefix_operators=[], qualifier=sbEsc, selectors=[], type_arguments=None), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=ch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=';'), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=sbEsc, selectors=[], type_arguments=None)], member=xmlUnescape, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=append, postfix_operators=[], prefix_operators=[], qualifier=sb, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=sbEsc, selectors=[], type_arguments=None)], member=delete, postfix_operators=[], prefix_operators=[], qualifier=sbEsc, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=isStartEsc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)), label=None)]))])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=isStartEsc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=ch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=append, postfix_operators=[], prefix_operators=[], qualifier=sbEsc, selectors=[], type_arguments=None), label=None), ContinueStatement(goto=None, 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=pSource, 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[call[sb.toString, parameter[]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[final] identifier[String] identifier[unescapeXml] operator[SEP] Keyword[final] identifier[String] identifier[pSource] operator[SEP] Keyword[throws] identifier[Exception] { identifier[StringBuffer] identifier[sb] operator[=] Keyword[new] identifier[StringBuffer] operator[SEP] operator[SEP] operator[SEP] identifier[StringBuffer] identifier[sbEsc] operator[=] Keyword[new] identifier[StringBuffer] operator[SEP] operator[SEP] operator[SEP] Keyword[boolean] identifier[isStartEsc] operator[=] literal[boolean] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[pSource] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[++] operator[SEP] { Keyword[char] identifier[ch] operator[=] identifier[pSource] operator[SEP] identifier[charAt] operator[SEP] identifier[i] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[isStartEsc] operator[&&] identifier[ch] operator[==] literal[String] operator[SEP] { identifier[isStartEsc] operator[=] literal[boolean] operator[SEP] identifier[sbEsc] operator[SEP] identifier[append] operator[SEP] identifier[ch] operator[SEP] operator[SEP] Keyword[continue] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[isStartEsc] operator[SEP] { identifier[sbEsc] operator[SEP] identifier[append] operator[SEP] identifier[ch] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[ch] operator[==] literal[String] operator[SEP] { identifier[sb] operator[SEP] identifier[append] operator[SEP] identifier[xmlUnescape] operator[SEP] identifier[sbEsc] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[sbEsc] operator[SEP] identifier[delete] operator[SEP] Other[0] , identifier[sbEsc] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[isStartEsc] operator[=] literal[boolean] operator[SEP] } } Keyword[else] { identifier[sb] operator[SEP] identifier[append] operator[SEP] identifier[ch] operator[SEP] operator[SEP] } } Keyword[return] identifier[sb] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] }
public static IParsedElement boundingParent( List<IParseTree> locations, int position, Class<? extends IParsedElement>... possibleTypes ) { IParseTree location = IParseTree.Search.getDeepestLocation( locations, position, true ); IParsedElement pe = null; if( location != null ) { pe = location.getParsedElement(); while( pe != null && !isOneOfTypes( pe, possibleTypes ) ) { pe = pe.getParent(); } } return pe; }
class class_name[name] begin[{] method[boundingParent, return_type[type[IParsedElement]], modifier[public static], parameter[locations, position, possibleTypes]] begin[{] local_variable[type[IParseTree], location] local_variable[type[IParsedElement], pe] if[binary_operation[member[.location], !=, literal[null]]] begin[{] assign[member[.pe], call[location.getParsedElement, parameter[]]] while[binary_operation[binary_operation[member[.pe], !=, literal[null]], &&, call[.isOneOfTypes, parameter[member[.pe], member[.possibleTypes]]]]] begin[{] assign[member[.pe], call[pe.getParent, parameter[]]] end[}] else begin[{] None end[}] return[member[.pe]] end[}] END[}]
Keyword[public] Keyword[static] identifier[IParsedElement] identifier[boundingParent] operator[SEP] identifier[List] operator[<] identifier[IParseTree] operator[>] identifier[locations] , Keyword[int] identifier[position] , identifier[Class] operator[<] operator[?] Keyword[extends] identifier[IParsedElement] operator[>] operator[...] identifier[possibleTypes] operator[SEP] { identifier[IParseTree] identifier[location] operator[=] identifier[IParseTree] operator[SEP] identifier[Search] operator[SEP] identifier[getDeepestLocation] operator[SEP] identifier[locations] , identifier[position] , literal[boolean] operator[SEP] operator[SEP] identifier[IParsedElement] identifier[pe] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[location] operator[!=] Other[null] operator[SEP] { identifier[pe] operator[=] identifier[location] operator[SEP] identifier[getParsedElement] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[pe] operator[!=] Other[null] operator[&&] operator[!] identifier[isOneOfTypes] operator[SEP] identifier[pe] , identifier[possibleTypes] operator[SEP] operator[SEP] { identifier[pe] operator[=] identifier[pe] operator[SEP] identifier[getParent] operator[SEP] operator[SEP] operator[SEP] } } Keyword[return] identifier[pe] operator[SEP] }
@Override public Optional<Property.Builder> getPropertyNames( TypeElement valueType, ExecutableElement method) { boolean declaredOnValueType = method.getEnclosingElement().equals(valueType); String name = method.getSimpleName().toString(); Matcher getterMatcher = GETTER_PATTERN.matcher(name); if (!getterMatcher.matches()) { if (declaredOnValueType) { messager.printMessage( ERROR, "Only getter methods (starting with '" + GET_PREFIX + "' or '" + IS_PREFIX + "') may be declared abstract on FreeBuilder types", method); } else { printNoImplementationMessage(valueType, method); } return Optional.empty(); } String prefix = getterMatcher.group(1); String capitalizedName = getterMatcher.group(2); if (hasUpperCase(capitalizedName.codePointAt(0))) { if (declaredOnValueType) { String message = new StringBuilder() .append("Getter methods cannot have a lowercase character immediately after the '") .append(prefix) .append("' prefix on FreeBuilder types (did you mean '") .append(prefix) .appendCodePoint(Character.toUpperCase(capitalizedName.codePointAt(0))) .append(capitalizedName.substring(capitalizedName.offsetByCodePoints(0, 1))) .append("'?)") .toString(); messager.printMessage(ERROR, message, method); } else { printNoImplementationMessage(valueType, method); } return Optional.empty(); } TypeMirror returnType = getReturnType(valueType, method, types); if (returnType.getKind() == TypeKind.VOID) { if (declaredOnValueType) { messager.printMessage( ERROR, "Getter methods must not be void on FreeBuilder types", method); } else { printNoImplementationMessage(valueType, method); } return Optional.empty(); } if (prefix.equals(IS_PREFIX) && (returnType.getKind() != TypeKind.BOOLEAN)) { if (declaredOnValueType) { messager.printMessage( ERROR, "Getter methods starting with '" + IS_PREFIX + "' must return a boolean on FreeBuilder types", method); } else { printNoImplementationMessage(valueType, method); } return Optional.empty(); } if (!method.getParameters().isEmpty()) { if (declaredOnValueType) { messager.printMessage( ERROR, "Getter methods cannot take parameters on FreeBuilder types", method); } else { printNoImplementationMessage(valueType, method); } return Optional.empty(); } if (!isLegalType(returnType)) { // The compiler should already have issued an error. return Optional.empty(); } String camelCaseName = Introspector.decapitalize(capitalizedName); return Optional.of(new Property.Builder() .setUsingBeanConvention(true) .setName(camelCaseName) .setCapitalizedName(capitalizedName) .setGetterName(getterMatcher.group(0))); }
class class_name[name] begin[{] method[getPropertyNames, return_type[type[Optional]], modifier[public], parameter[valueType, method]] begin[{] local_variable[type[boolean], declaredOnValueType] local_variable[type[String], name] local_variable[type[Matcher], getterMatcher] if[call[getterMatcher.matches, parameter[]]] begin[{] if[member[.declaredOnValueType]] begin[{] call[messager.printMessage, parameter[member[.ERROR], binary_operation[binary_operation[binary_operation[binary_operation[literal["Only getter methods (starting with '"], +, member[.GET_PREFIX]], +, literal["' or '"]], +, member[.IS_PREFIX]], +, literal["') may be declared abstract on FreeBuilder types"]], member[.method]]] else begin[{] call[.printNoImplementationMessage, parameter[member[.valueType], member[.method]]] end[}] return[call[Optional.empty, parameter[]]] else begin[{] None end[}] local_variable[type[String], prefix] local_variable[type[String], capitalizedName] if[call[.hasUpperCase, parameter[call[capitalizedName.codePointAt, parameter[literal[0]]]]]] begin[{] if[member[.declaredOnValueType]] begin[{] local_variable[type[String], message] call[messager.printMessage, parameter[member[.ERROR], member[.message], member[.method]]] else begin[{] call[.printNoImplementationMessage, parameter[member[.valueType], member[.method]]] end[}] return[call[Optional.empty, parameter[]]] else begin[{] None end[}] local_variable[type[TypeMirror], returnType] if[binary_operation[call[returnType.getKind, parameter[]], ==, member[TypeKind.VOID]]] begin[{] if[member[.declaredOnValueType]] begin[{] call[messager.printMessage, parameter[member[.ERROR], literal["Getter methods must not be void on FreeBuilder types"], member[.method]]] else begin[{] call[.printNoImplementationMessage, parameter[member[.valueType], member[.method]]] end[}] return[call[Optional.empty, parameter[]]] else begin[{] None end[}] if[binary_operation[call[prefix.equals, parameter[member[.IS_PREFIX]]], &&, binary_operation[call[returnType.getKind, parameter[]], !=, member[TypeKind.BOOLEAN]]]] begin[{] if[member[.declaredOnValueType]] begin[{] call[messager.printMessage, parameter[member[.ERROR], binary_operation[binary_operation[literal["Getter methods starting with '"], +, member[.IS_PREFIX]], +, literal["' must return a boolean on FreeBuilder types"]], member[.method]]] else begin[{] call[.printNoImplementationMessage, parameter[member[.valueType], member[.method]]] end[}] return[call[Optional.empty, parameter[]]] else begin[{] None end[}] if[call[method.getParameters, parameter[]]] begin[{] if[member[.declaredOnValueType]] begin[{] call[messager.printMessage, parameter[member[.ERROR], literal["Getter methods cannot take parameters on FreeBuilder types"], member[.method]]] else begin[{] call[.printNoImplementationMessage, parameter[member[.valueType], member[.method]]] end[}] return[call[Optional.empty, parameter[]]] else begin[{] None end[}] if[call[.isLegalType, parameter[member[.returnType]]]] begin[{] return[call[Optional.empty, parameter[]]] else begin[{] None end[}] local_variable[type[String], camelCaseName] return[call[Optional.of, parameter[ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], member=setUsingBeanConvention, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=camelCaseName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=capitalizedName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setCapitalizedName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], member=group, postfix_operators=[], prefix_operators=[], qualifier=getterMatcher, selectors=[], type_arguments=None)], member=setGetterName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=Property, sub_type=ReferenceType(arguments=None, dimensions=None, name=Builder, sub_type=None)))]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[Optional] operator[<] identifier[Property] operator[SEP] identifier[Builder] operator[>] identifier[getPropertyNames] operator[SEP] identifier[TypeElement] identifier[valueType] , identifier[ExecutableElement] identifier[method] operator[SEP] { Keyword[boolean] identifier[declaredOnValueType] operator[=] identifier[method] operator[SEP] identifier[getEnclosingElement] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[valueType] operator[SEP] operator[SEP] identifier[String] identifier[name] operator[=] identifier[method] operator[SEP] identifier[getSimpleName] operator[SEP] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] identifier[Matcher] identifier[getterMatcher] operator[=] identifier[GETTER_PATTERN] operator[SEP] identifier[matcher] operator[SEP] identifier[name] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[getterMatcher] operator[SEP] identifier[matches] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[declaredOnValueType] operator[SEP] { identifier[messager] operator[SEP] identifier[printMessage] operator[SEP] identifier[ERROR] , literal[String] operator[+] identifier[GET_PREFIX] operator[+] literal[String] operator[+] identifier[IS_PREFIX] operator[+] literal[String] , identifier[method] operator[SEP] operator[SEP] } Keyword[else] { identifier[printNoImplementationMessage] operator[SEP] identifier[valueType] , identifier[method] operator[SEP] operator[SEP] } Keyword[return] identifier[Optional] operator[SEP] identifier[empty] operator[SEP] operator[SEP] operator[SEP] } identifier[String] identifier[prefix] operator[=] identifier[getterMatcher] operator[SEP] identifier[group] operator[SEP] Other[1] operator[SEP] operator[SEP] identifier[String] identifier[capitalizedName] operator[=] identifier[getterMatcher] operator[SEP] identifier[group] operator[SEP] Other[2] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[hasUpperCase] operator[SEP] identifier[capitalizedName] operator[SEP] identifier[codePointAt] operator[SEP] Other[0] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[declaredOnValueType] operator[SEP] { identifier[String] identifier[message] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[prefix] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[prefix] operator[SEP] operator[SEP] identifier[appendCodePoint] operator[SEP] identifier[Character] operator[SEP] identifier[toUpperCase] operator[SEP] identifier[capitalizedName] operator[SEP] identifier[codePointAt] operator[SEP] Other[0] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[capitalizedName] operator[SEP] identifier[substring] operator[SEP] identifier[capitalizedName] operator[SEP] identifier[offsetByCodePoints] operator[SEP] Other[0] , Other[1] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] identifier[messager] operator[SEP] identifier[printMessage] operator[SEP] identifier[ERROR] , identifier[message] , identifier[method] operator[SEP] operator[SEP] } Keyword[else] { identifier[printNoImplementationMessage] operator[SEP] identifier[valueType] , identifier[method] operator[SEP] operator[SEP] } Keyword[return] identifier[Optional] operator[SEP] identifier[empty] operator[SEP] operator[SEP] operator[SEP] } identifier[TypeMirror] identifier[returnType] operator[=] identifier[getReturnType] operator[SEP] identifier[valueType] , identifier[method] , identifier[types] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[returnType] operator[SEP] identifier[getKind] operator[SEP] operator[SEP] operator[==] identifier[TypeKind] operator[SEP] identifier[VOID] operator[SEP] { Keyword[if] operator[SEP] identifier[declaredOnValueType] operator[SEP] { identifier[messager] operator[SEP] identifier[printMessage] operator[SEP] identifier[ERROR] , literal[String] , identifier[method] operator[SEP] operator[SEP] } Keyword[else] { identifier[printNoImplementationMessage] operator[SEP] identifier[valueType] , identifier[method] operator[SEP] operator[SEP] } Keyword[return] identifier[Optional] operator[SEP] identifier[empty] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[prefix] operator[SEP] identifier[equals] operator[SEP] identifier[IS_PREFIX] operator[SEP] operator[&&] operator[SEP] identifier[returnType] operator[SEP] identifier[getKind] operator[SEP] operator[SEP] operator[!=] identifier[TypeKind] operator[SEP] identifier[BOOLEAN] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[declaredOnValueType] operator[SEP] { identifier[messager] operator[SEP] identifier[printMessage] operator[SEP] identifier[ERROR] , literal[String] operator[+] identifier[IS_PREFIX] operator[+] literal[String] , identifier[method] operator[SEP] operator[SEP] } Keyword[else] { identifier[printNoImplementationMessage] operator[SEP] identifier[valueType] , identifier[method] operator[SEP] operator[SEP] } Keyword[return] identifier[Optional] operator[SEP] identifier[empty] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] operator[!] identifier[method] operator[SEP] identifier[getParameters] operator[SEP] operator[SEP] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[declaredOnValueType] operator[SEP] { identifier[messager] operator[SEP] identifier[printMessage] operator[SEP] identifier[ERROR] , literal[String] , identifier[method] operator[SEP] operator[SEP] } Keyword[else] { identifier[printNoImplementationMessage] operator[SEP] identifier[valueType] , identifier[method] operator[SEP] operator[SEP] } Keyword[return] identifier[Optional] operator[SEP] identifier[empty] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] operator[!] identifier[isLegalType] operator[SEP] identifier[returnType] operator[SEP] operator[SEP] { Keyword[return] identifier[Optional] operator[SEP] identifier[empty] operator[SEP] operator[SEP] operator[SEP] } identifier[String] identifier[camelCaseName] operator[=] identifier[Introspector] operator[SEP] identifier[decapitalize] operator[SEP] identifier[capitalizedName] operator[SEP] operator[SEP] Keyword[return] identifier[Optional] operator[SEP] identifier[of] operator[SEP] Keyword[new] identifier[Property] operator[SEP] identifier[Builder] operator[SEP] operator[SEP] operator[SEP] identifier[setUsingBeanConvention] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[setName] operator[SEP] identifier[camelCaseName] operator[SEP] operator[SEP] identifier[setCapitalizedName] operator[SEP] identifier[capitalizedName] operator[SEP] operator[SEP] identifier[setGetterName] operator[SEP] identifier[getterMatcher] operator[SEP] identifier[group] operator[SEP] Other[0] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
public static Class getSuperClassGenericType(Class clazz, int index) { Type genType = clazz.getGenericSuperclass();//得到泛型父类 //如果没有实现ParameterizedType接口,即不支持泛型,直接返回Object.class if (!(genType instanceof ParameterizedType)) { return Object.class; } //返回表示此类型实际类型参数的Type对象的数组,数组里放的都是对应类型的Class, 如BuyerServiceBean extends DaoSupport<Buyer,Contact>就返回Buyer和Contact类型 Type[] params = ((ParameterizedType) genType).getActualTypeArguments(); if (index >= params.length || index < 0) { throw new IllegalArgumentException("index "+ (index<0 ? " must > 0 " : " over total arguments")); } if (!(params[index] instanceof Class)) { return Object.class; } return (Class) params[index]; }
class class_name[name] begin[{] method[getSuperClassGenericType, return_type[type[Class]], modifier[public static], parameter[clazz, index]] begin[{] local_variable[type[Type], genType] if[binary_operation[member[.genType], instanceof, type[ParameterizedType]]] begin[{] return[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Object, sub_type=None))] else begin[{] None end[}] local_variable[type[Type], params] if[binary_operation[binary_operation[member[.index], >=, member[params.length]], ||, binary_operation[member[.index], <, literal[0]]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="index "), operandr=TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=<), if_false=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" over total arguments"), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" must > 0 ")), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None) else begin[{] None end[}] if[binary_operation[member[.params], instanceof, type[Class]]] begin[{] return[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Object, sub_type=None))] else begin[{] None end[}] return[Cast(expression=MemberReference(member=params, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type=ReferenceType(arguments=None, dimensions=[], name=Class, sub_type=None))] end[}] END[}]
Keyword[public] Keyword[static] identifier[Class] identifier[getSuperClassGenericType] operator[SEP] identifier[Class] identifier[clazz] , Keyword[int] identifier[index] operator[SEP] { identifier[Type] identifier[genType] operator[=] identifier[clazz] operator[SEP] identifier[getGenericSuperclass] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] operator[SEP] identifier[genType] Keyword[instanceof] identifier[ParameterizedType] operator[SEP] operator[SEP] { Keyword[return] identifier[Object] operator[SEP] Keyword[class] operator[SEP] } identifier[Type] operator[SEP] operator[SEP] identifier[params] operator[=] operator[SEP] operator[SEP] identifier[ParameterizedType] operator[SEP] identifier[genType] operator[SEP] operator[SEP] identifier[getActualTypeArguments] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[index] operator[>=] identifier[params] operator[SEP] identifier[length] operator[||] identifier[index] operator[<] Other[0] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[+] operator[SEP] identifier[index] operator[<] Other[0] operator[?] literal[String] operator[:] literal[String] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] operator[!] operator[SEP] identifier[params] operator[SEP] identifier[index] operator[SEP] Keyword[instanceof] identifier[Class] operator[SEP] operator[SEP] { Keyword[return] identifier[Object] operator[SEP] Keyword[class] operator[SEP] } Keyword[return] operator[SEP] identifier[Class] operator[SEP] identifier[params] operator[SEP] identifier[index] operator[SEP] operator[SEP] }
protected float[] findLimitsTwoLines() { boolean repeat = false; for (;;) { if (repeat && currentLeading == 0) return null; repeat = true; float x1[] = findLimitsOneLine(); if (lineStatus == LINE_STATUS_OFFLIMITS) return null; yLine -= currentLeading; if (lineStatus == LINE_STATUS_NOLINE) { continue; } float x2[] = findLimitsOneLine(); if (lineStatus == LINE_STATUS_OFFLIMITS) return null; if (lineStatus == LINE_STATUS_NOLINE) { yLine -= currentLeading; continue; } if (x1[0] >= x2[1] || x2[0] >= x1[1]) continue; return new float[]{x1[0], x1[1], x2[0], x2[1]}; } }
class class_name[name] begin[{] method[findLimitsTwoLines, return_type[type[float]], modifier[protected], parameter[]] begin[{] local_variable[type[boolean], repeat] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=repeat, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=BinaryOperation(operandl=MemberReference(member=currentLeading, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator===), operator=&&), else_statement=None, label=None, then_statement=ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), label=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=repeat, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[None], initializer=MethodInvocation(arguments=[], member=findLimitsOneLine, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=x1)], modifiers=set(), type=BasicType(dimensions=[], name=float)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=lineStatus, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=LINE_STATUS_OFFLIMITS, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), else_statement=None, label=None, then_statement=ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), label=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=yLine, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=-=, value=MemberReference(member=currentLeading, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=lineStatus, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=LINE_STATUS_NOLINE, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ContinueStatement(goto=None, label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[None], initializer=MethodInvocation(arguments=[], member=findLimitsOneLine, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=x2)], modifiers=set(), type=BasicType(dimensions=[], name=float)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=lineStatus, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=LINE_STATUS_OFFLIMITS, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), else_statement=None, label=None, then_statement=ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), label=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=lineStatus, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=LINE_STATUS_NOLINE, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=yLine, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=-=, value=MemberReference(member=currentLeading, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), ContinueStatement(goto=None, label=None)])), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=x1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))]), operandr=MemberReference(member=x2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1))]), operator=>=), operandr=BinaryOperation(operandl=MemberReference(member=x2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))]), operandr=MemberReference(member=x1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1))]), operator=>=), operator=||), else_statement=None, label=None, then_statement=ContinueStatement(goto=None, label=None)), ReturnStatement(expression=ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MemberReference(member=x1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))]), MemberReference(member=x1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1))]), MemberReference(member=x2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))]), MemberReference(member=x2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1))])]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=None, name=float)), label=None)]), control=ForControl(condition=None, init=None, update=None), label=None) end[}] END[}]
Keyword[protected] Keyword[float] operator[SEP] operator[SEP] identifier[findLimitsTwoLines] operator[SEP] operator[SEP] { Keyword[boolean] identifier[repeat] operator[=] literal[boolean] operator[SEP] Keyword[for] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[repeat] operator[&&] identifier[currentLeading] operator[==] Other[0] operator[SEP] Keyword[return] Other[null] operator[SEP] identifier[repeat] operator[=] literal[boolean] operator[SEP] Keyword[float] identifier[x1] operator[SEP] operator[SEP] operator[=] identifier[findLimitsOneLine] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[lineStatus] operator[==] identifier[LINE_STATUS_OFFLIMITS] operator[SEP] Keyword[return] Other[null] operator[SEP] identifier[yLine] operator[-=] identifier[currentLeading] operator[SEP] Keyword[if] operator[SEP] identifier[lineStatus] operator[==] identifier[LINE_STATUS_NOLINE] operator[SEP] { Keyword[continue] operator[SEP] } Keyword[float] identifier[x2] operator[SEP] operator[SEP] operator[=] identifier[findLimitsOneLine] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[lineStatus] operator[==] identifier[LINE_STATUS_OFFLIMITS] operator[SEP] Keyword[return] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[lineStatus] operator[==] identifier[LINE_STATUS_NOLINE] operator[SEP] { identifier[yLine] operator[-=] identifier[currentLeading] operator[SEP] Keyword[continue] operator[SEP] } Keyword[if] operator[SEP] identifier[x1] operator[SEP] Other[0] operator[SEP] operator[>=] identifier[x2] operator[SEP] Other[1] operator[SEP] operator[||] identifier[x2] operator[SEP] Other[0] operator[SEP] operator[>=] identifier[x1] operator[SEP] Other[1] operator[SEP] operator[SEP] Keyword[continue] operator[SEP] Keyword[return] Keyword[new] Keyword[float] operator[SEP] operator[SEP] { identifier[x1] operator[SEP] Other[0] operator[SEP] , identifier[x1] operator[SEP] Other[1] operator[SEP] , identifier[x2] operator[SEP] Other[0] operator[SEP] , identifier[x2] operator[SEP] Other[1] operator[SEP] } operator[SEP] } }
public void start(IStore store, int interval) { synchronized (this) { _invalInterval = interval; _timer = new Timer(true); _invalTask = new InvalidationTask(store); _timer.schedule(_invalTask, _delay * 1000, _invalInterval * 1000); } }
class class_name[name] begin[{] method[start, return_type[void], modifier[public], parameter[store, interval]] begin[{] SYNCHRONIZED[THIS[]] BEGIN[{] assign[member[._invalInterval], member[.interval]] assign[member[._timer], ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Timer, sub_type=None))] assign[member[._invalTask], ClassCreator(arguments=[MemberReference(member=store, 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=InvalidationTask, sub_type=None))] call[_timer.schedule, parameter[member[._invalTask], binary_operation[member[._delay], *, literal[1000]], binary_operation[member[._invalInterval], *, literal[1000]]]] END[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[start] operator[SEP] identifier[IStore] identifier[store] , Keyword[int] identifier[interval] operator[SEP] { Keyword[synchronized] operator[SEP] Keyword[this] operator[SEP] { identifier[_invalInterval] operator[=] identifier[interval] operator[SEP] identifier[_timer] operator[=] Keyword[new] identifier[Timer] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[_invalTask] operator[=] Keyword[new] identifier[InvalidationTask] operator[SEP] identifier[store] operator[SEP] operator[SEP] identifier[_timer] operator[SEP] identifier[schedule] operator[SEP] identifier[_invalTask] , identifier[_delay] operator[*] Other[1000] , identifier[_invalInterval] operator[*] Other[1000] operator[SEP] operator[SEP] } }
public File getStylesheetPath() { String path = System.getProperty(STYLESHEET_KEY); return path == null ? null : new File(path); }
class class_name[name] begin[{] method[getStylesheetPath, return_type[type[File]], modifier[public], parameter[]] begin[{] local_variable[type[String], path] return[TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=path, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), if_false=ClassCreator(arguments=[MemberReference(member=path, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=File, sub_type=None)), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null))] end[}] END[}]
Keyword[public] identifier[File] identifier[getStylesheetPath] operator[SEP] operator[SEP] { identifier[String] identifier[path] operator[=] identifier[System] operator[SEP] identifier[getProperty] operator[SEP] identifier[STYLESHEET_KEY] operator[SEP] operator[SEP] Keyword[return] identifier[path] operator[==] Other[null] operator[?] Other[null] operator[:] Keyword[new] identifier[File] operator[SEP] identifier[path] operator[SEP] operator[SEP] }
public void renderMessage(JComponent component) { if (component instanceof JTextComponent) { ((JTextComponent)component).setText(getMessage()); } else if (component instanceof JLabel) { JLabel label = (JLabel)component; label.setText(LabelUtils.htmlBlock(getMessage())); label.setIcon(getIcon()); } else { throw new IllegalArgumentException("Unsupported component type " + component); } }
class class_name[name] begin[{] method[renderMessage, return_type[void], modifier[public], parameter[component]] begin[{] if[binary_operation[member[.component], instanceof, type[JTextComponent]]] begin[{] Cast(expression=MemberReference(member=component, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=JTextComponent, sub_type=None)) else begin[{] if[binary_operation[member[.component], instanceof, type[JLabel]]] begin[{] local_variable[type[JLabel], label] call[label.setText, parameter[call[LabelUtils.htmlBlock, parameter[call[.getMessage, parameter[]]]]]] call[label.setIcon, parameter[call[.getIcon, parameter[]]]] else begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unsupported component type "), operandr=MemberReference(member=component, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None) end[}] end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[renderMessage] operator[SEP] identifier[JComponent] identifier[component] operator[SEP] { Keyword[if] operator[SEP] identifier[component] Keyword[instanceof] identifier[JTextComponent] operator[SEP] { operator[SEP] operator[SEP] identifier[JTextComponent] operator[SEP] identifier[component] operator[SEP] operator[SEP] identifier[setText] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[component] Keyword[instanceof] identifier[JLabel] operator[SEP] { identifier[JLabel] identifier[label] operator[=] operator[SEP] identifier[JLabel] operator[SEP] identifier[component] operator[SEP] identifier[label] operator[SEP] identifier[setText] operator[SEP] identifier[LabelUtils] operator[SEP] identifier[htmlBlock] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[label] operator[SEP] identifier[setIcon] operator[SEP] identifier[getIcon] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[+] identifier[component] operator[SEP] operator[SEP] } }
public static <T> Operation<T> operation(Class<? extends T> type, Operator operator, Expression<?>... args) { return operation(type, operator, ImmutableList.copyOf(args)); }
class class_name[name] begin[{] method[operation, return_type[type[Operation]], modifier[public static], parameter[type, operator, args]] begin[{] return[call[.operation, parameter[member[.type], member[.operator], call[ImmutableList.copyOf, parameter[member[.args]]]]]] end[}] END[}]
Keyword[public] Keyword[static] operator[<] identifier[T] operator[>] identifier[Operation] operator[<] identifier[T] operator[>] identifier[operation] operator[SEP] identifier[Class] operator[<] operator[?] Keyword[extends] identifier[T] operator[>] identifier[type] , identifier[Operator] identifier[operator] , identifier[Expression] operator[<] operator[?] operator[>] operator[...] identifier[args] operator[SEP] { Keyword[return] identifier[operation] operator[SEP] identifier[type] , identifier[operator] , identifier[ImmutableList] operator[SEP] identifier[copyOf] operator[SEP] identifier[args] operator[SEP] operator[SEP] operator[SEP] }
@Override public String[] getSheetNames() { String[] ret = null; if(workbook != null) ret = workbook.getSheetNames(); else if(writableWorkbook != null) ret = writableWorkbook.getSheetNames(); return ret; }
class class_name[name] begin[{] method[getSheetNames, return_type[type[String]], modifier[public], parameter[]] begin[{] local_variable[type[String], ret] if[binary_operation[member[.workbook], !=, literal[null]]] begin[{] assign[member[.ret], call[workbook.getSheetNames, parameter[]]] else begin[{] if[binary_operation[member[.writableWorkbook], !=, literal[null]]] begin[{] assign[member[.ret], call[writableWorkbook.getSheetNames, parameter[]]] else begin[{] None end[}] end[}] return[member[.ret]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[String] operator[SEP] operator[SEP] identifier[getSheetNames] operator[SEP] operator[SEP] { identifier[String] operator[SEP] operator[SEP] identifier[ret] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[workbook] operator[!=] Other[null] operator[SEP] identifier[ret] operator[=] identifier[workbook] operator[SEP] identifier[getSheetNames] operator[SEP] operator[SEP] operator[SEP] Keyword[else] Keyword[if] operator[SEP] identifier[writableWorkbook] operator[!=] Other[null] operator[SEP] identifier[ret] operator[=] identifier[writableWorkbook] operator[SEP] identifier[getSheetNames] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[ret] operator[SEP] }
public Decimal multipliedBy(Decimal multiplicand) { if ((this == NaN) || (multiplicand == NaN)) { return NaN; } return new Decimal(delegate.multiply(multiplicand.delegate, MATH_CONTEXT)); }
class class_name[name] begin[{] method[multipliedBy, return_type[type[Decimal]], modifier[public], parameter[multiplicand]] begin[{] if[binary_operation[binary_operation[THIS[], ==, member[.NaN]], ||, binary_operation[member[.multiplicand], ==, member[.NaN]]]] begin[{] return[member[.NaN]] else begin[{] None end[}] return[ClassCreator(arguments=[MethodInvocation(arguments=[MemberReference(member=delegate, postfix_operators=[], prefix_operators=[], qualifier=multiplicand, selectors=[]), MemberReference(member=MATH_CONTEXT, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=multiply, postfix_operators=[], prefix_operators=[], qualifier=delegate, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Decimal, sub_type=None))] end[}] END[}]
Keyword[public] identifier[Decimal] identifier[multipliedBy] operator[SEP] identifier[Decimal] identifier[multiplicand] operator[SEP] { Keyword[if] operator[SEP] operator[SEP] Keyword[this] operator[==] identifier[NaN] operator[SEP] operator[||] operator[SEP] identifier[multiplicand] operator[==] identifier[NaN] operator[SEP] operator[SEP] { Keyword[return] identifier[NaN] operator[SEP] } Keyword[return] Keyword[new] identifier[Decimal] operator[SEP] identifier[delegate] operator[SEP] identifier[multiply] operator[SEP] identifier[multiplicand] operator[SEP] identifier[delegate] , identifier[MATH_CONTEXT] operator[SEP] operator[SEP] operator[SEP] }
private File unGzip(final File inputFile, final File outputDir) throws FileNotFoundException, IOException { _log.info(String.format("Ungzipping %s to dir %s.", inputFile.getAbsolutePath(), outputDir.getAbsolutePath())); //final File outputFile = new File(outputDir, inputFile.getName().substring(0, inputFile.getName().length() - 3)); final GZIPInputStream in = new GZIPInputStream(new FileInputStream(inputFile)); final FileOutputStream out = new FileOutputStream(outputDir); IOUtils.copy(in, out); in.close(); out.close(); return outputDir; }
class class_name[name] begin[{] method[unGzip, return_type[type[File]], modifier[private], parameter[inputFile, outputDir]] begin[{] call[_log.info, parameter[call[String.format, parameter[literal["Ungzipping %s to dir %s."], call[inputFile.getAbsolutePath, parameter[]], call[outputDir.getAbsolutePath, parameter[]]]]]] local_variable[type[GZIPInputStream], in] local_variable[type[FileOutputStream], out] call[IOUtils.copy, parameter[member[.in], member[.out]]] call[in.close, parameter[]] call[out.close, parameter[]] return[member[.outputDir]] end[}] END[}]
Keyword[private] identifier[File] identifier[unGzip] operator[SEP] Keyword[final] identifier[File] identifier[inputFile] , Keyword[final] identifier[File] identifier[outputDir] operator[SEP] Keyword[throws] identifier[FileNotFoundException] , identifier[IOException] { identifier[_log] operator[SEP] identifier[info] operator[SEP] identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[inputFile] operator[SEP] identifier[getAbsolutePath] operator[SEP] operator[SEP] , identifier[outputDir] operator[SEP] identifier[getAbsolutePath] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[GZIPInputStream] identifier[in] operator[=] Keyword[new] identifier[GZIPInputStream] operator[SEP] Keyword[new] identifier[FileInputStream] operator[SEP] identifier[inputFile] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[FileOutputStream] identifier[out] operator[=] Keyword[new] identifier[FileOutputStream] operator[SEP] identifier[outputDir] operator[SEP] operator[SEP] identifier[IOUtils] operator[SEP] identifier[copy] operator[SEP] identifier[in] , identifier[out] operator[SEP] operator[SEP] identifier[in] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP] identifier[out] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[outputDir] operator[SEP] }
@Override public void visitGETSTATIC(GETSTATIC obj) { if (getNumWordsProduced(obj) != 1) { super.visitGETSTATIC(obj); return; } if (checkForKnownValue(obj)) { return; } XField field = XFactory.createXField(obj, cpg); if (field.isFinal()) { Item summary = AnalysisContext.currentAnalysisContext().getFieldSummary().getSummary(field); if (summary.isNull()) { produce(IsNullValue.nullValue()); return; } } if ("java.util.logging.Level".equals(field.getClassName()) && "SEVERE".equals(field.getName()) || "org.apache.log4j.Level".equals(field.getClassName()) && ("ERROR".equals(field.getName()) || "FATAL".equals(field.getName()))) { getFrame().toExceptionValues(); } if (field.getName().startsWith("class$")) { produce(IsNullValue.nonNullValue()); return; } NullnessAnnotation annotation = AnalysisContext.currentAnalysisContext().getNullnessAnnotationDatabase() .getResolvedAnnotation(field, false); if (annotation == NullnessAnnotation.NONNULL) { modelNormalInstruction(obj, getNumWordsConsumed(obj), 0); produce(IsNullValue.nonNullValue()); } else if (annotation == NullnessAnnotation.CHECK_FOR_NULL) { modelNormalInstruction(obj, getNumWordsConsumed(obj), 0); produce(IsNullValue.nullOnSimplePathValue().markInformationAsComingFromFieldValue(field)); } else { super.visitGETSTATIC(obj); } }
class class_name[name] begin[{] method[visitGETSTATIC, return_type[void], modifier[public], parameter[obj]] begin[{] if[binary_operation[call[.getNumWordsProduced, parameter[member[.obj]]], !=, literal[1]]] begin[{] SuperMethodInvocation(arguments=[MemberReference(member=obj, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=visitGETSTATIC, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None) return[None] else begin[{] None end[}] if[call[.checkForKnownValue, parameter[member[.obj]]]] begin[{] return[None] else begin[{] None end[}] local_variable[type[XField], field] if[call[field.isFinal, parameter[]]] begin[{] local_variable[type[Item], summary] if[call[summary.isNull, parameter[]]] begin[{] call[.produce, parameter[call[IsNullValue.nullValue, parameter[]]]] return[None] else begin[{] None end[}] else begin[{] None end[}] if[binary_operation[binary_operation[literal["java.util.logging.Level"], &&, literal["SEVERE"]], ||, binary_operation[literal["org.apache.log4j.Level"], &&, binary_operation[literal["ERROR"], ||, literal["FATAL"]]]]] begin[{] call[.getFrame, parameter[]] else begin[{] None end[}] if[call[field.getName, parameter[]]] begin[{] call[.produce, parameter[call[IsNullValue.nonNullValue, parameter[]]]] return[None] else begin[{] None end[}] local_variable[type[NullnessAnnotation], annotation] if[binary_operation[member[.annotation], ==, member[NullnessAnnotation.NONNULL]]] begin[{] call[.modelNormalInstruction, parameter[member[.obj], call[.getNumWordsConsumed, parameter[member[.obj]]], literal[0]]] call[.produce, parameter[call[IsNullValue.nonNullValue, parameter[]]]] else begin[{] if[binary_operation[member[.annotation], ==, member[NullnessAnnotation.CHECK_FOR_NULL]]] begin[{] call[.modelNormalInstruction, parameter[member[.obj], call[.getNumWordsConsumed, parameter[member[.obj]]], literal[0]]] call[.produce, parameter[call[IsNullValue.nullOnSimplePathValue, parameter[]]]] else begin[{] SuperMethodInvocation(arguments=[MemberReference(member=obj, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=visitGETSTATIC, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None) end[}] end[}] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[visitGETSTATIC] operator[SEP] identifier[GETSTATIC] identifier[obj] operator[SEP] { Keyword[if] operator[SEP] identifier[getNumWordsProduced] operator[SEP] identifier[obj] operator[SEP] operator[!=] Other[1] operator[SEP] { Keyword[super] operator[SEP] identifier[visitGETSTATIC] operator[SEP] identifier[obj] operator[SEP] operator[SEP] Keyword[return] operator[SEP] } Keyword[if] operator[SEP] identifier[checkForKnownValue] operator[SEP] identifier[obj] operator[SEP] operator[SEP] { Keyword[return] operator[SEP] } identifier[XField] identifier[field] operator[=] identifier[XFactory] operator[SEP] identifier[createXField] operator[SEP] identifier[obj] , identifier[cpg] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[field] operator[SEP] identifier[isFinal] operator[SEP] operator[SEP] operator[SEP] { identifier[Item] identifier[summary] operator[=] identifier[AnalysisContext] operator[SEP] identifier[currentAnalysisContext] operator[SEP] operator[SEP] operator[SEP] identifier[getFieldSummary] operator[SEP] operator[SEP] operator[SEP] identifier[getSummary] operator[SEP] identifier[field] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[summary] operator[SEP] identifier[isNull] operator[SEP] operator[SEP] operator[SEP] { identifier[produce] operator[SEP] identifier[IsNullValue] operator[SEP] identifier[nullValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] operator[SEP] } } Keyword[if] operator[SEP] literal[String] operator[SEP] identifier[equals] operator[SEP] identifier[field] operator[SEP] identifier[getClassName] operator[SEP] operator[SEP] operator[SEP] operator[&&] literal[String] operator[SEP] identifier[equals] operator[SEP] identifier[field] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[||] literal[String] operator[SEP] identifier[equals] operator[SEP] identifier[field] operator[SEP] identifier[getClassName] operator[SEP] operator[SEP] operator[SEP] operator[&&] operator[SEP] literal[String] operator[SEP] identifier[equals] operator[SEP] identifier[field] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[||] literal[String] operator[SEP] identifier[equals] operator[SEP] identifier[field] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { identifier[getFrame] operator[SEP] operator[SEP] operator[SEP] identifier[toExceptionValues] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[field] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] identifier[startsWith] operator[SEP] literal[String] operator[SEP] operator[SEP] { identifier[produce] operator[SEP] identifier[IsNullValue] operator[SEP] identifier[nonNullValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] operator[SEP] } identifier[NullnessAnnotation] identifier[annotation] operator[=] identifier[AnalysisContext] operator[SEP] identifier[currentAnalysisContext] operator[SEP] operator[SEP] operator[SEP] identifier[getNullnessAnnotationDatabase] operator[SEP] operator[SEP] operator[SEP] identifier[getResolvedAnnotation] operator[SEP] identifier[field] , literal[boolean] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[annotation] operator[==] identifier[NullnessAnnotation] operator[SEP] identifier[NONNULL] operator[SEP] { identifier[modelNormalInstruction] operator[SEP] identifier[obj] , identifier[getNumWordsConsumed] operator[SEP] identifier[obj] operator[SEP] , Other[0] operator[SEP] operator[SEP] identifier[produce] operator[SEP] identifier[IsNullValue] operator[SEP] identifier[nonNullValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[annotation] operator[==] identifier[NullnessAnnotation] operator[SEP] identifier[CHECK_FOR_NULL] operator[SEP] { identifier[modelNormalInstruction] operator[SEP] identifier[obj] , identifier[getNumWordsConsumed] operator[SEP] identifier[obj] operator[SEP] , Other[0] operator[SEP] operator[SEP] identifier[produce] operator[SEP] identifier[IsNullValue] operator[SEP] identifier[nullOnSimplePathValue] operator[SEP] operator[SEP] operator[SEP] identifier[markInformationAsComingFromFieldValue] operator[SEP] identifier[field] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { Keyword[super] operator[SEP] identifier[visitGETSTATIC] operator[SEP] identifier[obj] operator[SEP] operator[SEP] } }
public void deleteShippingAddress(final String accountCode, final long shippingAddressId) { doDELETE(Accounts.ACCOUNTS_RESOURCE + "/" + accountCode + ShippingAddresses.SHIPPING_ADDRESSES_RESOURCE + "/" + shippingAddressId); }
class class_name[name] begin[{] method[deleteShippingAddress, return_type[void], modifier[public], parameter[accountCode, shippingAddressId]] begin[{] call[.doDELETE, parameter[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[member[Accounts.ACCOUNTS_RESOURCE], +, literal["/"]], +, member[.accountCode]], +, member[ShippingAddresses.SHIPPING_ADDRESSES_RESOURCE]], +, literal["/"]], +, member[.shippingAddressId]]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[deleteShippingAddress] operator[SEP] Keyword[final] identifier[String] identifier[accountCode] , Keyword[final] Keyword[long] identifier[shippingAddressId] operator[SEP] { identifier[doDELETE] operator[SEP] identifier[Accounts] operator[SEP] identifier[ACCOUNTS_RESOURCE] operator[+] literal[String] operator[+] identifier[accountCode] operator[+] identifier[ShippingAddresses] operator[SEP] identifier[SHIPPING_ADDRESSES_RESOURCE] operator[+] literal[String] operator[+] identifier[shippingAddressId] operator[SEP] operator[SEP] }
public synchronized void close() throws IOException, InterruptedException { if (isClosed){ return; } logger.info("closing server endpoint"); idPriv.destroyId(); group.unregisterServerEp(this); isClosed = true; }
class class_name[name] begin[{] method[close, return_type[void], modifier[synchronized public], parameter[]] begin[{] if[member[.isClosed]] begin[{] return[None] else begin[{] None end[}] call[logger.info, parameter[literal["closing server endpoint"]]] call[idPriv.destroyId, parameter[]] call[group.unregisterServerEp, parameter[THIS[]]] assign[member[.isClosed], literal[true]] end[}] END[}]
Keyword[public] Keyword[synchronized] Keyword[void] identifier[close] operator[SEP] operator[SEP] Keyword[throws] identifier[IOException] , identifier[InterruptedException] { Keyword[if] operator[SEP] identifier[isClosed] operator[SEP] { Keyword[return] operator[SEP] } identifier[logger] operator[SEP] identifier[info] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[idPriv] operator[SEP] identifier[destroyId] operator[SEP] operator[SEP] operator[SEP] identifier[group] operator[SEP] identifier[unregisterServerEp] operator[SEP] Keyword[this] operator[SEP] operator[SEP] identifier[isClosed] operator[=] literal[boolean] operator[SEP] }
public Object serialize(Object obj, String contentType, Map<String, Object> formParams) throws ApiException { if (contentType.startsWith("multipart/form-data")) { FormDataMultiPart mp = new FormDataMultiPart(); for (Entry<String, Object> param : formParams.entrySet()) { if (param.getValue() instanceof List && !((List) param.getValue()).isEmpty() && ((List) param.getValue()).get(0) instanceof File) { @SuppressWarnings("unchecked") List<File> files = (List<File>) param.getValue(); for (File file : files) { mp.bodyPart(new FileDataBodyPart(param.getKey(), file, MediaType.APPLICATION_OCTET_STREAM_TYPE)); } } else if (param.getValue() instanceof File) { File file = (File) param.getValue(); mp.bodyPart(new FileDataBodyPart(param.getKey(), file, MediaType.APPLICATION_OCTET_STREAM_TYPE)); } else { mp.field(param.getKey(), parameterToString(param.getValue()), MediaType.MULTIPART_FORM_DATA_TYPE); } } return mp; } else if (contentType.startsWith("application/x-www-form-urlencoded")) { return this.getXWWWFormUrlencodedParams(formParams); } else { // We let Jersey attempt to serialize the body return obj; } }
class class_name[name] begin[{] method[serialize, return_type[type[Object]], modifier[public], parameter[obj, contentType, formParams]] begin[{] if[call[contentType.startsWith, parameter[literal["multipart/form-data"]]]] begin[{] local_variable[type[FormDataMultiPart], mp] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=param, selectors=[], type_arguments=None), operandr=ReferenceType(arguments=None, dimensions=[], name=List, sub_type=None), operator=instanceof), operandr=Cast(expression=MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=param, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=List, sub_type=None)), operator=&&), operandr=BinaryOperation(operandl=Cast(expression=MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=param, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=List, sub_type=None)), operandr=ReferenceType(arguments=None, dimensions=[], name=File, sub_type=None), operator=instanceof), operator=&&), else_statement=IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=param, selectors=[], type_arguments=None), operandr=ReferenceType(arguments=None, dimensions=[], name=File, sub_type=None), operator=instanceof), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getKey, postfix_operators=[], prefix_operators=[], qualifier=param, selectors=[], type_arguments=None), MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=param, selectors=[], type_arguments=None)], member=parameterToString, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), MemberReference(member=MULTIPART_FORM_DATA_TYPE, postfix_operators=[], prefix_operators=[], qualifier=MediaType, selectors=[])], member=field, postfix_operators=[], prefix_operators=[], qualifier=mp, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=param, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=File, sub_type=None)), name=file)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=File, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[ClassCreator(arguments=[MethodInvocation(arguments=[], member=getKey, postfix_operators=[], prefix_operators=[], qualifier=param, selectors=[], type_arguments=None), MemberReference(member=file, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=APPLICATION_OCTET_STREAM_TYPE, postfix_operators=[], prefix_operators=[], qualifier=MediaType, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=FileDataBodyPart, sub_type=None))], member=bodyPart, postfix_operators=[], prefix_operators=[], qualifier=mp, selectors=[], type_arguments=None), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[Annotation(element=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="unchecked"), name=SuppressWarnings)], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=param, selectors=[], type_arguments=None), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=File, sub_type=None))], dimensions=[], name=List, sub_type=None)), name=files)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=File, sub_type=None))], dimensions=[], name=List, sub_type=None)), ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[ClassCreator(arguments=[MethodInvocation(arguments=[], member=getKey, postfix_operators=[], prefix_operators=[], qualifier=param, selectors=[], type_arguments=None), MemberReference(member=file, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=APPLICATION_OCTET_STREAM_TYPE, postfix_operators=[], prefix_operators=[], qualifier=MediaType, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=FileDataBodyPart, sub_type=None))], member=bodyPart, postfix_operators=[], prefix_operators=[], qualifier=mp, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=files, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=file)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=File, sub_type=None))), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=entrySet, postfix_operators=[], prefix_operators=[], qualifier=formParams, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=param)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))], dimensions=[], name=Entry, sub_type=None))), label=None) return[member[.mp]] else begin[{] if[call[contentType.startsWith, parameter[literal["application/x-www-form-urlencoded"]]]] begin[{] return[THIS[call[None.getXWWWFormUrlencodedParams, parameter[member[.formParams]]]]] else begin[{] return[member[.obj]] end[}] end[}] end[}] END[}]
Keyword[public] identifier[Object] identifier[serialize] operator[SEP] identifier[Object] identifier[obj] , identifier[String] identifier[contentType] , identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] identifier[formParams] operator[SEP] Keyword[throws] identifier[ApiException] { Keyword[if] operator[SEP] identifier[contentType] operator[SEP] identifier[startsWith] operator[SEP] literal[String] operator[SEP] operator[SEP] { identifier[FormDataMultiPart] identifier[mp] operator[=] Keyword[new] identifier[FormDataMultiPart] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Entry] operator[<] identifier[String] , identifier[Object] operator[>] identifier[param] operator[:] identifier[formParams] operator[SEP] identifier[entrySet] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[param] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] Keyword[instanceof] identifier[List] operator[&&] operator[!] operator[SEP] operator[SEP] identifier[List] operator[SEP] identifier[param] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[&&] operator[SEP] operator[SEP] identifier[List] operator[SEP] identifier[param] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] Other[0] operator[SEP] Keyword[instanceof] identifier[File] operator[SEP] { annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] identifier[List] operator[<] identifier[File] operator[>] identifier[files] operator[=] operator[SEP] identifier[List] operator[<] identifier[File] operator[>] operator[SEP] identifier[param] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[File] identifier[file] operator[:] identifier[files] operator[SEP] { identifier[mp] operator[SEP] identifier[bodyPart] operator[SEP] Keyword[new] identifier[FileDataBodyPart] operator[SEP] identifier[param] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] , identifier[file] , identifier[MediaType] operator[SEP] identifier[APPLICATION_OCTET_STREAM_TYPE] operator[SEP] operator[SEP] operator[SEP] } } Keyword[else] Keyword[if] operator[SEP] identifier[param] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] Keyword[instanceof] identifier[File] operator[SEP] { identifier[File] identifier[file] operator[=] operator[SEP] identifier[File] operator[SEP] identifier[param] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] identifier[mp] operator[SEP] identifier[bodyPart] operator[SEP] Keyword[new] identifier[FileDataBodyPart] operator[SEP] identifier[param] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] , identifier[file] , identifier[MediaType] operator[SEP] identifier[APPLICATION_OCTET_STREAM_TYPE] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[mp] operator[SEP] identifier[field] operator[SEP] identifier[param] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] , identifier[parameterToString] operator[SEP] identifier[param] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] , identifier[MediaType] operator[SEP] identifier[MULTIPART_FORM_DATA_TYPE] operator[SEP] operator[SEP] } } Keyword[return] identifier[mp] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[contentType] operator[SEP] identifier[startsWith] operator[SEP] literal[String] operator[SEP] operator[SEP] { Keyword[return] Keyword[this] operator[SEP] identifier[getXWWWFormUrlencodedParams] operator[SEP] identifier[formParams] operator[SEP] operator[SEP] } Keyword[else] { Keyword[return] identifier[obj] operator[SEP] } }
@Override public java.util.concurrent.Future<DescribeApplicationsResult> describeApplicationsAsync( com.amazonaws.handlers.AsyncHandler<DescribeApplicationsRequest, DescribeApplicationsResult> asyncHandler) { return describeApplicationsAsync(new DescribeApplicationsRequest(), asyncHandler); }
class class_name[name] begin[{] method[describeApplicationsAsync, return_type[type[java]], modifier[public], parameter[asyncHandler]] begin[{] return[call[.describeApplicationsAsync, parameter[ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=DescribeApplicationsRequest, sub_type=None)), member[.asyncHandler]]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[concurrent] operator[SEP] identifier[Future] operator[<] identifier[DescribeApplicationsResult] operator[>] identifier[describeApplicationsAsync] operator[SEP] identifier[com] operator[SEP] identifier[amazonaws] operator[SEP] identifier[handlers] operator[SEP] identifier[AsyncHandler] operator[<] identifier[DescribeApplicationsRequest] , identifier[DescribeApplicationsResult] operator[>] identifier[asyncHandler] operator[SEP] { Keyword[return] identifier[describeApplicationsAsync] operator[SEP] Keyword[new] identifier[DescribeApplicationsRequest] operator[SEP] operator[SEP] , identifier[asyncHandler] operator[SEP] operator[SEP] }
private Parser<Class<?>> arrayClass() { Parser<Class<?>> arrayType = FQN.next(name -> { // Only invoked when we already see a "[" at the beginning. Class<?> primitiveArray = PRIMITIVE_ARRAY_TYPES.get("[" + name); if (primitiveArray != null) return Parsers.constant(primitiveArray); if (name.startsWith("L") && name.endsWith(";")) { String className = name.substring(1, name.length() - 1); return Parsers.constant(Types.newArrayType(loadClass(className))); } else { return Parsers.expect("array class internal name"); } }); return TERMS.token("[") // must be an array internal format from this point on. .next(arrayType.prefix(TERMS.token("[").retn(Types::newArrayType))); }
class class_name[name] begin[{] method[arrayClass, return_type[type[Parser]], modifier[private], parameter[]] begin[{] local_variable[type[Parser], arrayType] return[call[TERMS.token, parameter[literal["["]]]] end[}] END[}]
Keyword[private] identifier[Parser] operator[<] identifier[Class] operator[<] operator[?] operator[>] operator[>] identifier[arrayClass] operator[SEP] operator[SEP] { identifier[Parser] operator[<] identifier[Class] operator[<] operator[?] operator[>] operator[>] identifier[arrayType] operator[=] identifier[FQN] operator[SEP] identifier[next] operator[SEP] identifier[name] operator[->] { identifier[Class] operator[<] operator[?] operator[>] identifier[primitiveArray] operator[=] identifier[PRIMITIVE_ARRAY_TYPES] operator[SEP] identifier[get] operator[SEP] literal[String] operator[+] identifier[name] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[primitiveArray] operator[!=] Other[null] operator[SEP] Keyword[return] identifier[Parsers] operator[SEP] identifier[constant] operator[SEP] identifier[primitiveArray] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[name] operator[SEP] identifier[startsWith] operator[SEP] literal[String] operator[SEP] operator[&&] identifier[name] operator[SEP] identifier[endsWith] operator[SEP] literal[String] operator[SEP] operator[SEP] { identifier[String] identifier[className] operator[=] identifier[name] operator[SEP] identifier[substring] operator[SEP] Other[1] , identifier[name] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[-] Other[1] operator[SEP] operator[SEP] Keyword[return] identifier[Parsers] operator[SEP] identifier[constant] operator[SEP] identifier[Types] operator[SEP] identifier[newArrayType] operator[SEP] identifier[loadClass] operator[SEP] identifier[className] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { Keyword[return] identifier[Parsers] operator[SEP] identifier[expect] operator[SEP] literal[String] operator[SEP] operator[SEP] } } operator[SEP] operator[SEP] Keyword[return] identifier[TERMS] operator[SEP] identifier[token] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[next] operator[SEP] identifier[arrayType] operator[SEP] identifier[prefix] operator[SEP] identifier[TERMS] operator[SEP] identifier[token] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[retn] operator[SEP] identifier[Types] operator[::] identifier[newArrayType] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
public synchronized void stop() { if (m_thread != null) { long timeBeforeShutdownWasCalled = System.currentTimeMillis(); JLANServer.shutdownServer(new String[] {}); while (m_thread.isAlive() && ((System.currentTimeMillis() - timeBeforeShutdownWasCalled) < MAX_SHUTDOWN_WAIT_MILLIS)) { try { Thread.sleep(500); } catch (InterruptedException e) { // ignore } } } }
class class_name[name] begin[{] method[stop, return_type[void], modifier[synchronized public], parameter[]] begin[{] if[binary_operation[member[.m_thread], !=, literal[null]]] begin[{] local_variable[type[long], timeBeforeShutdownWasCalled] call[JLANServer.shutdownServer, parameter[ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=String, sub_type=None))]] while[binary_operation[call[m_thread.isAlive, parameter[]], &&, binary_operation[binary_operation[call[System.currentTimeMillis, parameter[]], -, member[.timeBeforeShutdownWasCalled]], <, member[.MAX_SHUTDOWN_WAIT_MILLIS]]]] begin[{] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=500)], member=sleep, postfix_operators=[], prefix_operators=[], qualifier=Thread, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['InterruptedException']))], finally_block=None, label=None, resources=None) end[}] else begin[{] None end[}] end[}] END[}]
Keyword[public] Keyword[synchronized] Keyword[void] identifier[stop] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[m_thread] operator[!=] Other[null] operator[SEP] { Keyword[long] identifier[timeBeforeShutdownWasCalled] operator[=] identifier[System] operator[SEP] identifier[currentTimeMillis] operator[SEP] operator[SEP] operator[SEP] identifier[JLANServer] operator[SEP] identifier[shutdownServer] operator[SEP] Keyword[new] identifier[String] operator[SEP] operator[SEP] { } operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[m_thread] operator[SEP] identifier[isAlive] operator[SEP] operator[SEP] operator[&&] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[currentTimeMillis] operator[SEP] operator[SEP] operator[-] identifier[timeBeforeShutdownWasCalled] operator[SEP] operator[<] identifier[MAX_SHUTDOWN_WAIT_MILLIS] operator[SEP] operator[SEP] { Keyword[try] { identifier[Thread] operator[SEP] identifier[sleep] operator[SEP] Other[500] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[InterruptedException] identifier[e] operator[SEP] { } } } }
public static PersianCalendar of( int pyear, PersianMonth pmonth, int pdom ) { return PersianCalendar.of(pyear, pmonth.getValue(), pdom); }
class class_name[name] begin[{] method[of, return_type[type[PersianCalendar]], modifier[public static], parameter[pyear, pmonth, pdom]] begin[{] return[call[PersianCalendar.of, parameter[member[.pyear], call[pmonth.getValue, parameter[]], member[.pdom]]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[PersianCalendar] identifier[of] operator[SEP] Keyword[int] identifier[pyear] , identifier[PersianMonth] identifier[pmonth] , Keyword[int] identifier[pdom] operator[SEP] { Keyword[return] identifier[PersianCalendar] operator[SEP] identifier[of] operator[SEP] identifier[pyear] , identifier[pmonth] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] , identifier[pdom] operator[SEP] operator[SEP] }
public void updateMailServer(int id, String hostName, String username, String password, int port, boolean tls, boolean ssl, long lifeTimeSpan, long idleTimeSpan, boolean reuseConnections) throws PageException { checkWriteAccess(); boolean hasAccess = ConfigWebUtil.hasAccess(config, SecurityManager.TYPE_MAIL); if (!hasAccess) throw new SecurityException("no access to update mail server settings"); Element mail = _getRootElement("mail"); if (port < 1) port = 21; if (hostName == null || hostName.trim().length() == 0) throw new ExpressionException("Host (SMTP) can be a empty value"); hostName = hostName.trim(); Element[] children = XMLConfigWebFactory.getChildren(mail, "server"); boolean checkId = id > 0; // Update Element server = null; String _hostName, _username; for (int i = 0; i < children.length; i++) { Element el = children[i]; if (checkId) { if (i + 1 == id) { server = el; break; } } else { _hostName = StringUtil.emptyIfNull(el.getAttribute("smtp")); _username = StringUtil.emptyIfNull(el.getAttribute("username")); if (_hostName.equalsIgnoreCase(hostName) && _username.equals(StringUtil.emptyIfNull(username))) { server = el; break; } } } // Insert if (server == null) { server = doc.createElement("server"); mail.appendChild(XMLCaster.toRawNode(server)); } server.setAttribute("smtp", hostName); server.setAttribute("username", username); server.setAttribute("password", ConfigWebUtil.encrypt(password)); server.setAttribute("port", Caster.toString(port)); server.setAttribute("tls", Caster.toString(tls)); server.setAttribute("ssl", Caster.toString(ssl)); server.setAttribute("life", Caster.toString(lifeTimeSpan)); server.setAttribute("idle", Caster.toString(idleTimeSpan)); server.setAttribute("reuse-connection", Caster.toString(reuseConnections)); }
class class_name[name] begin[{] method[updateMailServer, return_type[void], modifier[public], parameter[id, hostName, username, password, port, tls, ssl, lifeTimeSpan, idleTimeSpan, reuseConnections]] begin[{] call[.checkWriteAccess, parameter[]] local_variable[type[boolean], hasAccess] if[member[.hasAccess]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="no access to update mail server settings")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SecurityException, sub_type=None)), label=None) else begin[{] None end[}] local_variable[type[Element], mail] if[binary_operation[member[.port], <, literal[1]]] begin[{] assign[member[.port], literal[21]] else begin[{] None end[}] if[binary_operation[binary_operation[member[.hostName], ==, literal[null]], ||, binary_operation[call[hostName.trim, parameter[]], ==, literal[0]]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Host (SMTP) can be a empty value")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ExpressionException, sub_type=None)), label=None) else begin[{] None end[}] assign[member[.hostName], call[hostName.trim, parameter[]]] local_variable[type[Element], children] local_variable[type[boolean], checkId] local_variable[type[Element], server] local_variable[type[String], _hostName] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=children, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), name=el)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Element, sub_type=None)), IfStatement(condition=MemberReference(member=checkId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=_hostName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="smtp")], member=getAttribute, postfix_operators=[], prefix_operators=[], qualifier=el, selectors=[], type_arguments=None)], member=emptyIfNull, postfix_operators=[], prefix_operators=[], qualifier=StringUtil, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=_username, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="username")], member=getAttribute, postfix_operators=[], prefix_operators=[], qualifier=el, selectors=[], type_arguments=None)], member=emptyIfNull, postfix_operators=[], prefix_operators=[], qualifier=StringUtil, selectors=[], type_arguments=None)), label=None), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=hostName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equalsIgnoreCase, postfix_operators=[], prefix_operators=[], qualifier=_hostName, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=username, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=emptyIfNull, postfix_operators=[], prefix_operators=[], qualifier=StringUtil, selectors=[], type_arguments=None)], member=equals, postfix_operators=[], prefix_operators=[], qualifier=_username, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=server, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=el, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), BreakStatement(goto=None, label=None)]))]), label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+), operandr=MemberReference(member=id, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=server, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=el, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), BreakStatement(goto=None, label=None)]))]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=children, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) if[binary_operation[member[.server], ==, literal[null]]] begin[{] assign[member[.server], call[doc.createElement, parameter[literal["server"]]]] call[mail.appendChild, parameter[call[XMLCaster.toRawNode, parameter[member[.server]]]]] else begin[{] None end[}] call[server.setAttribute, parameter[literal["smtp"], member[.hostName]]] call[server.setAttribute, parameter[literal["username"], member[.username]]] call[server.setAttribute, parameter[literal["password"], call[ConfigWebUtil.encrypt, parameter[member[.password]]]]] call[server.setAttribute, parameter[literal["port"], call[Caster.toString, parameter[member[.port]]]]] call[server.setAttribute, parameter[literal["tls"], call[Caster.toString, parameter[member[.tls]]]]] call[server.setAttribute, parameter[literal["ssl"], call[Caster.toString, parameter[member[.ssl]]]]] call[server.setAttribute, parameter[literal["life"], call[Caster.toString, parameter[member[.lifeTimeSpan]]]]] call[server.setAttribute, parameter[literal["idle"], call[Caster.toString, parameter[member[.idleTimeSpan]]]]] call[server.setAttribute, parameter[literal["reuse-connection"], call[Caster.toString, parameter[member[.reuseConnections]]]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[updateMailServer] operator[SEP] Keyword[int] identifier[id] , identifier[String] identifier[hostName] , identifier[String] identifier[username] , identifier[String] identifier[password] , Keyword[int] identifier[port] , Keyword[boolean] identifier[tls] , Keyword[boolean] identifier[ssl] , Keyword[long] identifier[lifeTimeSpan] , Keyword[long] identifier[idleTimeSpan] , Keyword[boolean] identifier[reuseConnections] operator[SEP] Keyword[throws] identifier[PageException] { identifier[checkWriteAccess] operator[SEP] operator[SEP] operator[SEP] Keyword[boolean] identifier[hasAccess] operator[=] identifier[ConfigWebUtil] operator[SEP] identifier[hasAccess] operator[SEP] identifier[config] , identifier[SecurityManager] operator[SEP] identifier[TYPE_MAIL] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[hasAccess] operator[SEP] Keyword[throw] Keyword[new] identifier[SecurityException] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[Element] identifier[mail] operator[=] identifier[_getRootElement] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[port] operator[<] Other[1] operator[SEP] identifier[port] operator[=] Other[21] operator[SEP] Keyword[if] operator[SEP] identifier[hostName] operator[==] Other[null] operator[||] identifier[hostName] operator[SEP] identifier[trim] operator[SEP] operator[SEP] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[==] Other[0] operator[SEP] Keyword[throw] Keyword[new] identifier[ExpressionException] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[hostName] operator[=] identifier[hostName] operator[SEP] identifier[trim] operator[SEP] operator[SEP] operator[SEP] identifier[Element] operator[SEP] operator[SEP] identifier[children] operator[=] identifier[XMLConfigWebFactory] operator[SEP] identifier[getChildren] operator[SEP] identifier[mail] , literal[String] operator[SEP] operator[SEP] Keyword[boolean] identifier[checkId] operator[=] identifier[id] operator[>] Other[0] operator[SEP] identifier[Element] identifier[server] operator[=] Other[null] operator[SEP] identifier[String] identifier[_hostName] , identifier[_username] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[children] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[Element] identifier[el] operator[=] identifier[children] operator[SEP] identifier[i] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[checkId] operator[SEP] { Keyword[if] operator[SEP] identifier[i] operator[+] Other[1] operator[==] identifier[id] operator[SEP] { identifier[server] operator[=] identifier[el] operator[SEP] Keyword[break] operator[SEP] } } Keyword[else] { identifier[_hostName] operator[=] identifier[StringUtil] operator[SEP] identifier[emptyIfNull] operator[SEP] identifier[el] operator[SEP] identifier[getAttribute] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[_username] operator[=] identifier[StringUtil] operator[SEP] identifier[emptyIfNull] operator[SEP] identifier[el] operator[SEP] identifier[getAttribute] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[_hostName] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] identifier[hostName] operator[SEP] operator[&&] identifier[_username] operator[SEP] identifier[equals] operator[SEP] identifier[StringUtil] operator[SEP] identifier[emptyIfNull] operator[SEP] identifier[username] operator[SEP] operator[SEP] operator[SEP] { identifier[server] operator[=] identifier[el] operator[SEP] Keyword[break] operator[SEP] } } } Keyword[if] operator[SEP] identifier[server] operator[==] Other[null] operator[SEP] { identifier[server] operator[=] identifier[doc] operator[SEP] identifier[createElement] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[mail] operator[SEP] identifier[appendChild] operator[SEP] identifier[XMLCaster] operator[SEP] identifier[toRawNode] operator[SEP] identifier[server] operator[SEP] operator[SEP] operator[SEP] } identifier[server] operator[SEP] identifier[setAttribute] operator[SEP] literal[String] , identifier[hostName] operator[SEP] operator[SEP] identifier[server] operator[SEP] identifier[setAttribute] operator[SEP] literal[String] , identifier[username] operator[SEP] operator[SEP] identifier[server] operator[SEP] identifier[setAttribute] operator[SEP] literal[String] , identifier[ConfigWebUtil] operator[SEP] identifier[encrypt] operator[SEP] identifier[password] operator[SEP] operator[SEP] operator[SEP] identifier[server] operator[SEP] identifier[setAttribute] operator[SEP] literal[String] , identifier[Caster] operator[SEP] identifier[toString] operator[SEP] identifier[port] operator[SEP] operator[SEP] operator[SEP] identifier[server] operator[SEP] identifier[setAttribute] operator[SEP] literal[String] , identifier[Caster] operator[SEP] identifier[toString] operator[SEP] identifier[tls] operator[SEP] operator[SEP] operator[SEP] identifier[server] operator[SEP] identifier[setAttribute] operator[SEP] literal[String] , identifier[Caster] operator[SEP] identifier[toString] operator[SEP] identifier[ssl] operator[SEP] operator[SEP] operator[SEP] identifier[server] operator[SEP] identifier[setAttribute] operator[SEP] literal[String] , identifier[Caster] operator[SEP] identifier[toString] operator[SEP] identifier[lifeTimeSpan] operator[SEP] operator[SEP] operator[SEP] identifier[server] operator[SEP] identifier[setAttribute] operator[SEP] literal[String] , identifier[Caster] operator[SEP] identifier[toString] operator[SEP] identifier[idleTimeSpan] operator[SEP] operator[SEP] operator[SEP] identifier[server] operator[SEP] identifier[setAttribute] operator[SEP] literal[String] , identifier[Caster] operator[SEP] identifier[toString] operator[SEP] identifier[reuseConnections] operator[SEP] operator[SEP] operator[SEP] }
public static Date setDate(final @NonNull Date dateToSet, final int year, final int month, final int day, final int hour, final int minute, final int second, final int milliSecond, final TimeZone zone, final Locale locale) { final Calendar calendar = Calendar.getInstance(zone, locale); calendar.setTime(dateToSet); calendar.set(Calendar.YEAR, year); calendar.set(Calendar.MONTH, month - 1); calendar.set(Calendar.DATE, day); calendar.set(Calendar.HOUR_OF_DAY, hour); calendar.set(Calendar.MINUTE, minute); calendar.set(Calendar.SECOND, second); calendar.set(Calendar.MILLISECOND, milliSecond); return calendar.getTime(); }
class class_name[name] begin[{] method[setDate, return_type[type[Date]], modifier[public static], parameter[dateToSet, year, month, day, hour, minute, second, milliSecond, zone, locale]] begin[{] local_variable[type[Calendar], calendar] call[calendar.setTime, parameter[member[.dateToSet]]] call[calendar.set, parameter[member[Calendar.YEAR], member[.year]]] call[calendar.set, parameter[member[Calendar.MONTH], binary_operation[member[.month], -, literal[1]]]] call[calendar.set, parameter[member[Calendar.DATE], member[.day]]] call[calendar.set, parameter[member[Calendar.HOUR_OF_DAY], member[.hour]]] call[calendar.set, parameter[member[Calendar.MINUTE], member[.minute]]] call[calendar.set, parameter[member[Calendar.SECOND], member[.second]]] call[calendar.set, parameter[member[Calendar.MILLISECOND], member[.milliSecond]]] return[call[calendar.getTime, parameter[]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[Date] identifier[setDate] operator[SEP] Keyword[final] annotation[@] identifier[NonNull] identifier[Date] identifier[dateToSet] , Keyword[final] Keyword[int] identifier[year] , Keyword[final] Keyword[int] identifier[month] , Keyword[final] Keyword[int] identifier[day] , Keyword[final] Keyword[int] identifier[hour] , Keyword[final] Keyword[int] identifier[minute] , Keyword[final] Keyword[int] identifier[second] , Keyword[final] Keyword[int] identifier[milliSecond] , Keyword[final] identifier[TimeZone] identifier[zone] , Keyword[final] identifier[Locale] identifier[locale] operator[SEP] { Keyword[final] identifier[Calendar] identifier[calendar] operator[=] identifier[Calendar] operator[SEP] identifier[getInstance] operator[SEP] identifier[zone] , identifier[locale] operator[SEP] operator[SEP] identifier[calendar] operator[SEP] identifier[setTime] operator[SEP] identifier[dateToSet] operator[SEP] operator[SEP] identifier[calendar] operator[SEP] identifier[set] operator[SEP] identifier[Calendar] operator[SEP] identifier[YEAR] , identifier[year] operator[SEP] operator[SEP] identifier[calendar] operator[SEP] identifier[set] operator[SEP] identifier[Calendar] operator[SEP] identifier[MONTH] , identifier[month] operator[-] Other[1] operator[SEP] operator[SEP] identifier[calendar] operator[SEP] identifier[set] operator[SEP] identifier[Calendar] operator[SEP] identifier[DATE] , identifier[day] operator[SEP] operator[SEP] identifier[calendar] operator[SEP] identifier[set] operator[SEP] identifier[Calendar] operator[SEP] identifier[HOUR_OF_DAY] , identifier[hour] operator[SEP] operator[SEP] identifier[calendar] operator[SEP] identifier[set] operator[SEP] identifier[Calendar] operator[SEP] identifier[MINUTE] , identifier[minute] operator[SEP] operator[SEP] identifier[calendar] operator[SEP] identifier[set] operator[SEP] identifier[Calendar] operator[SEP] identifier[SECOND] , identifier[second] operator[SEP] operator[SEP] identifier[calendar] operator[SEP] identifier[set] operator[SEP] identifier[Calendar] operator[SEP] identifier[MILLISECOND] , identifier[milliSecond] operator[SEP] operator[SEP] Keyword[return] identifier[calendar] operator[SEP] identifier[getTime] operator[SEP] operator[SEP] operator[SEP] }
public int[] PixelsToRaster( int px, int py, int zoom ) { int mapSize = tileSize << zoom; return new int[]{px, mapSize - py}; }
class class_name[name] begin[{] method[PixelsToRaster, return_type[type[int]], modifier[public], parameter[px, py, zoom]] begin[{] local_variable[type[int], mapSize] return[ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MemberReference(member=px, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=MemberReference(member=mapSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=py, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=-)]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=None, name=int))] end[}] END[}]
Keyword[public] Keyword[int] operator[SEP] operator[SEP] identifier[PixelsToRaster] operator[SEP] Keyword[int] identifier[px] , Keyword[int] identifier[py] , Keyword[int] identifier[zoom] operator[SEP] { Keyword[int] identifier[mapSize] operator[=] identifier[tileSize] operator[<<] identifier[zoom] operator[SEP] Keyword[return] Keyword[new] Keyword[int] operator[SEP] operator[SEP] { identifier[px] , identifier[mapSize] operator[-] identifier[py] } operator[SEP] }
public void setExportsInfo(java.util.Collection<ExportInfo> exportsInfo) { if (exportsInfo == null) { this.exportsInfo = null; return; } this.exportsInfo = new java.util.ArrayList<ExportInfo>(exportsInfo); }
class class_name[name] begin[{] method[setExportsInfo, return_type[void], modifier[public], parameter[exportsInfo]] begin[{] if[binary_operation[member[.exportsInfo], ==, literal[null]]] begin[{] assign[THIS[member[None.exportsInfo]], literal[null]] return[None] else begin[{] None end[}] assign[THIS[member[None.exportsInfo]], ClassCreator(arguments=[MemberReference(member=exportsInfo, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=java, sub_type=ReferenceType(arguments=None, dimensions=None, name=util, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=ExportInfo, sub_type=None))], dimensions=None, name=ArrayList, sub_type=None))))] end[}] END[}]
Keyword[public] Keyword[void] identifier[setExportsInfo] operator[SEP] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[Collection] operator[<] identifier[ExportInfo] operator[>] identifier[exportsInfo] operator[SEP] { Keyword[if] operator[SEP] identifier[exportsInfo] operator[==] Other[null] operator[SEP] { Keyword[this] operator[SEP] identifier[exportsInfo] operator[=] Other[null] operator[SEP] Keyword[return] operator[SEP] } Keyword[this] operator[SEP] identifier[exportsInfo] operator[=] Keyword[new] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[ArrayList] operator[<] identifier[ExportInfo] operator[>] operator[SEP] identifier[exportsInfo] operator[SEP] operator[SEP] }
public static <Resp extends HttpCmdResponse> Resp doGet(String ip, int port, HttpCmd<Resp> cmd) { Assert.hasText(cmd.getNodeIdentity(), "nodeIdentity can't be empty"); Assert.hasText(cmd.getCommand(), "command can't be empty"); StringBuilder sb = new StringBuilder(); sb.append("http://").append(ip).append(":").append(port).append("/").append(cmd.getNodeIdentity()).append("/").append(cmd.getCommand()); try { Map<String, String> params = cmd.getParams(); if (CollectionUtils.isNotEmpty(params)) { String prefix = "?"; for (Map.Entry<String, String> entry : params.entrySet()) { sb.append(prefix); prefix = "&"; sb.append(String.format("%s=%s", entry.getKey(), URLEncoder.encode(entry.getValue(), "UTF-8"))); } } return cmd.doGet(sb.toString()); } catch (Exception e) { throw new HttpCmdException(e); } }
class class_name[name] begin[{] method[doGet, return_type[type[Resp]], modifier[public static], parameter[ip, port, cmd]] begin[{] call[Assert.hasText, parameter[call[cmd.getNodeIdentity, parameter[]], literal["nodeIdentity can't be empty"]]] call[Assert.hasText, parameter[call[cmd.getCommand, parameter[]], literal["command can't be empty"]]] local_variable[type[StringBuilder], sb] call[sb.append, parameter[literal["http://"]]] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getParams, postfix_operators=[], prefix_operators=[], qualifier=cmd, selectors=[], type_arguments=None), name=params)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=[], name=Map, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=params, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isNotEmpty, postfix_operators=[], prefix_operators=[], qualifier=CollectionUtils, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="?"), name=prefix)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=prefix, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=append, postfix_operators=[], prefix_operators=[], qualifier=sb, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=prefix, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="&")), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="%s=%s"), MethodInvocation(arguments=[], member=getKey, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None), MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="UTF-8")], member=encode, postfix_operators=[], prefix_operators=[], qualifier=URLEncoder, selectors=[], type_arguments=None)], member=format, postfix_operators=[], prefix_operators=[], qualifier=String, selectors=[], type_arguments=None)], member=append, postfix_operators=[], prefix_operators=[], qualifier=sb, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=entrySet, postfix_operators=[], prefix_operators=[], qualifier=params, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=entry)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Map, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=None, name=Entry, sub_type=None)))), label=None)])), ReturnStatement(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=sb, selectors=[], type_arguments=None)], member=doGet, postfix_operators=[], prefix_operators=[], qualifier=cmd, 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=HttpCmdException, 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[static] operator[<] identifier[Resp] Keyword[extends] identifier[HttpCmdResponse] operator[>] identifier[Resp] identifier[doGet] operator[SEP] identifier[String] identifier[ip] , Keyword[int] identifier[port] , identifier[HttpCmd] operator[<] identifier[Resp] operator[>] identifier[cmd] operator[SEP] { identifier[Assert] operator[SEP] identifier[hasText] operator[SEP] identifier[cmd] operator[SEP] identifier[getNodeIdentity] operator[SEP] operator[SEP] , literal[String] operator[SEP] operator[SEP] identifier[Assert] operator[SEP] identifier[hasText] operator[SEP] identifier[cmd] operator[SEP] identifier[getCommand] operator[SEP] 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] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[ip] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[port] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[cmd] operator[SEP] identifier[getNodeIdentity] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[cmd] operator[SEP] identifier[getCommand] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[try] { identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[params] operator[=] identifier[cmd] operator[SEP] identifier[getParams] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[CollectionUtils] operator[SEP] identifier[isNotEmpty] operator[SEP] identifier[params] operator[SEP] operator[SEP] { identifier[String] identifier[prefix] operator[=] literal[String] operator[SEP] Keyword[for] operator[SEP] identifier[Map] operator[SEP] identifier[Entry] operator[<] identifier[String] , identifier[String] operator[>] identifier[entry] operator[:] identifier[params] operator[SEP] identifier[entrySet] operator[SEP] operator[SEP] operator[SEP] { identifier[sb] operator[SEP] identifier[append] operator[SEP] identifier[prefix] operator[SEP] operator[SEP] identifier[prefix] operator[=] literal[String] operator[SEP] identifier[sb] operator[SEP] identifier[append] operator[SEP] identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[entry] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] , identifier[URLEncoder] operator[SEP] identifier[encode] operator[SEP] identifier[entry] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] , literal[String] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } Keyword[return] identifier[cmd] operator[SEP] identifier[doGet] operator[SEP] identifier[sb] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[HttpCmdException] operator[SEP] identifier[e] operator[SEP] operator[SEP] } }
public static void writeGenerators( IGeneratorSet generators, OutputStream outputStream) { try( GeneratorSetJsonWriter writer = new GeneratorSetJsonWriter( outputStream)) { writer.write( generators); } catch( Exception e) { throw new RuntimeException( "Can't write generator definitions", e); } }
class class_name[name] begin[{] method[writeGenerators, return_type[void], modifier[public static], parameter[generators, outputStream]] begin[{] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=generators, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=write, postfix_operators=[], prefix_operators=[], qualifier=writer, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Can't write generator definitions"), 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=['Exception']))], finally_block=None, label=None, resources=[TryResource(annotations=[], modifiers=set(), name=writer, type=ReferenceType(arguments=None, dimensions=[], name=GeneratorSetJsonWriter, sub_type=None), value=ClassCreator(arguments=[MemberReference(member=outputStream, 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=GeneratorSetJsonWriter, sub_type=None)))]) end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[writeGenerators] operator[SEP] identifier[IGeneratorSet] identifier[generators] , identifier[OutputStream] identifier[outputStream] operator[SEP] { Keyword[try] operator[SEP] identifier[GeneratorSetJsonWriter] identifier[writer] operator[=] Keyword[new] identifier[GeneratorSetJsonWriter] operator[SEP] identifier[outputStream] operator[SEP] operator[SEP] { identifier[writer] operator[SEP] identifier[write] operator[SEP] identifier[generators] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[RuntimeException] operator[SEP] literal[String] , identifier[e] operator[SEP] operator[SEP] } }
public void setSecondColor(final Color COLOR) { if (null == secondColor) { _secondColor = COLOR; fireUpdateEvent(REDRAW_EVENT); } else { secondColor.set(COLOR); } }
class class_name[name] begin[{] method[setSecondColor, return_type[void], modifier[public], parameter[COLOR]] begin[{] if[binary_operation[literal[null], ==, member[.secondColor]]] begin[{] assign[member[._secondColor], member[.COLOR]] call[.fireUpdateEvent, parameter[member[.REDRAW_EVENT]]] else begin[{] call[secondColor.set, parameter[member[.COLOR]]] end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[setSecondColor] operator[SEP] Keyword[final] identifier[Color] identifier[COLOR] operator[SEP] { Keyword[if] operator[SEP] Other[null] operator[==] identifier[secondColor] operator[SEP] { identifier[_secondColor] operator[=] identifier[COLOR] operator[SEP] identifier[fireUpdateEvent] operator[SEP] identifier[REDRAW_EVENT] operator[SEP] operator[SEP] } Keyword[else] { identifier[secondColor] operator[SEP] identifier[set] operator[SEP] identifier[COLOR] operator[SEP] operator[SEP] } }
public static String encodeFromFile(final String filename) { java.io.File file = new java.io.File(filename); long fileLength = file.length(); java.io.InputStream ins; try { ins = new java.io.FileInputStream(file); } catch (FileNotFoundException e) { System.out.println("Error opening file " + filename + e.getMessage()); return null; } String encodedData = encodeFromInputStream(ins, fileLength); if (encodedData == null) { System.err.println("Error encoding from file " + filename); } return encodedData; }
class class_name[name] begin[{] method[encodeFromFile, return_type[type[String]], modifier[public static], parameter[filename]] begin[{] local_variable[type[java], file] local_variable[type[long], fileLength] local_variable[type[java], ins] TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=ins, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[MemberReference(member=file, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=java, sub_type=ReferenceType(arguments=None, dimensions=None, name=io, sub_type=ReferenceType(arguments=None, dimensions=None, name=FileInputStream, sub_type=None))))), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Error opening file "), operandr=MemberReference(member=filename, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), operator=+)], member=println, postfix_operators=[], prefix_operators=[], qualifier=System.out, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['FileNotFoundException']))], finally_block=None, label=None, resources=None) local_variable[type[String], encodedData] if[binary_operation[member[.encodedData], ==, literal[null]]] begin[{] call[System.err.println, parameter[binary_operation[literal["Error encoding from file "], +, member[.filename]]]] else begin[{] None end[}] return[member[.encodedData]] end[}] END[}]
Keyword[public] Keyword[static] identifier[String] identifier[encodeFromFile] operator[SEP] Keyword[final] identifier[String] identifier[filename] operator[SEP] { identifier[java] operator[SEP] identifier[io] operator[SEP] identifier[File] identifier[file] operator[=] Keyword[new] identifier[java] operator[SEP] identifier[io] operator[SEP] identifier[File] operator[SEP] identifier[filename] operator[SEP] operator[SEP] Keyword[long] identifier[fileLength] operator[=] identifier[file] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] identifier[java] operator[SEP] identifier[io] operator[SEP] identifier[InputStream] identifier[ins] operator[SEP] Keyword[try] { identifier[ins] operator[=] Keyword[new] identifier[java] operator[SEP] identifier[io] operator[SEP] identifier[FileInputStream] operator[SEP] identifier[file] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[FileNotFoundException] identifier[e] operator[SEP] { identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[println] operator[SEP] literal[String] operator[+] identifier[filename] operator[+] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] Other[null] operator[SEP] } identifier[String] identifier[encodedData] operator[=] identifier[encodeFromInputStream] operator[SEP] identifier[ins] , identifier[fileLength] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[encodedData] operator[==] Other[null] operator[SEP] { identifier[System] operator[SEP] identifier[err] operator[SEP] identifier[println] operator[SEP] literal[String] operator[+] identifier[filename] operator[SEP] operator[SEP] } Keyword[return] identifier[encodedData] operator[SEP] }
public final void setSecurityController(SecurityController controller) { if (sealed) onSealedMutation(); if (controller == null) throw new IllegalArgumentException(); if (securityController != null) { throw new SecurityException("Can not overwrite existing SecurityController object"); } if (SecurityController.hasGlobal()) { throw new SecurityException("Can not overwrite existing global SecurityController object"); } securityController = controller; }
class class_name[name] begin[{] method[setSecurityController, return_type[void], modifier[final public], parameter[controller]] begin[{] if[member[.sealed]] begin[{] call[.onSealedMutation, parameter[]] else begin[{] None end[}] if[binary_operation[member[.controller], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None) else begin[{] None end[}] if[binary_operation[member[.securityController], !=, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Can not overwrite existing SecurityController object")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SecurityException, sub_type=None)), label=None) else begin[{] None end[}] if[call[SecurityController.hasGlobal, parameter[]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Can not overwrite existing global SecurityController object")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SecurityException, sub_type=None)), label=None) else begin[{] None end[}] assign[member[.securityController], member[.controller]] end[}] END[}]
Keyword[public] Keyword[final] Keyword[void] identifier[setSecurityController] operator[SEP] identifier[SecurityController] identifier[controller] operator[SEP] { Keyword[if] operator[SEP] identifier[sealed] operator[SEP] identifier[onSealedMutation] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[controller] operator[==] Other[null] operator[SEP] Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[securityController] operator[!=] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[SecurityException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[SecurityController] operator[SEP] identifier[hasGlobal] operator[SEP] operator[SEP] operator[SEP] { Keyword[throw] Keyword[new] identifier[SecurityException] operator[SEP] literal[String] operator[SEP] operator[SEP] } identifier[securityController] operator[=] identifier[controller] operator[SEP] }
public static Vector tokenizePath (String path, String separator) { Vector ret = new Vector(); if (FileUtil.isAbsolutePath(path)) { String[] s = FileUtil.dissect(path); ret.add(s[0]); path = s[1]; } StringTokenizer st = new StringTokenizer(path, separator); while (st.hasMoreTokens()) { ret.addElement(st.nextToken()); } return ret; }
class class_name[name] begin[{] method[tokenizePath, return_type[type[Vector]], modifier[public static], parameter[path, separator]] begin[{] local_variable[type[Vector], ret] if[call[FileUtil.isAbsolutePath, parameter[member[.path]]]] begin[{] local_variable[type[String], s] call[ret.add, parameter[member[.s]]] assign[member[.path], member[.s]] else begin[{] None end[}] local_variable[type[StringTokenizer], st] while[call[st.hasMoreTokens, parameter[]]] begin[{] call[ret.addElement, parameter[call[st.nextToken, parameter[]]]] end[}] return[member[.ret]] end[}] END[}]
Keyword[public] Keyword[static] identifier[Vector] identifier[tokenizePath] operator[SEP] identifier[String] identifier[path] , identifier[String] identifier[separator] operator[SEP] { identifier[Vector] identifier[ret] operator[=] Keyword[new] identifier[Vector] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[FileUtil] operator[SEP] identifier[isAbsolutePath] operator[SEP] identifier[path] operator[SEP] operator[SEP] { identifier[String] operator[SEP] operator[SEP] identifier[s] operator[=] identifier[FileUtil] operator[SEP] identifier[dissect] operator[SEP] identifier[path] operator[SEP] operator[SEP] identifier[ret] operator[SEP] identifier[add] operator[SEP] identifier[s] operator[SEP] Other[0] operator[SEP] operator[SEP] operator[SEP] identifier[path] operator[=] identifier[s] operator[SEP] Other[1] operator[SEP] operator[SEP] } identifier[StringTokenizer] identifier[st] operator[=] Keyword[new] identifier[StringTokenizer] operator[SEP] identifier[path] , identifier[separator] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[st] operator[SEP] identifier[hasMoreTokens] operator[SEP] operator[SEP] operator[SEP] { identifier[ret] operator[SEP] identifier[addElement] operator[SEP] identifier[st] operator[SEP] identifier[nextToken] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[ret] operator[SEP] }
@Override public void removeAttributes() { beginUpdate(); try { // remove all attributes so.removeAttributes(); } catch (Exception ex) { log.warn("Exception on so.removeAttributes", ex); } finally { endUpdate(); } // notify listeners on attributes clear for (ISharedObjectListener listener : serverListeners) { listener.onSharedObjectClear(this); } }
class class_name[name] begin[{] method[removeAttributes, return_type[void], modifier[public], parameter[]] begin[{] call[.beginUpdate, parameter[]] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=removeAttributes, postfix_operators=[], prefix_operators=[], qualifier=so, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Exception on so.removeAttributes"), MemberReference(member=ex, 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=ex, types=['Exception']))], finally_block=[StatementExpression(expression=MethodInvocation(arguments=[], member=endUpdate, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], label=None, resources=None) ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[])], member=onSharedObjectClear, postfix_operators=[], prefix_operators=[], qualifier=listener, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=serverListeners, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=listener)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ISharedObjectListener, sub_type=None))), label=None) end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[removeAttributes] operator[SEP] operator[SEP] { identifier[beginUpdate] operator[SEP] operator[SEP] operator[SEP] Keyword[try] { identifier[so] operator[SEP] identifier[removeAttributes] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[ex] operator[SEP] { identifier[log] operator[SEP] identifier[warn] operator[SEP] literal[String] , identifier[ex] operator[SEP] operator[SEP] } Keyword[finally] { identifier[endUpdate] operator[SEP] operator[SEP] operator[SEP] } Keyword[for] operator[SEP] identifier[ISharedObjectListener] identifier[listener] operator[:] identifier[serverListeners] operator[SEP] { identifier[listener] operator[SEP] identifier[onSharedObjectClear] operator[SEP] Keyword[this] operator[SEP] operator[SEP] } }
protected <T> T initialize(final T object, final Object... args) { if (object instanceof ParameterizedInitable) { ((ParameterizedInitable) object).init(args); } else if (object instanceof Initable) { ((Initable) object).init(); } return object; }
class class_name[name] begin[{] method[initialize, return_type[type[T]], modifier[protected], parameter[object, args]] begin[{] if[binary_operation[member[.object], instanceof, type[ParameterizedInitable]]] begin[{] Cast(expression=MemberReference(member=object, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=ParameterizedInitable, sub_type=None)) else begin[{] if[binary_operation[member[.object], instanceof, type[Initable]]] begin[{] Cast(expression=MemberReference(member=object, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Initable, sub_type=None)) else begin[{] None end[}] end[}] return[member[.object]] end[}] END[}]
Keyword[protected] operator[<] identifier[T] operator[>] identifier[T] identifier[initialize] operator[SEP] Keyword[final] identifier[T] identifier[object] , Keyword[final] identifier[Object] operator[...] identifier[args] operator[SEP] { Keyword[if] operator[SEP] identifier[object] Keyword[instanceof] identifier[ParameterizedInitable] operator[SEP] { operator[SEP] operator[SEP] identifier[ParameterizedInitable] operator[SEP] identifier[object] operator[SEP] operator[SEP] identifier[init] operator[SEP] identifier[args] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[object] Keyword[instanceof] identifier[Initable] operator[SEP] { operator[SEP] operator[SEP] identifier[Initable] operator[SEP] identifier[object] operator[SEP] operator[SEP] identifier[init] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[object] operator[SEP] }
public void parse (String string) { char[] data = string.toCharArray(); parse(data, 0, data.length); }
class class_name[name] begin[{] method[parse, return_type[void], modifier[public], parameter[string]] begin[{] local_variable[type[char], data] call[.parse, parameter[member[.data], literal[0], member[data.length]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[parse] operator[SEP] identifier[String] identifier[string] operator[SEP] { Keyword[char] operator[SEP] operator[SEP] identifier[data] operator[=] identifier[string] operator[SEP] identifier[toCharArray] operator[SEP] operator[SEP] operator[SEP] identifier[parse] operator[SEP] identifier[data] , Other[0] , identifier[data] operator[SEP] identifier[length] operator[SEP] operator[SEP] }
@Override public Collection<Dependency> getDependencies() { return dependencies == null ? Collections.<Dependency>emptyList() : dependencies; }
class class_name[name] begin[{] method[getDependencies, return_type[type[Collection]], modifier[public], parameter[]] begin[{] return[TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=dependencies, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), if_false=MemberReference(member=dependencies, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_true=MethodInvocation(arguments=[], member=Collections, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Dependency, sub_type=None))]))] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[Collection] operator[<] identifier[Dependency] operator[>] identifier[getDependencies] operator[SEP] operator[SEP] { Keyword[return] identifier[dependencies] operator[==] Other[null] operator[?] identifier[Collections] operator[SEP] operator[<] identifier[Dependency] operator[>] identifier[emptyList] operator[SEP] operator[SEP] operator[:] identifier[dependencies] operator[SEP] }
public String connectAndBind(String host, int port, BindParameter bindParam, long timeout) throws IOException { logger.debug("Connect and bind to {} port {}", host, port); if (getSessionState() != SessionState.CLOSED) { throw new IOException("Session state is not closed"); } conn = connFactory.createConnection(host, port); logger.info("Connected to {}", conn.getInetAddress()); conn.setSoTimeout(getEnquireLinkTimer()); sessionContext.open(); try { in = new DataInputStream(conn.getInputStream()); out = conn.getOutputStream(); pduReaderWorker = new PDUReaderWorker(); pduReaderWorker.start(); String smscSystemId = sendBind(bindParam.getBindType(), bindParam.getSystemId(), bindParam.getPassword(), bindParam.getSystemType(), bindParam.getInterfaceVersion(), bindParam.getAddrTon(), bindParam.getAddrNpi(), bindParam.getAddressRange(), timeout); sessionContext.bound(bindParam.getBindType()); enquireLinkSender = new EnquireLinkSender(); enquireLinkSender.start(); return smscSystemId; } catch (PDUException e) { logger.error("Failed sending bind command", e); throw new IOException("Failed sending bind since some string parameter area invalid: " + e.getMessage(), e); } catch (NegativeResponseException e) { String message = "Receive negative bind response"; logger.error(message, e); close(); throw new IOException(message + ": " + e.getMessage(), e); } catch (InvalidResponseException e) { String message = "Receive invalid response of bind"; logger.error(message, e); close(); throw new IOException(message + ": " + e.getMessage(), e); } catch (ResponseTimeoutException e) { String message = "Waiting bind response take time too long"; logger.error(message, e); close(); throw new IOException(message + ": " + e.getMessage(), e); } catch (IOException e) { logger.error("IO error occurred", e); close(); throw e; } }
class class_name[name] begin[{] method[connectAndBind, return_type[type[String]], modifier[public], parameter[host, port, bindParam, timeout]] begin[{] call[logger.debug, parameter[literal["Connect and bind to {} port {}"], member[.host], member[.port]]] if[binary_operation[call[.getSessionState, parameter[]], !=, member[SessionState.CLOSED]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Session state is not closed")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IOException, sub_type=None)), label=None) else begin[{] None end[}] assign[member[.conn], call[connFactory.createConnection, parameter[member[.host], member[.port]]]] call[logger.info, parameter[literal["Connected to {}"], call[conn.getInetAddress, parameter[]]]] call[conn.setSoTimeout, parameter[call[.getEnquireLinkTimer, parameter[]]]] call[sessionContext.open, parameter[]] TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=in, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[MethodInvocation(arguments=[], member=getInputStream, postfix_operators=[], prefix_operators=[], qualifier=conn, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=DataInputStream, sub_type=None))), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=out, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=getOutputStream, postfix_operators=[], prefix_operators=[], qualifier=conn, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=pduReaderWorker, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=PDUReaderWorker, sub_type=None))), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=start, postfix_operators=[], prefix_operators=[], qualifier=pduReaderWorker, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getBindType, postfix_operators=[], prefix_operators=[], qualifier=bindParam, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getSystemId, postfix_operators=[], prefix_operators=[], qualifier=bindParam, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getPassword, postfix_operators=[], prefix_operators=[], qualifier=bindParam, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getSystemType, postfix_operators=[], prefix_operators=[], qualifier=bindParam, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getInterfaceVersion, postfix_operators=[], prefix_operators=[], qualifier=bindParam, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getAddrTon, postfix_operators=[], prefix_operators=[], qualifier=bindParam, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getAddrNpi, postfix_operators=[], prefix_operators=[], qualifier=bindParam, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getAddressRange, postfix_operators=[], prefix_operators=[], qualifier=bindParam, selectors=[], type_arguments=None), MemberReference(member=timeout, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=sendBind, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=smscSystemId)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getBindType, postfix_operators=[], prefix_operators=[], qualifier=bindParam, selectors=[], type_arguments=None)], member=bound, postfix_operators=[], prefix_operators=[], qualifier=sessionContext, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=enquireLinkSender, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=EnquireLinkSender, sub_type=None))), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=start, postfix_operators=[], prefix_operators=[], qualifier=enquireLinkSender, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=MemberReference(member=smscSystemId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Failed sending bind command"), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), label=None), ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Failed sending bind since some string parameter area invalid: "), operandr=MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), operator=+), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IOException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['PDUException'])), CatchClause(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Receive negative bind response"), name=message)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=message, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=close, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=message, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=": "), operator=+), operandr=MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), operator=+), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IOException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['NegativeResponseException'])), CatchClause(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Receive invalid response of bind"), name=message)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=message, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=close, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=message, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=": "), operator=+), operandr=MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), operator=+), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IOException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['InvalidResponseException'])), CatchClause(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Waiting bind response take time too long"), name=message)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=message, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=close, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=message, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=": "), operator=+), operandr=MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), operator=+), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IOException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['ResponseTimeoutException'])), CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="IO error occurred"), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=close, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), ThrowStatement(expression=MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IOException']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[public] identifier[String] identifier[connectAndBind] operator[SEP] identifier[String] identifier[host] , Keyword[int] identifier[port] , identifier[BindParameter] identifier[bindParam] , Keyword[long] identifier[timeout] operator[SEP] Keyword[throws] identifier[IOException] { identifier[logger] operator[SEP] identifier[debug] operator[SEP] literal[String] , identifier[host] , identifier[port] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[getSessionState] operator[SEP] operator[SEP] operator[!=] identifier[SessionState] operator[SEP] identifier[CLOSED] operator[SEP] { Keyword[throw] Keyword[new] identifier[IOException] operator[SEP] literal[String] operator[SEP] operator[SEP] } identifier[conn] operator[=] identifier[connFactory] operator[SEP] identifier[createConnection] operator[SEP] identifier[host] , identifier[port] operator[SEP] operator[SEP] identifier[logger] operator[SEP] identifier[info] operator[SEP] literal[String] , identifier[conn] operator[SEP] identifier[getInetAddress] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[conn] operator[SEP] identifier[setSoTimeout] operator[SEP] identifier[getEnquireLinkTimer] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[sessionContext] operator[SEP] identifier[open] operator[SEP] operator[SEP] operator[SEP] Keyword[try] { identifier[in] operator[=] Keyword[new] identifier[DataInputStream] operator[SEP] identifier[conn] operator[SEP] identifier[getInputStream] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[out] operator[=] identifier[conn] operator[SEP] identifier[getOutputStream] operator[SEP] operator[SEP] operator[SEP] identifier[pduReaderWorker] operator[=] Keyword[new] identifier[PDUReaderWorker] operator[SEP] operator[SEP] operator[SEP] identifier[pduReaderWorker] operator[SEP] identifier[start] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[smscSystemId] operator[=] identifier[sendBind] operator[SEP] identifier[bindParam] operator[SEP] identifier[getBindType] operator[SEP] operator[SEP] , identifier[bindParam] operator[SEP] identifier[getSystemId] operator[SEP] operator[SEP] , identifier[bindParam] operator[SEP] identifier[getPassword] operator[SEP] operator[SEP] , identifier[bindParam] operator[SEP] identifier[getSystemType] operator[SEP] operator[SEP] , identifier[bindParam] operator[SEP] identifier[getInterfaceVersion] operator[SEP] operator[SEP] , identifier[bindParam] operator[SEP] identifier[getAddrTon] operator[SEP] operator[SEP] , identifier[bindParam] operator[SEP] identifier[getAddrNpi] operator[SEP] operator[SEP] , identifier[bindParam] operator[SEP] identifier[getAddressRange] operator[SEP] operator[SEP] , identifier[timeout] operator[SEP] operator[SEP] identifier[sessionContext] operator[SEP] identifier[bound] operator[SEP] identifier[bindParam] operator[SEP] identifier[getBindType] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[enquireLinkSender] operator[=] Keyword[new] identifier[EnquireLinkSender] operator[SEP] operator[SEP] operator[SEP] identifier[enquireLinkSender] operator[SEP] identifier[start] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[smscSystemId] operator[SEP] } Keyword[catch] operator[SEP] identifier[PDUException] identifier[e] operator[SEP] { identifier[logger] operator[SEP] identifier[error] operator[SEP] literal[String] , identifier[e] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[IOException] operator[SEP] literal[String] operator[+] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[NegativeResponseException] identifier[e] operator[SEP] { identifier[String] identifier[message] operator[=] literal[String] operator[SEP] identifier[logger] operator[SEP] identifier[error] operator[SEP] identifier[message] , identifier[e] operator[SEP] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[IOException] operator[SEP] identifier[message] operator[+] literal[String] operator[+] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[InvalidResponseException] identifier[e] operator[SEP] { identifier[String] identifier[message] operator[=] literal[String] operator[SEP] identifier[logger] operator[SEP] identifier[error] operator[SEP] identifier[message] , identifier[e] operator[SEP] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[IOException] operator[SEP] identifier[message] operator[+] literal[String] operator[+] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[ResponseTimeoutException] identifier[e] operator[SEP] { identifier[String] identifier[message] operator[=] literal[String] operator[SEP] identifier[logger] operator[SEP] identifier[error] operator[SEP] identifier[message] , identifier[e] operator[SEP] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[IOException] operator[SEP] identifier[message] operator[+] literal[String] operator[+] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[e] 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] identifier[close] operator[SEP] operator[SEP] operator[SEP] Keyword[throw] identifier[e] operator[SEP] } }
public String getNotNullTrueStringRep() { try { String rep = ""; String joiner = "\n"; Field[] f = this.getClass().getFields(); for (Field ff : f) { String name = ff.getName(); Class<?> type = ff.getType(); if (type.equals(Boolean.class) || type.equals(boolean.class)) { boolean val = ff.getBoolean(this); if (val == true) rep += joiner + name + "=" + val; } else if (type.equals(String.class)) { String val = (String) ff.get(this); if (val != null) rep += joiner + name + "=" + val; } else if (type.equals(Double.class)) { Double val = (Double) ff.get(this); rep += joiner + name + "=" + val; } else if (type.equals(double.class)) { double val = ff.getDouble(this); rep += joiner + name + "=" + val; } else if (type.equals(Integer.class)) { Integer val = (Integer) ff.get(this); rep += joiner + name + "=" + val; } else if (type.equals(int.class)) { int val = ff.getInt(this); rep += joiner + name + "=" + val; } else if (type.equals(Float.class)) { Float val = (Float) ff.get(this); rep += joiner + name + "=" + val; } else if (type.equals(float.class)) { float val = ff.getFloat(this); rep += joiner + name + "=" + val; } else if (type.equals(Byte.class)) { Byte val = (Byte) ff.get(this); rep += joiner + name + "=" + val; } else if (type.equals(byte.class)) { byte val = ff.getByte(this); rep += joiner + name + "=" + val; } else if (type.equals(char.class)) { char val = ff.getChar(this); rep += joiner + name + "=" + val; } else if (type.equals(Long.class)) { Long val = (Long) ff.get(this); rep += joiner + name + "=" + val; } else if (type.equals(long.class)) { long val = ff.getLong(this); rep += joiner + name + "=" + val; } } return rep; } catch (Exception e) { e.printStackTrace(); } return null; }
class class_name[name] begin[{] method[getNotNullTrueStringRep, return_type[type[String]], modifier[public], parameter[]] begin[{] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=""), name=rep)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\n"), name=joiner)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[], member=getClass, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=getFields, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), name=f)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[None], name=Field, sub_type=None)), ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=ff, 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=getType, postfix_operators=[], prefix_operators=[], qualifier=ff, selectors=[], type_arguments=None), name=type)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=?, type=None)], dimensions=[], name=Class, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Boolean, sub_type=None))], member=equals, postfix_operators=[], prefix_operators=[], qualifier=type, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=[], name=boolean))], member=equals, postfix_operators=[], prefix_operators=[], qualifier=type, selectors=[], type_arguments=None), operator=||), else_statement=IfStatement(condition=MethodInvocation(arguments=[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=String, sub_type=None))], member=equals, postfix_operators=[], prefix_operators=[], qualifier=type, selectors=[], type_arguments=None), else_statement=IfStatement(condition=MethodInvocation(arguments=[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Double, sub_type=None))], member=equals, postfix_operators=[], prefix_operators=[], qualifier=type, selectors=[], type_arguments=None), else_statement=IfStatement(condition=MethodInvocation(arguments=[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=[], name=double))], member=equals, postfix_operators=[], prefix_operators=[], qualifier=type, selectors=[], type_arguments=None), else_statement=IfStatement(condition=MethodInvocation(arguments=[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Integer, sub_type=None))], member=equals, postfix_operators=[], prefix_operators=[], qualifier=type, selectors=[], type_arguments=None), else_statement=IfStatement(condition=MethodInvocation(arguments=[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=[], name=int))], member=equals, postfix_operators=[], prefix_operators=[], qualifier=type, selectors=[], type_arguments=None), else_statement=IfStatement(condition=MethodInvocation(arguments=[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Float, sub_type=None))], member=equals, postfix_operators=[], prefix_operators=[], qualifier=type, selectors=[], type_arguments=None), else_statement=IfStatement(condition=MethodInvocation(arguments=[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=[], name=float))], member=equals, postfix_operators=[], prefix_operators=[], qualifier=type, selectors=[], type_arguments=None), else_statement=IfStatement(condition=MethodInvocation(arguments=[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Byte, sub_type=None))], member=equals, postfix_operators=[], prefix_operators=[], qualifier=type, selectors=[], type_arguments=None), else_statement=IfStatement(condition=MethodInvocation(arguments=[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=[], name=byte))], member=equals, postfix_operators=[], prefix_operators=[], qualifier=type, selectors=[], type_arguments=None), else_statement=IfStatement(condition=MethodInvocation(arguments=[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=[], name=char))], member=equals, postfix_operators=[], prefix_operators=[], qualifier=type, selectors=[], type_arguments=None), else_statement=IfStatement(condition=MethodInvocation(arguments=[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Long, sub_type=None))], member=equals, postfix_operators=[], prefix_operators=[], qualifier=type, selectors=[], type_arguments=None), else_statement=IfStatement(condition=MethodInvocation(arguments=[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=[], name=long))], member=equals, postfix_operators=[], prefix_operators=[], qualifier=type, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[])], member=getLong, postfix_operators=[], prefix_operators=[], qualifier=ff, selectors=[], type_arguments=None), name=val)], modifiers=set(), type=BasicType(dimensions=[], name=long)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=rep, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=joiner, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), 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=val, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=ff, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=Long, sub_type=None)), name=val)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Long, sub_type=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=rep, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=joiner, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), 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=val, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[])], member=getChar, postfix_operators=[], prefix_operators=[], qualifier=ff, selectors=[], type_arguments=None), name=val)], modifiers=set(), type=BasicType(dimensions=[], name=char)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=rep, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=joiner, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), 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=val, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[])], member=getByte, postfix_operators=[], prefix_operators=[], qualifier=ff, selectors=[], type_arguments=None), name=val)], modifiers=set(), type=BasicType(dimensions=[], name=byte)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=rep, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=joiner, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), 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=val, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=ff, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=Byte, sub_type=None)), name=val)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Byte, sub_type=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=rep, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=joiner, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), 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=val, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[])], member=getFloat, postfix_operators=[], prefix_operators=[], qualifier=ff, selectors=[], type_arguments=None), name=val)], modifiers=set(), type=BasicType(dimensions=[], name=float)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=rep, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=joiner, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), 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=val, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=ff, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=Float, sub_type=None)), name=val)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Float, sub_type=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=rep, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=joiner, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), 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=val, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[])], member=getInt, postfix_operators=[], prefix_operators=[], qualifier=ff, selectors=[], type_arguments=None), name=val)], modifiers=set(), type=BasicType(dimensions=[], name=int)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=rep, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=joiner, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), 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=val, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=ff, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=Integer, sub_type=None)), name=val)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Integer, sub_type=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=rep, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=joiner, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), 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=val, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[])], member=getDouble, postfix_operators=[], prefix_operators=[], qualifier=ff, selectors=[], type_arguments=None), name=val)], modifiers=set(), type=BasicType(dimensions=[], name=double)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=rep, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=joiner, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), 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=val, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=ff, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=Double, sub_type=None)), name=val)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Double, sub_type=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=rep, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=joiner, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), 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=val, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=ff, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), name=val)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=val, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=StatementExpression(expression=Assignment(expressionl=MemberReference(member=rep, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=joiner, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), 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=val, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)), label=None))])), label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[])], member=getBoolean, postfix_operators=[], prefix_operators=[], qualifier=ff, selectors=[], type_arguments=None), name=val)], modifiers=set(), type=BasicType(dimensions=[], name=boolean)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=val, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true), operator===), else_statement=None, label=None, then_statement=StatementExpression(expression=Assignment(expressionl=MemberReference(member=rep, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=joiner, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), 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=val, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)), label=None))]))]), control=EnhancedForControl(iterable=MemberReference(member=f, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=ff)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Field, sub_type=None))), label=None), ReturnStatement(expression=MemberReference(member=rep, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=printStackTrace, postfix_operators=[], prefix_operators=[], qualifier=e, 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) return[literal[null]] end[}] END[}]
Keyword[public] identifier[String] identifier[getNotNullTrueStringRep] operator[SEP] operator[SEP] { Keyword[try] { identifier[String] identifier[rep] operator[=] literal[String] operator[SEP] identifier[String] identifier[joiner] operator[=] literal[String] operator[SEP] identifier[Field] operator[SEP] operator[SEP] identifier[f] operator[=] Keyword[this] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] identifier[getFields] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Field] identifier[ff] operator[:] identifier[f] operator[SEP] { identifier[String] identifier[name] operator[=] identifier[ff] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] identifier[Class] operator[<] operator[?] operator[>] identifier[type] operator[=] identifier[ff] operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[type] operator[SEP] identifier[equals] operator[SEP] identifier[Boolean] operator[SEP] Keyword[class] operator[SEP] operator[||] identifier[type] operator[SEP] identifier[equals] operator[SEP] Keyword[boolean] operator[SEP] Keyword[class] operator[SEP] operator[SEP] { Keyword[boolean] identifier[val] operator[=] identifier[ff] operator[SEP] identifier[getBoolean] operator[SEP] Keyword[this] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[val] operator[==] literal[boolean] operator[SEP] identifier[rep] operator[+=] identifier[joiner] operator[+] identifier[name] operator[+] literal[String] operator[+] identifier[val] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[type] operator[SEP] identifier[equals] operator[SEP] identifier[String] operator[SEP] Keyword[class] operator[SEP] operator[SEP] { identifier[String] identifier[val] operator[=] operator[SEP] identifier[String] operator[SEP] identifier[ff] operator[SEP] identifier[get] operator[SEP] Keyword[this] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[val] operator[!=] Other[null] operator[SEP] identifier[rep] operator[+=] identifier[joiner] operator[+] identifier[name] operator[+] literal[String] operator[+] identifier[val] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[type] operator[SEP] identifier[equals] operator[SEP] identifier[Double] operator[SEP] Keyword[class] operator[SEP] operator[SEP] { identifier[Double] identifier[val] operator[=] operator[SEP] identifier[Double] operator[SEP] identifier[ff] operator[SEP] identifier[get] operator[SEP] Keyword[this] operator[SEP] operator[SEP] identifier[rep] operator[+=] identifier[joiner] operator[+] identifier[name] operator[+] literal[String] operator[+] identifier[val] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[type] operator[SEP] identifier[equals] operator[SEP] Keyword[double] operator[SEP] Keyword[class] operator[SEP] operator[SEP] { Keyword[double] identifier[val] operator[=] identifier[ff] operator[SEP] identifier[getDouble] operator[SEP] Keyword[this] operator[SEP] operator[SEP] identifier[rep] operator[+=] identifier[joiner] operator[+] identifier[name] operator[+] literal[String] operator[+] identifier[val] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[type] operator[SEP] identifier[equals] operator[SEP] identifier[Integer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] { identifier[Integer] identifier[val] operator[=] operator[SEP] identifier[Integer] operator[SEP] identifier[ff] operator[SEP] identifier[get] operator[SEP] Keyword[this] operator[SEP] operator[SEP] identifier[rep] operator[+=] identifier[joiner] operator[+] identifier[name] operator[+] literal[String] operator[+] identifier[val] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[type] operator[SEP] identifier[equals] operator[SEP] Keyword[int] operator[SEP] Keyword[class] operator[SEP] operator[SEP] { Keyword[int] identifier[val] operator[=] identifier[ff] operator[SEP] identifier[getInt] operator[SEP] Keyword[this] operator[SEP] operator[SEP] identifier[rep] operator[+=] identifier[joiner] operator[+] identifier[name] operator[+] literal[String] operator[+] identifier[val] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[type] operator[SEP] identifier[equals] operator[SEP] identifier[Float] operator[SEP] Keyword[class] operator[SEP] operator[SEP] { identifier[Float] identifier[val] operator[=] operator[SEP] identifier[Float] operator[SEP] identifier[ff] operator[SEP] identifier[get] operator[SEP] Keyword[this] operator[SEP] operator[SEP] identifier[rep] operator[+=] identifier[joiner] operator[+] identifier[name] operator[+] literal[String] operator[+] identifier[val] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[type] operator[SEP] identifier[equals] operator[SEP] Keyword[float] operator[SEP] Keyword[class] operator[SEP] operator[SEP] { Keyword[float] identifier[val] operator[=] identifier[ff] operator[SEP] identifier[getFloat] operator[SEP] Keyword[this] operator[SEP] operator[SEP] identifier[rep] operator[+=] identifier[joiner] operator[+] identifier[name] operator[+] literal[String] operator[+] identifier[val] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[type] operator[SEP] identifier[equals] operator[SEP] identifier[Byte] operator[SEP] Keyword[class] operator[SEP] operator[SEP] { identifier[Byte] identifier[val] operator[=] operator[SEP] identifier[Byte] operator[SEP] identifier[ff] operator[SEP] identifier[get] operator[SEP] Keyword[this] operator[SEP] operator[SEP] identifier[rep] operator[+=] identifier[joiner] operator[+] identifier[name] operator[+] literal[String] operator[+] identifier[val] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[type] operator[SEP] identifier[equals] operator[SEP] Keyword[byte] operator[SEP] Keyword[class] operator[SEP] operator[SEP] { Keyword[byte] identifier[val] operator[=] identifier[ff] operator[SEP] identifier[getByte] operator[SEP] Keyword[this] operator[SEP] operator[SEP] identifier[rep] operator[+=] identifier[joiner] operator[+] identifier[name] operator[+] literal[String] operator[+] identifier[val] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[type] operator[SEP] identifier[equals] operator[SEP] Keyword[char] operator[SEP] Keyword[class] operator[SEP] operator[SEP] { Keyword[char] identifier[val] operator[=] identifier[ff] operator[SEP] identifier[getChar] operator[SEP] Keyword[this] operator[SEP] operator[SEP] identifier[rep] operator[+=] identifier[joiner] operator[+] identifier[name] operator[+] literal[String] operator[+] identifier[val] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[type] operator[SEP] identifier[equals] operator[SEP] identifier[Long] operator[SEP] Keyword[class] operator[SEP] operator[SEP] { identifier[Long] identifier[val] operator[=] operator[SEP] identifier[Long] operator[SEP] identifier[ff] operator[SEP] identifier[get] operator[SEP] Keyword[this] operator[SEP] operator[SEP] identifier[rep] operator[+=] identifier[joiner] operator[+] identifier[name] operator[+] literal[String] operator[+] identifier[val] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[type] operator[SEP] identifier[equals] operator[SEP] Keyword[long] operator[SEP] Keyword[class] operator[SEP] operator[SEP] { Keyword[long] identifier[val] operator[=] identifier[ff] operator[SEP] identifier[getLong] operator[SEP] Keyword[this] operator[SEP] operator[SEP] identifier[rep] operator[+=] identifier[joiner] operator[+] identifier[name] operator[+] literal[String] operator[+] identifier[val] operator[SEP] } } Keyword[return] identifier[rep] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { identifier[e] operator[SEP] identifier[printStackTrace] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] Other[null] operator[SEP] }
public void addEntities(String[][] entityArray) { for (String[] anEntityArray : entityArray) { addEntity(anEntityArray[0], Integer.parseInt(anEntityArray[1])); } }
class class_name[name] begin[{] method[addEntities, return_type[void], modifier[public], parameter[entityArray]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=anEntityArray, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))]), MethodInvocation(arguments=[MemberReference(member=anEntityArray, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1))])], member=parseInt, postfix_operators=[], prefix_operators=[], qualifier=Integer, selectors=[], type_arguments=None)], member=addEntity, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=entityArray, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=anEntityArray)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[None], name=String, sub_type=None))), label=None) end[}] END[}]
Keyword[public] Keyword[void] identifier[addEntities] operator[SEP] identifier[String] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[entityArray] operator[SEP] { Keyword[for] operator[SEP] identifier[String] operator[SEP] operator[SEP] identifier[anEntityArray] operator[:] identifier[entityArray] operator[SEP] { identifier[addEntity] operator[SEP] identifier[anEntityArray] operator[SEP] Other[0] operator[SEP] , identifier[Integer] operator[SEP] identifier[parseInt] operator[SEP] identifier[anEntityArray] operator[SEP] Other[1] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } }
public void setUploadTempDir(File uploadTempDir) throws IOException { if (!uploadTempDir.exists() && !uploadTempDir.mkdirs()) { String message = "Given uploadTempDir [" + uploadTempDir + "] could not be created."; throw new IllegalArgumentException(message); } this.mFileItemFactory.setRepository(uploadTempDir); }
class class_name[name] begin[{] method[setUploadTempDir, return_type[void], modifier[public], parameter[uploadTempDir]] begin[{] if[binary_operation[call[uploadTempDir.exists, parameter[]], &&, call[uploadTempDir.mkdirs, parameter[]]]] begin[{] local_variable[type[String], message] ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=message, 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=IllegalArgumentException, sub_type=None)), label=None) else begin[{] None end[}] THIS[member[None.mFileItemFactory]call[None.setRepository, parameter[member[.uploadTempDir]]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[setUploadTempDir] operator[SEP] identifier[File] identifier[uploadTempDir] operator[SEP] Keyword[throws] identifier[IOException] { Keyword[if] operator[SEP] operator[!] identifier[uploadTempDir] operator[SEP] identifier[exists] operator[SEP] operator[SEP] operator[&&] operator[!] identifier[uploadTempDir] operator[SEP] identifier[mkdirs] operator[SEP] operator[SEP] operator[SEP] { identifier[String] identifier[message] operator[=] literal[String] operator[+] identifier[uploadTempDir] operator[+] literal[String] operator[SEP] Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] identifier[message] operator[SEP] operator[SEP] } Keyword[this] operator[SEP] identifier[mFileItemFactory] operator[SEP] identifier[setRepository] operator[SEP] identifier[uploadTempDir] operator[SEP] operator[SEP] }
@Override public int predict(T x) { double minDist = Double.MAX_VALUE; int bestCluster = 0; for (int i = 0; i < k; i++) { double dist = distance.d(x, medoids[i]); if (dist < minDist) { minDist = dist; bestCluster = i; } } return bestCluster; }
class class_name[name] begin[{] method[predict, return_type[type[int]], modifier[public], parameter[x]] begin[{] local_variable[type[double], minDist] local_variable[type[int], bestCluster] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=medoids, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])], member=d, postfix_operators=[], prefix_operators=[], qualifier=distance, selectors=[], type_arguments=None), name=dist)], modifiers=set(), type=BasicType(dimensions=[], name=double)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=dist, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=minDist, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=minDist, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=dist, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=bestCluster, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=k, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) return[member[.bestCluster]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[int] identifier[predict] operator[SEP] identifier[T] identifier[x] operator[SEP] { Keyword[double] identifier[minDist] operator[=] identifier[Double] operator[SEP] identifier[MAX_VALUE] operator[SEP] Keyword[int] identifier[bestCluster] operator[=] Other[0] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[k] operator[SEP] identifier[i] operator[++] operator[SEP] { Keyword[double] identifier[dist] operator[=] identifier[distance] operator[SEP] identifier[d] operator[SEP] identifier[x] , identifier[medoids] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[dist] operator[<] identifier[minDist] operator[SEP] { identifier[minDist] operator[=] identifier[dist] operator[SEP] identifier[bestCluster] operator[=] identifier[i] operator[SEP] } } Keyword[return] identifier[bestCluster] operator[SEP] }
public static Config parseFileAnySyntax(File fileBasename, ConfigParseOptions options) { return ConfigImpl.parseFileAnySyntax(fileBasename, options).toConfig(); }
class class_name[name] begin[{] method[parseFileAnySyntax, return_type[type[Config]], modifier[public static], parameter[fileBasename, options]] begin[{] return[call[ConfigImpl.parseFileAnySyntax, parameter[member[.fileBasename], member[.options]]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[Config] identifier[parseFileAnySyntax] operator[SEP] identifier[File] identifier[fileBasename] , identifier[ConfigParseOptions] identifier[options] operator[SEP] { Keyword[return] identifier[ConfigImpl] operator[SEP] identifier[parseFileAnySyntax] operator[SEP] identifier[fileBasename] , identifier[options] operator[SEP] operator[SEP] identifier[toConfig] operator[SEP] operator[SEP] operator[SEP] }
public static int[] range(int start, int end) { int[] out = new int[end - start]; for(int i = 0, j = start; j < end; i++, j++) { out[i] = j; } return out; }
class class_name[name] begin[{] method[range, return_type[type[int]], modifier[public static], parameter[start, end]] begin[{] local_variable[type[int], out] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=out, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=end, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i), VariableDeclarator(dimensions=[], initializer=MemberReference(member=start, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), name=j)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=j, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) return[member[.out]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[int] operator[SEP] operator[SEP] identifier[range] operator[SEP] Keyword[int] identifier[start] , Keyword[int] identifier[end] operator[SEP] { Keyword[int] operator[SEP] operator[SEP] identifier[out] operator[=] Keyword[new] Keyword[int] operator[SEP] identifier[end] operator[-] identifier[start] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] , identifier[j] operator[=] identifier[start] operator[SEP] identifier[j] operator[<] identifier[end] operator[SEP] identifier[i] operator[++] , identifier[j] operator[++] operator[SEP] { identifier[out] operator[SEP] identifier[i] operator[SEP] operator[=] identifier[j] operator[SEP] } Keyword[return] identifier[out] operator[SEP] }
public static InputStream decrypt(InputStream inputStream, byte[] key) { checkNotNull(inputStream); checkNotNull(key); checkArgument(key.length >= 5 && key.length <= 256); StreamCipher rc4 = new RC4Engine(); rc4.init(false, new KeyParameter(key)); return new CipherInputStream(inputStream, rc4); }
class class_name[name] begin[{] method[decrypt, return_type[type[InputStream]], modifier[public static], parameter[inputStream, key]] begin[{] call[.checkNotNull, parameter[member[.inputStream]]] call[.checkNotNull, parameter[member[.key]]] call[.checkArgument, parameter[binary_operation[binary_operation[member[key.length], >=, literal[5]], &&, binary_operation[member[key.length], <=, literal[256]]]]] local_variable[type[StreamCipher], rc4] call[rc4.init, parameter[literal[false], ClassCreator(arguments=[MemberReference(member=key, 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=KeyParameter, sub_type=None))]] return[ClassCreator(arguments=[MemberReference(member=inputStream, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=rc4, 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=CipherInputStream, sub_type=None))] end[}] END[}]
Keyword[public] Keyword[static] identifier[InputStream] identifier[decrypt] operator[SEP] identifier[InputStream] identifier[inputStream] , Keyword[byte] operator[SEP] operator[SEP] identifier[key] operator[SEP] { identifier[checkNotNull] operator[SEP] identifier[inputStream] operator[SEP] operator[SEP] identifier[checkNotNull] operator[SEP] identifier[key] operator[SEP] operator[SEP] identifier[checkArgument] operator[SEP] identifier[key] operator[SEP] identifier[length] operator[>=] Other[5] operator[&&] identifier[key] operator[SEP] identifier[length] operator[<=] Other[256] operator[SEP] operator[SEP] identifier[StreamCipher] identifier[rc4] operator[=] Keyword[new] identifier[RC4Engine] operator[SEP] operator[SEP] operator[SEP] identifier[rc4] operator[SEP] identifier[init] operator[SEP] literal[boolean] , Keyword[new] identifier[KeyParameter] operator[SEP] identifier[key] operator[SEP] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[CipherInputStream] operator[SEP] identifier[inputStream] , identifier[rc4] operator[SEP] operator[SEP] }
public void marshall(VerificationMessageTemplateType verificationMessageTemplateType, ProtocolMarshaller protocolMarshaller) { if (verificationMessageTemplateType == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(verificationMessageTemplateType.getSmsMessage(), SMSMESSAGE_BINDING); protocolMarshaller.marshall(verificationMessageTemplateType.getEmailMessage(), EMAILMESSAGE_BINDING); protocolMarshaller.marshall(verificationMessageTemplateType.getEmailSubject(), EMAILSUBJECT_BINDING); protocolMarshaller.marshall(verificationMessageTemplateType.getEmailMessageByLink(), EMAILMESSAGEBYLINK_BINDING); protocolMarshaller.marshall(verificationMessageTemplateType.getEmailSubjectByLink(), EMAILSUBJECTBYLINK_BINDING); protocolMarshaller.marshall(verificationMessageTemplateType.getDefaultEmailOption(), DEFAULTEMAILOPTION_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[verificationMessageTemplateType, protocolMarshaller]] begin[{] if[binary_operation[member[.verificationMessageTemplateType], ==, 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=getSmsMessage, postfix_operators=[], prefix_operators=[], qualifier=verificationMessageTemplateType, selectors=[], type_arguments=None), MemberReference(member=SMSMESSAGE_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=getEmailMessage, postfix_operators=[], prefix_operators=[], qualifier=verificationMessageTemplateType, selectors=[], type_arguments=None), MemberReference(member=EMAILMESSAGE_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=getEmailSubject, postfix_operators=[], prefix_operators=[], qualifier=verificationMessageTemplateType, selectors=[], type_arguments=None), MemberReference(member=EMAILSUBJECT_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=getEmailMessageByLink, postfix_operators=[], prefix_operators=[], qualifier=verificationMessageTemplateType, selectors=[], type_arguments=None), MemberReference(member=EMAILMESSAGEBYLINK_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=getEmailSubjectByLink, postfix_operators=[], prefix_operators=[], qualifier=verificationMessageTemplateType, selectors=[], type_arguments=None), MemberReference(member=EMAILSUBJECTBYLINK_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=getDefaultEmailOption, postfix_operators=[], prefix_operators=[], qualifier=verificationMessageTemplateType, selectors=[], type_arguments=None), MemberReference(member=DEFAULTEMAILOPTION_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[VerificationMessageTemplateType] identifier[verificationMessageTemplateType] , identifier[ProtocolMarshaller] identifier[protocolMarshaller] operator[SEP] { Keyword[if] operator[SEP] identifier[verificationMessageTemplateType] 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[verificationMessageTemplateType] operator[SEP] identifier[getSmsMessage] operator[SEP] operator[SEP] , identifier[SMSMESSAGE_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[verificationMessageTemplateType] operator[SEP] identifier[getEmailMessage] operator[SEP] operator[SEP] , identifier[EMAILMESSAGE_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[verificationMessageTemplateType] operator[SEP] identifier[getEmailSubject] operator[SEP] operator[SEP] , identifier[EMAILSUBJECT_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[verificationMessageTemplateType] operator[SEP] identifier[getEmailMessageByLink] operator[SEP] operator[SEP] , identifier[EMAILMESSAGEBYLINK_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[verificationMessageTemplateType] operator[SEP] identifier[getEmailSubjectByLink] operator[SEP] operator[SEP] , identifier[EMAILSUBJECTBYLINK_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[verificationMessageTemplateType] operator[SEP] identifier[getDefaultEmailOption] operator[SEP] operator[SEP] , identifier[DEFAULTEMAILOPTION_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 TreeNode<T> findByContent(T content) { Optional<TreeNode<T>> opt = TreeStream.breadthFirst(treeDef(), this).filter(node -> node.getContent().equals(content)).findFirst(); if (opt.isPresent()) { return opt.get(); } else { throw new IllegalArgumentException(this.toString() + " has no child with content " + content); } }
class class_name[name] begin[{] method[findByContent, return_type[type[TreeNode]], modifier[public], parameter[content]] begin[{] local_variable[type[Optional], opt] if[call[opt.isPresent, parameter[]]] begin[{] return[call[opt.get, parameter[]]] else begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[], member=toString, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" has no child with content "), operator=+), operandr=MemberReference(member=content, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None) end[}] end[}] END[}]
Keyword[public] identifier[TreeNode] operator[<] identifier[T] operator[>] identifier[findByContent] operator[SEP] identifier[T] identifier[content] operator[SEP] { identifier[Optional] operator[<] identifier[TreeNode] operator[<] identifier[T] operator[>] operator[>] identifier[opt] operator[=] identifier[TreeStream] operator[SEP] identifier[breadthFirst] operator[SEP] identifier[treeDef] operator[SEP] operator[SEP] , Keyword[this] operator[SEP] operator[SEP] identifier[filter] operator[SEP] identifier[node] operator[->] identifier[node] operator[SEP] identifier[getContent] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[content] operator[SEP] operator[SEP] operator[SEP] identifier[findFirst] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[opt] operator[SEP] identifier[isPresent] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] identifier[opt] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] Keyword[this] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[content] operator[SEP] operator[SEP] } }
private double getCovalentRadius(String symbol, IBond.Order maxBondOrder) { double radiusTarget = 0; if (symbol.equals("F")) { radiusTarget = 0.64; } else if (symbol.equals("Cl")) { radiusTarget = 0.99; } else if (symbol.equals("Br")) { radiusTarget = 1.14; } else if (symbol.equals("I")) { radiusTarget = 1.33; } else if (symbol.equals("H")) { radiusTarget = 0.30; } else if (symbol.equals("C")) { if (maxBondOrder == IBond.Order.SINGLE) { // Csp3 radiusTarget = 0.77; } else if (maxBondOrder == IBond.Order.DOUBLE) { radiusTarget = 0.67; } else { radiusTarget = 0.60; } } else if (symbol.equals("O")) { if (maxBondOrder == IBond.Order.SINGLE) { // Csp3 radiusTarget = 0.66; } else if (maxBondOrder != IBond.Order.SINGLE) { radiusTarget = 0.60; } } else if (symbol.equals("Si")) { radiusTarget = 1.11; } else if (symbol.equals("S")) { radiusTarget = 1.04; } else if (symbol.equals("N")) { radiusTarget = 0.70; } else { radiusTarget = 0; } return radiusTarget; }
class class_name[name] begin[{] method[getCovalentRadius, return_type[type[double]], modifier[private], parameter[symbol, maxBondOrder]] begin[{] local_variable[type[double], radiusTarget] if[call[symbol.equals, parameter[literal["F"]]]] begin[{] assign[member[.radiusTarget], literal[0.64]] else begin[{] if[call[symbol.equals, parameter[literal["Cl"]]]] begin[{] assign[member[.radiusTarget], literal[0.99]] else begin[{] if[call[symbol.equals, parameter[literal["Br"]]]] begin[{] assign[member[.radiusTarget], literal[1.14]] else begin[{] if[call[symbol.equals, parameter[literal["I"]]]] begin[{] assign[member[.radiusTarget], literal[1.33]] else begin[{] if[call[symbol.equals, parameter[literal["H"]]]] begin[{] assign[member[.radiusTarget], literal[0.30]] else begin[{] if[call[symbol.equals, parameter[literal["C"]]]] begin[{] if[binary_operation[member[.maxBondOrder], ==, member[IBond.Order.SINGLE]]] begin[{] assign[member[.radiusTarget], literal[0.77]] else begin[{] if[binary_operation[member[.maxBondOrder], ==, member[IBond.Order.DOUBLE]]] begin[{] assign[member[.radiusTarget], literal[0.67]] else begin[{] assign[member[.radiusTarget], literal[0.60]] end[}] end[}] else begin[{] if[call[symbol.equals, parameter[literal["O"]]]] begin[{] if[binary_operation[member[.maxBondOrder], ==, member[IBond.Order.SINGLE]]] begin[{] assign[member[.radiusTarget], literal[0.66]] else begin[{] if[binary_operation[member[.maxBondOrder], !=, member[IBond.Order.SINGLE]]] begin[{] assign[member[.radiusTarget], literal[0.60]] else begin[{] None end[}] end[}] else begin[{] if[call[symbol.equals, parameter[literal["Si"]]]] begin[{] assign[member[.radiusTarget], literal[1.11]] else begin[{] if[call[symbol.equals, parameter[literal["S"]]]] begin[{] assign[member[.radiusTarget], literal[1.04]] else begin[{] if[call[symbol.equals, parameter[literal["N"]]]] begin[{] assign[member[.radiusTarget], literal[0.70]] else begin[{] assign[member[.radiusTarget], literal[0]] end[}] end[}] end[}] end[}] end[}] end[}] end[}] end[}] end[}] end[}] return[member[.radiusTarget]] end[}] END[}]
Keyword[private] Keyword[double] identifier[getCovalentRadius] operator[SEP] identifier[String] identifier[symbol] , identifier[IBond] operator[SEP] identifier[Order] identifier[maxBondOrder] operator[SEP] { Keyword[double] identifier[radiusTarget] operator[=] Other[0] operator[SEP] Keyword[if] operator[SEP] identifier[symbol] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] { identifier[radiusTarget] operator[=] literal[Float] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[symbol] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] { identifier[radiusTarget] operator[=] literal[Float] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[symbol] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] { identifier[radiusTarget] operator[=] literal[Float] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[symbol] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] { identifier[radiusTarget] operator[=] literal[Float] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[symbol] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] { identifier[radiusTarget] operator[=] literal[Float] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[symbol] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[maxBondOrder] operator[==] identifier[IBond] operator[SEP] identifier[Order] operator[SEP] identifier[SINGLE] operator[SEP] { identifier[radiusTarget] operator[=] literal[Float] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[maxBondOrder] operator[==] identifier[IBond] operator[SEP] identifier[Order] operator[SEP] identifier[DOUBLE] operator[SEP] { identifier[radiusTarget] operator[=] literal[Float] operator[SEP] } Keyword[else] { identifier[radiusTarget] operator[=] literal[Float] operator[SEP] } } Keyword[else] Keyword[if] operator[SEP] identifier[symbol] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[maxBondOrder] operator[==] identifier[IBond] operator[SEP] identifier[Order] operator[SEP] identifier[SINGLE] operator[SEP] { identifier[radiusTarget] operator[=] literal[Float] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[maxBondOrder] operator[!=] identifier[IBond] operator[SEP] identifier[Order] operator[SEP] identifier[SINGLE] operator[SEP] { identifier[radiusTarget] operator[=] literal[Float] operator[SEP] } } Keyword[else] Keyword[if] operator[SEP] identifier[symbol] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] { identifier[radiusTarget] operator[=] literal[Float] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[symbol] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] { identifier[radiusTarget] operator[=] literal[Float] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[symbol] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] { identifier[radiusTarget] operator[=] literal[Float] operator[SEP] } Keyword[else] { identifier[radiusTarget] operator[=] Other[0] operator[SEP] } Keyword[return] identifier[radiusTarget] operator[SEP] }
public static JobOperator getJobOperator() { JobOperator operator = AccessController.doPrivileged(new PrivilegedAction<JobOperator> () { public JobOperator run() { ServiceLoader<JobOperator> loader = ServiceLoader.load(JobOperator.class); JobOperator returnVal = null; for (JobOperator provider : loader) { if (provider != null) { if (logger.isLoggable(Level.FINE)) { logger.fine("Loaded BatchContainerServiceProvider with className = " + provider.getClass().getCanonicalName()); } // Use first one returnVal = provider; break; } } return returnVal; } }); if (operator == null) { if (logger.isLoggable(Level.WARNING)) { logger.warning("The ServiceLoader was unable to find an implementation for JobOperator. Check classpath for META-INF/services/javax.batch.operations.JobOperator file."); } } return operator; }
class class_name[name] begin[{] method[getJobOperator, return_type[type[JobOperator]], modifier[public static], parameter[]] begin[{] local_variable[type[JobOperator], operator] if[binary_operation[member[.operator], ==, literal[null]]] begin[{] if[call[logger.isLoggable, parameter[member[Level.WARNING]]]] begin[{] call[logger.warning, parameter[literal["The ServiceLoader was unable to find an implementation for JobOperator. Check classpath for META-INF/services/javax.batch.operations.JobOperator file."]]] else begin[{] None end[}] else begin[{] None end[}] return[member[.operator]] end[}] END[}]
Keyword[public] Keyword[static] identifier[JobOperator] identifier[getJobOperator] operator[SEP] operator[SEP] { identifier[JobOperator] identifier[operator] operator[=] identifier[AccessController] operator[SEP] identifier[doPrivileged] operator[SEP] Keyword[new] identifier[PrivilegedAction] operator[<] identifier[JobOperator] operator[>] operator[SEP] operator[SEP] { Keyword[public] identifier[JobOperator] identifier[run] operator[SEP] operator[SEP] { identifier[ServiceLoader] operator[<] identifier[JobOperator] operator[>] identifier[loader] operator[=] identifier[ServiceLoader] operator[SEP] identifier[load] operator[SEP] identifier[JobOperator] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[JobOperator] identifier[returnVal] operator[=] Other[null] operator[SEP] Keyword[for] operator[SEP] identifier[JobOperator] identifier[provider] operator[:] identifier[loader] operator[SEP] { Keyword[if] operator[SEP] identifier[provider] operator[!=] Other[null] operator[SEP] { Keyword[if] operator[SEP] identifier[logger] operator[SEP] identifier[isLoggable] operator[SEP] identifier[Level] operator[SEP] identifier[FINE] operator[SEP] operator[SEP] { identifier[logger] operator[SEP] identifier[fine] operator[SEP] literal[String] operator[+] identifier[provider] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] identifier[getCanonicalName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[returnVal] operator[=] identifier[provider] operator[SEP] Keyword[break] operator[SEP] } } Keyword[return] identifier[returnVal] operator[SEP] } } operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[operator] operator[==] Other[null] operator[SEP] { Keyword[if] operator[SEP] identifier[logger] operator[SEP] identifier[isLoggable] operator[SEP] identifier[Level] operator[SEP] identifier[WARNING] operator[SEP] operator[SEP] { identifier[logger] operator[SEP] identifier[warning] operator[SEP] literal[String] operator[SEP] operator[SEP] } } Keyword[return] identifier[operator] operator[SEP] }
@Override public void init(final ServletConfig config) throws ServletException { super.init(config); contextDirPath = getServletContext().getRealPath("/"); }
class class_name[name] begin[{] method[init, return_type[void], modifier[public], parameter[config]] begin[{] SuperMethodInvocation(arguments=[MemberReference(member=config, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=init, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None) assign[member[.contextDirPath], call[.getServletContext, parameter[]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[init] operator[SEP] Keyword[final] identifier[ServletConfig] identifier[config] operator[SEP] Keyword[throws] identifier[ServletException] { Keyword[super] operator[SEP] identifier[init] operator[SEP] identifier[config] operator[SEP] operator[SEP] identifier[contextDirPath] operator[=] identifier[getServletContext] operator[SEP] operator[SEP] operator[SEP] identifier[getRealPath] operator[SEP] literal[String] operator[SEP] operator[SEP] }
public static String fromBytes(byte[] bytes) { EnsureUtil.ensureActiveCommandContext("StringUtil.fromBytes"); ProcessEngineConfigurationImpl processEngineConfiguration = Context.getProcessEngineConfiguration(); return fromBytes(bytes, processEngineConfiguration.getProcessEngine()); }
class class_name[name] begin[{] method[fromBytes, return_type[type[String]], modifier[public static], parameter[bytes]] begin[{] call[EnsureUtil.ensureActiveCommandContext, parameter[literal["StringUtil.fromBytes"]]] local_variable[type[ProcessEngineConfigurationImpl], processEngineConfiguration] return[call[.fromBytes, parameter[member[.bytes], call[processEngineConfiguration.getProcessEngine, parameter[]]]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[String] identifier[fromBytes] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[bytes] operator[SEP] { identifier[EnsureUtil] operator[SEP] identifier[ensureActiveCommandContext] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[ProcessEngineConfigurationImpl] identifier[processEngineConfiguration] operator[=] identifier[Context] operator[SEP] identifier[getProcessEngineConfiguration] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[fromBytes] operator[SEP] identifier[bytes] , identifier[processEngineConfiguration] operator[SEP] identifier[getProcessEngine] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
public ArrayList<String> getConditionChildrenList(String text, boolean addChildren) { Node[] c = getConditionChildren(text); this.suggestions.clear(); for (int idx=0; idx < c.length; idx++) { this.suggestions.add(c[idx].getToken()); if (addChildren) { this.addChildToList(c[idx], c[idx].getToken(), this.suggestions); } } return this.suggestions; }
class class_name[name] begin[{] method[getConditionChildrenList, return_type[type[ArrayList]], modifier[public], parameter[text, addChildren]] begin[{] local_variable[type[Node], c] THIS[member[None.suggestions]call[None.clear, parameter[]]] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=suggestions, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=idx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MethodInvocation(arguments=[], member=getToken, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)])], member=add, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None), IfStatement(condition=MemberReference(member=addChildren, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=idx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=idx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MethodInvocation(arguments=[], member=getToken, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=suggestions, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)])], member=addChildToList, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=idx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=c, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=idx)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=idx, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) return[THIS[member[None.suggestions]]] end[}] END[}]
Keyword[public] identifier[ArrayList] operator[<] identifier[String] operator[>] identifier[getConditionChildrenList] operator[SEP] identifier[String] identifier[text] , Keyword[boolean] identifier[addChildren] operator[SEP] { identifier[Node] operator[SEP] operator[SEP] identifier[c] operator[=] identifier[getConditionChildren] operator[SEP] identifier[text] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[suggestions] operator[SEP] identifier[clear] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[idx] operator[=] Other[0] operator[SEP] identifier[idx] operator[<] identifier[c] operator[SEP] identifier[length] operator[SEP] identifier[idx] operator[++] operator[SEP] { Keyword[this] operator[SEP] identifier[suggestions] operator[SEP] identifier[add] operator[SEP] identifier[c] operator[SEP] identifier[idx] operator[SEP] operator[SEP] identifier[getToken] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[addChildren] operator[SEP] { Keyword[this] operator[SEP] identifier[addChildToList] operator[SEP] identifier[c] operator[SEP] identifier[idx] operator[SEP] , identifier[c] operator[SEP] identifier[idx] operator[SEP] operator[SEP] identifier[getToken] operator[SEP] operator[SEP] , Keyword[this] operator[SEP] identifier[suggestions] operator[SEP] operator[SEP] } } Keyword[return] Keyword[this] operator[SEP] identifier[suggestions] operator[SEP] }
public BaiduMessage withSubstitutions(java.util.Map<String, java.util.List<String>> substitutions) { setSubstitutions(substitutions); return this; }
class class_name[name] begin[{] method[withSubstitutions, return_type[type[BaiduMessage]], modifier[public], parameter[substitutions]] begin[{] call[.setSubstitutions, parameter[member[.substitutions]]] return[THIS[]] end[}] END[}]
Keyword[public] identifier[BaiduMessage] identifier[withSubstitutions] operator[SEP] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[List] operator[<] identifier[String] operator[>] operator[>] identifier[substitutions] operator[SEP] { identifier[setSubstitutions] operator[SEP] identifier[substitutions] operator[SEP] operator[SEP] Keyword[return] Keyword[this] operator[SEP] }
public final hqlParser.takeClause_return takeClause() throws RecognitionException { hqlParser.takeClause_return retval = new hqlParser.takeClause_return(); retval.start = input.LT(1); CommonTree root_0 = null; Token TAKE134=null; Token NUM_INT135=null; ParserRuleReturnScope parameter136 =null; CommonTree TAKE134_tree=null; CommonTree NUM_INT135_tree=null; try { // hql.g:344:2: ( TAKE ^ ( NUM_INT | parameter ) ) // hql.g:344:4: TAKE ^ ( NUM_INT | parameter ) { root_0 = (CommonTree)adaptor.nil(); TAKE134=(Token)match(input,TAKE,FOLLOW_TAKE_in_takeClause1650); TAKE134_tree = (CommonTree)adaptor.create(TAKE134); root_0 = (CommonTree)adaptor.becomeRoot(TAKE134_tree, root_0); // hql.g:344:10: ( NUM_INT | parameter ) int alt42=2; int LA42_0 = input.LA(1); if ( (LA42_0==NUM_INT) ) { alt42=1; } else if ( (LA42_0==COLON||LA42_0==PARAM) ) { alt42=2; } else { NoViableAltException nvae = new NoViableAltException("", 42, 0, input); throw nvae; } switch (alt42) { case 1 : // hql.g:344:11: NUM_INT { NUM_INT135=(Token)match(input,NUM_INT,FOLLOW_NUM_INT_in_takeClause1654); NUM_INT135_tree = (CommonTree)adaptor.create(NUM_INT135); adaptor.addChild(root_0, NUM_INT135_tree); } break; case 2 : // hql.g:344:21: parameter { pushFollow(FOLLOW_parameter_in_takeClause1658); parameter136=parameter(); state._fsp--; adaptor.addChild(root_0, parameter136.getTree()); } break; } } retval.stop = input.LT(-1); retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0); adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop); } catch (RecognitionException re) { reportError(re); recover(input,re); retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re); } finally { // do for sure before leaving } return retval; }
class class_name[name] begin[{] method[takeClause, return_type[type[hqlParser]], modifier[final public], parameter[]] begin[{] local_variable[type[hqlParser], retval] assign[member[retval.start], call[input.LT, parameter[literal[1]]]] local_variable[type[CommonTree], root_0] local_variable[type[Token], TAKE134] local_variable[type[Token], NUM_INT135] local_variable[type[ParserRuleReturnScope], parameter136] local_variable[type[CommonTree], TAKE134_tree] local_variable[type[CommonTree], NUM_INT135_tree] TryStatement(block=[BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=root_0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Cast(expression=MethodInvocation(arguments=[], member=nil, postfix_operators=[], prefix_operators=[], qualifier=adaptor, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=CommonTree, sub_type=None))), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=TAKE134, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Cast(expression=MethodInvocation(arguments=[MemberReference(member=input, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=TAKE, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=FOLLOW_TAKE_in_takeClause1650, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=match, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=Token, sub_type=None))), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=TAKE134_tree, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Cast(expression=MethodInvocation(arguments=[MemberReference(member=TAKE134, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=create, postfix_operators=[], prefix_operators=[], qualifier=adaptor, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=CommonTree, sub_type=None))), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=root_0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Cast(expression=MethodInvocation(arguments=[MemberReference(member=TAKE134_tree, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=root_0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=becomeRoot, postfix_operators=[], prefix_operators=[], qualifier=adaptor, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=CommonTree, sub_type=None))), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), name=alt42)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], member=LA, postfix_operators=[], prefix_operators=[], qualifier=input, selectors=[], type_arguments=None), name=LA42_0)], modifiers=set(), type=BasicType(dimensions=[], name=int)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=LA42_0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=NUM_INT, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), else_statement=IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=LA42_0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=COLON, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), operandr=BinaryOperation(operandl=MemberReference(member=LA42_0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=PARAM, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), operator=||), else_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=""), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=42), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), MemberReference(member=input, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=NoViableAltException, sub_type=None)), name=nvae)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=NoViableAltException, sub_type=None)), ThrowStatement(expression=MemberReference(member=nvae, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=alt42, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2)), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=alt42, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)), label=None)])), SwitchStatement(cases=[SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], statements=[BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=NUM_INT135, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Cast(expression=MethodInvocation(arguments=[MemberReference(member=input, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=NUM_INT, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=FOLLOW_NUM_INT_in_takeClause1654, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=match, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=Token, sub_type=None))), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=NUM_INT135_tree, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Cast(expression=MethodInvocation(arguments=[MemberReference(member=NUM_INT135, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=create, postfix_operators=[], prefix_operators=[], qualifier=adaptor, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=CommonTree, sub_type=None))), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=root_0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=NUM_INT135_tree, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addChild, postfix_operators=[], prefix_operators=[], qualifier=adaptor, selectors=[], type_arguments=None), label=None)]), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2)], statements=[BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=FOLLOW_parameter_in_takeClause1658, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=pushFollow, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=parameter136, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=parameter, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=MemberReference(member=_fsp, postfix_operators=['--'], prefix_operators=[], qualifier=state, selectors=[]), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=root_0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getTree, postfix_operators=[], prefix_operators=[], qualifier=parameter136, selectors=[], type_arguments=None)], member=addChild, postfix_operators=[], prefix_operators=[], qualifier=adaptor, selectors=[], type_arguments=None), label=None)]), BreakStatement(goto=None, label=None)])], expression=MemberReference(member=alt42, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)]), StatementExpression(expression=Assignment(expressionl=MemberReference(member=stop, postfix_operators=[], prefix_operators=[], qualifier=retval, selectors=[]), type==, value=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=1)], member=LT, postfix_operators=[], prefix_operators=[], qualifier=input, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=tree, postfix_operators=[], prefix_operators=[], qualifier=retval, selectors=[]), type==, value=Cast(expression=MethodInvocation(arguments=[MemberReference(member=root_0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=rulePostProcessing, postfix_operators=[], prefix_operators=[], qualifier=adaptor, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=CommonTree, sub_type=None))), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=tree, postfix_operators=[], prefix_operators=[], qualifier=retval, selectors=[]), MemberReference(member=start, postfix_operators=[], prefix_operators=[], qualifier=retval, selectors=[]), MemberReference(member=stop, postfix_operators=[], prefix_operators=[], qualifier=retval, selectors=[])], member=setTokenBoundaries, postfix_operators=[], prefix_operators=[], qualifier=adaptor, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=re, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=reportError, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=input, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=re, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=recover, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=tree, postfix_operators=[], prefix_operators=[], qualifier=retval, selectors=[]), type==, value=Cast(expression=MethodInvocation(arguments=[MemberReference(member=input, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=start, postfix_operators=[], prefix_operators=[], qualifier=retval, selectors=[]), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=1)], member=LT, postfix_operators=[], prefix_operators=[], qualifier=input, selectors=[], type_arguments=None), MemberReference(member=re, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=errorNode, postfix_operators=[], prefix_operators=[], qualifier=adaptor, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=CommonTree, sub_type=None))), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=re, types=['RecognitionException']))], finally_block=[], label=None, resources=None) return[member[.retval]] end[}] END[}]
Keyword[public] Keyword[final] identifier[hqlParser] operator[SEP] identifier[takeClause_return] identifier[takeClause] operator[SEP] operator[SEP] Keyword[throws] identifier[RecognitionException] { identifier[hqlParser] operator[SEP] identifier[takeClause_return] identifier[retval] operator[=] Keyword[new] identifier[hqlParser] operator[SEP] identifier[takeClause_return] operator[SEP] operator[SEP] operator[SEP] identifier[retval] operator[SEP] identifier[start] operator[=] identifier[input] operator[SEP] identifier[LT] operator[SEP] Other[1] operator[SEP] operator[SEP] identifier[CommonTree] identifier[root_0] operator[=] Other[null] operator[SEP] identifier[Token] identifier[TAKE134] operator[=] Other[null] operator[SEP] identifier[Token] identifier[NUM_INT135] operator[=] Other[null] operator[SEP] identifier[ParserRuleReturnScope] identifier[parameter136] operator[=] Other[null] operator[SEP] identifier[CommonTree] identifier[TAKE134_tree] operator[=] Other[null] operator[SEP] identifier[CommonTree] identifier[NUM_INT135_tree] operator[=] Other[null] operator[SEP] Keyword[try] { { identifier[root_0] operator[=] operator[SEP] identifier[CommonTree] operator[SEP] identifier[adaptor] operator[SEP] identifier[nil] operator[SEP] operator[SEP] operator[SEP] identifier[TAKE134] operator[=] operator[SEP] identifier[Token] operator[SEP] identifier[match] operator[SEP] identifier[input] , identifier[TAKE] , identifier[FOLLOW_TAKE_in_takeClause1650] operator[SEP] operator[SEP] identifier[TAKE134_tree] operator[=] operator[SEP] identifier[CommonTree] operator[SEP] identifier[adaptor] operator[SEP] identifier[create] operator[SEP] identifier[TAKE134] operator[SEP] operator[SEP] identifier[root_0] operator[=] operator[SEP] identifier[CommonTree] operator[SEP] identifier[adaptor] operator[SEP] identifier[becomeRoot] operator[SEP] identifier[TAKE134_tree] , identifier[root_0] operator[SEP] operator[SEP] Keyword[int] identifier[alt42] operator[=] Other[2] operator[SEP] Keyword[int] identifier[LA42_0] operator[=] identifier[input] operator[SEP] identifier[LA] operator[SEP] Other[1] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[SEP] identifier[LA42_0] operator[==] identifier[NUM_INT] operator[SEP] operator[SEP] { identifier[alt42] operator[=] Other[1] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] operator[SEP] identifier[LA42_0] operator[==] identifier[COLON] operator[||] identifier[LA42_0] operator[==] identifier[PARAM] operator[SEP] operator[SEP] { identifier[alt42] operator[=] Other[2] operator[SEP] } Keyword[else] { identifier[NoViableAltException] identifier[nvae] operator[=] Keyword[new] identifier[NoViableAltException] operator[SEP] literal[String] , Other[42] , Other[0] , identifier[input] operator[SEP] operator[SEP] Keyword[throw] identifier[nvae] operator[SEP] } Keyword[switch] operator[SEP] identifier[alt42] operator[SEP] { Keyword[case] Other[1] operator[:] { identifier[NUM_INT135] operator[=] operator[SEP] identifier[Token] operator[SEP] identifier[match] operator[SEP] identifier[input] , identifier[NUM_INT] , identifier[FOLLOW_NUM_INT_in_takeClause1654] operator[SEP] operator[SEP] identifier[NUM_INT135_tree] operator[=] operator[SEP] identifier[CommonTree] operator[SEP] identifier[adaptor] operator[SEP] identifier[create] operator[SEP] identifier[NUM_INT135] operator[SEP] operator[SEP] identifier[adaptor] operator[SEP] identifier[addChild] operator[SEP] identifier[root_0] , identifier[NUM_INT135_tree] operator[SEP] operator[SEP] } Keyword[break] operator[SEP] Keyword[case] Other[2] operator[:] { identifier[pushFollow] operator[SEP] identifier[FOLLOW_parameter_in_takeClause1658] operator[SEP] operator[SEP] identifier[parameter136] operator[=] identifier[parameter] operator[SEP] operator[SEP] operator[SEP] identifier[state] operator[SEP] identifier[_fsp] operator[--] operator[SEP] identifier[adaptor] operator[SEP] identifier[addChild] operator[SEP] identifier[root_0] , identifier[parameter136] operator[SEP] identifier[getTree] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[break] operator[SEP] } } identifier[retval] operator[SEP] identifier[stop] operator[=] identifier[input] operator[SEP] identifier[LT] operator[SEP] operator[-] Other[1] operator[SEP] operator[SEP] identifier[retval] operator[SEP] identifier[tree] operator[=] operator[SEP] identifier[CommonTree] operator[SEP] identifier[adaptor] operator[SEP] identifier[rulePostProcessing] operator[SEP] identifier[root_0] operator[SEP] operator[SEP] identifier[adaptor] operator[SEP] identifier[setTokenBoundaries] operator[SEP] identifier[retval] operator[SEP] identifier[tree] , identifier[retval] operator[SEP] identifier[start] , identifier[retval] operator[SEP] identifier[stop] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[RecognitionException] identifier[re] operator[SEP] { identifier[reportError] operator[SEP] identifier[re] operator[SEP] operator[SEP] identifier[recover] operator[SEP] identifier[input] , identifier[re] operator[SEP] operator[SEP] identifier[retval] operator[SEP] identifier[tree] operator[=] operator[SEP] identifier[CommonTree] operator[SEP] identifier[adaptor] operator[SEP] identifier[errorNode] operator[SEP] identifier[input] , identifier[retval] operator[SEP] identifier[start] , identifier[input] operator[SEP] identifier[LT] operator[SEP] operator[-] Other[1] operator[SEP] , identifier[re] operator[SEP] operator[SEP] } Keyword[finally] { } Keyword[return] identifier[retval] operator[SEP] }
public static <T, U> Matcher<T> hasFeature(Function<T, U> featureFunction, Matcher<? super U> featureMatcher) { return hasFeature(featureFunction.toString(), featureFunction, featureMatcher); }
class class_name[name] begin[{] method[hasFeature, return_type[type[Matcher]], modifier[public static], parameter[featureFunction, featureMatcher]] begin[{] return[call[.hasFeature, parameter[call[featureFunction.toString, parameter[]], member[.featureFunction], member[.featureMatcher]]]] end[}] END[}]
Keyword[public] Keyword[static] operator[<] identifier[T] , identifier[U] operator[>] identifier[Matcher] operator[<] identifier[T] operator[>] identifier[hasFeature] operator[SEP] identifier[Function] operator[<] identifier[T] , identifier[U] operator[>] identifier[featureFunction] , identifier[Matcher] operator[<] operator[?] Keyword[super] identifier[U] operator[>] identifier[featureMatcher] operator[SEP] { Keyword[return] identifier[hasFeature] operator[SEP] identifier[featureFunction] operator[SEP] identifier[toString] operator[SEP] operator[SEP] , identifier[featureFunction] , identifier[featureMatcher] operator[SEP] operator[SEP] }
public final EventFilterParser.exists_predicate_return exists_predicate() throws RecognitionException { EventFilterParser.exists_predicate_return retval = new EventFilterParser.exists_predicate_return(); retval.start = input.LT(1); CommonTree root_0 = null; Token EXISTS78=null; Token EXISTS79=null; EventFilterParser.path_function_return path_function77 =null; EventFilterParser.path_function_return path_function80 =null; CommonTree EXISTS78_tree=null; CommonTree EXISTS79_tree=null; RewriteRuleTokenStream stream_EXISTS=new RewriteRuleTokenStream(adaptor,"token EXISTS"); RewriteRuleSubtreeStream stream_path_function=new RewriteRuleSubtreeStream(adaptor,"rule path_function"); try { // EventFilter.g:160:2: ( path_function EXISTS -> ^( EXISTS path_function ) | EXISTS path_function -> ^( EXISTS path_function ) ) int alt11=2; int LA11_0 = input.LA(1); if ( (LA11_0==XPATH_FUN_NAME) ) { alt11=1; } else if ( (LA11_0==EXISTS) ) { alt11=2; } else { NoViableAltException nvae = new NoViableAltException("", 11, 0, input); throw nvae; } switch (alt11) { case 1 : // EventFilter.g:160:4: path_function EXISTS { pushFollow(FOLLOW_path_function_in_exists_predicate940); path_function77=path_function(); state._fsp--; stream_path_function.add(path_function77.getTree()); EXISTS78=(Token)match(input,EXISTS,FOLLOW_EXISTS_in_exists_predicate942); stream_EXISTS.add(EXISTS78); // AST REWRITE // elements: EXISTS, path_function // token labels: // rule labels: retval // token list labels: // rule list labels: // wildcard labels: retval.tree = root_0; RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null); root_0 = (CommonTree)adaptor.nil(); // 160:25: -> ^( EXISTS path_function ) { // EventFilter.g:160:28: ^( EXISTS path_function ) { CommonTree root_1 = (CommonTree)adaptor.nil(); root_1 = (CommonTree)adaptor.becomeRoot( new ExistsTreeNode(stream_EXISTS.nextToken()) , root_1); adaptor.addChild(root_1, stream_path_function.nextTree()); adaptor.addChild(root_0, root_1); } } retval.tree = root_0; } break; case 2 : // EventFilter.g:161:3: EXISTS path_function { EXISTS79=(Token)match(input,EXISTS,FOLLOW_EXISTS_in_exists_predicate959); stream_EXISTS.add(EXISTS79); pushFollow(FOLLOW_path_function_in_exists_predicate961); path_function80=path_function(); state._fsp--; stream_path_function.add(path_function80.getTree()); // AST REWRITE // elements: path_function, EXISTS // token labels: // rule labels: retval // token list labels: // rule list labels: // wildcard labels: retval.tree = root_0; RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null); root_0 = (CommonTree)adaptor.nil(); // 161:24: -> ^( EXISTS path_function ) { // EventFilter.g:161:27: ^( EXISTS path_function ) { CommonTree root_1 = (CommonTree)adaptor.nil(); root_1 = (CommonTree)adaptor.becomeRoot( new ExistsTreeNode(stream_EXISTS.nextToken()) , root_1); adaptor.addChild(root_1, stream_path_function.nextTree()); adaptor.addChild(root_0, root_1); } } retval.tree = root_0; } break; } retval.stop = input.LT(-1); retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0); adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop); } catch (RecognitionException re) { reportError(re); recover(input,re); retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re); } finally { // do for sure before leaving } return retval; }
class class_name[name] begin[{] method[exists_predicate, return_type[type[EventFilterParser]], modifier[final public], parameter[]] begin[{] local_variable[type[EventFilterParser], retval] assign[member[retval.start], call[input.LT, parameter[literal[1]]]] local_variable[type[CommonTree], root_0] local_variable[type[Token], EXISTS78] local_variable[type[Token], EXISTS79] local_variable[type[EventFilterParser], path_function77] local_variable[type[EventFilterParser], path_function80] local_variable[type[CommonTree], EXISTS78_tree] local_variable[type[CommonTree], EXISTS79_tree] local_variable[type[RewriteRuleTokenStream], stream_EXISTS] local_variable[type[RewriteRuleSubtreeStream], stream_path_function] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), name=alt11)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], member=LA, postfix_operators=[], prefix_operators=[], qualifier=input, selectors=[], type_arguments=None), name=LA11_0)], modifiers=set(), type=BasicType(dimensions=[], name=int)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=LA11_0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=XPATH_FUN_NAME, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), else_statement=IfStatement(condition=BinaryOperation(operandl=MemberReference(member=LA11_0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=EXISTS, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), else_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=""), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=11), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), MemberReference(member=input, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=NoViableAltException, sub_type=None)), name=nvae)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=NoViableAltException, sub_type=None)), ThrowStatement(expression=MemberReference(member=nvae, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=alt11, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2)), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=alt11, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)), label=None)])), SwitchStatement(cases=[SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], statements=[BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=FOLLOW_path_function_in_exists_predicate940, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=pushFollow, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=path_function77, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=path_function, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=MemberReference(member=_fsp, postfix_operators=['--'], prefix_operators=[], qualifier=state, selectors=[]), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getTree, postfix_operators=[], prefix_operators=[], qualifier=path_function77, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=stream_path_function, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=EXISTS78, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Cast(expression=MethodInvocation(arguments=[MemberReference(member=input, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=EXISTS, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=FOLLOW_EXISTS_in_exists_predicate942, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=match, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=Token, sub_type=None))), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=EXISTS78, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=stream_EXISTS, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=tree, postfix_operators=[], prefix_operators=[], qualifier=retval, selectors=[]), type==, value=MemberReference(member=root_0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MemberReference(member=adaptor, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="rule retval"), TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=retval, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), if_false=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), if_true=MemberReference(member=tree, postfix_operators=[], prefix_operators=[], qualifier=retval, selectors=[]))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=RewriteRuleSubtreeStream, sub_type=None)), name=stream_retval)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=RewriteRuleSubtreeStream, sub_type=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=root_0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Cast(expression=MethodInvocation(arguments=[], member=nil, postfix_operators=[], prefix_operators=[], qualifier=adaptor, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=CommonTree, sub_type=None))), label=None), BlockStatement(label=None, statements=[BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MethodInvocation(arguments=[], member=nil, postfix_operators=[], prefix_operators=[], qualifier=adaptor, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=CommonTree, sub_type=None)), name=root_1)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=CommonTree, sub_type=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=root_1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Cast(expression=MethodInvocation(arguments=[ClassCreator(arguments=[MethodInvocation(arguments=[], member=nextToken, postfix_operators=[], prefix_operators=[], qualifier=stream_EXISTS, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ExistsTreeNode, sub_type=None)), MemberReference(member=root_1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=becomeRoot, postfix_operators=[], prefix_operators=[], qualifier=adaptor, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=CommonTree, sub_type=None))), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=root_1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=nextTree, postfix_operators=[], prefix_operators=[], qualifier=stream_path_function, selectors=[], type_arguments=None)], member=addChild, postfix_operators=[], prefix_operators=[], qualifier=adaptor, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=root_0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=root_1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addChild, postfix_operators=[], prefix_operators=[], qualifier=adaptor, selectors=[], type_arguments=None), label=None)])]), StatementExpression(expression=Assignment(expressionl=MemberReference(member=tree, postfix_operators=[], prefix_operators=[], qualifier=retval, selectors=[]), type==, value=MemberReference(member=root_0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)]), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2)], statements=[BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=EXISTS79, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Cast(expression=MethodInvocation(arguments=[MemberReference(member=input, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=EXISTS, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=FOLLOW_EXISTS_in_exists_predicate959, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=match, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=Token, sub_type=None))), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=EXISTS79, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=stream_EXISTS, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=FOLLOW_path_function_in_exists_predicate961, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=pushFollow, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=path_function80, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=path_function, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=MemberReference(member=_fsp, postfix_operators=['--'], prefix_operators=[], qualifier=state, selectors=[]), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getTree, postfix_operators=[], prefix_operators=[], qualifier=path_function80, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=stream_path_function, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=tree, postfix_operators=[], prefix_operators=[], qualifier=retval, selectors=[]), type==, value=MemberReference(member=root_0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MemberReference(member=adaptor, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="rule retval"), TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=retval, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), if_false=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), if_true=MemberReference(member=tree, postfix_operators=[], prefix_operators=[], qualifier=retval, selectors=[]))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=RewriteRuleSubtreeStream, sub_type=None)), name=stream_retval)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=RewriteRuleSubtreeStream, sub_type=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=root_0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Cast(expression=MethodInvocation(arguments=[], member=nil, postfix_operators=[], prefix_operators=[], qualifier=adaptor, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=CommonTree, sub_type=None))), label=None), BlockStatement(label=None, statements=[BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MethodInvocation(arguments=[], member=nil, postfix_operators=[], prefix_operators=[], qualifier=adaptor, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=CommonTree, sub_type=None)), name=root_1)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=CommonTree, sub_type=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=root_1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Cast(expression=MethodInvocation(arguments=[ClassCreator(arguments=[MethodInvocation(arguments=[], member=nextToken, postfix_operators=[], prefix_operators=[], qualifier=stream_EXISTS, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ExistsTreeNode, sub_type=None)), MemberReference(member=root_1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=becomeRoot, postfix_operators=[], prefix_operators=[], qualifier=adaptor, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=CommonTree, sub_type=None))), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=root_1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=nextTree, postfix_operators=[], prefix_operators=[], qualifier=stream_path_function, selectors=[], type_arguments=None)], member=addChild, postfix_operators=[], prefix_operators=[], qualifier=adaptor, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=root_0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=root_1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addChild, postfix_operators=[], prefix_operators=[], qualifier=adaptor, selectors=[], type_arguments=None), label=None)])]), StatementExpression(expression=Assignment(expressionl=MemberReference(member=tree, postfix_operators=[], prefix_operators=[], qualifier=retval, selectors=[]), type==, value=MemberReference(member=root_0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)]), BreakStatement(goto=None, label=None)])], expression=MemberReference(member=alt11, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=stop, postfix_operators=[], prefix_operators=[], qualifier=retval, selectors=[]), type==, value=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=1)], member=LT, postfix_operators=[], prefix_operators=[], qualifier=input, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=tree, postfix_operators=[], prefix_operators=[], qualifier=retval, selectors=[]), type==, value=Cast(expression=MethodInvocation(arguments=[MemberReference(member=root_0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=rulePostProcessing, postfix_operators=[], prefix_operators=[], qualifier=adaptor, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=CommonTree, sub_type=None))), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=tree, postfix_operators=[], prefix_operators=[], qualifier=retval, selectors=[]), MemberReference(member=start, postfix_operators=[], prefix_operators=[], qualifier=retval, selectors=[]), MemberReference(member=stop, postfix_operators=[], prefix_operators=[], qualifier=retval, selectors=[])], member=setTokenBoundaries, postfix_operators=[], prefix_operators=[], qualifier=adaptor, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=re, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=reportError, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=input, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=re, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=recover, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=tree, postfix_operators=[], prefix_operators=[], qualifier=retval, selectors=[]), type==, value=Cast(expression=MethodInvocation(arguments=[MemberReference(member=input, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=start, postfix_operators=[], prefix_operators=[], qualifier=retval, selectors=[]), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=1)], member=LT, postfix_operators=[], prefix_operators=[], qualifier=input, selectors=[], type_arguments=None), MemberReference(member=re, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=errorNode, postfix_operators=[], prefix_operators=[], qualifier=adaptor, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=CommonTree, sub_type=None))), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=re, types=['RecognitionException']))], finally_block=[], label=None, resources=None) return[member[.retval]] end[}] END[}]
Keyword[public] Keyword[final] identifier[EventFilterParser] operator[SEP] identifier[exists_predicate_return] identifier[exists_predicate] operator[SEP] operator[SEP] Keyword[throws] identifier[RecognitionException] { identifier[EventFilterParser] operator[SEP] identifier[exists_predicate_return] identifier[retval] operator[=] Keyword[new] identifier[EventFilterParser] operator[SEP] identifier[exists_predicate_return] operator[SEP] operator[SEP] operator[SEP] identifier[retval] operator[SEP] identifier[start] operator[=] identifier[input] operator[SEP] identifier[LT] operator[SEP] Other[1] operator[SEP] operator[SEP] identifier[CommonTree] identifier[root_0] operator[=] Other[null] operator[SEP] identifier[Token] identifier[EXISTS78] operator[=] Other[null] operator[SEP] identifier[Token] identifier[EXISTS79] operator[=] Other[null] operator[SEP] identifier[EventFilterParser] operator[SEP] identifier[path_function_return] identifier[path_function77] operator[=] Other[null] operator[SEP] identifier[EventFilterParser] operator[SEP] identifier[path_function_return] identifier[path_function80] operator[=] Other[null] operator[SEP] identifier[CommonTree] identifier[EXISTS78_tree] operator[=] Other[null] operator[SEP] identifier[CommonTree] identifier[EXISTS79_tree] operator[=] Other[null] operator[SEP] identifier[RewriteRuleTokenStream] identifier[stream_EXISTS] operator[=] Keyword[new] identifier[RewriteRuleTokenStream] operator[SEP] identifier[adaptor] , literal[String] operator[SEP] operator[SEP] identifier[RewriteRuleSubtreeStream] identifier[stream_path_function] operator[=] Keyword[new] identifier[RewriteRuleSubtreeStream] operator[SEP] identifier[adaptor] , literal[String] operator[SEP] operator[SEP] Keyword[try] { Keyword[int] identifier[alt11] operator[=] Other[2] operator[SEP] Keyword[int] identifier[LA11_0] operator[=] identifier[input] operator[SEP] identifier[LA] operator[SEP] Other[1] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[SEP] identifier[LA11_0] operator[==] identifier[XPATH_FUN_NAME] operator[SEP] operator[SEP] { identifier[alt11] operator[=] Other[1] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] operator[SEP] identifier[LA11_0] operator[==] identifier[EXISTS] operator[SEP] operator[SEP] { identifier[alt11] operator[=] Other[2] operator[SEP] } Keyword[else] { identifier[NoViableAltException] identifier[nvae] operator[=] Keyword[new] identifier[NoViableAltException] operator[SEP] literal[String] , Other[11] , Other[0] , identifier[input] operator[SEP] operator[SEP] Keyword[throw] identifier[nvae] operator[SEP] } Keyword[switch] operator[SEP] identifier[alt11] operator[SEP] { Keyword[case] Other[1] operator[:] { identifier[pushFollow] operator[SEP] identifier[FOLLOW_path_function_in_exists_predicate940] operator[SEP] operator[SEP] identifier[path_function77] operator[=] identifier[path_function] operator[SEP] operator[SEP] operator[SEP] identifier[state] operator[SEP] identifier[_fsp] operator[--] operator[SEP] identifier[stream_path_function] operator[SEP] identifier[add] operator[SEP] identifier[path_function77] operator[SEP] identifier[getTree] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[EXISTS78] operator[=] operator[SEP] identifier[Token] operator[SEP] identifier[match] operator[SEP] identifier[input] , identifier[EXISTS] , identifier[FOLLOW_EXISTS_in_exists_predicate942] operator[SEP] operator[SEP] identifier[stream_EXISTS] operator[SEP] identifier[add] operator[SEP] identifier[EXISTS78] operator[SEP] operator[SEP] identifier[retval] operator[SEP] identifier[tree] operator[=] identifier[root_0] operator[SEP] identifier[RewriteRuleSubtreeStream] identifier[stream_retval] operator[=] Keyword[new] identifier[RewriteRuleSubtreeStream] operator[SEP] identifier[adaptor] , literal[String] , identifier[retval] operator[!=] Other[null] operator[?] identifier[retval] operator[SEP] identifier[tree] operator[:] Other[null] operator[SEP] operator[SEP] identifier[root_0] operator[=] operator[SEP] identifier[CommonTree] operator[SEP] identifier[adaptor] operator[SEP] identifier[nil] operator[SEP] operator[SEP] operator[SEP] { { identifier[CommonTree] identifier[root_1] operator[=] operator[SEP] identifier[CommonTree] operator[SEP] identifier[adaptor] operator[SEP] identifier[nil] operator[SEP] operator[SEP] operator[SEP] identifier[root_1] operator[=] operator[SEP] identifier[CommonTree] operator[SEP] identifier[adaptor] operator[SEP] identifier[becomeRoot] operator[SEP] Keyword[new] identifier[ExistsTreeNode] operator[SEP] identifier[stream_EXISTS] operator[SEP] identifier[nextToken] operator[SEP] operator[SEP] operator[SEP] , identifier[root_1] operator[SEP] operator[SEP] identifier[adaptor] operator[SEP] identifier[addChild] operator[SEP] identifier[root_1] , identifier[stream_path_function] operator[SEP] identifier[nextTree] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[adaptor] operator[SEP] identifier[addChild] operator[SEP] identifier[root_0] , identifier[root_1] operator[SEP] operator[SEP] } } identifier[retval] operator[SEP] identifier[tree] operator[=] identifier[root_0] operator[SEP] } Keyword[break] operator[SEP] Keyword[case] Other[2] operator[:] { identifier[EXISTS79] operator[=] operator[SEP] identifier[Token] operator[SEP] identifier[match] operator[SEP] identifier[input] , identifier[EXISTS] , identifier[FOLLOW_EXISTS_in_exists_predicate959] operator[SEP] operator[SEP] identifier[stream_EXISTS] operator[SEP] identifier[add] operator[SEP] identifier[EXISTS79] operator[SEP] operator[SEP] identifier[pushFollow] operator[SEP] identifier[FOLLOW_path_function_in_exists_predicate961] operator[SEP] operator[SEP] identifier[path_function80] operator[=] identifier[path_function] operator[SEP] operator[SEP] operator[SEP] identifier[state] operator[SEP] identifier[_fsp] operator[--] operator[SEP] identifier[stream_path_function] operator[SEP] identifier[add] operator[SEP] identifier[path_function80] operator[SEP] identifier[getTree] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[retval] operator[SEP] identifier[tree] operator[=] identifier[root_0] operator[SEP] identifier[RewriteRuleSubtreeStream] identifier[stream_retval] operator[=] Keyword[new] identifier[RewriteRuleSubtreeStream] operator[SEP] identifier[adaptor] , literal[String] , identifier[retval] operator[!=] Other[null] operator[?] identifier[retval] operator[SEP] identifier[tree] operator[:] Other[null] operator[SEP] operator[SEP] identifier[root_0] operator[=] operator[SEP] identifier[CommonTree] operator[SEP] identifier[adaptor] operator[SEP] identifier[nil] operator[SEP] operator[SEP] operator[SEP] { { identifier[CommonTree] identifier[root_1] operator[=] operator[SEP] identifier[CommonTree] operator[SEP] identifier[adaptor] operator[SEP] identifier[nil] operator[SEP] operator[SEP] operator[SEP] identifier[root_1] operator[=] operator[SEP] identifier[CommonTree] operator[SEP] identifier[adaptor] operator[SEP] identifier[becomeRoot] operator[SEP] Keyword[new] identifier[ExistsTreeNode] operator[SEP] identifier[stream_EXISTS] operator[SEP] identifier[nextToken] operator[SEP] operator[SEP] operator[SEP] , identifier[root_1] operator[SEP] operator[SEP] identifier[adaptor] operator[SEP] identifier[addChild] operator[SEP] identifier[root_1] , identifier[stream_path_function] operator[SEP] identifier[nextTree] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[adaptor] operator[SEP] identifier[addChild] operator[SEP] identifier[root_0] , identifier[root_1] operator[SEP] operator[SEP] } } identifier[retval] operator[SEP] identifier[tree] operator[=] identifier[root_0] operator[SEP] } Keyword[break] operator[SEP] } identifier[retval] operator[SEP] identifier[stop] operator[=] identifier[input] operator[SEP] identifier[LT] operator[SEP] operator[-] Other[1] operator[SEP] operator[SEP] identifier[retval] operator[SEP] identifier[tree] operator[=] operator[SEP] identifier[CommonTree] operator[SEP] identifier[adaptor] operator[SEP] identifier[rulePostProcessing] operator[SEP] identifier[root_0] operator[SEP] operator[SEP] identifier[adaptor] operator[SEP] identifier[setTokenBoundaries] operator[SEP] identifier[retval] operator[SEP] identifier[tree] , identifier[retval] operator[SEP] identifier[start] , identifier[retval] operator[SEP] identifier[stop] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[RecognitionException] identifier[re] operator[SEP] { identifier[reportError] operator[SEP] identifier[re] operator[SEP] operator[SEP] identifier[recover] operator[SEP] identifier[input] , identifier[re] operator[SEP] operator[SEP] identifier[retval] operator[SEP] identifier[tree] operator[=] operator[SEP] identifier[CommonTree] operator[SEP] identifier[adaptor] operator[SEP] identifier[errorNode] operator[SEP] identifier[input] , identifier[retval] operator[SEP] identifier[start] , identifier[input] operator[SEP] identifier[LT] operator[SEP] operator[-] Other[1] operator[SEP] , identifier[re] operator[SEP] operator[SEP] } Keyword[finally] { } Keyword[return] identifier[retval] operator[SEP] }
private Document findAssociation(AssociationKey key, AssociationContext associationContext, AssociationStorageStrategy storageStrategy) { final Document associationKeyObject = associationKeyToObject( key, storageStrategy ); MongoCollection<Document> associationCollection = getAssociationCollection( key, storageStrategy, associationContext ); FindIterable<Document> fi = associationCollection.find( associationKeyObject ); return fi != null ? ( fi.projection( getProjection( key, false ) ).first() ) : null ; }
class class_name[name] begin[{] method[findAssociation, return_type[type[Document]], modifier[private], parameter[key, associationContext, storageStrategy]] begin[{] local_variable[type[Document], associationKeyObject] local_variable[type[MongoCollection], associationCollection] local_variable[type[FindIterable], fi] return[TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=fi, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), if_false=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), if_true=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)], member=getProjection, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=projection, postfix_operators=[], prefix_operators=[], qualifier=fi, selectors=[], type_arguments=None))] end[}] END[}]
Keyword[private] identifier[Document] identifier[findAssociation] operator[SEP] identifier[AssociationKey] identifier[key] , identifier[AssociationContext] identifier[associationContext] , identifier[AssociationStorageStrategy] identifier[storageStrategy] operator[SEP] { Keyword[final] identifier[Document] identifier[associationKeyObject] operator[=] identifier[associationKeyToObject] operator[SEP] identifier[key] , identifier[storageStrategy] operator[SEP] operator[SEP] identifier[MongoCollection] operator[<] identifier[Document] operator[>] identifier[associationCollection] operator[=] identifier[getAssociationCollection] operator[SEP] identifier[key] , identifier[storageStrategy] , identifier[associationContext] operator[SEP] operator[SEP] identifier[FindIterable] operator[<] identifier[Document] operator[>] identifier[fi] operator[=] identifier[associationCollection] operator[SEP] identifier[find] operator[SEP] identifier[associationKeyObject] operator[SEP] operator[SEP] Keyword[return] identifier[fi] operator[!=] Other[null] operator[?] operator[SEP] identifier[fi] operator[SEP] identifier[projection] operator[SEP] identifier[getProjection] operator[SEP] identifier[key] , literal[boolean] operator[SEP] operator[SEP] operator[SEP] identifier[first] operator[SEP] operator[SEP] operator[SEP] operator[:] Other[null] operator[SEP] }
public void buildFieldDoc(XMLNode node, Content memberDetailsTree) { if (writer == null) { return; } int size = fields.size(); if (size > 0) { Content fieldDetailsTree = writer.getFieldDetailsTreeHeader( classDoc, memberDetailsTree); for (currentFieldIndex = 0; currentFieldIndex < size; currentFieldIndex++) { Content fieldDocTree = writer.getFieldDocTreeHeader( (FieldDoc) fields.get(currentFieldIndex), fieldDetailsTree); buildChildren(node, fieldDocTree); fieldDetailsTree.addContent(writer.getFieldDoc( fieldDocTree, (currentFieldIndex == size - 1))); } memberDetailsTree.addContent( writer.getFieldDetails(fieldDetailsTree)); } }
class class_name[name] begin[{] method[buildFieldDoc, return_type[void], modifier[public], parameter[node, memberDetailsTree]] begin[{] if[binary_operation[member[.writer], ==, literal[null]]] begin[{] return[None] else begin[{] None end[}] local_variable[type[int], size] if[binary_operation[member[.size], >, literal[0]]] begin[{] local_variable[type[Content], fieldDetailsTree] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Cast(expression=MethodInvocation(arguments=[MemberReference(member=currentFieldIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=fields, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=FieldDoc, sub_type=None)), MemberReference(member=fieldDetailsTree, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getFieldDocTreeHeader, postfix_operators=[], prefix_operators=[], qualifier=writer, selectors=[], type_arguments=None), name=fieldDocTree)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Content, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=node, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=fieldDocTree, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=buildChildren, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=fieldDocTree, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=MemberReference(member=currentFieldIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=BinaryOperation(operandl=MemberReference(member=size, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-), operator===)], member=getFieldDoc, postfix_operators=[], prefix_operators=[], qualifier=writer, selectors=[], type_arguments=None)], member=addContent, postfix_operators=[], prefix_operators=[], qualifier=fieldDetailsTree, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=currentFieldIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=size, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=[Assignment(expressionl=MemberReference(member=currentFieldIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))], update=[MemberReference(member=currentFieldIndex, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) call[memberDetailsTree.addContent, parameter[call[writer.getFieldDetails, parameter[member[.fieldDetailsTree]]]]] else begin[{] None end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[buildFieldDoc] operator[SEP] identifier[XMLNode] identifier[node] , identifier[Content] identifier[memberDetailsTree] operator[SEP] { Keyword[if] operator[SEP] identifier[writer] operator[==] Other[null] operator[SEP] { Keyword[return] operator[SEP] } Keyword[int] identifier[size] operator[=] identifier[fields] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[size] operator[>] Other[0] operator[SEP] { identifier[Content] identifier[fieldDetailsTree] operator[=] identifier[writer] operator[SEP] identifier[getFieldDetailsTreeHeader] operator[SEP] identifier[classDoc] , identifier[memberDetailsTree] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[currentFieldIndex] operator[=] Other[0] operator[SEP] identifier[currentFieldIndex] operator[<] identifier[size] operator[SEP] identifier[currentFieldIndex] operator[++] operator[SEP] { identifier[Content] identifier[fieldDocTree] operator[=] identifier[writer] operator[SEP] identifier[getFieldDocTreeHeader] operator[SEP] operator[SEP] identifier[FieldDoc] operator[SEP] identifier[fields] operator[SEP] identifier[get] operator[SEP] identifier[currentFieldIndex] operator[SEP] , identifier[fieldDetailsTree] operator[SEP] operator[SEP] identifier[buildChildren] operator[SEP] identifier[node] , identifier[fieldDocTree] operator[SEP] operator[SEP] identifier[fieldDetailsTree] operator[SEP] identifier[addContent] operator[SEP] identifier[writer] operator[SEP] identifier[getFieldDoc] operator[SEP] identifier[fieldDocTree] , operator[SEP] identifier[currentFieldIndex] operator[==] identifier[size] operator[-] Other[1] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[memberDetailsTree] operator[SEP] identifier[addContent] operator[SEP] identifier[writer] operator[SEP] identifier[getFieldDetails] operator[SEP] identifier[fieldDetailsTree] operator[SEP] operator[SEP] operator[SEP] } }
public void marshall(Source source, ProtocolMarshaller protocolMarshaller) { if (source == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(source.getDecryption(), DECRYPTION_BINDING); protocolMarshaller.marshall(source.getDescription(), DESCRIPTION_BINDING); protocolMarshaller.marshall(source.getEntitlementArn(), ENTITLEMENTARN_BINDING); protocolMarshaller.marshall(source.getIngestIp(), INGESTIP_BINDING); protocolMarshaller.marshall(source.getIngestPort(), INGESTPORT_BINDING); protocolMarshaller.marshall(source.getName(), NAME_BINDING); protocolMarshaller.marshall(source.getSourceArn(), SOURCEARN_BINDING); protocolMarshaller.marshall(source.getTransport(), TRANSPORT_BINDING); protocolMarshaller.marshall(source.getWhitelistCidr(), WHITELISTCIDR_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[source, protocolMarshaller]] begin[{] if[binary_operation[member[.source], ==, 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=getDecryption, postfix_operators=[], prefix_operators=[], qualifier=source, selectors=[], type_arguments=None), MemberReference(member=DECRYPTION_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=getDescription, postfix_operators=[], prefix_operators=[], qualifier=source, selectors=[], type_arguments=None), MemberReference(member=DESCRIPTION_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=getEntitlementArn, postfix_operators=[], prefix_operators=[], qualifier=source, selectors=[], type_arguments=None), MemberReference(member=ENTITLEMENTARN_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=getIngestIp, postfix_operators=[], prefix_operators=[], qualifier=source, selectors=[], type_arguments=None), MemberReference(member=INGESTIP_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=getIngestPort, postfix_operators=[], prefix_operators=[], qualifier=source, selectors=[], type_arguments=None), MemberReference(member=INGESTPORT_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=source, selectors=[], type_arguments=None), MemberReference(member=NAME_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getSourceArn, postfix_operators=[], prefix_operators=[], qualifier=source, selectors=[], type_arguments=None), MemberReference(member=SOURCEARN_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=getTransport, postfix_operators=[], prefix_operators=[], qualifier=source, selectors=[], type_arguments=None), MemberReference(member=TRANSPORT_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=getWhitelistCidr, postfix_operators=[], prefix_operators=[], qualifier=source, selectors=[], type_arguments=None), MemberReference(member=WHITELISTCIDR_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[Source] identifier[source] , identifier[ProtocolMarshaller] identifier[protocolMarshaller] operator[SEP] { Keyword[if] operator[SEP] identifier[source] 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[source] operator[SEP] identifier[getDecryption] operator[SEP] operator[SEP] , identifier[DECRYPTION_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[source] operator[SEP] identifier[getDescription] operator[SEP] operator[SEP] , identifier[DESCRIPTION_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[source] operator[SEP] identifier[getEntitlementArn] operator[SEP] operator[SEP] , identifier[ENTITLEMENTARN_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[source] operator[SEP] identifier[getIngestIp] operator[SEP] operator[SEP] , identifier[INGESTIP_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[source] operator[SEP] identifier[getIngestPort] operator[SEP] operator[SEP] , identifier[INGESTPORT_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[source] operator[SEP] identifier[getName] operator[SEP] operator[SEP] , identifier[NAME_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[source] operator[SEP] identifier[getSourceArn] operator[SEP] operator[SEP] , identifier[SOURCEARN_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[source] operator[SEP] identifier[getTransport] operator[SEP] operator[SEP] , identifier[TRANSPORT_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[source] operator[SEP] identifier[getWhitelistCidr] operator[SEP] operator[SEP] , identifier[WHITELISTCIDR_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] } }
@ForOverride @Nullable protected JSType findPropertyTypeWithoutConsideringTemplateTypes(String propertyName) { ObjectType autoboxObjType = ObjectType.cast(autoboxesTo()); if (autoboxObjType != null) { return autoboxObjType.findPropertyType(propertyName); } return null; }
class class_name[name] begin[{] method[findPropertyTypeWithoutConsideringTemplateTypes, return_type[type[JSType]], modifier[protected], parameter[propertyName]] begin[{] local_variable[type[ObjectType], autoboxObjType] if[binary_operation[member[.autoboxObjType], !=, literal[null]]] begin[{] return[call[autoboxObjType.findPropertyType, parameter[member[.propertyName]]]] else begin[{] None end[}] return[literal[null]] end[}] END[}]
annotation[@] identifier[ForOverride] annotation[@] identifier[Nullable] Keyword[protected] identifier[JSType] identifier[findPropertyTypeWithoutConsideringTemplateTypes] operator[SEP] identifier[String] identifier[propertyName] operator[SEP] { identifier[ObjectType] identifier[autoboxObjType] operator[=] identifier[ObjectType] operator[SEP] identifier[cast] operator[SEP] identifier[autoboxesTo] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[autoboxObjType] operator[!=] Other[null] operator[SEP] { Keyword[return] identifier[autoboxObjType] operator[SEP] identifier[findPropertyType] operator[SEP] identifier[propertyName] operator[SEP] operator[SEP] } Keyword[return] Other[null] operator[SEP] }
public WebhookBuilder setAvatar(InputStream avatar, String fileType) { delegate.setAvatar(avatar, fileType); return this; }
class class_name[name] begin[{] method[setAvatar, return_type[type[WebhookBuilder]], modifier[public], parameter[avatar, fileType]] begin[{] call[delegate.setAvatar, parameter[member[.avatar], member[.fileType]]] return[THIS[]] end[}] END[}]
Keyword[public] identifier[WebhookBuilder] identifier[setAvatar] operator[SEP] identifier[InputStream] identifier[avatar] , identifier[String] identifier[fileType] operator[SEP] { identifier[delegate] operator[SEP] identifier[setAvatar] operator[SEP] identifier[avatar] , identifier[fileType] operator[SEP] operator[SEP] Keyword[return] Keyword[this] operator[SEP] }
protected Map<String, List<String>> initProcessLists(List<RabbitmqClusterContext> contextList) throws RabbitmqCommunicateException { if (this.contextMap == null) { this.contextMap = initContextMap(contextList); } Map<String, List<String>> processLists = new HashMap<String, List<String>>(); LinkedList<String> processList = null; String connectionProcess = null; int processIndex = 0; for (String queueName : this.contextMap.keySet()) { //エンティティ内のインスタンスを変更しないよう、ディープコピーする。 RabbitmqClusterContext context = this.contextMap.get(queueName); processList = new LinkedList<String>(context.getMqProcessList()); //接続先RabbitMQプロセスが何番目に定義されているかを確認する。 //デフォルトでは先頭(0) processIndex = 0; connectionProcess = context.getConnectionProcessMap().get(getClientId(queueName)); if (connectionProcess != null) { processIndex = processList.indexOf(connectionProcess); } //接続先RabbitMQプロセスが先頭となるよう、RabbitMQプロセス一覧を並び替える。 LinkedList<String> backwardProcesses = new LinkedList<String>(processList.subList(0, processIndex)); LinkedList<String> forwardProcesses = new LinkedList<String>(processList.subList( processIndex, processList.size())); forwardProcesses.addAll(backwardProcesses); processList = new LinkedList<String>(forwardProcesses); processLists.put(queueName, processList); } return processLists; }
class class_name[name] begin[{] method[initProcessLists, return_type[type[Map]], modifier[protected], parameter[contextList]] begin[{] if[binary_operation[THIS[member[None.contextMap]], ==, literal[null]]] begin[{] assign[THIS[member[None.contextMap]], call[.initContextMap, parameter[member[.contextList]]]] else begin[{] None end[}] local_variable[type[Map], processLists] local_variable[type[LinkedList], processList] local_variable[type[String], connectionProcess] local_variable[type[int], processIndex] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=contextMap, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[MemberReference(member=queueName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), name=context)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=RabbitmqClusterContext, sub_type=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=processList, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[MethodInvocation(arguments=[], member=getMqProcessList, postfix_operators=[], prefix_operators=[], qualifier=context, selectors=[], type_arguments=None)], 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))], dimensions=None, name=LinkedList, sub_type=None))), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=processIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=connectionProcess, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=getConnectionProcessMap, postfix_operators=[], prefix_operators=[], qualifier=context, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=queueName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getClientId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=get, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=connectionProcess, 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=processIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=connectionProcess, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=indexOf, postfix_operators=[], prefix_operators=[], qualifier=processList, selectors=[], type_arguments=None)), label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), MemberReference(member=processIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=subList, postfix_operators=[], prefix_operators=[], qualifier=processList, selectors=[], type_arguments=None)], 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))], dimensions=None, name=LinkedList, sub_type=None)), name=backwardProcesses)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=[], name=LinkedList, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MethodInvocation(arguments=[MemberReference(member=processIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=processList, selectors=[], type_arguments=None)], member=subList, postfix_operators=[], prefix_operators=[], qualifier=processList, selectors=[], type_arguments=None)], 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))], dimensions=None, name=LinkedList, sub_type=None)), name=forwardProcesses)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=[], name=LinkedList, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=backwardProcesses, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addAll, postfix_operators=[], prefix_operators=[], qualifier=forwardProcesses, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=processList, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[MemberReference(member=forwardProcesses, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=None, name=LinkedList, sub_type=None))), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=queueName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=processList, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=put, postfix_operators=[], prefix_operators=[], qualifier=processLists, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=contextMap, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[], member=keySet, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=queueName)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None) return[member[.processLists]] end[}] END[}]
Keyword[protected] identifier[Map] operator[<] identifier[String] , identifier[List] operator[<] identifier[String] operator[>] operator[>] identifier[initProcessLists] operator[SEP] identifier[List] operator[<] identifier[RabbitmqClusterContext] operator[>] identifier[contextList] operator[SEP] Keyword[throws] identifier[RabbitmqCommunicateException] { Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[contextMap] operator[==] Other[null] operator[SEP] { Keyword[this] operator[SEP] identifier[contextMap] operator[=] identifier[initContextMap] operator[SEP] identifier[contextList] operator[SEP] operator[SEP] } identifier[Map] operator[<] identifier[String] , identifier[List] operator[<] identifier[String] operator[>] operator[>] identifier[processLists] operator[=] Keyword[new] identifier[HashMap] operator[<] identifier[String] , identifier[List] operator[<] identifier[String] operator[>] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[LinkedList] operator[<] identifier[String] operator[>] identifier[processList] operator[=] Other[null] operator[SEP] identifier[String] identifier[connectionProcess] operator[=] Other[null] operator[SEP] Keyword[int] identifier[processIndex] operator[=] Other[0] operator[SEP] Keyword[for] operator[SEP] identifier[String] identifier[queueName] operator[:] Keyword[this] operator[SEP] identifier[contextMap] operator[SEP] identifier[keySet] operator[SEP] operator[SEP] operator[SEP] { identifier[RabbitmqClusterContext] identifier[context] operator[=] Keyword[this] operator[SEP] identifier[contextMap] operator[SEP] identifier[get] operator[SEP] identifier[queueName] operator[SEP] operator[SEP] identifier[processList] operator[=] Keyword[new] identifier[LinkedList] operator[<] identifier[String] operator[>] operator[SEP] identifier[context] operator[SEP] identifier[getMqProcessList] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[processIndex] operator[=] Other[0] operator[SEP] identifier[connectionProcess] operator[=] identifier[context] operator[SEP] identifier[getConnectionProcessMap] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] identifier[getClientId] operator[SEP] identifier[queueName] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[connectionProcess] operator[!=] Other[null] operator[SEP] { identifier[processIndex] operator[=] identifier[processList] operator[SEP] identifier[indexOf] operator[SEP] identifier[connectionProcess] operator[SEP] operator[SEP] } identifier[LinkedList] operator[<] identifier[String] operator[>] identifier[backwardProcesses] operator[=] Keyword[new] identifier[LinkedList] operator[<] identifier[String] operator[>] operator[SEP] identifier[processList] operator[SEP] identifier[subList] operator[SEP] Other[0] , identifier[processIndex] operator[SEP] operator[SEP] operator[SEP] identifier[LinkedList] operator[<] identifier[String] operator[>] identifier[forwardProcesses] operator[=] Keyword[new] identifier[LinkedList] operator[<] identifier[String] operator[>] operator[SEP] identifier[processList] operator[SEP] identifier[subList] operator[SEP] identifier[processIndex] , identifier[processList] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[forwardProcesses] operator[SEP] identifier[addAll] operator[SEP] identifier[backwardProcesses] operator[SEP] operator[SEP] identifier[processList] operator[=] Keyword[new] identifier[LinkedList] operator[<] identifier[String] operator[>] operator[SEP] identifier[forwardProcesses] operator[SEP] operator[SEP] identifier[processLists] operator[SEP] identifier[put] operator[SEP] identifier[queueName] , identifier[processList] operator[SEP] operator[SEP] } Keyword[return] identifier[processLists] operator[SEP] }
public AstNode node( String name, AstNode parent, Object... types ) { CheckArg.isNotNull(name, "name"); CheckArg.isNotNull(parent, "parent"); CheckArg.isNotEmpty(types, "types"); AstNode node = new AstNode(parent, name); node.setProperty(JCR_MIXIN_TYPES, types); node.setProperty(JCR_PRIMARY_TYPE, NT_UNSTRUCTURED); return node; }
class class_name[name] begin[{] method[node, return_type[type[AstNode]], modifier[public], parameter[name, parent, types]] begin[{] call[CheckArg.isNotNull, parameter[member[.name], literal["name"]]] call[CheckArg.isNotNull, parameter[member[.parent], literal["parent"]]] call[CheckArg.isNotEmpty, parameter[member[.types], literal["types"]]] local_variable[type[AstNode], node] call[node.setProperty, parameter[member[.JCR_MIXIN_TYPES], member[.types]]] call[node.setProperty, parameter[member[.JCR_PRIMARY_TYPE], member[.NT_UNSTRUCTURED]]] return[member[.node]] end[}] END[}]
Keyword[public] identifier[AstNode] identifier[node] operator[SEP] identifier[String] identifier[name] , identifier[AstNode] identifier[parent] , identifier[Object] operator[...] identifier[types] operator[SEP] { identifier[CheckArg] operator[SEP] identifier[isNotNull] operator[SEP] identifier[name] , literal[String] operator[SEP] operator[SEP] identifier[CheckArg] operator[SEP] identifier[isNotNull] operator[SEP] identifier[parent] , literal[String] operator[SEP] operator[SEP] identifier[CheckArg] operator[SEP] identifier[isNotEmpty] operator[SEP] identifier[types] , literal[String] operator[SEP] operator[SEP] identifier[AstNode] identifier[node] operator[=] Keyword[new] identifier[AstNode] operator[SEP] identifier[parent] , identifier[name] operator[SEP] operator[SEP] identifier[node] operator[SEP] identifier[setProperty] operator[SEP] identifier[JCR_MIXIN_TYPES] , identifier[types] operator[SEP] operator[SEP] identifier[node] operator[SEP] identifier[setProperty] operator[SEP] identifier[JCR_PRIMARY_TYPE] , identifier[NT_UNSTRUCTURED] operator[SEP] operator[SEP] Keyword[return] identifier[node] operator[SEP] }
public static Map<String, QualityValue> getStringQualityValues(String header) { if (header == null) return null; header = header.trim(); if (header.length() == 0) return null; Map<String, QualityValue> result = new LinkedHashMap<String, QualityValue>(); int offset = 0; while (true) { int endIndex = header.indexOf(',', offset); String content; if (endIndex < 0) content = header.substring(offset); else content = header.substring(offset, endIndex); QualityValue qualityValue = QualityValue.DEFAULT; int qualityIndex = content.indexOf(';'); if (qualityIndex >= 0) { String parameter = content.substring(qualityIndex + 1); content = content.substring(0, qualityIndex); int equalsIndex = parameter.indexOf('='); if (equalsIndex < 0) throw new IllegalArgumentException("Malformed parameter: " + parameter); String name = parameter.substring(0, equalsIndex).trim(); if (!"q".equals(name)) throw new IllegalArgumentException("Unsupported parameter: " + name); String value = parameter.substring(equalsIndex + 1).trim(); qualityValue = QualityValue.valueOf(value); } content = content.trim(); if (content.length() == 0) throw new IllegalArgumentException("Empty field in: " + header + "."); if (content.equals("*")) result.put(null, qualityValue); else result.put(content, qualityValue); if (endIndex < 0) break; offset = endIndex + 1; } ; if (logger.isDebugEnabled()) logger.debug(result.toString()); return result; }
class class_name[name] begin[{] method[getStringQualityValues, return_type[type[Map]], modifier[public static], parameter[header]] begin[{] if[binary_operation[member[.header], ==, literal[null]]] begin[{] return[literal[null]] else begin[{] None end[}] assign[member[.header], call[header.trim, parameter[]]] if[binary_operation[call[header.length, parameter[]], ==, literal[0]]] begin[{] return[literal[null]] else begin[{] None end[}] local_variable[type[Map], result] local_variable[type[int], offset] while[literal[true]] begin[{] local_variable[type[int], endIndex] local_variable[type[String], content] if[binary_operation[member[.endIndex], <, literal[0]]] begin[{] assign[member[.content], call[header.substring, parameter[member[.offset]]]] else begin[{] assign[member[.content], call[header.substring, parameter[member[.offset], member[.endIndex]]]] end[}] local_variable[type[QualityValue], qualityValue] local_variable[type[int], qualityIndex] if[binary_operation[member[.qualityIndex], >=, literal[0]]] begin[{] local_variable[type[String], parameter] assign[member[.content], call[content.substring, parameter[literal[0], member[.qualityIndex]]]] local_variable[type[int], equalsIndex] if[binary_operation[member[.equalsIndex], <, literal[0]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Malformed parameter: "), operandr=MemberReference(member=parameter, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None) else begin[{] None end[}] local_variable[type[String], name] if[literal["q"]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unsupported parameter: "), operandr=MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None) else begin[{] None end[}] local_variable[type[String], value] assign[member[.qualityValue], call[QualityValue.valueOf, parameter[member[.value]]]] else begin[{] None end[}] assign[member[.content], call[content.trim, parameter[]]] if[binary_operation[call[content.length, parameter[]], ==, literal[0]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Empty field in: "), operandr=MemberReference(member=header, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="."), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None) else begin[{] None end[}] if[call[content.equals, parameter[literal["*"]]]] begin[{] call[result.put, parameter[literal[null], member[.qualityValue]]] else begin[{] call[result.put, parameter[member[.content], member[.qualityValue]]] end[}] if[binary_operation[member[.endIndex], <, literal[0]]] begin[{] BreakStatement(goto=None, label=None) else begin[{] None end[}] assign[member[.offset], binary_operation[member[.endIndex], +, literal[1]]] end[}] Statement(label=None) if[call[logger.isDebugEnabled, parameter[]]] begin[{] call[logger.debug, parameter[call[result.toString, parameter[]]]] else begin[{] None end[}] return[member[.result]] end[}] END[}]
Keyword[public] Keyword[static] identifier[Map] operator[<] identifier[String] , identifier[QualityValue] operator[>] identifier[getStringQualityValues] operator[SEP] identifier[String] identifier[header] operator[SEP] { Keyword[if] operator[SEP] identifier[header] operator[==] Other[null] operator[SEP] Keyword[return] Other[null] operator[SEP] identifier[header] operator[=] identifier[header] operator[SEP] identifier[trim] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[header] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[==] Other[0] operator[SEP] Keyword[return] Other[null] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[QualityValue] operator[>] identifier[result] operator[=] Keyword[new] identifier[LinkedHashMap] operator[<] identifier[String] , identifier[QualityValue] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[offset] operator[=] Other[0] operator[SEP] Keyword[while] operator[SEP] literal[boolean] operator[SEP] { Keyword[int] identifier[endIndex] operator[=] identifier[header] operator[SEP] identifier[indexOf] operator[SEP] literal[String] , identifier[offset] operator[SEP] operator[SEP] identifier[String] identifier[content] operator[SEP] Keyword[if] operator[SEP] identifier[endIndex] operator[<] Other[0] operator[SEP] identifier[content] operator[=] identifier[header] operator[SEP] identifier[substring] operator[SEP] identifier[offset] operator[SEP] operator[SEP] Keyword[else] identifier[content] operator[=] identifier[header] operator[SEP] identifier[substring] operator[SEP] identifier[offset] , identifier[endIndex] operator[SEP] operator[SEP] identifier[QualityValue] identifier[qualityValue] operator[=] identifier[QualityValue] operator[SEP] identifier[DEFAULT] operator[SEP] Keyword[int] identifier[qualityIndex] operator[=] identifier[content] operator[SEP] identifier[indexOf] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[qualityIndex] operator[>=] Other[0] operator[SEP] { identifier[String] identifier[parameter] operator[=] identifier[content] operator[SEP] identifier[substring] operator[SEP] identifier[qualityIndex] operator[+] Other[1] operator[SEP] operator[SEP] identifier[content] operator[=] identifier[content] operator[SEP] identifier[substring] operator[SEP] Other[0] , identifier[qualityIndex] operator[SEP] operator[SEP] Keyword[int] identifier[equalsIndex] operator[=] identifier[parameter] operator[SEP] identifier[indexOf] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[equalsIndex] operator[<] Other[0] operator[SEP] Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[+] identifier[parameter] operator[SEP] operator[SEP] identifier[String] identifier[name] operator[=] identifier[parameter] operator[SEP] identifier[substring] operator[SEP] Other[0] , identifier[equalsIndex] operator[SEP] operator[SEP] identifier[trim] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] literal[String] operator[SEP] identifier[equals] operator[SEP] identifier[name] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[+] identifier[name] operator[SEP] operator[SEP] identifier[String] identifier[value] operator[=] identifier[parameter] operator[SEP] identifier[substring] operator[SEP] identifier[equalsIndex] operator[+] Other[1] operator[SEP] operator[SEP] identifier[trim] operator[SEP] operator[SEP] operator[SEP] identifier[qualityValue] operator[=] identifier[QualityValue] operator[SEP] identifier[valueOf] operator[SEP] identifier[value] operator[SEP] operator[SEP] } identifier[content] operator[=] identifier[content] operator[SEP] identifier[trim] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[content] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[==] Other[0] operator[SEP] Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[+] identifier[header] operator[+] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[content] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[put] operator[SEP] Other[null] , identifier[qualityValue] operator[SEP] operator[SEP] Keyword[else] identifier[result] operator[SEP] identifier[put] operator[SEP] identifier[content] , identifier[qualityValue] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[endIndex] operator[<] Other[0] operator[SEP] Keyword[break] operator[SEP] identifier[offset] operator[=] identifier[endIndex] operator[+] Other[1] operator[SEP] } operator[SEP] Keyword[if] operator[SEP] identifier[logger] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[logger] operator[SEP] identifier[debug] operator[SEP] identifier[result] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[result] operator[SEP] }
public static void imgCompressByScale(String srcFile, String desFile, double base, int wh, Float quality) { ImgCompressUtils.imgCompressByScale(srcFile, desFile, base, wh, quality, false); }
class class_name[name] begin[{] method[imgCompressByScale, return_type[void], modifier[public static], parameter[srcFile, desFile, base, wh, quality]] begin[{] call[ImgCompressUtils.imgCompressByScale, parameter[member[.srcFile], member[.desFile], member[.base], member[.wh], member[.quality], literal[false]]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[imgCompressByScale] operator[SEP] identifier[String] identifier[srcFile] , identifier[String] identifier[desFile] , Keyword[double] identifier[base] , Keyword[int] identifier[wh] , identifier[Float] identifier[quality] operator[SEP] { identifier[ImgCompressUtils] operator[SEP] identifier[imgCompressByScale] operator[SEP] identifier[srcFile] , identifier[desFile] , identifier[base] , identifier[wh] , identifier[quality] , literal[boolean] operator[SEP] operator[SEP] }
public static List<String> canonicalizeSecurityQuestions(final Map<String, String> questionMap) { val keys = new ArrayList<String>(questionMap.keySet()); keys.sort(String.CASE_INSENSITIVE_ORDER); return keys; }
class class_name[name] begin[{] method[canonicalizeSecurityQuestions, return_type[type[List]], modifier[public static], parameter[questionMap]] begin[{] local_variable[type[val], keys] call[keys.sort, parameter[member[String.CASE_INSENSITIVE_ORDER]]] return[member[.keys]] end[}] END[}]
Keyword[public] Keyword[static] identifier[List] operator[<] identifier[String] operator[>] identifier[canonicalizeSecurityQuestions] operator[SEP] Keyword[final] identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[questionMap] operator[SEP] { identifier[val] identifier[keys] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[String] operator[>] operator[SEP] identifier[questionMap] operator[SEP] identifier[keySet] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[keys] operator[SEP] identifier[sort] operator[SEP] identifier[String] operator[SEP] identifier[CASE_INSENSITIVE_ORDER] operator[SEP] operator[SEP] Keyword[return] identifier[keys] operator[SEP] }
@Override public AtmosphereRequestBuilder newRequestBuilder(Class<AtmosphereRequest.AtmosphereRequestBuilder> clazz) { AtmosphereRequestBuilder b; try { b = clazz.newInstance(); } catch (InstantiationException e) { throw new RuntimeException(e); } catch (IllegalAccessException e) { throw new RuntimeException(e); } return AtmosphereRequestBuilder.class.cast(b.resolver(FunctionResolver.DEFAULT)); }
class class_name[name] begin[{] method[newRequestBuilder, return_type[type[AtmosphereRequestBuilder]], modifier[public], parameter[clazz]] begin[{] local_variable[type[AtmosphereRequestBuilder], b] TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=b, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=newInstance, postfix_operators=[], prefix_operators=[], qualifier=clazz, 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=['InstantiationException'])), CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=RuntimeException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IllegalAccessException']))], finally_block=None, label=None, resources=None) return[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=DEFAULT, postfix_operators=[], prefix_operators=[], qualifier=FunctionResolver, selectors=[])], member=resolver, postfix_operators=[], prefix_operators=[], qualifier=b, selectors=[], type_arguments=None)], member=cast, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=AtmosphereRequestBuilder, sub_type=None))] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[AtmosphereRequestBuilder] identifier[newRequestBuilder] operator[SEP] identifier[Class] operator[<] identifier[AtmosphereRequest] operator[SEP] identifier[AtmosphereRequestBuilder] operator[>] identifier[clazz] operator[SEP] { identifier[AtmosphereRequestBuilder] identifier[b] operator[SEP] Keyword[try] { identifier[b] operator[=] identifier[clazz] operator[SEP] identifier[newInstance] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[InstantiationException] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[RuntimeException] operator[SEP] identifier[e] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[IllegalAccessException] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[RuntimeException] operator[SEP] identifier[e] operator[SEP] operator[SEP] } Keyword[return] identifier[AtmosphereRequestBuilder] operator[SEP] Keyword[class] operator[SEP] identifier[cast] operator[SEP] identifier[b] operator[SEP] identifier[resolver] operator[SEP] identifier[FunctionResolver] operator[SEP] identifier[DEFAULT] operator[SEP] operator[SEP] operator[SEP] }
public void save(ProcessingEnvironment env) throws IOException { Filer filer = env.getFiler(); //JavaFileObject sourceFile = filer.createClassFile(getQualifiedName(), superClass); FileObject sourceFile = filer.createResource( StandardLocation.CLASS_OUTPUT, El.getPackageOf(this).getQualifiedName(), getSimpleName()+".class" ); BufferedOutputStream bos = new BufferedOutputStream(sourceFile.openOutputStream()); DataOutputStream dos = new DataOutputStream(bos); write(dos); dos.close(); System.err.println("wrote "+sourceFile.getName()); }
class class_name[name] begin[{] method[save, return_type[void], modifier[public], parameter[env]] begin[{] local_variable[type[Filer], filer] local_variable[type[FileObject], sourceFile] local_variable[type[BufferedOutputStream], bos] local_variable[type[DataOutputStream], dos] call[.write, parameter[member[.dos]]] call[dos.close, parameter[]] call[System.err.println, parameter[binary_operation[literal["wrote "], +, call[sourceFile.getName, parameter[]]]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[save] operator[SEP] identifier[ProcessingEnvironment] identifier[env] operator[SEP] Keyword[throws] identifier[IOException] { identifier[Filer] identifier[filer] operator[=] identifier[env] operator[SEP] identifier[getFiler] operator[SEP] operator[SEP] operator[SEP] identifier[FileObject] identifier[sourceFile] operator[=] identifier[filer] operator[SEP] identifier[createResource] operator[SEP] identifier[StandardLocation] operator[SEP] identifier[CLASS_OUTPUT] , identifier[El] operator[SEP] identifier[getPackageOf] operator[SEP] Keyword[this] operator[SEP] operator[SEP] identifier[getQualifiedName] operator[SEP] operator[SEP] , identifier[getSimpleName] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] identifier[BufferedOutputStream] identifier[bos] operator[=] Keyword[new] identifier[BufferedOutputStream] operator[SEP] identifier[sourceFile] operator[SEP] identifier[openOutputStream] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[DataOutputStream] identifier[dos] operator[=] Keyword[new] identifier[DataOutputStream] operator[SEP] identifier[bos] operator[SEP] operator[SEP] identifier[write] operator[SEP] identifier[dos] operator[SEP] operator[SEP] identifier[dos] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[err] operator[SEP] identifier[println] operator[SEP] literal[String] operator[+] identifier[sourceFile] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
private LoginContext getClientLoginContext() throws LoginException { Configuration config = new Configuration() { @Override public AppConfigurationEntry[] getAppConfigurationEntry(String name) { Map<String, String> options = new HashMap<String, String>(); options.put("multi-threaded", "true"); options.put("restore-login-identity", "true"); AppConfigurationEntry clmEntry = new AppConfigurationEntry(ClientLoginModule.class.getName(), LoginModuleControlFlag.REQUIRED, options); return new AppConfigurationEntry[] { clmEntry }; } }; return getLoginContext(config); }
class class_name[name] begin[{] method[getClientLoginContext, return_type[type[LoginContext]], modifier[private], parameter[]] begin[{] local_variable[type[Configuration], config] return[call[.getLoginContext, parameter[member[.config]]]] end[}] END[}]
Keyword[private] identifier[LoginContext] identifier[getClientLoginContext] operator[SEP] operator[SEP] Keyword[throws] identifier[LoginException] { identifier[Configuration] identifier[config] operator[=] Keyword[new] identifier[Configuration] operator[SEP] operator[SEP] { annotation[@] identifier[Override] Keyword[public] identifier[AppConfigurationEntry] operator[SEP] operator[SEP] identifier[getAppConfigurationEntry] operator[SEP] identifier[String] identifier[name] operator[SEP] { identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[options] operator[=] Keyword[new] identifier[HashMap] operator[<] identifier[String] , identifier[String] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[options] operator[SEP] identifier[put] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[options] operator[SEP] identifier[put] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[AppConfigurationEntry] identifier[clmEntry] operator[=] Keyword[new] identifier[AppConfigurationEntry] operator[SEP] identifier[ClientLoginModule] operator[SEP] Keyword[class] operator[SEP] identifier[getName] operator[SEP] operator[SEP] , identifier[LoginModuleControlFlag] operator[SEP] identifier[REQUIRED] , identifier[options] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[AppConfigurationEntry] operator[SEP] operator[SEP] { identifier[clmEntry] } operator[SEP] } } operator[SEP] Keyword[return] identifier[getLoginContext] operator[SEP] identifier[config] operator[SEP] operator[SEP] }
private Path getPath(String fileName) throws IOException, URISyntaxException { Path path; URL url = getClass().getClassLoader().getResource(fileName); if (url == null) { throw new IOException(String.format("File %s is not existing", fileName)); } URI uri = url.toURI(); Map<String, String> env = new HashMap<>(); if (uri.toString().contains("!")) { String[] parts = uri.toString().split("!"); if (fs == null) { fs = FileSystems.newFileSystem(URI.create(parts[0]), env); } path = fs.getPath(parts[1]); } else { path = Paths.get(uri); } return path; }
class class_name[name] begin[{] method[getPath, return_type[type[Path]], modifier[private], parameter[fileName]] begin[{] local_variable[type[Path], path] local_variable[type[URL], url] if[binary_operation[member[.url], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="File %s is not existing"), MemberReference(member=fileName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=format, postfix_operators=[], prefix_operators=[], qualifier=String, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IOException, sub_type=None)), label=None) else begin[{] None end[}] local_variable[type[URI], uri] local_variable[type[Map], env] if[call[uri.toString, parameter[]]] begin[{] local_variable[type[String], parts] if[binary_operation[member[.fs], ==, literal[null]]] begin[{] assign[member[.fs], call[FileSystems.newFileSystem, parameter[call[URI.create, parameter[member[.parts]]], member[.env]]]] else begin[{] None end[}] assign[member[.path], call[fs.getPath, parameter[member[.parts]]]] else begin[{] assign[member[.path], call[Paths.get, parameter[member[.uri]]]] end[}] return[member[.path]] end[}] END[}]
Keyword[private] identifier[Path] identifier[getPath] operator[SEP] identifier[String] identifier[fileName] operator[SEP] Keyword[throws] identifier[IOException] , identifier[URISyntaxException] { identifier[Path] identifier[path] operator[SEP] identifier[URL] identifier[url] operator[=] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] identifier[getClassLoader] operator[SEP] operator[SEP] operator[SEP] identifier[getResource] operator[SEP] identifier[fileName] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[url] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[IOException] operator[SEP] identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[fileName] operator[SEP] operator[SEP] operator[SEP] } identifier[URI] identifier[uri] operator[=] identifier[url] operator[SEP] identifier[toURI] operator[SEP] operator[SEP] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[env] operator[=] Keyword[new] identifier[HashMap] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[uri] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] identifier[contains] operator[SEP] literal[String] operator[SEP] operator[SEP] { identifier[String] operator[SEP] operator[SEP] identifier[parts] operator[=] identifier[uri] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] identifier[split] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[fs] operator[==] Other[null] operator[SEP] { identifier[fs] operator[=] identifier[FileSystems] operator[SEP] identifier[newFileSystem] operator[SEP] identifier[URI] operator[SEP] identifier[create] operator[SEP] identifier[parts] operator[SEP] Other[0] operator[SEP] operator[SEP] , identifier[env] operator[SEP] operator[SEP] } identifier[path] operator[=] identifier[fs] operator[SEP] identifier[getPath] operator[SEP] identifier[parts] operator[SEP] Other[1] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[path] operator[=] identifier[Paths] operator[SEP] identifier[get] operator[SEP] identifier[uri] operator[SEP] operator[SEP] } Keyword[return] identifier[path] operator[SEP] }
@Override public AttributeSetBuilder addAttribute(int resId, String value) { attrToValue.put(resId, value); return this; }
class class_name[name] begin[{] method[addAttribute, return_type[type[AttributeSetBuilder]], modifier[public], parameter[resId, value]] begin[{] call[attrToValue.put, parameter[member[.resId], member[.value]]] return[THIS[]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[AttributeSetBuilder] identifier[addAttribute] operator[SEP] Keyword[int] identifier[resId] , identifier[String] identifier[value] operator[SEP] { identifier[attrToValue] operator[SEP] identifier[put] operator[SEP] identifier[resId] , identifier[value] operator[SEP] operator[SEP] Keyword[return] Keyword[this] operator[SEP] }
public boolean put(int key, int value) { IntSet values = map.get(key); if (values == null) { values = new TroveIntSet(); map.put(key, values); } boolean added = values.add(value); if (added) { range++; } return added; }
class class_name[name] begin[{] method[put, return_type[type[boolean]], modifier[public], parameter[key, value]] begin[{] local_variable[type[IntSet], values] if[binary_operation[member[.values], ==, literal[null]]] begin[{] assign[member[.values], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=TroveIntSet, sub_type=None))] call[map.put, parameter[member[.key], member[.values]]] else begin[{] None end[}] local_variable[type[boolean], added] if[member[.added]] begin[{] member[.range] else begin[{] None end[}] return[member[.added]] end[}] END[}]
Keyword[public] Keyword[boolean] identifier[put] operator[SEP] Keyword[int] identifier[key] , Keyword[int] identifier[value] operator[SEP] { identifier[IntSet] identifier[values] operator[=] identifier[map] operator[SEP] identifier[get] operator[SEP] identifier[key] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[values] operator[==] Other[null] operator[SEP] { identifier[values] operator[=] Keyword[new] identifier[TroveIntSet] operator[SEP] operator[SEP] operator[SEP] identifier[map] operator[SEP] identifier[put] operator[SEP] identifier[key] , identifier[values] operator[SEP] operator[SEP] } Keyword[boolean] identifier[added] operator[=] identifier[values] operator[SEP] identifier[add] operator[SEP] identifier[value] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[added] operator[SEP] { identifier[range] operator[++] operator[SEP] } Keyword[return] identifier[added] operator[SEP] }
@POST @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) public Response registerWindowsVariant( WindowsVariant windowsVariant, @PathParam("pushAppID") String pushApplicationID, @Context UriInfo uriInfo) { PushApplication pushApp = getSearch().findByPushApplicationIDForDeveloper(pushApplicationID); if (pushApp == null) { return Response.status(Response.Status.NOT_FOUND).entity("Could not find requested PushApplicationEntity").build(); } // some validation try { validateModelClass(windowsVariant); } catch (ConstraintViolationException cve) { logger.trace("Unable to create Windows variant"); // Build and return the 400 (Bad Request) response Response.ResponseBuilder builder = createBadRequestResponse(cve.getConstraintViolations()); return builder.build(); } logger.trace("Register Windows variant with Push Application '{}'", pushApplicationID); // store the Windows variant: variantService.addVariant(windowsVariant); // add iOS variant, and merge: pushAppService.addVariant(pushApp, windowsVariant); return Response.created(uriInfo.getAbsolutePathBuilder().path(String.valueOf(windowsVariant.getVariantID())).build()).entity(windowsVariant).build(); }
class class_name[name] begin[{] method[registerWindowsVariant, return_type[type[Response]], modifier[public], parameter[windowsVariant, pushApplicationID, uriInfo]] begin[{] local_variable[type[PushApplication], pushApp] if[binary_operation[member[.pushApp], ==, literal[null]]] begin[{] return[call[Response.status, parameter[member[Response.Status.NOT_FOUND]]]] else begin[{] None end[}] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=windowsVariant, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=validateModelClass, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unable to create Windows variant")], member=trace, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getConstraintViolations, postfix_operators=[], prefix_operators=[], qualifier=cve, selectors=[], type_arguments=None)], member=createBadRequestResponse, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=builder)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Response, sub_type=ReferenceType(arguments=None, dimensions=None, name=ResponseBuilder, sub_type=None))), ReturnStatement(expression=MethodInvocation(arguments=[], member=build, postfix_operators=[], prefix_operators=[], qualifier=builder, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=cve, types=['ConstraintViolationException']))], finally_block=None, label=None, resources=None) call[logger.trace, parameter[literal["Register Windows variant with Push Application '{}'"], member[.pushApplicationID]]] call[variantService.addVariant, parameter[member[.windowsVariant]]] call[pushAppService.addVariant, parameter[member[.pushApp], member[.windowsVariant]]] return[call[Response.created, parameter[call[uriInfo.getAbsolutePathBuilder, parameter[]]]]] end[}] END[}]
annotation[@] identifier[POST] annotation[@] identifier[Consumes] operator[SEP] identifier[MediaType] operator[SEP] identifier[APPLICATION_JSON] operator[SEP] annotation[@] identifier[Produces] operator[SEP] identifier[MediaType] operator[SEP] identifier[APPLICATION_JSON] operator[SEP] Keyword[public] identifier[Response] identifier[registerWindowsVariant] operator[SEP] identifier[WindowsVariant] identifier[windowsVariant] , annotation[@] identifier[PathParam] operator[SEP] literal[String] operator[SEP] identifier[String] identifier[pushApplicationID] , annotation[@] identifier[Context] identifier[UriInfo] identifier[uriInfo] operator[SEP] { identifier[PushApplication] identifier[pushApp] operator[=] identifier[getSearch] operator[SEP] operator[SEP] operator[SEP] identifier[findByPushApplicationIDForDeveloper] operator[SEP] identifier[pushApplicationID] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[pushApp] operator[==] Other[null] operator[SEP] { Keyword[return] identifier[Response] operator[SEP] identifier[status] operator[SEP] identifier[Response] operator[SEP] identifier[Status] operator[SEP] identifier[NOT_FOUND] operator[SEP] operator[SEP] identifier[entity] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP] } Keyword[try] { identifier[validateModelClass] operator[SEP] identifier[windowsVariant] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[ConstraintViolationException] identifier[cve] operator[SEP] { identifier[logger] operator[SEP] identifier[trace] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[Response] operator[SEP] identifier[ResponseBuilder] identifier[builder] operator[=] identifier[createBadRequestResponse] operator[SEP] identifier[cve] operator[SEP] identifier[getConstraintViolations] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[builder] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP] } identifier[logger] operator[SEP] identifier[trace] operator[SEP] literal[String] , identifier[pushApplicationID] operator[SEP] operator[SEP] identifier[variantService] operator[SEP] identifier[addVariant] operator[SEP] identifier[windowsVariant] operator[SEP] operator[SEP] identifier[pushAppService] operator[SEP] identifier[addVariant] operator[SEP] identifier[pushApp] , identifier[windowsVariant] operator[SEP] operator[SEP] Keyword[return] identifier[Response] operator[SEP] identifier[created] operator[SEP] identifier[uriInfo] operator[SEP] identifier[getAbsolutePathBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[path] operator[SEP] identifier[String] operator[SEP] identifier[valueOf] operator[SEP] identifier[windowsVariant] operator[SEP] identifier[getVariantID] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[entity] operator[SEP] identifier[windowsVariant] operator[SEP] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP] }
@Override public long getLong(TemporalField field) { if (field == OFFSET_SECONDS) { return totalSeconds; } else if (field instanceof ChronoField) { throw new UnsupportedTemporalTypeException("Unsupported field: " + field); } return field.getFrom(this); }
class class_name[name] begin[{] method[getLong, return_type[type[long]], modifier[public], parameter[field]] begin[{] if[binary_operation[member[.field], ==, member[.OFFSET_SECONDS]]] begin[{] return[member[.totalSeconds]] else begin[{] if[binary_operation[member[.field], instanceof, type[ChronoField]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unsupported field: "), operandr=MemberReference(member=field, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=UnsupportedTemporalTypeException, sub_type=None)), label=None) else begin[{] None end[}] end[}] return[call[field.getFrom, parameter[THIS[]]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[long] identifier[getLong] operator[SEP] identifier[TemporalField] identifier[field] operator[SEP] { Keyword[if] operator[SEP] identifier[field] operator[==] identifier[OFFSET_SECONDS] operator[SEP] { Keyword[return] identifier[totalSeconds] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[field] Keyword[instanceof] identifier[ChronoField] operator[SEP] { Keyword[throw] Keyword[new] identifier[UnsupportedTemporalTypeException] operator[SEP] literal[String] operator[+] identifier[field] operator[SEP] operator[SEP] } Keyword[return] identifier[field] operator[SEP] identifier[getFrom] operator[SEP] Keyword[this] operator[SEP] operator[SEP] }
public void comment(char[] ch, int start, int length) throws SAXException { if (lexicalHandler != null) { lexicalHandler.comment(ch, start, length); } }
class class_name[name] begin[{] method[comment, return_type[void], modifier[public], parameter[ch, start, length]] begin[{] if[binary_operation[member[.lexicalHandler], !=, literal[null]]] begin[{] call[lexicalHandler.comment, parameter[member[.ch], member[.start], member[.length]]] else begin[{] None end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[comment] operator[SEP] Keyword[char] operator[SEP] operator[SEP] identifier[ch] , Keyword[int] identifier[start] , Keyword[int] identifier[length] operator[SEP] Keyword[throws] identifier[SAXException] { Keyword[if] operator[SEP] identifier[lexicalHandler] operator[!=] Other[null] operator[SEP] { identifier[lexicalHandler] operator[SEP] identifier[comment] operator[SEP] identifier[ch] , identifier[start] , identifier[length] operator[SEP] operator[SEP] } }
public Observable<Void> disableAutoScaleAsync(String poolId, PoolDisableAutoScaleOptions poolDisableAutoScaleOptions) { return disableAutoScaleWithServiceResponseAsync(poolId, poolDisableAutoScaleOptions).map(new Func1<ServiceResponseWithHeaders<Void, PoolDisableAutoScaleHeaders>, Void>() { @Override public Void call(ServiceResponseWithHeaders<Void, PoolDisableAutoScaleHeaders> response) { return response.body(); } }); }
class class_name[name] begin[{] method[disableAutoScaleAsync, return_type[type[Observable]], modifier[public], parameter[poolId, poolDisableAutoScaleOptions]] begin[{] return[call[.disableAutoScaleWithServiceResponseAsync, parameter[member[.poolId], member[.poolDisableAutoScaleOptions]]]] end[}] END[}]
Keyword[public] identifier[Observable] operator[<] identifier[Void] operator[>] identifier[disableAutoScaleAsync] operator[SEP] identifier[String] identifier[poolId] , identifier[PoolDisableAutoScaleOptions] identifier[poolDisableAutoScaleOptions] operator[SEP] { Keyword[return] identifier[disableAutoScaleWithServiceResponseAsync] operator[SEP] identifier[poolId] , identifier[poolDisableAutoScaleOptions] operator[SEP] operator[SEP] identifier[map] operator[SEP] Keyword[new] identifier[Func1] operator[<] identifier[ServiceResponseWithHeaders] operator[<] identifier[Void] , identifier[PoolDisableAutoScaleHeaders] operator[>] , identifier[Void] operator[>] operator[SEP] operator[SEP] { annotation[@] identifier[Override] Keyword[public] identifier[Void] identifier[call] operator[SEP] identifier[ServiceResponseWithHeaders] operator[<] identifier[Void] , identifier[PoolDisableAutoScaleHeaders] operator[>] identifier[response] operator[SEP] { Keyword[return] identifier[response] operator[SEP] identifier[body] operator[SEP] operator[SEP] operator[SEP] } } operator[SEP] operator[SEP] }
@Override public GetSendStatisticsResult getSendStatistics(GetSendStatisticsRequest request) { request = beforeClientExecution(request); return executeGetSendStatistics(request); }
class class_name[name] begin[{] method[getSendStatistics, return_type[type[GetSendStatisticsResult]], modifier[public], parameter[request]] begin[{] assign[member[.request], call[.beforeClientExecution, parameter[member[.request]]]] return[call[.executeGetSendStatistics, parameter[member[.request]]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[GetSendStatisticsResult] identifier[getSendStatistics] operator[SEP] identifier[GetSendStatisticsRequest] identifier[request] operator[SEP] { identifier[request] operator[=] identifier[beforeClientExecution] operator[SEP] identifier[request] operator[SEP] operator[SEP] Keyword[return] identifier[executeGetSendStatistics] operator[SEP] identifier[request] operator[SEP] operator[SEP] }
public ApplicationDefinition createApplication(ApplicationDefinition appDef) { Utils.require(!m_restClient.isClosed(), "Client has been closed"); Utils.require(appDef != null, "appDef"); Utils.require(appDef.getAppName() != null && appDef.getAppName().length() > 0, "Application must have a 'name' defined"); try { // Serialize as a JSON message and convert to bytes. byte[] body = null; body = Utils.toBytes(appDef.toDoc().toJSON()); // Send a POST request to the "/_applications" StringBuilder uri = new StringBuilder(Utils.isEmpty(m_apiPrefix) ? "" : "/" + m_apiPrefix); uri.append("/_applications/"); RESTResponse response = m_restClient.sendRequest(HttpMethod.POST, uri.toString(), ContentType.APPLICATION_JSON, body); m_logger.debug("defineApplication() response: {}", response.toString()); throwIfErrorResponse(response); return getAppDef(appDef.getAppName()); } catch (Exception e) { throw new RuntimeException(e); } }
class class_name[name] begin[{] method[createApplication, return_type[type[ApplicationDefinition]], modifier[public], parameter[appDef]] begin[{] call[Utils.require, parameter[call[m_restClient.isClosed, parameter[]], literal["Client has been closed"]]] call[Utils.require, parameter[binary_operation[member[.appDef], !=, literal[null]], literal["appDef"]]] call[Utils.require, parameter[binary_operation[binary_operation[call[appDef.getAppName, parameter[]], !=, literal[null]], &&, binary_operation[call[appDef.getAppName, parameter[]], >, literal[0]]], literal["Application must have a 'name' defined"]]] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), name=body)], modifiers=set(), type=BasicType(dimensions=[None], name=byte)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=body, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=toDoc, postfix_operators=[], prefix_operators=[], qualifier=appDef, selectors=[MethodInvocation(arguments=[], member=toJSON, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=toBytes, postfix_operators=[], prefix_operators=[], qualifier=Utils, selectors=[], type_arguments=None)), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[TernaryExpression(condition=MethodInvocation(arguments=[MemberReference(member=m_apiPrefix, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isEmpty, postfix_operators=[], prefix_operators=[], qualifier=Utils, selectors=[], type_arguments=None), if_false=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="/"), operandr=MemberReference(member=m_apiPrefix, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=""))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=StringBuilder, sub_type=None)), name=uri)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=StringBuilder, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="/_applications/")], member=append, postfix_operators=[], prefix_operators=[], qualifier=uri, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=POST, postfix_operators=[], prefix_operators=[], qualifier=HttpMethod, selectors=[]), MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=uri, selectors=[], type_arguments=None), MemberReference(member=APPLICATION_JSON, postfix_operators=[], prefix_operators=[], qualifier=ContentType, selectors=[]), MemberReference(member=body, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=sendRequest, postfix_operators=[], prefix_operators=[], qualifier=m_restClient, selectors=[], type_arguments=None), name=response)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=RESTResponse, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="defineApplication() response: {}"), MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=response, selectors=[], type_arguments=None)], member=debug, postfix_operators=[], prefix_operators=[], qualifier=m_logger, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=response, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=throwIfErrorResponse, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getAppName, postfix_operators=[], prefix_operators=[], qualifier=appDef, selectors=[], type_arguments=None)], member=getAppDef, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=RuntimeException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[public] identifier[ApplicationDefinition] identifier[createApplication] operator[SEP] identifier[ApplicationDefinition] identifier[appDef] operator[SEP] { identifier[Utils] operator[SEP] identifier[require] operator[SEP] operator[!] identifier[m_restClient] operator[SEP] identifier[isClosed] operator[SEP] operator[SEP] , literal[String] operator[SEP] operator[SEP] identifier[Utils] operator[SEP] identifier[require] operator[SEP] identifier[appDef] operator[!=] Other[null] , literal[String] operator[SEP] operator[SEP] identifier[Utils] operator[SEP] identifier[require] operator[SEP] identifier[appDef] operator[SEP] identifier[getAppName] operator[SEP] operator[SEP] operator[!=] Other[null] operator[&&] identifier[appDef] operator[SEP] identifier[getAppName] operator[SEP] operator[SEP] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[>] Other[0] , literal[String] operator[SEP] operator[SEP] Keyword[try] { Keyword[byte] operator[SEP] operator[SEP] identifier[body] operator[=] Other[null] operator[SEP] identifier[body] operator[=] identifier[Utils] operator[SEP] identifier[toBytes] operator[SEP] identifier[appDef] operator[SEP] identifier[toDoc] operator[SEP] operator[SEP] operator[SEP] identifier[toJSON] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[StringBuilder] identifier[uri] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] identifier[Utils] operator[SEP] identifier[isEmpty] operator[SEP] identifier[m_apiPrefix] operator[SEP] operator[?] literal[String] operator[:] literal[String] operator[+] identifier[m_apiPrefix] operator[SEP] operator[SEP] identifier[uri] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[RESTResponse] identifier[response] operator[=] identifier[m_restClient] operator[SEP] identifier[sendRequest] operator[SEP] identifier[HttpMethod] operator[SEP] identifier[POST] , identifier[uri] operator[SEP] identifier[toString] operator[SEP] operator[SEP] , identifier[ContentType] operator[SEP] identifier[APPLICATION_JSON] , identifier[body] operator[SEP] operator[SEP] identifier[m_logger] operator[SEP] identifier[debug] operator[SEP] literal[String] , identifier[response] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[throwIfErrorResponse] operator[SEP] identifier[response] operator[SEP] operator[SEP] Keyword[return] identifier[getAppDef] operator[SEP] identifier[appDef] operator[SEP] identifier[getAppName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[RuntimeException] operator[SEP] identifier[e] operator[SEP] operator[SEP] } }
private void doWork() { boolean isTraceOn = TraceComponent.isAnyTracingEnabled(); if (isTraceOn && tc.isEntryEnabled()) Tr.entry(tc, "doWork: " + ivTimer); TimedObjectWrapper timedObject; try { ivBeanId = ivBeanId.getInitializedBeanId(); // F743-506CodRev } catch (Exception ex) { FFDCFilter.processException(ex, CLASS_NAME + ".doWork", "247", this); if (isTraceOn && tc.isEntryEnabled()) Tr.exit(tc, "doWork: " + ex); throw ExceptionUtil.EJBException(ex); } EJSHome home = (EJSHome) ivBeanId.home; // Get the TimedObjectWrapper from the pool to execute the method. timedObject = home.getTimedObjectWrapper(ivBeanId); // Invoke ejbTimeout on the wrapper. No need to handle exceptions, // as the wrapper will have already handled/mapped any exceptions // as expected. try { ivTimer.ivTimeoutThread = Thread.currentThread(); // d595255 timedObject.invokeCallback(ivTimer, ivMethodId, false); // F743-506 } finally { ivTimer.ivTimeoutThread = null; // d595255 // Always return the TimedObjectWrapper to the pool. home.putTimedObjectWrapper(timedObject); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) Tr.exit(tc, "doWork"); } }
class class_name[name] begin[{] method[doWork, return_type[void], modifier[private], parameter[]] begin[{] local_variable[type[boolean], isTraceOn] if[binary_operation[member[.isTraceOn], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{] call[Tr.entry, parameter[member[.tc], binary_operation[literal["doWork: "], +, member[.ivTimer]]]] else begin[{] None end[}] local_variable[type[TimedObjectWrapper], timedObject] TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=ivBeanId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=getInitializedBeanId, postfix_operators=[], prefix_operators=[], qualifier=ivBeanId, selectors=[], type_arguments=None)), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=ex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=MemberReference(member=CLASS_NAME, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=".doWork"), operator=+), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="247"), This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[])], member=processException, postfix_operators=[], prefix_operators=[], qualifier=FFDCFilter, selectors=[], type_arguments=None), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=isTraceOn, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=isEntryEnabled, postfix_operators=[], prefix_operators=[], qualifier=tc, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=tc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="doWork: "), operandr=MemberReference(member=ex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=exit, postfix_operators=[], prefix_operators=[], qualifier=Tr, selectors=[], type_arguments=None), label=None)), ThrowStatement(expression=MethodInvocation(arguments=[MemberReference(member=ex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=EJBException, postfix_operators=[], prefix_operators=[], qualifier=ExceptionUtil, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ex, types=['Exception']))], finally_block=None, label=None, resources=None) local_variable[type[EJSHome], home] assign[member[.timedObject], call[home.getTimedObjectWrapper, parameter[member[.ivBeanId]]]] TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=ivTimeoutThread, postfix_operators=[], prefix_operators=[], qualifier=ivTimer, selectors=[]), type==, value=MethodInvocation(arguments=[], member=currentThread, postfix_operators=[], prefix_operators=[], qualifier=Thread, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=ivTimer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=ivMethodId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)], member=invokeCallback, postfix_operators=[], prefix_operators=[], qualifier=timedObject, selectors=[], type_arguments=None), label=None)], catches=None, finally_block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=ivTimeoutThread, postfix_operators=[], prefix_operators=[], qualifier=ivTimer, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=timedObject, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=putTimedObjectWrapper, postfix_operators=[], prefix_operators=[], qualifier=home, selectors=[], type_arguments=None), label=None), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=isAnyTracingEnabled, postfix_operators=[], prefix_operators=[], qualifier=TraceComponent, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[], member=isEntryEnabled, postfix_operators=[], prefix_operators=[], qualifier=tc, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=tc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="doWork")], member=exit, postfix_operators=[], prefix_operators=[], qualifier=Tr, selectors=[], type_arguments=None), label=None))], label=None, resources=None) end[}] END[}]
Keyword[private] Keyword[void] identifier[doWork] operator[SEP] operator[SEP] { Keyword[boolean] identifier[isTraceOn] operator[=] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[isTraceOn] operator[&&] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[Tr] operator[SEP] identifier[entry] operator[SEP] identifier[tc] , literal[String] operator[+] identifier[ivTimer] operator[SEP] operator[SEP] identifier[TimedObjectWrapper] identifier[timedObject] operator[SEP] Keyword[try] { identifier[ivBeanId] operator[=] identifier[ivBeanId] operator[SEP] identifier[getInitializedBeanId] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[ex] operator[SEP] { identifier[FFDCFilter] operator[SEP] identifier[processException] operator[SEP] identifier[ex] , identifier[CLASS_NAME] operator[+] literal[String] , literal[String] , Keyword[this] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[isTraceOn] operator[&&] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[Tr] operator[SEP] identifier[exit] operator[SEP] identifier[tc] , literal[String] operator[+] identifier[ex] operator[SEP] operator[SEP] Keyword[throw] identifier[ExceptionUtil] operator[SEP] identifier[EJBException] operator[SEP] identifier[ex] operator[SEP] operator[SEP] } identifier[EJSHome] identifier[home] operator[=] operator[SEP] identifier[EJSHome] operator[SEP] identifier[ivBeanId] operator[SEP] identifier[home] operator[SEP] identifier[timedObject] operator[=] identifier[home] operator[SEP] identifier[getTimedObjectWrapper] operator[SEP] identifier[ivBeanId] operator[SEP] operator[SEP] Keyword[try] { identifier[ivTimer] operator[SEP] identifier[ivTimeoutThread] operator[=] identifier[Thread] operator[SEP] identifier[currentThread] operator[SEP] operator[SEP] operator[SEP] identifier[timedObject] operator[SEP] identifier[invokeCallback] operator[SEP] identifier[ivTimer] , identifier[ivMethodId] , literal[boolean] operator[SEP] operator[SEP] } Keyword[finally] { identifier[ivTimer] operator[SEP] identifier[ivTimeoutThread] operator[=] Other[null] operator[SEP] identifier[home] operator[SEP] identifier[putTimedObjectWrapper] operator[SEP] identifier[timedObject] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[Tr] operator[SEP] identifier[exit] operator[SEP] identifier[tc] , literal[String] operator[SEP] operator[SEP] } }
public static SSLContext getInstance(String protocol) throws NoSuchAlgorithmException { GetInstance.Instance instance = GetInstance.getInstance ("SSLContext", SSLContextSpi.class, protocol); return new SSLContext((SSLContextSpi)instance.impl, instance.provider, protocol); }
class class_name[name] begin[{] method[getInstance, return_type[type[SSLContext]], modifier[public static], parameter[protocol]] begin[{] local_variable[type[GetInstance], instance] return[ClassCreator(arguments=[Cast(expression=MemberReference(member=impl, postfix_operators=[], prefix_operators=[], qualifier=instance, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=SSLContextSpi, sub_type=None)), MemberReference(member=provider, postfix_operators=[], prefix_operators=[], qualifier=instance, selectors=[]), MemberReference(member=protocol, 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=SSLContext, sub_type=None))] end[}] END[}]
Keyword[public] Keyword[static] identifier[SSLContext] identifier[getInstance] operator[SEP] identifier[String] identifier[protocol] operator[SEP] Keyword[throws] identifier[NoSuchAlgorithmException] { identifier[GetInstance] operator[SEP] identifier[Instance] identifier[instance] operator[=] identifier[GetInstance] operator[SEP] identifier[getInstance] operator[SEP] literal[String] , identifier[SSLContextSpi] operator[SEP] Keyword[class] , identifier[protocol] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[SSLContext] operator[SEP] operator[SEP] identifier[SSLContextSpi] operator[SEP] identifier[instance] operator[SEP] identifier[impl] , identifier[instance] operator[SEP] identifier[provider] , identifier[protocol] operator[SEP] operator[SEP] }
public EmbeddedTomcat addContextEnvironment(String name, String value, String type) { final ContextEnvironment env = new ContextEnvironment(); env.setType(type); env.setName(name); env.setValue(value); addContextEnvironment(env); return this; }
class class_name[name] begin[{] method[addContextEnvironment, return_type[type[EmbeddedTomcat]], modifier[public], parameter[name, value, type]] begin[{] local_variable[type[ContextEnvironment], env] call[env.setType, parameter[member[.type]]] call[env.setName, parameter[member[.name]]] call[env.setValue, parameter[member[.value]]] call[.addContextEnvironment, parameter[member[.env]]] return[THIS[]] end[}] END[}]
Keyword[public] identifier[EmbeddedTomcat] identifier[addContextEnvironment] operator[SEP] identifier[String] identifier[name] , identifier[String] identifier[value] , identifier[String] identifier[type] operator[SEP] { Keyword[final] identifier[ContextEnvironment] identifier[env] operator[=] Keyword[new] identifier[ContextEnvironment] operator[SEP] operator[SEP] operator[SEP] identifier[env] operator[SEP] identifier[setType] operator[SEP] identifier[type] operator[SEP] operator[SEP] identifier[env] operator[SEP] identifier[setName] operator[SEP] identifier[name] operator[SEP] operator[SEP] identifier[env] operator[SEP] identifier[setValue] operator[SEP] identifier[value] operator[SEP] operator[SEP] identifier[addContextEnvironment] operator[SEP] identifier[env] operator[SEP] operator[SEP] Keyword[return] Keyword[this] operator[SEP] }
public boolean removeValue(Object name,Object value) { Object lo = super.get(name); Object ln=lo; int s=LazyList.size(lo); if (s>0) { ln=LazyList.remove(lo,value); if (ln==null) super.remove(name); else super.put(name, ln); } return LazyList.size(ln)!=s; }
class class_name[name] begin[{] method[removeValue, return_type[type[boolean]], modifier[public], parameter[name, value]] begin[{] local_variable[type[Object], lo] local_variable[type[Object], ln] local_variable[type[int], s] if[binary_operation[member[.s], >, literal[0]]] begin[{] assign[member[.ln], call[LazyList.remove, parameter[member[.lo], member[.value]]]] if[binary_operation[member[.ln], ==, literal[null]]] begin[{] SuperMethodInvocation(arguments=[MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=remove, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None) else begin[{] SuperMethodInvocation(arguments=[MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=ln, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=put, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None) end[}] else begin[{] None end[}] return[binary_operation[call[LazyList.size, parameter[member[.ln]]], !=, member[.s]]] end[}] END[}]
Keyword[public] Keyword[boolean] identifier[removeValue] operator[SEP] identifier[Object] identifier[name] , identifier[Object] identifier[value] operator[SEP] { identifier[Object] identifier[lo] operator[=] Keyword[super] operator[SEP] identifier[get] operator[SEP] identifier[name] operator[SEP] operator[SEP] identifier[Object] identifier[ln] operator[=] identifier[lo] operator[SEP] Keyword[int] identifier[s] operator[=] identifier[LazyList] operator[SEP] identifier[size] operator[SEP] identifier[lo] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[s] operator[>] Other[0] operator[SEP] { identifier[ln] operator[=] identifier[LazyList] operator[SEP] identifier[remove] operator[SEP] identifier[lo] , identifier[value] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[ln] operator[==] Other[null] operator[SEP] Keyword[super] operator[SEP] identifier[remove] operator[SEP] identifier[name] operator[SEP] operator[SEP] Keyword[else] Keyword[super] operator[SEP] identifier[put] operator[SEP] identifier[name] , identifier[ln] operator[SEP] operator[SEP] } Keyword[return] identifier[LazyList] operator[SEP] identifier[size] operator[SEP] identifier[ln] operator[SEP] operator[!=] identifier[s] operator[SEP] }
public static Node reduceNS(Node node, Namespaces parentNamespaces) throws MalformedElementException { Namespaces namespaces = parentNamespaces; if (node.getNodeType() == Node.ELEMENT_NODE) { Element element = (Element) node; namespaces = getNamespaces(element, parentNamespaces, false); String nsPrefix = getNSPrefix(element); String nsLocalName = getNSLocalName(element); if (nsPrefix != null) { String nsName = namespaces.getNSName(nsPrefix); ensureNotNull(Policy.bind("ensure.missingNamespaceForPrefix", nsPrefix), nsName); //$NON-NLS-1$ String tagName = null; if (nsName.equals(namespaces.getDefaultNSName())) { tagName = nsLocalName; } else { tagName = namespaces.getNSPrefix(nsName) + ":" + nsLocalName; //$NON-NLS-1$ } if (!tagName.equals(element.getTagName())) { Document document = element.getOwnerDocument(); Element newElement = document.createElement(tagName); NamedNodeMap nodeMap = element.getAttributes(); for (int i = 0; i < nodeMap.getLength(); ++i) { Attr attr = (Attr) nodeMap.item(i); newElement.setAttribute(attr.getName(), attr.getValue()); } Node child = element.getFirstChild(); while (child != null) { element.removeChild(child); newElement.appendChild(child); child = element.getFirstChild(); } element.getParentNode().replaceChild(newElement, element); element = newElement; } } Vector oldAttributes = new Vector(); Vector newAttributes = new Vector(); NamedNodeMap nodeMap = element.getAttributes(); for (int i = 0; i < nodeMap.getLength(); ++i) { Attr attr = (Attr) nodeMap.item(i); String name = attr.getName(); String value = attr.getValue(); String newName = name; nsPrefix = getNSPrefix(name); nsLocalName = getNSLocalName(name); if (nsPrefix != null && !nsPrefix.equals(XML_PREFIX)) { String nsName = namespaces.getNSName(nsPrefix); ensureNotNull(Policy.bind("ensure.missingNamespaceForPrefix", nsPrefix), nsName); //$NON-NLS-1$ String newNSPrefix = namespaces.getNSPrefix(nsName); if (!newNSPrefix.equals(nsPrefix)) { newName = newNSPrefix + ":" + nsLocalName; //$NON-NLS-1$ } } boolean newAttribute = true; if (parentNamespaces != null) { if (nsPrefix == null && XML_PREFIX.equals(nsLocalName)) { if (value.equals(parentNamespaces.getDefaultNSName())) { newAttribute = false; } } if (nsPrefix != null && XML_PREFIX.equals(nsPrefix)) { if (parentNamespaces.getNSPrefix(value) != null) { newAttribute = false; } } } oldAttributes.addElement(attr); if (newAttribute) { newAttributes.addElement(new String[] {newName, value}); } } Enumeration oldAttrs = oldAttributes.elements(); while (oldAttrs.hasMoreElements()) { element.removeAttributeNode((Attr) oldAttrs.nextElement()); } Enumeration newAttrs = newAttributes.elements(); while (newAttrs.hasMoreElements()) { String[] newAttr = (String[]) newAttrs.nextElement(); element.setAttribute(newAttr[0], newAttr[1]); } node = element; } Node child = node.getFirstChild(); while (child != null) { child = reduceNS(child, namespaces); child = child.getNextSibling(); } return node; }
class class_name[name] begin[{] method[reduceNS, return_type[type[Node]], modifier[public static], parameter[node, parentNamespaces]] begin[{] local_variable[type[Namespaces], namespaces] if[binary_operation[call[node.getNodeType, parameter[]], ==, member[Node.ELEMENT_NODE]]] begin[{] local_variable[type[Element], element] assign[member[.namespaces], call[.getNamespaces, parameter[member[.element], member[.parentNamespaces], literal[false]]]] local_variable[type[String], nsPrefix] local_variable[type[String], nsLocalName] if[binary_operation[member[.nsPrefix], !=, literal[null]]] begin[{] local_variable[type[String], nsName] call[.ensureNotNull, parameter[call[Policy.bind, parameter[literal["ensure.missingNamespaceForPrefix"], member[.nsPrefix]]], member[.nsName]]] local_variable[type[String], tagName] if[call[nsName.equals, parameter[call[namespaces.getDefaultNSName, parameter[]]]]] begin[{] assign[member[.tagName], member[.nsLocalName]] else begin[{] assign[member[.tagName], binary_operation[binary_operation[call[namespaces.getNSPrefix, parameter[member[.nsName]]], +, literal[":"]], +, member[.nsLocalName]]] end[}] if[call[tagName.equals, parameter[call[element.getTagName, parameter[]]]]] begin[{] local_variable[type[Document], document] local_variable[type[Element], newElement] local_variable[type[NamedNodeMap], nodeMap] 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=item, postfix_operators=[], prefix_operators=[], qualifier=nodeMap, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=Attr, sub_type=None)), name=attr)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Attr, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=attr, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=attr, selectors=[], type_arguments=None)], member=setAttribute, postfix_operators=[], prefix_operators=[], qualifier=newElement, 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=nodeMap, selectors=[], type_arguments=None), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=[], prefix_operators=['++'], qualifier=, selectors=[])]), label=None) local_variable[type[Node], child] while[binary_operation[member[.child], !=, literal[null]]] begin[{] call[element.removeChild, parameter[member[.child]]] call[newElement.appendChild, parameter[member[.child]]] assign[member[.child], call[element.getFirstChild, parameter[]]] end[}] call[element.getParentNode, parameter[]] assign[member[.element], member[.newElement]] else begin[{] None end[}] else begin[{] None end[}] local_variable[type[Vector], oldAttributes] local_variable[type[Vector], newAttributes] local_variable[type[NamedNodeMap], nodeMap] 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=item, postfix_operators=[], prefix_operators=[], qualifier=nodeMap, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=Attr, sub_type=None)), name=attr)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Attr, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=attr, 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=attr, selectors=[], type_arguments=None), name=value)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), name=newName)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=nsPrefix, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getNSPrefix, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=nsLocalName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getNSLocalName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=nsPrefix, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operandr=MethodInvocation(arguments=[MemberReference(member=XML_PREFIX, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equals, postfix_operators=[], prefix_operators=['!'], qualifier=nsPrefix, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=nsPrefix, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getNSName, postfix_operators=[], prefix_operators=[], qualifier=namespaces, selectors=[], type_arguments=None), name=nsName)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="ensure.missingNamespaceForPrefix"), MemberReference(member=nsPrefix, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=bind, postfix_operators=[], prefix_operators=[], qualifier=Policy, selectors=[], type_arguments=None), MemberReference(member=nsName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=ensureNotNull, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=nsName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getNSPrefix, postfix_operators=[], prefix_operators=[], qualifier=namespaces, selectors=[], type_arguments=None), name=newNSPrefix)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=nsPrefix, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equals, postfix_operators=[], prefix_operators=['!'], qualifier=newNSPrefix, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=newName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=newNSPrefix, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=":"), operator=+), operandr=MemberReference(member=nsLocalName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)), label=None)]))])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true), name=newAttribute)], modifiers=set(), type=BasicType(dimensions=[], name=boolean)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=parentNamespaces, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=nsPrefix, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), operandr=MethodInvocation(arguments=[MemberReference(member=nsLocalName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equals, postfix_operators=[], prefix_operators=[], qualifier=XML_PREFIX, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getDefaultNSName, postfix_operators=[], prefix_operators=[], qualifier=parentNamespaces, selectors=[], type_arguments=None)], member=equals, postfix_operators=[], prefix_operators=[], qualifier=value, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=newAttribute, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)), label=None)]))])), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=nsPrefix, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operandr=MethodInvocation(arguments=[MemberReference(member=nsPrefix, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equals, postfix_operators=[], prefix_operators=[], qualifier=XML_PREFIX, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getNSPrefix, postfix_operators=[], prefix_operators=[], qualifier=parentNamespaces, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=newAttribute, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)), label=None)]))]))])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=attr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addElement, postfix_operators=[], prefix_operators=[], qualifier=oldAttributes, selectors=[], type_arguments=None), label=None), IfStatement(condition=MemberReference(member=newAttribute, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MemberReference(member=newName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=String, sub_type=None))], member=addElement, postfix_operators=[], prefix_operators=[], qualifier=newAttributes, 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=nodeMap, selectors=[], type_arguments=None), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=[], prefix_operators=['++'], qualifier=, selectors=[])]), label=None) local_variable[type[Enumeration], oldAttrs] while[call[oldAttrs.hasMoreElements, parameter[]]] begin[{] call[element.removeAttributeNode, parameter[Cast(expression=MethodInvocation(arguments=[], member=nextElement, postfix_operators=[], prefix_operators=[], qualifier=oldAttrs, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=Attr, sub_type=None))]] end[}] local_variable[type[Enumeration], newAttrs] while[call[newAttrs.hasMoreElements, parameter[]]] begin[{] local_variable[type[String], newAttr] call[element.setAttribute, parameter[member[.newAttr], member[.newAttr]]] end[}] assign[member[.node], member[.element]] else begin[{] None end[}] local_variable[type[Node], child] while[binary_operation[member[.child], !=, literal[null]]] begin[{] assign[member[.child], call[.reduceNS, parameter[member[.child], member[.namespaces]]]] assign[member[.child], call[child.getNextSibling, parameter[]]] end[}] return[member[.node]] end[}] END[}]
Keyword[public] Keyword[static] identifier[Node] identifier[reduceNS] operator[SEP] identifier[Node] identifier[node] , identifier[Namespaces] identifier[parentNamespaces] operator[SEP] Keyword[throws] identifier[MalformedElementException] { identifier[Namespaces] identifier[namespaces] operator[=] identifier[parentNamespaces] operator[SEP] Keyword[if] operator[SEP] identifier[node] operator[SEP] identifier[getNodeType] operator[SEP] operator[SEP] operator[==] identifier[Node] operator[SEP] identifier[ELEMENT_NODE] operator[SEP] { identifier[Element] identifier[element] operator[=] operator[SEP] identifier[Element] operator[SEP] identifier[node] operator[SEP] identifier[namespaces] operator[=] identifier[getNamespaces] operator[SEP] identifier[element] , identifier[parentNamespaces] , literal[boolean] operator[SEP] operator[SEP] identifier[String] identifier[nsPrefix] operator[=] identifier[getNSPrefix] operator[SEP] identifier[element] operator[SEP] operator[SEP] identifier[String] identifier[nsLocalName] operator[=] identifier[getNSLocalName] operator[SEP] identifier[element] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[nsPrefix] operator[!=] Other[null] operator[SEP] { identifier[String] identifier[nsName] operator[=] identifier[namespaces] operator[SEP] identifier[getNSName] operator[SEP] identifier[nsPrefix] operator[SEP] operator[SEP] identifier[ensureNotNull] operator[SEP] identifier[Policy] operator[SEP] identifier[bind] operator[SEP] literal[String] , identifier[nsPrefix] operator[SEP] , identifier[nsName] operator[SEP] operator[SEP] identifier[String] identifier[tagName] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[nsName] operator[SEP] identifier[equals] operator[SEP] identifier[namespaces] operator[SEP] identifier[getDefaultNSName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { identifier[tagName] operator[=] identifier[nsLocalName] operator[SEP] } Keyword[else] { identifier[tagName] operator[=] identifier[namespaces] operator[SEP] identifier[getNSPrefix] operator[SEP] identifier[nsName] operator[SEP] operator[+] literal[String] operator[+] identifier[nsLocalName] operator[SEP] } Keyword[if] operator[SEP] operator[!] identifier[tagName] operator[SEP] identifier[equals] operator[SEP] identifier[element] operator[SEP] identifier[getTagName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { identifier[Document] identifier[document] operator[=] identifier[element] operator[SEP] identifier[getOwnerDocument] operator[SEP] operator[SEP] operator[SEP] identifier[Element] identifier[newElement] operator[=] identifier[document] operator[SEP] identifier[createElement] operator[SEP] identifier[tagName] operator[SEP] operator[SEP] identifier[NamedNodeMap] identifier[nodeMap] operator[=] identifier[element] operator[SEP] identifier[getAttributes] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[nodeMap] operator[SEP] identifier[getLength] operator[SEP] operator[SEP] operator[SEP] operator[++] identifier[i] operator[SEP] { identifier[Attr] identifier[attr] operator[=] operator[SEP] identifier[Attr] operator[SEP] identifier[nodeMap] operator[SEP] identifier[item] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[newElement] operator[SEP] identifier[setAttribute] operator[SEP] identifier[attr] operator[SEP] identifier[getName] operator[SEP] operator[SEP] , identifier[attr] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[Node] identifier[child] operator[=] identifier[element] operator[SEP] identifier[getFirstChild] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[child] operator[!=] Other[null] operator[SEP] { identifier[element] operator[SEP] identifier[removeChild] operator[SEP] identifier[child] operator[SEP] operator[SEP] identifier[newElement] operator[SEP] identifier[appendChild] operator[SEP] identifier[child] operator[SEP] operator[SEP] identifier[child] operator[=] identifier[element] operator[SEP] identifier[getFirstChild] operator[SEP] operator[SEP] operator[SEP] } identifier[element] operator[SEP] identifier[getParentNode] operator[SEP] operator[SEP] operator[SEP] identifier[replaceChild] operator[SEP] identifier[newElement] , identifier[element] operator[SEP] operator[SEP] identifier[element] operator[=] identifier[newElement] operator[SEP] } } identifier[Vector] identifier[oldAttributes] operator[=] Keyword[new] identifier[Vector] operator[SEP] operator[SEP] operator[SEP] identifier[Vector] identifier[newAttributes] operator[=] Keyword[new] identifier[Vector] operator[SEP] operator[SEP] operator[SEP] identifier[NamedNodeMap] identifier[nodeMap] operator[=] identifier[element] operator[SEP] identifier[getAttributes] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[nodeMap] operator[SEP] identifier[getLength] operator[SEP] operator[SEP] operator[SEP] operator[++] identifier[i] operator[SEP] { identifier[Attr] identifier[attr] operator[=] operator[SEP] identifier[Attr] operator[SEP] identifier[nodeMap] operator[SEP] identifier[item] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[String] identifier[name] operator[=] identifier[attr] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[value] operator[=] identifier[attr] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[newName] operator[=] identifier[name] operator[SEP] identifier[nsPrefix] operator[=] identifier[getNSPrefix] operator[SEP] identifier[name] operator[SEP] operator[SEP] identifier[nsLocalName] operator[=] identifier[getNSLocalName] operator[SEP] identifier[name] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[nsPrefix] operator[!=] Other[null] operator[&&] operator[!] identifier[nsPrefix] operator[SEP] identifier[equals] operator[SEP] identifier[XML_PREFIX] operator[SEP] operator[SEP] { identifier[String] identifier[nsName] operator[=] identifier[namespaces] operator[SEP] identifier[getNSName] operator[SEP] identifier[nsPrefix] operator[SEP] operator[SEP] identifier[ensureNotNull] operator[SEP] identifier[Policy] operator[SEP] identifier[bind] operator[SEP] literal[String] , identifier[nsPrefix] operator[SEP] , identifier[nsName] operator[SEP] operator[SEP] identifier[String] identifier[newNSPrefix] operator[=] identifier[namespaces] operator[SEP] identifier[getNSPrefix] operator[SEP] identifier[nsName] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[newNSPrefix] operator[SEP] identifier[equals] operator[SEP] identifier[nsPrefix] operator[SEP] operator[SEP] { identifier[newName] operator[=] identifier[newNSPrefix] operator[+] literal[String] operator[+] identifier[nsLocalName] operator[SEP] } } Keyword[boolean] identifier[newAttribute] operator[=] literal[boolean] operator[SEP] Keyword[if] operator[SEP] identifier[parentNamespaces] operator[!=] Other[null] operator[SEP] { Keyword[if] operator[SEP] identifier[nsPrefix] operator[==] Other[null] operator[&&] identifier[XML_PREFIX] operator[SEP] identifier[equals] operator[SEP] identifier[nsLocalName] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[value] operator[SEP] identifier[equals] operator[SEP] identifier[parentNamespaces] operator[SEP] identifier[getDefaultNSName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { identifier[newAttribute] operator[=] literal[boolean] operator[SEP] } } Keyword[if] operator[SEP] identifier[nsPrefix] operator[!=] Other[null] operator[&&] identifier[XML_PREFIX] operator[SEP] identifier[equals] operator[SEP] identifier[nsPrefix] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[parentNamespaces] operator[SEP] identifier[getNSPrefix] operator[SEP] identifier[value] operator[SEP] operator[!=] Other[null] operator[SEP] { identifier[newAttribute] operator[=] literal[boolean] operator[SEP] } } } identifier[oldAttributes] operator[SEP] identifier[addElement] operator[SEP] identifier[attr] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[newAttribute] operator[SEP] { identifier[newAttributes] operator[SEP] identifier[addElement] operator[SEP] Keyword[new] identifier[String] operator[SEP] operator[SEP] { identifier[newName] , identifier[value] } operator[SEP] operator[SEP] } } identifier[Enumeration] identifier[oldAttrs] operator[=] identifier[oldAttributes] operator[SEP] identifier[elements] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[oldAttrs] operator[SEP] identifier[hasMoreElements] operator[SEP] operator[SEP] operator[SEP] { identifier[element] operator[SEP] identifier[removeAttributeNode] operator[SEP] operator[SEP] identifier[Attr] operator[SEP] identifier[oldAttrs] operator[SEP] identifier[nextElement] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[Enumeration] identifier[newAttrs] operator[=] identifier[newAttributes] operator[SEP] identifier[elements] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[newAttrs] operator[SEP] identifier[hasMoreElements] operator[SEP] operator[SEP] operator[SEP] { identifier[String] operator[SEP] operator[SEP] identifier[newAttr] operator[=] operator[SEP] identifier[String] operator[SEP] operator[SEP] operator[SEP] identifier[newAttrs] operator[SEP] identifier[nextElement] operator[SEP] operator[SEP] operator[SEP] identifier[element] operator[SEP] identifier[setAttribute] operator[SEP] identifier[newAttr] operator[SEP] Other[0] operator[SEP] , identifier[newAttr] operator[SEP] Other[1] operator[SEP] operator[SEP] operator[SEP] } identifier[node] operator[=] identifier[element] operator[SEP] } identifier[Node] identifier[child] operator[=] identifier[node] operator[SEP] identifier[getFirstChild] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[child] operator[!=] Other[null] operator[SEP] { identifier[child] operator[=] identifier[reduceNS] operator[SEP] identifier[child] , identifier[namespaces] operator[SEP] operator[SEP] identifier[child] operator[=] identifier[child] operator[SEP] identifier[getNextSibling] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[node] operator[SEP] }
public static String removeHtmlTag(String content, boolean withTagContent, String... tagNames) { String regex = null; for (String tagName : tagNames) { if (StrUtil.isBlank(tagName)) { continue; } tagName = tagName.trim(); // (?i)表示其后面的表达式忽略大小写 if (withTagContent) { // 标签及其包含内容 regex = StrUtil.format("(?i)<{}\\s*?[^>]*?/?>(.*?</{}>)?", tagName, tagName); } else { // 标签不包含内容 regex = StrUtil.format("(?i)<{}\\s*?[^>]*?>|</{}>", tagName, tagName); } content = ReUtil.delAll(regex, content); // 非自闭标签小写 } return content; }
class class_name[name] begin[{] method[removeHtmlTag, return_type[type[String]], modifier[public static], parameter[content, withTagContent, tagNames]] begin[{] local_variable[type[String], regex] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=tagName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isBlank, postfix_operators=[], prefix_operators=[], qualifier=StrUtil, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ContinueStatement(goto=None, label=None)])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=tagName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=trim, postfix_operators=[], prefix_operators=[], qualifier=tagName, selectors=[], type_arguments=None)), label=None), IfStatement(condition=MemberReference(member=withTagContent, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=regex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="(?i)<{}\\s*?[^>]*?>|</{}>"), MemberReference(member=tagName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=tagName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=format, postfix_operators=[], prefix_operators=[], qualifier=StrUtil, selectors=[], type_arguments=None)), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=regex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="(?i)<{}\\s*?[^>]*?/?>(.*?</{}>)?"), MemberReference(member=tagName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=tagName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=format, postfix_operators=[], prefix_operators=[], qualifier=StrUtil, selectors=[], type_arguments=None)), label=None)])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=content, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=regex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=content, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=delAll, postfix_operators=[], prefix_operators=[], qualifier=ReUtil, selectors=[], type_arguments=None)), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=tagNames, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=tagName)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None) return[member[.content]] end[}] END[}]
Keyword[public] Keyword[static] identifier[String] identifier[removeHtmlTag] operator[SEP] identifier[String] identifier[content] , Keyword[boolean] identifier[withTagContent] , identifier[String] operator[...] identifier[tagNames] operator[SEP] { identifier[String] identifier[regex] operator[=] Other[null] operator[SEP] Keyword[for] operator[SEP] identifier[String] identifier[tagName] operator[:] identifier[tagNames] operator[SEP] { Keyword[if] operator[SEP] identifier[StrUtil] operator[SEP] identifier[isBlank] operator[SEP] identifier[tagName] operator[SEP] operator[SEP] { Keyword[continue] operator[SEP] } identifier[tagName] operator[=] identifier[tagName] operator[SEP] identifier[trim] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[withTagContent] operator[SEP] { identifier[regex] operator[=] identifier[StrUtil] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[tagName] , identifier[tagName] operator[SEP] operator[SEP] } Keyword[else] { identifier[regex] operator[=] identifier[StrUtil] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[tagName] , identifier[tagName] operator[SEP] operator[SEP] } identifier[content] operator[=] identifier[ReUtil] operator[SEP] identifier[delAll] operator[SEP] identifier[regex] , identifier[content] operator[SEP] operator[SEP] } Keyword[return] identifier[content] operator[SEP] }
public Observable<ServiceResponse<Void>> deleteHybridConnectionWithServiceResponseAsync(String resourceGroupName, String name, String namespaceName, String relayName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } if (name == null) { throw new IllegalArgumentException("Parameter name is required and cannot be null."); } if (namespaceName == null) { throw new IllegalArgumentException("Parameter namespaceName is required and cannot be null."); } if (relayName == null) { throw new IllegalArgumentException("Parameter relayName is required and cannot be null."); } if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } if (this.client.apiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); } return service.deleteHybridConnection(resourceGroupName, name, namespaceName, relayName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Void>>>() { @Override public Observable<ServiceResponse<Void>> call(Response<ResponseBody> response) { try { ServiceResponse<Void> clientResponse = deleteHybridConnectionDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); } } }); }
class class_name[name] begin[{] method[deleteHybridConnectionWithServiceResponseAsync, return_type[type[Observable]], modifier[public], parameter[resourceGroupName, name, namespaceName, relayName]] begin[{] if[binary_operation[member[.resourceGroupName], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Parameter resourceGroupName is required and cannot be null.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None) else begin[{] None end[}] if[binary_operation[member[.name], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Parameter name is required and cannot be null.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None) else begin[{] None end[}] if[binary_operation[member[.namespaceName], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Parameter namespaceName is required and cannot be null.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None) else begin[{] None end[}] if[binary_operation[member[.relayName], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Parameter relayName is required and cannot be null.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None) else begin[{] None end[}] if[binary_operation[THIS[member[None.client]call[None.subscriptionId, parameter[]]], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Parameter this.client.subscriptionId() is required and cannot be null.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None) else begin[{] None end[}] if[binary_operation[THIS[member[None.client]call[None.apiVersion, parameter[]]], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Parameter this.client.apiVersion() is required and cannot be null.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None) else begin[{] None end[}] return[call[service.deleteHybridConnection, parameter[member[.resourceGroupName], member[.name], member[.namespaceName], member[.relayName], THIS[member[None.client]call[None.subscriptionId, parameter[]]], THIS[member[None.client]call[None.apiVersion, parameter[]]], THIS[member[None.client]call[None.acceptLanguage, parameter[]]], THIS[member[None.client]call[None.userAgent, parameter[]]]]]] end[}] END[}]
Keyword[public] identifier[Observable] operator[<] identifier[ServiceResponse] operator[<] identifier[Void] operator[>] operator[>] identifier[deleteHybridConnectionWithServiceResponseAsync] operator[SEP] identifier[String] identifier[resourceGroupName] , identifier[String] identifier[name] , identifier[String] identifier[namespaceName] , identifier[String] identifier[relayName] operator[SEP] { Keyword[if] operator[SEP] identifier[resourceGroupName] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[name] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[namespaceName] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[relayName] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[client] operator[SEP] identifier[subscriptionId] operator[SEP] operator[SEP] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[client] operator[SEP] identifier[apiVersion] operator[SEP] operator[SEP] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[return] identifier[service] operator[SEP] identifier[deleteHybridConnection] operator[SEP] identifier[resourceGroupName] , identifier[name] , identifier[namespaceName] , identifier[relayName] , Keyword[this] operator[SEP] identifier[client] operator[SEP] identifier[subscriptionId] operator[SEP] operator[SEP] , Keyword[this] operator[SEP] identifier[client] operator[SEP] identifier[apiVersion] operator[SEP] operator[SEP] , Keyword[this] operator[SEP] identifier[client] operator[SEP] identifier[acceptLanguage] operator[SEP] operator[SEP] , Keyword[this] operator[SEP] identifier[client] operator[SEP] identifier[userAgent] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[flatMap] operator[SEP] Keyword[new] identifier[Func1] operator[<] identifier[Response] operator[<] identifier[ResponseBody] operator[>] , identifier[Observable] operator[<] identifier[ServiceResponse] operator[<] identifier[Void] operator[>] operator[>] operator[>] operator[SEP] operator[SEP] { annotation[@] identifier[Override] Keyword[public] identifier[Observable] operator[<] identifier[ServiceResponse] operator[<] identifier[Void] operator[>] operator[>] identifier[call] operator[SEP] identifier[Response] operator[<] identifier[ResponseBody] operator[>] identifier[response] operator[SEP] { Keyword[try] { identifier[ServiceResponse] operator[<] identifier[Void] operator[>] identifier[clientResponse] operator[=] identifier[deleteHybridConnectionDelegate] operator[SEP] identifier[response] operator[SEP] operator[SEP] Keyword[return] identifier[Observable] operator[SEP] identifier[just] operator[SEP] identifier[clientResponse] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Throwable] identifier[t] operator[SEP] { Keyword[return] identifier[Observable] operator[SEP] identifier[error] operator[SEP] identifier[t] operator[SEP] operator[SEP] } } } operator[SEP] operator[SEP] }