code
stringlengths
63
466k
code_sememe
stringlengths
141
3.79M
token_type
stringlengths
274
1.23M
@Override public int read(byte[] b, int off, int len) throws IOException { // Obey InputStream contract. checkPositionIndexes(off, off + len, b.length); if (len == 0) { return 0; } // The rest of this method implements the process described by the CharsetEncoder javadoc. int totalBytesRead = 0; boolean doneEncoding = endOfInput; DRAINING: while (true) { // We stay in draining mode until there are no bytes left in the output buffer. Then we go // back to encoding/flushing. if (draining) { totalBytesRead += drain(b, off + totalBytesRead, len - totalBytesRead); if (totalBytesRead == len || doneFlushing) { return (totalBytesRead > 0) ? totalBytesRead : -1; } draining = false; byteBuffer.clear(); } while (true) { // We call encode until there is no more input. The last call to encode will have endOfInput // == true. Then there is a final call to flush. CoderResult result; if (doneFlushing) { result = CoderResult.UNDERFLOW; } else if (doneEncoding) { result = encoder.flush(byteBuffer); } else { result = encoder.encode(charBuffer, byteBuffer, endOfInput); } if (result.isOverflow()) { // Not enough room in output buffer--drain it, creating a bigger buffer if necessary. startDraining(true); continue DRAINING; } else if (result.isUnderflow()) { // If encoder underflows, it means either: // a) the final flush() succeeded; next drain (then done) // b) we encoded all of the input; next flush // c) we ran of out input to encode; next read more input if (doneEncoding) { // (a) doneFlushing = true; startDraining(false); continue DRAINING; } else if (endOfInput) { // (b) doneEncoding = true; } else { // (c) readMoreChars(); } } else if (result.isError()) { // Only reach here if a CharsetEncoder with non-REPLACE settings is used. result.throwException(); return 0; // Not called. } } } }
class class_name[name] begin[{] method[read, return_type[type[int]], modifier[public], parameter[b, off, len]] begin[{] call[.checkPositionIndexes, parameter[member[.off], binary_operation[member[.off], +, member[.len]], member[b.length]]] if[binary_operation[member[.len], ==, literal[0]]] begin[{] return[literal[0]] else begin[{] None end[}] local_variable[type[int], totalBytesRead] local_variable[type[boolean], doneEncoding] while[literal[true]] begin[{] if[member[.draining]] begin[{] assign[member[.totalBytesRead], call[.drain, parameter[member[.b], binary_operation[member[.off], +, member[.totalBytesRead]], binary_operation[member[.len], -, member[.totalBytesRead]]]]] if[binary_operation[binary_operation[member[.totalBytesRead], ==, member[.len]], ||, member[.doneFlushing]]] begin[{] return[TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=totalBytesRead, 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=1), if_true=MemberReference(member=totalBytesRead, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))] else begin[{] None end[}] assign[member[.draining], literal[false]] call[byteBuffer.clear, parameter[]] else begin[{] None end[}] while[literal[true]] begin[{] local_variable[type[CoderResult], result] if[member[.doneFlushing]] begin[{] assign[member[.result], member[CoderResult.UNDERFLOW]] else begin[{] if[member[.doneEncoding]] begin[{] assign[member[.result], call[encoder.flush, parameter[member[.byteBuffer]]]] else begin[{] assign[member[.result], call[encoder.encode, parameter[member[.charBuffer], member[.byteBuffer], member[.endOfInput]]]] end[}] end[}] if[call[result.isOverflow, parameter[]]] begin[{] call[.startDraining, parameter[literal[true]]] ContinueStatement(goto=DRAINING, label=None) else begin[{] if[call[result.isUnderflow, parameter[]]] begin[{] if[member[.doneEncoding]] begin[{] assign[member[.doneFlushing], literal[true]] call[.startDraining, parameter[literal[false]]] ContinueStatement(goto=DRAINING, label=None) else begin[{] if[member[.endOfInput]] begin[{] assign[member[.doneEncoding], literal[true]] else begin[{] call[.readMoreChars, parameter[]] end[}] end[}] else begin[{] if[call[result.isError, parameter[]]] begin[{] call[result.throwException, parameter[]] return[literal[0]] else begin[{] None end[}] end[}] end[}] end[}] end[}] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[int] identifier[read] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[b] , Keyword[int] identifier[off] , Keyword[int] identifier[len] operator[SEP] Keyword[throws] identifier[IOException] { identifier[checkPositionIndexes] operator[SEP] identifier[off] , identifier[off] operator[+] identifier[len] , identifier[b] operator[SEP] identifier[length] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[len] operator[==] Other[0] operator[SEP] { Keyword[return] Other[0] operator[SEP] } Keyword[int] identifier[totalBytesRead] operator[=] Other[0] operator[SEP] Keyword[boolean] identifier[doneEncoding] operator[=] identifier[endOfInput] operator[SEP] identifier[DRAINING] operator[:] Keyword[while] operator[SEP] literal[boolean] operator[SEP] { Keyword[if] operator[SEP] identifier[draining] operator[SEP] { identifier[totalBytesRead] operator[+=] identifier[drain] operator[SEP] identifier[b] , identifier[off] operator[+] identifier[totalBytesRead] , identifier[len] operator[-] identifier[totalBytesRead] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[totalBytesRead] operator[==] identifier[len] operator[||] identifier[doneFlushing] operator[SEP] { Keyword[return] operator[SEP] identifier[totalBytesRead] operator[>] Other[0] operator[SEP] operator[?] identifier[totalBytesRead] operator[:] operator[-] Other[1] operator[SEP] } identifier[draining] operator[=] literal[boolean] operator[SEP] identifier[byteBuffer] operator[SEP] identifier[clear] operator[SEP] operator[SEP] operator[SEP] } Keyword[while] operator[SEP] literal[boolean] operator[SEP] { identifier[CoderResult] identifier[result] operator[SEP] Keyword[if] operator[SEP] identifier[doneFlushing] operator[SEP] { identifier[result] operator[=] identifier[CoderResult] operator[SEP] identifier[UNDERFLOW] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[doneEncoding] operator[SEP] { identifier[result] operator[=] identifier[encoder] operator[SEP] identifier[flush] operator[SEP] identifier[byteBuffer] operator[SEP] operator[SEP] } Keyword[else] { identifier[result] operator[=] identifier[encoder] operator[SEP] identifier[encode] operator[SEP] identifier[charBuffer] , identifier[byteBuffer] , identifier[endOfInput] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[result] operator[SEP] identifier[isOverflow] operator[SEP] operator[SEP] operator[SEP] { identifier[startDraining] operator[SEP] literal[boolean] operator[SEP] operator[SEP] Keyword[continue] identifier[DRAINING] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[result] operator[SEP] identifier[isUnderflow] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[doneEncoding] operator[SEP] { identifier[doneFlushing] operator[=] literal[boolean] operator[SEP] identifier[startDraining] operator[SEP] literal[boolean] operator[SEP] operator[SEP] Keyword[continue] identifier[DRAINING] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[endOfInput] operator[SEP] { identifier[doneEncoding] operator[=] literal[boolean] operator[SEP] } Keyword[else] { identifier[readMoreChars] operator[SEP] operator[SEP] operator[SEP] } } Keyword[else] Keyword[if] operator[SEP] identifier[result] operator[SEP] identifier[isError] operator[SEP] operator[SEP] operator[SEP] { identifier[result] operator[SEP] identifier[throwException] operator[SEP] operator[SEP] operator[SEP] Keyword[return] Other[0] operator[SEP] } } } }
public void marshall(Filter filter, ProtocolMarshaller protocolMarshaller) { if (filter == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(filter.getKey(), KEY_BINDING); protocolMarshaller.marshall(filter.getValues(), VALUES_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[filter, protocolMarshaller]] begin[{] if[binary_operation[member[.filter], ==, 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=getKey, postfix_operators=[], prefix_operators=[], qualifier=filter, selectors=[], type_arguments=None), MemberReference(member=KEY_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=getValues, postfix_operators=[], prefix_operators=[], qualifier=filter, selectors=[], type_arguments=None), MemberReference(member=VALUES_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[Filter] identifier[filter] , identifier[ProtocolMarshaller] identifier[protocolMarshaller] operator[SEP] { Keyword[if] operator[SEP] identifier[filter] 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[filter] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] , identifier[KEY_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[filter] operator[SEP] identifier[getValues] operator[SEP] operator[SEP] , identifier[VALUES_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 Stream<Note> getIssueNotesStream(Object projectIdOrPath, Integer issueIid) throws GitLabApiException { return (getIssueNotes(projectIdOrPath, issueIid, getDefaultPerPage()).stream()); }
class class_name[name] begin[{] method[getIssueNotesStream, return_type[type[Stream]], modifier[public], parameter[projectIdOrPath, issueIid]] begin[{] return[call[.getIssueNotes, parameter[member[.projectIdOrPath], member[.issueIid], call[.getDefaultPerPage, parameter[]]]]] end[}] END[}]
Keyword[public] identifier[Stream] operator[<] identifier[Note] operator[>] identifier[getIssueNotesStream] operator[SEP] identifier[Object] identifier[projectIdOrPath] , identifier[Integer] identifier[issueIid] operator[SEP] Keyword[throws] identifier[GitLabApiException] { Keyword[return] operator[SEP] identifier[getIssueNotes] operator[SEP] identifier[projectIdOrPath] , identifier[issueIid] , identifier[getDefaultPerPage] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[stream] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
public void registerInterposedSynchronization(Synchronization synchronization) throws IllegalStateException, SystemException { int status = ContextTransactionSynchronizationRegistry.getInstance().getTransactionStatus(); switch (status) { case javax.transaction.Status.STATUS_ACTIVE: case javax.transaction.Status.STATUS_PREPARING: break; case Status.STATUS_MARKED_ROLLBACK: // do nothing; we can pretend like it was registered, but it'll never be run anyway. return; default: throw TransactionLogger.ROOT_LOGGER.syncsnotallowed(status); } if (synchronization.getClass().getName().startsWith("org.jboss.jca")) { if (TransactionLogger.ROOT_LOGGER.isTraceEnabled()) { TransactionLogger.ROOT_LOGGER.trace("JCAOrderedLastSynchronizationList.jcaSyncs.add - Class: " + synchronization.getClass() + " HashCode: " + synchronization.hashCode() + " toString: " + synchronization); } jcaSyncs.add(synchronization); } else { if (TransactionLogger.ROOT_LOGGER.isTraceEnabled()) { TransactionLogger.ROOT_LOGGER.trace("JCAOrderedLastSynchronizationList.preJcaSyncs.add - Class: " + synchronization.getClass() + " HashCode: " + synchronization.hashCode() + " toString: " + synchronization); } preJcaSyncs.add(synchronization); } }
class class_name[name] begin[{] method[registerInterposedSynchronization, return_type[void], modifier[public], parameter[synchronization]] begin[{] local_variable[type[int], status] SwitchStatement(cases=[SwitchStatementCase(case=[MemberReference(member=STATUS_ACTIVE, postfix_operators=[], prefix_operators=[], qualifier=javax.transaction.Status, selectors=[]), MemberReference(member=STATUS_PREPARING, postfix_operators=[], prefix_operators=[], qualifier=javax.transaction.Status, selectors=[])], statements=[BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[MemberReference(member=STATUS_MARKED_ROLLBACK, postfix_operators=[], prefix_operators=[], qualifier=Status, selectors=[])], statements=[ReturnStatement(expression=None, label=None)]), SwitchStatementCase(case=[], statements=[ThrowStatement(expression=MethodInvocation(arguments=[MemberReference(member=status, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=syncsnotallowed, postfix_operators=[], prefix_operators=[], qualifier=TransactionLogger.ROOT_LOGGER, selectors=[], type_arguments=None), label=None)])], expression=MemberReference(member=status, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None) if[call[synchronization.getClass, parameter[]]] begin[{] if[call[TransactionLogger.ROOT_LOGGER.isTraceEnabled, parameter[]]] begin[{] call[TransactionLogger.ROOT_LOGGER.trace, parameter[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[literal["JCAOrderedLastSynchronizationList.jcaSyncs.add - Class: "], +, call[synchronization.getClass, parameter[]]], +, literal[" HashCode: "]], +, call[synchronization.hashCode, parameter[]]], +, literal[" toString: "]], +, member[.synchronization]]]] else begin[{] None end[}] call[jcaSyncs.add, parameter[member[.synchronization]]] else begin[{] if[call[TransactionLogger.ROOT_LOGGER.isTraceEnabled, parameter[]]] begin[{] call[TransactionLogger.ROOT_LOGGER.trace, parameter[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[literal["JCAOrderedLastSynchronizationList.preJcaSyncs.add - Class: "], +, call[synchronization.getClass, parameter[]]], +, literal[" HashCode: "]], +, call[synchronization.hashCode, parameter[]]], +, literal[" toString: "]], +, member[.synchronization]]]] else begin[{] None end[}] call[preJcaSyncs.add, parameter[member[.synchronization]]] end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[registerInterposedSynchronization] operator[SEP] identifier[Synchronization] identifier[synchronization] operator[SEP] Keyword[throws] identifier[IllegalStateException] , identifier[SystemException] { Keyword[int] identifier[status] operator[=] identifier[ContextTransactionSynchronizationRegistry] operator[SEP] identifier[getInstance] operator[SEP] operator[SEP] operator[SEP] identifier[getTransactionStatus] operator[SEP] operator[SEP] operator[SEP] Keyword[switch] operator[SEP] identifier[status] operator[SEP] { Keyword[case] identifier[javax] operator[SEP] identifier[transaction] operator[SEP] identifier[Status] operator[SEP] identifier[STATUS_ACTIVE] operator[:] Keyword[case] identifier[javax] operator[SEP] identifier[transaction] operator[SEP] identifier[Status] operator[SEP] identifier[STATUS_PREPARING] operator[:] Keyword[break] operator[SEP] Keyword[case] identifier[Status] operator[SEP] identifier[STATUS_MARKED_ROLLBACK] operator[:] Keyword[return] operator[SEP] Keyword[default] operator[:] Keyword[throw] identifier[TransactionLogger] operator[SEP] identifier[ROOT_LOGGER] operator[SEP] identifier[syncsnotallowed] operator[SEP] identifier[status] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[synchronization] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] identifier[startsWith] operator[SEP] literal[String] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[TransactionLogger] operator[SEP] identifier[ROOT_LOGGER] operator[SEP] identifier[isTraceEnabled] operator[SEP] operator[SEP] operator[SEP] { identifier[TransactionLogger] operator[SEP] identifier[ROOT_LOGGER] operator[SEP] identifier[trace] operator[SEP] literal[String] operator[+] identifier[synchronization] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[synchronization] operator[SEP] identifier[hashCode] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[synchronization] operator[SEP] operator[SEP] } identifier[jcaSyncs] operator[SEP] identifier[add] operator[SEP] identifier[synchronization] operator[SEP] operator[SEP] } Keyword[else] { Keyword[if] operator[SEP] identifier[TransactionLogger] operator[SEP] identifier[ROOT_LOGGER] operator[SEP] identifier[isTraceEnabled] operator[SEP] operator[SEP] operator[SEP] { identifier[TransactionLogger] operator[SEP] identifier[ROOT_LOGGER] operator[SEP] identifier[trace] operator[SEP] literal[String] operator[+] identifier[synchronization] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[synchronization] operator[SEP] identifier[hashCode] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[synchronization] operator[SEP] operator[SEP] } identifier[preJcaSyncs] operator[SEP] identifier[add] operator[SEP] identifier[synchronization] operator[SEP] operator[SEP] } }
public void stop() { Plugin plugin = getPlugin(); if (plugin != null) { try { LOGGER.log(Level.FINE, "Stopping {0}", shortName); plugin.stop(); } catch (Throwable t) { LOGGER.log(WARNING, "Failed to shut down " + shortName, t); } } else { LOGGER.log(Level.FINE, "Could not find Plugin instance to stop for {0}", shortName); } // Work around a bug in commons-logging. // See http://www.szegedi.org/articles/memleak.html LogFactory.release(classLoader); }
class class_name[name] begin[{] method[stop, return_type[void], modifier[public], parameter[]] begin[{] local_variable[type[Plugin], plugin] if[binary_operation[member[.plugin], !=, literal[null]]] begin[{] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=FINE, postfix_operators=[], prefix_operators=[], qualifier=Level, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Stopping {0}"), MemberReference(member=shortName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=log, postfix_operators=[], prefix_operators=[], qualifier=LOGGER, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=stop, postfix_operators=[], prefix_operators=[], qualifier=plugin, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=WARNING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Failed to shut down "), operandr=MemberReference(member=shortName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), MemberReference(member=t, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=log, postfix_operators=[], prefix_operators=[], qualifier=LOGGER, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=t, types=['Throwable']))], finally_block=None, label=None, resources=None) else begin[{] call[LOGGER.log, parameter[member[Level.FINE], literal["Could not find Plugin instance to stop for {0}"], member[.shortName]]] end[}] call[LogFactory.release, parameter[member[.classLoader]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[stop] operator[SEP] operator[SEP] { identifier[Plugin] identifier[plugin] operator[=] identifier[getPlugin] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[plugin] operator[!=] Other[null] operator[SEP] { Keyword[try] { identifier[LOGGER] operator[SEP] identifier[log] operator[SEP] identifier[Level] operator[SEP] identifier[FINE] , literal[String] , identifier[shortName] operator[SEP] operator[SEP] identifier[plugin] operator[SEP] identifier[stop] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Throwable] identifier[t] operator[SEP] { identifier[LOGGER] operator[SEP] identifier[log] operator[SEP] identifier[WARNING] , literal[String] operator[+] identifier[shortName] , identifier[t] operator[SEP] operator[SEP] } } Keyword[else] { identifier[LOGGER] operator[SEP] identifier[log] operator[SEP] identifier[Level] operator[SEP] identifier[FINE] , literal[String] , identifier[shortName] operator[SEP] operator[SEP] } identifier[LogFactory] operator[SEP] identifier[release] operator[SEP] identifier[classLoader] operator[SEP] operator[SEP] }
public static String getTempDir() { // default is user home directory String tempDir = System.getProperty("user.home"); try{ //create a temp file File temp = File.createTempFile("A0393939", ".tmp"); //Get tempropary file path String absolutePath = temp.getAbsolutePath(); tempDir = absolutePath.substring(0,absolutePath.lastIndexOf(File.separator)); }catch(IOException e){} return tempDir; }
class class_name[name] begin[{] method[getTempDir, return_type[type[String]], modifier[public static], parameter[]] begin[{] local_variable[type[String], tempDir] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="A0393939"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=".tmp")], member=createTempFile, postfix_operators=[], prefix_operators=[], qualifier=File, selectors=[], type_arguments=None), name=temp)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=File, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getAbsolutePath, postfix_operators=[], prefix_operators=[], qualifier=temp, selectors=[], type_arguments=None), name=absolutePath)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=tempDir, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), MethodInvocation(arguments=[MemberReference(member=separator, postfix_operators=[], prefix_operators=[], qualifier=File, selectors=[])], member=lastIndexOf, postfix_operators=[], prefix_operators=[], qualifier=absolutePath, selectors=[], type_arguments=None)], member=substring, postfix_operators=[], prefix_operators=[], qualifier=absolutePath, selectors=[], type_arguments=None)), label=None)], catches=[CatchClause(block=[], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IOException']))], finally_block=None, label=None, resources=None) return[member[.tempDir]] end[}] END[}]
Keyword[public] Keyword[static] identifier[String] identifier[getTempDir] operator[SEP] operator[SEP] { identifier[String] identifier[tempDir] operator[=] identifier[System] operator[SEP] identifier[getProperty] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[try] { identifier[File] identifier[temp] operator[=] identifier[File] operator[SEP] identifier[createTempFile] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[String] identifier[absolutePath] operator[=] identifier[temp] operator[SEP] identifier[getAbsolutePath] operator[SEP] operator[SEP] operator[SEP] identifier[tempDir] operator[=] identifier[absolutePath] operator[SEP] identifier[substring] operator[SEP] Other[0] , identifier[absolutePath] operator[SEP] identifier[lastIndexOf] operator[SEP] identifier[File] operator[SEP] identifier[separator] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[IOException] identifier[e] operator[SEP] { } Keyword[return] identifier[tempDir] operator[SEP] }
public boolean saturateByIncreasingBondOrder(IBond bond, IAtomContainer atomContainer) throws CDKException { IAtom[] atoms = BondManipulator.getAtomArray(bond); IAtom atom = atoms[0]; IAtom partner = atoms[1]; logger.debug(" saturating bond: ", atom.getSymbol(), "-", partner.getSymbol()); IAtomType[] atomTypes1 = getAtomTypeFactory(bond.getBuilder()).getAtomTypes(atom.getSymbol()); IAtomType[] atomTypes2 = getAtomTypeFactory(bond.getBuilder()).getAtomTypes(partner.getSymbol()); for (int atCounter1 = 0; atCounter1 < atomTypes1.length; atCounter1++) { IAtomType aType1 = atomTypes1[atCounter1]; logger.debug(" condidering atom type: ", aType1); if (couldMatchAtomType(atomContainer, atom, aType1)) { logger.debug(" trying atom type: ", aType1); for (int atCounter2 = 0; atCounter2 < atomTypes2.length; atCounter2++) { IAtomType aType2 = atomTypes2[atCounter2]; logger.debug(" condidering partner type: ", aType1); if (couldMatchAtomType(atomContainer, partner, atomTypes2[atCounter2])) { logger.debug(" with atom type: ", aType2); if (BondManipulator.isLowerOrder(bond.getOrder(), aType2.getMaxBondOrder()) && BondManipulator.isLowerOrder(bond.getOrder(), aType1.getMaxBondOrder())) { bond.setOrder(BondManipulator.increaseBondOrder(bond.getOrder())); logger.debug("Bond order now ", bond.getOrder()); return true; } } } } } return false; }
class class_name[name] begin[{] method[saturateByIncreasingBondOrder, return_type[type[boolean]], modifier[public], parameter[bond, atomContainer]] begin[{] local_variable[type[IAtom], atoms] local_variable[type[IAtom], atom] local_variable[type[IAtom], partner] call[logger.debug, parameter[literal[" saturating bond: "], call[atom.getSymbol, parameter[]], literal["-"], call[partner.getSymbol, parameter[]]]] local_variable[type[IAtomType], atomTypes1] local_variable[type[IAtomType], atomTypes2] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=atomTypes1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=atCounter1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), name=aType1)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=IAtomType, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" condidering atom type: "), MemberReference(member=aType1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=debug, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), label=None), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=atomContainer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=atom, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=aType1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=couldMatchAtomType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" trying atom type: "), MemberReference(member=aType1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=debug, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), label=None), ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=atomTypes2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=atCounter2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), name=aType2)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=IAtomType, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" condidering partner type: "), MemberReference(member=aType1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=debug, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), label=None), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=atomContainer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=partner, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=atomTypes2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=atCounter2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])], member=couldMatchAtomType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" with atom type: "), MemberReference(member=aType2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=debug, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), label=None), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getOrder, postfix_operators=[], prefix_operators=[], qualifier=bond, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getMaxBondOrder, postfix_operators=[], prefix_operators=[], qualifier=aType2, selectors=[], type_arguments=None)], member=isLowerOrder, postfix_operators=[], prefix_operators=[], qualifier=BondManipulator, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getOrder, postfix_operators=[], prefix_operators=[], qualifier=bond, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getMaxBondOrder, postfix_operators=[], prefix_operators=[], qualifier=aType1, selectors=[], type_arguments=None)], member=isLowerOrder, postfix_operators=[], prefix_operators=[], qualifier=BondManipulator, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getOrder, postfix_operators=[], prefix_operators=[], qualifier=bond, selectors=[], type_arguments=None)], member=increaseBondOrder, postfix_operators=[], prefix_operators=[], qualifier=BondManipulator, selectors=[], type_arguments=None)], member=setOrder, postfix_operators=[], prefix_operators=[], qualifier=bond, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Bond order now "), MethodInvocation(arguments=[], member=getOrder, postfix_operators=[], prefix_operators=[], qualifier=bond, selectors=[], type_arguments=None)], member=debug, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true), label=None)]))]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=atCounter2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=atomTypes2, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=atCounter2)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=atCounter2, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=atCounter1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=atomTypes1, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=atCounter1)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=atCounter1, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) return[literal[false]] end[}] END[}]
Keyword[public] Keyword[boolean] identifier[saturateByIncreasingBondOrder] operator[SEP] identifier[IBond] identifier[bond] , identifier[IAtomContainer] identifier[atomContainer] operator[SEP] Keyword[throws] identifier[CDKException] { identifier[IAtom] operator[SEP] operator[SEP] identifier[atoms] operator[=] identifier[BondManipulator] operator[SEP] identifier[getAtomArray] operator[SEP] identifier[bond] operator[SEP] operator[SEP] identifier[IAtom] identifier[atom] operator[=] identifier[atoms] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[IAtom] identifier[partner] operator[=] identifier[atoms] operator[SEP] Other[1] operator[SEP] operator[SEP] identifier[logger] operator[SEP] identifier[debug] operator[SEP] literal[String] , identifier[atom] operator[SEP] identifier[getSymbol] operator[SEP] operator[SEP] , literal[String] , identifier[partner] operator[SEP] identifier[getSymbol] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[IAtomType] operator[SEP] operator[SEP] identifier[atomTypes1] operator[=] identifier[getAtomTypeFactory] operator[SEP] identifier[bond] operator[SEP] identifier[getBuilder] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[getAtomTypes] operator[SEP] identifier[atom] operator[SEP] identifier[getSymbol] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[IAtomType] operator[SEP] operator[SEP] identifier[atomTypes2] operator[=] identifier[getAtomTypeFactory] operator[SEP] identifier[bond] operator[SEP] identifier[getBuilder] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[getAtomTypes] operator[SEP] identifier[partner] operator[SEP] identifier[getSymbol] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[atCounter1] operator[=] Other[0] operator[SEP] identifier[atCounter1] operator[<] identifier[atomTypes1] operator[SEP] identifier[length] operator[SEP] identifier[atCounter1] operator[++] operator[SEP] { identifier[IAtomType] identifier[aType1] operator[=] identifier[atomTypes1] operator[SEP] identifier[atCounter1] operator[SEP] operator[SEP] identifier[logger] operator[SEP] identifier[debug] operator[SEP] literal[String] , identifier[aType1] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[couldMatchAtomType] operator[SEP] identifier[atomContainer] , identifier[atom] , identifier[aType1] operator[SEP] operator[SEP] { identifier[logger] operator[SEP] identifier[debug] operator[SEP] literal[String] , identifier[aType1] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[atCounter2] operator[=] Other[0] operator[SEP] identifier[atCounter2] operator[<] identifier[atomTypes2] operator[SEP] identifier[length] operator[SEP] identifier[atCounter2] operator[++] operator[SEP] { identifier[IAtomType] identifier[aType2] operator[=] identifier[atomTypes2] operator[SEP] identifier[atCounter2] operator[SEP] operator[SEP] identifier[logger] operator[SEP] identifier[debug] operator[SEP] literal[String] , identifier[aType1] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[couldMatchAtomType] operator[SEP] identifier[atomContainer] , identifier[partner] , identifier[atomTypes2] operator[SEP] identifier[atCounter2] operator[SEP] operator[SEP] operator[SEP] { identifier[logger] operator[SEP] identifier[debug] operator[SEP] literal[String] , identifier[aType2] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[BondManipulator] operator[SEP] identifier[isLowerOrder] operator[SEP] identifier[bond] operator[SEP] identifier[getOrder] operator[SEP] operator[SEP] , identifier[aType2] operator[SEP] identifier[getMaxBondOrder] operator[SEP] operator[SEP] operator[SEP] operator[&&] identifier[BondManipulator] operator[SEP] identifier[isLowerOrder] operator[SEP] identifier[bond] operator[SEP] identifier[getOrder] operator[SEP] operator[SEP] , identifier[aType1] operator[SEP] identifier[getMaxBondOrder] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { identifier[bond] operator[SEP] identifier[setOrder] operator[SEP] identifier[BondManipulator] operator[SEP] identifier[increaseBondOrder] operator[SEP] identifier[bond] operator[SEP] identifier[getOrder] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[logger] operator[SEP] identifier[debug] operator[SEP] literal[String] , identifier[bond] operator[SEP] identifier[getOrder] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP] } } } } } Keyword[return] literal[boolean] operator[SEP] }
public GeneralRecognitionResponse generalRecognition(String image, String granularity, String mask, String langType, Boolean direction) { GeneralRecognitionRequest request = new GeneralRecognitionRequest().withImage(image) .withGranularity(granularity).withMask(mask).withLangType(langType).withDirection(direction); return generalRecognition(request); }
class class_name[name] begin[{] method[generalRecognition, return_type[type[GeneralRecognitionResponse]], modifier[public], parameter[image, granularity, mask, langType, direction]] begin[{] local_variable[type[GeneralRecognitionRequest], request] return[call[.generalRecognition, parameter[member[.request]]]] end[}] END[}]
Keyword[public] identifier[GeneralRecognitionResponse] identifier[generalRecognition] operator[SEP] identifier[String] identifier[image] , identifier[String] identifier[granularity] , identifier[String] identifier[mask] , identifier[String] identifier[langType] , identifier[Boolean] identifier[direction] operator[SEP] { identifier[GeneralRecognitionRequest] identifier[request] operator[=] Keyword[new] identifier[GeneralRecognitionRequest] operator[SEP] operator[SEP] operator[SEP] identifier[withImage] operator[SEP] identifier[image] operator[SEP] operator[SEP] identifier[withGranularity] operator[SEP] identifier[granularity] operator[SEP] operator[SEP] identifier[withMask] operator[SEP] identifier[mask] operator[SEP] operator[SEP] identifier[withLangType] operator[SEP] identifier[langType] operator[SEP] operator[SEP] identifier[withDirection] operator[SEP] identifier[direction] operator[SEP] operator[SEP] Keyword[return] identifier[generalRecognition] operator[SEP] identifier[request] operator[SEP] operator[SEP] }
public void setScopes(Set<ApiAppOauthScopeType> scopes) { if (oauth == null) { oauth = new ApiAppOauth(); } oauth.setScopes(scopes); }
class class_name[name] begin[{] method[setScopes, return_type[void], modifier[public], parameter[scopes]] begin[{] if[binary_operation[member[.oauth], ==, literal[null]]] begin[{] assign[member[.oauth], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ApiAppOauth, sub_type=None))] else begin[{] None end[}] call[oauth.setScopes, parameter[member[.scopes]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[setScopes] operator[SEP] identifier[Set] operator[<] identifier[ApiAppOauthScopeType] operator[>] identifier[scopes] operator[SEP] { Keyword[if] operator[SEP] identifier[oauth] operator[==] Other[null] operator[SEP] { identifier[oauth] operator[=] Keyword[new] identifier[ApiAppOauth] operator[SEP] operator[SEP] operator[SEP] } identifier[oauth] operator[SEP] identifier[setScopes] operator[SEP] identifier[scopes] operator[SEP] operator[SEP] }
public static String[] processMutliLineSQL(String multiLineSQL, boolean stripComments, boolean splitStatements, String endDelimiter) { StringClauses parsed = SqlParser.parse(multiLineSQL, true, !stripComments); List<String> returnArray = new ArrayList<>(); StringBuilder currentString = new StringBuilder(); String previousPiece = null; boolean previousDelimiter = false; List<Object> parsedArray = Arrays.asList(parsed.toArray(true)); for (Object piece : mergeTokens(parsedArray, endDelimiter)) { if (splitStatements && (piece instanceof String) && isDelimiter((String) piece, previousPiece, endDelimiter)) { String trimmedString = StringUtil.trimToNull(currentString.toString()); if (trimmedString != null) { returnArray.add(trimmedString); } currentString = new StringBuilder(); previousDelimiter = true; } else { if (!previousDelimiter || (StringUtil.trimToNull((String) piece) != null)) { //don't include whitespace after a delimiter if ((currentString.length() > 0) || (StringUtil.trimToNull((String) piece) != null)) { //don't include whitespace before the statement currentString.append(piece); } } previousDelimiter = false; } previousPiece = (String) piece; } String trimmedString = StringUtil.trimToNull(currentString.toString()); if (trimmedString != null) { returnArray.add(trimmedString); } return returnArray.toArray(new String[returnArray.size()]); }
class class_name[name] begin[{] method[processMutliLineSQL, return_type[type[String]], modifier[public static], parameter[multiLineSQL, stripComments, splitStatements, endDelimiter]] begin[{] local_variable[type[StringClauses], parsed] local_variable[type[List], returnArray] local_variable[type[StringBuilder], currentString] local_variable[type[String], previousPiece] local_variable[type[boolean], previousDelimiter] local_variable[type[List], parsedArray] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=splitStatements, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=BinaryOperation(operandl=MemberReference(member=piece, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None), operator=instanceof), operator=&&), operandr=MethodInvocation(arguments=[Cast(expression=MemberReference(member=piece, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), MemberReference(member=previousPiece, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=endDelimiter, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isDelimiter, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), operator=&&), else_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=previousDelimiter, postfix_operators=[], prefix_operators=['!'], qualifier=, selectors=[]), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[Cast(expression=MemberReference(member=piece, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], member=trimToNull, postfix_operators=[], prefix_operators=[], qualifier=StringUtil, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operator=||), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=currentString, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[Cast(expression=MemberReference(member=piece, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], member=trimToNull, postfix_operators=[], prefix_operators=[], qualifier=StringUtil, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operator=||), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=piece, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=append, postfix_operators=[], prefix_operators=[], qualifier=currentString, selectors=[], type_arguments=None), label=None)]))])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=previousDelimiter, 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=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=currentString, selectors=[], type_arguments=None)], member=trimToNull, postfix_operators=[], prefix_operators=[], qualifier=StringUtil, selectors=[], type_arguments=None), name=trimmedString)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=trimmedString, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=trimmedString, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=returnArray, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=currentString, 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=StringBuilder, sub_type=None))), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=previousDelimiter, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)), label=None)])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=previousPiece, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Cast(expression=MemberReference(member=piece, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[MemberReference(member=parsedArray, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=endDelimiter, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=mergeTokens, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=piece)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))), label=None) local_variable[type[String], trimmedString] if[binary_operation[member[.trimmedString], !=, literal[null]]] begin[{] call[returnArray.add, parameter[member[.trimmedString]]] else begin[{] None end[}] return[call[returnArray.toArray, parameter[ArrayCreator(dimensions=[MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=returnArray, selectors=[], type_arguments=None)], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=String, sub_type=None))]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[String] operator[SEP] operator[SEP] identifier[processMutliLineSQL] operator[SEP] identifier[String] identifier[multiLineSQL] , Keyword[boolean] identifier[stripComments] , Keyword[boolean] identifier[splitStatements] , identifier[String] identifier[endDelimiter] operator[SEP] { identifier[StringClauses] identifier[parsed] operator[=] identifier[SqlParser] operator[SEP] identifier[parse] operator[SEP] identifier[multiLineSQL] , literal[boolean] , operator[!] identifier[stripComments] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[String] operator[>] identifier[returnArray] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[StringBuilder] identifier[currentString] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[previousPiece] operator[=] Other[null] operator[SEP] Keyword[boolean] identifier[previousDelimiter] operator[=] literal[boolean] operator[SEP] identifier[List] operator[<] identifier[Object] operator[>] identifier[parsedArray] operator[=] identifier[Arrays] operator[SEP] identifier[asList] operator[SEP] identifier[parsed] operator[SEP] identifier[toArray] operator[SEP] literal[boolean] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Object] identifier[piece] operator[:] identifier[mergeTokens] operator[SEP] identifier[parsedArray] , identifier[endDelimiter] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[splitStatements] operator[&&] operator[SEP] identifier[piece] Keyword[instanceof] identifier[String] operator[SEP] operator[&&] identifier[isDelimiter] operator[SEP] operator[SEP] identifier[String] operator[SEP] identifier[piece] , identifier[previousPiece] , identifier[endDelimiter] operator[SEP] operator[SEP] { identifier[String] identifier[trimmedString] operator[=] identifier[StringUtil] operator[SEP] identifier[trimToNull] operator[SEP] identifier[currentString] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[trimmedString] operator[!=] Other[null] operator[SEP] { identifier[returnArray] operator[SEP] identifier[add] operator[SEP] identifier[trimmedString] operator[SEP] operator[SEP] } identifier[currentString] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[previousDelimiter] operator[=] literal[boolean] operator[SEP] } Keyword[else] { Keyword[if] operator[SEP] operator[!] identifier[previousDelimiter] operator[||] operator[SEP] identifier[StringUtil] operator[SEP] identifier[trimToNull] operator[SEP] operator[SEP] identifier[String] operator[SEP] identifier[piece] operator[SEP] operator[!=] Other[null] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] operator[SEP] identifier[currentString] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] operator[||] operator[SEP] identifier[StringUtil] operator[SEP] identifier[trimToNull] operator[SEP] operator[SEP] identifier[String] operator[SEP] identifier[piece] operator[SEP] operator[!=] Other[null] operator[SEP] operator[SEP] { identifier[currentString] operator[SEP] identifier[append] operator[SEP] identifier[piece] operator[SEP] operator[SEP] } } identifier[previousDelimiter] operator[=] literal[boolean] operator[SEP] } identifier[previousPiece] operator[=] operator[SEP] identifier[String] operator[SEP] identifier[piece] operator[SEP] } identifier[String] identifier[trimmedString] operator[=] identifier[StringUtil] operator[SEP] identifier[trimToNull] operator[SEP] identifier[currentString] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[trimmedString] operator[!=] Other[null] operator[SEP] { identifier[returnArray] operator[SEP] identifier[add] operator[SEP] identifier[trimmedString] operator[SEP] operator[SEP] } Keyword[return] identifier[returnArray] operator[SEP] identifier[toArray] operator[SEP] Keyword[new] identifier[String] operator[SEP] identifier[returnArray] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
@SuppressWarnings("unchecked") public CassandraJavaPairRDD<K, V> withAscOrder() { CassandraRDD<Tuple2<K, V>> newRDD = rdd().withAscOrder(); return wrap(newRDD); }
class class_name[name] begin[{] method[withAscOrder, return_type[type[CassandraJavaPairRDD]], modifier[public], parameter[]] begin[{] local_variable[type[CassandraRDD], newRDD] return[call[.wrap, parameter[member[.newRDD]]]] end[}] END[}]
annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] Keyword[public] identifier[CassandraJavaPairRDD] operator[<] identifier[K] , identifier[V] operator[>] identifier[withAscOrder] operator[SEP] operator[SEP] { identifier[CassandraRDD] operator[<] identifier[Tuple2] operator[<] identifier[K] , identifier[V] operator[>] operator[>] identifier[newRDD] operator[=] identifier[rdd] operator[SEP] operator[SEP] operator[SEP] identifier[withAscOrder] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[wrap] operator[SEP] identifier[newRDD] operator[SEP] operator[SEP] }
public final Disposable connect() { final Disposable[] out = { null }; connect(r -> out[0] = r); return out[0]; }
class class_name[name] begin[{] method[connect, return_type[type[Disposable]], modifier[final public], parameter[]] begin[{] local_variable[type[Disposable], out] call[.connect, parameter[LambdaExpression(body=Assignment(expressionl=MemberReference(member=out, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))]), type==, value=MemberReference(member=r, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), parameters=[MemberReference(member=r, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])])]] return[member[.out]] end[}] END[}]
Keyword[public] Keyword[final] identifier[Disposable] identifier[connect] operator[SEP] operator[SEP] { Keyword[final] identifier[Disposable] operator[SEP] operator[SEP] identifier[out] operator[=] { Other[null] } operator[SEP] identifier[connect] operator[SEP] identifier[r] operator[->] identifier[out] operator[SEP] Other[0] operator[SEP] operator[=] identifier[r] operator[SEP] operator[SEP] Keyword[return] identifier[out] operator[SEP] Other[0] operator[SEP] operator[SEP] }
protected Object calculateItem(Object obj){ if(obj == null){ return null; } if(obj instanceof Number){ return obj; } if(obj instanceof Boolean){ return obj; } if(obj instanceof String){ return obj; } if(obj instanceof Elobj){ return ((Elobj) obj).fetchVal(); } if(obj instanceof Operator){ return ((Operator) obj).calculate(); } throw new ElException("未知计算类型!" + obj); }
class class_name[name] begin[{] method[calculateItem, return_type[type[Object]], modifier[protected], parameter[obj]] begin[{] if[binary_operation[member[.obj], ==, literal[null]]] begin[{] return[literal[null]] else begin[{] None end[}] if[binary_operation[member[.obj], instanceof, type[Number]]] begin[{] return[member[.obj]] else begin[{] None end[}] if[binary_operation[member[.obj], instanceof, type[Boolean]]] begin[{] return[member[.obj]] else begin[{] None end[}] if[binary_operation[member[.obj], instanceof, type[String]]] begin[{] return[member[.obj]] else begin[{] None end[}] if[binary_operation[member[.obj], instanceof, type[Elobj]]] begin[{] return[Cast(expression=MemberReference(member=obj, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Elobj, sub_type=None))] else begin[{] None end[}] if[binary_operation[member[.obj], instanceof, type[Operator]]] begin[{] return[Cast(expression=MemberReference(member=obj, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Operator, sub_type=None))] else begin[{] None end[}] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="未知计算类型!"), operandr=MemberReference(member=obj, 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=ElException, sub_type=None)), label=None) end[}] END[}]
Keyword[protected] identifier[Object] identifier[calculateItem] operator[SEP] identifier[Object] identifier[obj] operator[SEP] { Keyword[if] operator[SEP] identifier[obj] operator[==] Other[null] operator[SEP] { Keyword[return] Other[null] operator[SEP] } Keyword[if] operator[SEP] identifier[obj] Keyword[instanceof] identifier[Number] operator[SEP] { Keyword[return] identifier[obj] operator[SEP] } Keyword[if] operator[SEP] identifier[obj] Keyword[instanceof] identifier[Boolean] operator[SEP] { Keyword[return] identifier[obj] operator[SEP] } Keyword[if] operator[SEP] identifier[obj] Keyword[instanceof] identifier[String] operator[SEP] { Keyword[return] identifier[obj] operator[SEP] } Keyword[if] operator[SEP] identifier[obj] Keyword[instanceof] identifier[Elobj] operator[SEP] { Keyword[return] operator[SEP] operator[SEP] identifier[Elobj] operator[SEP] identifier[obj] operator[SEP] operator[SEP] identifier[fetchVal] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[obj] Keyword[instanceof] identifier[Operator] operator[SEP] { Keyword[return] operator[SEP] operator[SEP] identifier[Operator] operator[SEP] identifier[obj] operator[SEP] operator[SEP] identifier[calculate] operator[SEP] operator[SEP] operator[SEP] } Keyword[throw] Keyword[new] identifier[ElException] operator[SEP] literal[String] operator[+] identifier[obj] operator[SEP] operator[SEP] }
protected String defaultActionHtmlContent() { StringBuffer result = new StringBuffer(2048); result.append("<form name='"); result.append(getList().getId()); result.append("-form' action='"); result.append(getDialogRealUri()); result.append("' method='post' class='nomargin'"); if (getList().getMetadata().isSearchable()) { result.append(" onsubmit=\"listSearchAction('"); result.append(getList().getId()); result.append("', '"); result.append(getList().getMetadata().getSearchAction().getId()); result.append("', '"); result.append(getList().getMetadata().getSearchAction().getConfirmationMessage().key(getLocale())); result.append("');\""); } result.append(">\n"); result.append(allParamsAsHidden()); result.append("\n"); getList().setWp(this); result.append(getList().listHtml()); result.append("\n</form>\n"); return result.toString(); }
class class_name[name] begin[{] method[defaultActionHtmlContent, return_type[type[String]], modifier[protected], parameter[]] begin[{] local_variable[type[StringBuffer], result] call[result.append, parameter[literal["<form name='"]]] call[result.append, parameter[call[.getList, parameter[]]]] call[result.append, parameter[literal["-form' action='"]]] call[result.append, parameter[call[.getDialogRealUri, parameter[]]]] call[result.append, parameter[literal["' method='post' class='nomargin'"]]] if[call[.getList, parameter[]]] begin[{] call[result.append, parameter[literal[" onsubmit=\"listSearchAction('"]]] call[result.append, parameter[call[.getList, parameter[]]]] call[result.append, parameter[literal["', '"]]] call[result.append, parameter[call[.getList, parameter[]]]] call[result.append, parameter[literal["', '"]]] call[result.append, parameter[call[.getList, parameter[]]]] call[result.append, parameter[literal["');\""]]] else begin[{] None end[}] call[result.append, parameter[literal[">\n"]]] call[result.append, parameter[call[.allParamsAsHidden, parameter[]]]] call[result.append, parameter[literal["\n"]]] call[.getList, parameter[]] call[result.append, parameter[call[.getList, parameter[]]]] call[result.append, parameter[literal["\n</form>\n"]]] return[call[result.toString, parameter[]]] end[}] END[}]
Keyword[protected] identifier[String] identifier[defaultActionHtmlContent] operator[SEP] operator[SEP] { identifier[StringBuffer] identifier[result] operator[=] Keyword[new] identifier[StringBuffer] operator[SEP] Other[2048] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[append] operator[SEP] identifier[getList] operator[SEP] operator[SEP] operator[SEP] identifier[getId] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[append] operator[SEP] identifier[getDialogRealUri] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[getList] operator[SEP] operator[SEP] operator[SEP] identifier[getMetadata] operator[SEP] operator[SEP] operator[SEP] identifier[isSearchable] operator[SEP] operator[SEP] operator[SEP] { identifier[result] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[append] operator[SEP] identifier[getList] operator[SEP] operator[SEP] operator[SEP] identifier[getId] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[append] operator[SEP] identifier[getList] operator[SEP] operator[SEP] operator[SEP] identifier[getMetadata] operator[SEP] operator[SEP] operator[SEP] identifier[getSearchAction] operator[SEP] operator[SEP] operator[SEP] identifier[getId] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[append] operator[SEP] identifier[getList] operator[SEP] operator[SEP] operator[SEP] identifier[getMetadata] operator[SEP] operator[SEP] operator[SEP] identifier[getSearchAction] operator[SEP] operator[SEP] operator[SEP] identifier[getConfirmationMessage] operator[SEP] operator[SEP] operator[SEP] identifier[key] operator[SEP] identifier[getLocale] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] } identifier[result] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[append] operator[SEP] identifier[allParamsAsHidden] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[getList] operator[SEP] operator[SEP] operator[SEP] identifier[setWp] operator[SEP] Keyword[this] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[append] operator[SEP] identifier[getList] operator[SEP] operator[SEP] operator[SEP] identifier[listHtml] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[result] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] }
public void injectMocks(final Object testClassInstance) { Class<?> clazz = testClassInstance.getClass(); Set<Field> mockDependentFields = new HashSet<Field>(); Set<Object> mocks = newMockSafeHashSet(); while (clazz != Object.class) { new InjectMocksScanner(clazz).addTo(mockDependentFields); new MockScanner(testClassInstance, clazz).addPreparedMocks(mocks); onInjection(testClassInstance, clazz, mockDependentFields, mocks); clazz = clazz.getSuperclass(); } new DefaultInjectionEngine().injectMocksOnFields(mockDependentFields, mocks, testClassInstance); }
class class_name[name] begin[{] method[injectMocks, return_type[void], modifier[public], parameter[testClassInstance]] begin[{] local_variable[type[Class], clazz] local_variable[type[Set], mockDependentFields] local_variable[type[Set], mocks] while[binary_operation[member[.clazz], !=, ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Object, sub_type=None))]] begin[{] ClassCreator(arguments=[MemberReference(member=clazz, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=mockDependentFields, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addTo, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=InjectMocksScanner, sub_type=None)) ClassCreator(arguments=[MemberReference(member=testClassInstance, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=clazz, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=mocks, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addPreparedMocks, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=MockScanner, sub_type=None)) call[.onInjection, parameter[member[.testClassInstance], member[.clazz], member[.mockDependentFields], member[.mocks]]] assign[member[.clazz], call[clazz.getSuperclass, parameter[]]] end[}] ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=mockDependentFields, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=mocks, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=testClassInstance, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=injectMocksOnFields, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=DefaultInjectionEngine, sub_type=None)) end[}] END[}]
Keyword[public] Keyword[void] identifier[injectMocks] operator[SEP] Keyword[final] identifier[Object] identifier[testClassInstance] operator[SEP] { identifier[Class] operator[<] operator[?] operator[>] identifier[clazz] operator[=] identifier[testClassInstance] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] identifier[Set] operator[<] identifier[Field] operator[>] identifier[mockDependentFields] operator[=] Keyword[new] identifier[HashSet] operator[<] identifier[Field] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[Set] operator[<] identifier[Object] operator[>] identifier[mocks] operator[=] identifier[newMockSafeHashSet] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[clazz] operator[!=] identifier[Object] operator[SEP] Keyword[class] operator[SEP] { Keyword[new] identifier[InjectMocksScanner] operator[SEP] identifier[clazz] operator[SEP] operator[SEP] identifier[addTo] operator[SEP] identifier[mockDependentFields] operator[SEP] operator[SEP] Keyword[new] identifier[MockScanner] operator[SEP] identifier[testClassInstance] , identifier[clazz] operator[SEP] operator[SEP] identifier[addPreparedMocks] operator[SEP] identifier[mocks] operator[SEP] operator[SEP] identifier[onInjection] operator[SEP] identifier[testClassInstance] , identifier[clazz] , identifier[mockDependentFields] , identifier[mocks] operator[SEP] operator[SEP] identifier[clazz] operator[=] identifier[clazz] operator[SEP] identifier[getSuperclass] operator[SEP] operator[SEP] operator[SEP] } Keyword[new] identifier[DefaultInjectionEngine] operator[SEP] operator[SEP] operator[SEP] identifier[injectMocksOnFields] operator[SEP] identifier[mockDependentFields] , identifier[mocks] , identifier[testClassInstance] operator[SEP] operator[SEP] }
public static DiscoMatchType getMatchType(boolean isSubsume, boolean isPlugin) { if (isSubsume) { if (isPlugin) { // If plugin and subsume -> this is an exact match return DiscoMatchType.Exact; } return DiscoMatchType.Subsume; } else { if (isPlugin) { return DiscoMatchType.Plugin; } } return DiscoMatchType.Fail; }
class class_name[name] begin[{] method[getMatchType, return_type[type[DiscoMatchType]], modifier[public static], parameter[isSubsume, isPlugin]] begin[{] if[member[.isSubsume]] begin[{] if[member[.isPlugin]] begin[{] return[member[DiscoMatchType.Exact]] else begin[{] None end[}] return[member[DiscoMatchType.Subsume]] else begin[{] if[member[.isPlugin]] begin[{] return[member[DiscoMatchType.Plugin]] else begin[{] None end[}] end[}] return[member[DiscoMatchType.Fail]] end[}] END[}]
Keyword[public] Keyword[static] identifier[DiscoMatchType] identifier[getMatchType] operator[SEP] Keyword[boolean] identifier[isSubsume] , Keyword[boolean] identifier[isPlugin] operator[SEP] { Keyword[if] operator[SEP] identifier[isSubsume] operator[SEP] { Keyword[if] operator[SEP] identifier[isPlugin] operator[SEP] { Keyword[return] identifier[DiscoMatchType] operator[SEP] identifier[Exact] operator[SEP] } Keyword[return] identifier[DiscoMatchType] operator[SEP] identifier[Subsume] operator[SEP] } Keyword[else] { Keyword[if] operator[SEP] identifier[isPlugin] operator[SEP] { Keyword[return] identifier[DiscoMatchType] operator[SEP] identifier[Plugin] operator[SEP] } } Keyword[return] identifier[DiscoMatchType] operator[SEP] identifier[Fail] operator[SEP] }
public <A extends Annotation> BindingKey<T> qualifiedWith(final Class<A> annotation) { return underlying.qualifiedWith(annotation).asJava(); }
class class_name[name] begin[{] method[qualifiedWith, return_type[type[BindingKey]], modifier[public], parameter[annotation]] begin[{] return[call[underlying.qualifiedWith, parameter[member[.annotation]]]] end[}] END[}]
Keyword[public] operator[<] identifier[A] Keyword[extends] identifier[Annotation] operator[>] identifier[BindingKey] operator[<] identifier[T] operator[>] identifier[qualifiedWith] operator[SEP] Keyword[final] identifier[Class] operator[<] identifier[A] operator[>] identifier[annotation] operator[SEP] { Keyword[return] identifier[underlying] operator[SEP] identifier[qualifiedWith] operator[SEP] identifier[annotation] operator[SEP] operator[SEP] identifier[asJava] operator[SEP] operator[SEP] operator[SEP] }
public static String getText(String key, ResourceBundle bundle) { try { return bundle.getString(key); } catch (MissingResourceException ex) { return key; } }
class class_name[name] begin[{] method[getText, return_type[type[String]], modifier[public static], parameter[key, bundle]] begin[{] TryStatement(block=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getString, postfix_operators=[], prefix_operators=[], qualifier=bundle, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ReturnStatement(expression=MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ex, types=['MissingResourceException']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[public] Keyword[static] identifier[String] identifier[getText] operator[SEP] identifier[String] identifier[key] , identifier[ResourceBundle] identifier[bundle] operator[SEP] { Keyword[try] { Keyword[return] identifier[bundle] operator[SEP] identifier[getString] operator[SEP] identifier[key] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[MissingResourceException] identifier[ex] operator[SEP] { Keyword[return] identifier[key] operator[SEP] } }
@Override public void encodeBegin(FacesContext context, UIComponent component) throws IOException { if (!component.isRendered()) { return; } Icon icon = (Icon) component; ResponseWriter writer = context.getResponseWriter(); String nameOfIcon = icon.getName(); if (null == nameOfIcon) { nameOfIcon = String.valueOf(icon.getValue()); if (null == icon.getValue()) { if (icon instanceof IconAwesome) { throw new FacesException("Please specify the attribute 'value' of the icon. This attribute takes the name of the icon, minus the prefix 'fa-'."); } else { throw new FacesException("Please specify the attribute 'value' of the icon. This attribute takes the name of the icon, minus the prefix 'glyphicon-'."); } } } String styleClass = icon.getStyleClass(); String responsiveCSS= Responsive.getResponsiveStyleClass(icon, false).trim(); if (responsiveCSS.length()>0) { writer.startElement("div", component); writer.writeAttribute("class", responsiveCSS, null); } String style = icon.getStyle(); String size = icon.getSize(); String rotate = icon.getRotate(); String flip = icon.getFlip(); boolean spin = icon.isSpin(); if (icon instanceof IconAwesome) { IconAwesome awesome = (IconAwesome) icon; encodeIcon(context.getResponseWriter(), icon, nameOfIcon, icon instanceof IconAwesome, size, rotate, flip, spin, styleClass, style, icon.isDisabled(), icon.isAddon(), true, true, awesome.isBrand(), awesome.isInverse(), awesome.isLight(), awesome.isPulse(), awesome.isRegular(), awesome.isSolid()); } else { encodeIcon(context.getResponseWriter(), icon, nameOfIcon, icon instanceof IconAwesome, size, rotate, flip, spin, styleClass, style, icon.isDisabled(), icon.isAddon(), true, true, false, false, false, false, false, false); } if (responsiveCSS.length()>0) { writer.endElement("div"); } Tooltip.activateTooltips(context, icon); }
class class_name[name] begin[{] method[encodeBegin, return_type[void], modifier[public], parameter[context, component]] begin[{] if[call[component.isRendered, parameter[]]] begin[{] return[None] else begin[{] None end[}] local_variable[type[Icon], icon] local_variable[type[ResponseWriter], writer] local_variable[type[String], nameOfIcon] if[binary_operation[literal[null], ==, member[.nameOfIcon]]] begin[{] assign[member[.nameOfIcon], call[String.valueOf, parameter[call[icon.getValue, parameter[]]]]] if[binary_operation[literal[null], ==, call[icon.getValue, parameter[]]]] begin[{] if[binary_operation[member[.icon], instanceof, type[IconAwesome]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Please specify the attribute 'value' of the icon. This attribute takes the name of the icon, minus the prefix 'fa-'.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=FacesException, sub_type=None)), label=None) else begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Please specify the attribute 'value' of the icon. This attribute takes the name of the icon, minus the prefix 'glyphicon-'.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=FacesException, sub_type=None)), label=None) end[}] else begin[{] None end[}] else begin[{] None end[}] local_variable[type[String], styleClass] local_variable[type[String], responsiveCSS] if[binary_operation[call[responsiveCSS.length, parameter[]], >, literal[0]]] begin[{] call[writer.startElement, parameter[literal["div"], member[.component]]] call[writer.writeAttribute, parameter[literal["class"], member[.responsiveCSS], literal[null]]] else begin[{] None end[}] local_variable[type[String], style] local_variable[type[String], size] local_variable[type[String], rotate] local_variable[type[String], flip] local_variable[type[boolean], spin] if[binary_operation[member[.icon], instanceof, type[IconAwesome]]] begin[{] local_variable[type[IconAwesome], awesome] call[.encodeIcon, parameter[call[context.getResponseWriter, parameter[]], member[.icon], member[.nameOfIcon], binary_operation[member[.icon], instanceof, type[IconAwesome]], member[.size], member[.rotate], member[.flip], member[.spin], member[.styleClass], member[.style], call[icon.isDisabled, parameter[]], call[icon.isAddon, parameter[]], literal[true], literal[true], call[awesome.isBrand, parameter[]], call[awesome.isInverse, parameter[]], call[awesome.isLight, parameter[]], call[awesome.isPulse, parameter[]], call[awesome.isRegular, parameter[]], call[awesome.isSolid, parameter[]]]] else begin[{] call[.encodeIcon, parameter[call[context.getResponseWriter, parameter[]], member[.icon], member[.nameOfIcon], binary_operation[member[.icon], instanceof, type[IconAwesome]], member[.size], member[.rotate], member[.flip], member[.spin], member[.styleClass], member[.style], call[icon.isDisabled, parameter[]], call[icon.isAddon, parameter[]], literal[true], literal[true], literal[false], literal[false], literal[false], literal[false], literal[false], literal[false]]] end[}] if[binary_operation[call[responsiveCSS.length, parameter[]], >, literal[0]]] begin[{] call[writer.endElement, parameter[literal["div"]]] else begin[{] None end[}] call[Tooltip.activateTooltips, parameter[member[.context], member[.icon]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[encodeBegin] operator[SEP] identifier[FacesContext] identifier[context] , identifier[UIComponent] identifier[component] operator[SEP] Keyword[throws] identifier[IOException] { Keyword[if] operator[SEP] operator[!] identifier[component] operator[SEP] identifier[isRendered] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] operator[SEP] } identifier[Icon] identifier[icon] operator[=] operator[SEP] identifier[Icon] operator[SEP] identifier[component] operator[SEP] identifier[ResponseWriter] identifier[writer] operator[=] identifier[context] operator[SEP] identifier[getResponseWriter] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[nameOfIcon] operator[=] identifier[icon] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] Other[null] operator[==] identifier[nameOfIcon] operator[SEP] { identifier[nameOfIcon] operator[=] identifier[String] operator[SEP] identifier[valueOf] operator[SEP] identifier[icon] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] Other[null] operator[==] identifier[icon] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[icon] Keyword[instanceof] identifier[IconAwesome] operator[SEP] { Keyword[throw] Keyword[new] identifier[FacesException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[else] { Keyword[throw] Keyword[new] identifier[FacesException] operator[SEP] literal[String] operator[SEP] operator[SEP] } } } identifier[String] identifier[styleClass] operator[=] identifier[icon] operator[SEP] identifier[getStyleClass] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[responsiveCSS] operator[=] identifier[Responsive] operator[SEP] identifier[getResponsiveStyleClass] operator[SEP] identifier[icon] , literal[boolean] operator[SEP] operator[SEP] identifier[trim] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[responsiveCSS] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] { identifier[writer] operator[SEP] identifier[startElement] operator[SEP] literal[String] , identifier[component] operator[SEP] operator[SEP] identifier[writer] operator[SEP] identifier[writeAttribute] operator[SEP] literal[String] , identifier[responsiveCSS] , Other[null] operator[SEP] operator[SEP] } identifier[String] identifier[style] operator[=] identifier[icon] operator[SEP] identifier[getStyle] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[size] operator[=] identifier[icon] operator[SEP] identifier[getSize] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[rotate] operator[=] identifier[icon] operator[SEP] identifier[getRotate] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[flip] operator[=] identifier[icon] operator[SEP] identifier[getFlip] operator[SEP] operator[SEP] operator[SEP] Keyword[boolean] identifier[spin] operator[=] identifier[icon] operator[SEP] identifier[isSpin] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[icon] Keyword[instanceof] identifier[IconAwesome] operator[SEP] { identifier[IconAwesome] identifier[awesome] operator[=] operator[SEP] identifier[IconAwesome] operator[SEP] identifier[icon] operator[SEP] identifier[encodeIcon] operator[SEP] identifier[context] operator[SEP] identifier[getResponseWriter] operator[SEP] operator[SEP] , identifier[icon] , identifier[nameOfIcon] , identifier[icon] Keyword[instanceof] identifier[IconAwesome] , identifier[size] , identifier[rotate] , identifier[flip] , identifier[spin] , identifier[styleClass] , identifier[style] , identifier[icon] operator[SEP] identifier[isDisabled] operator[SEP] operator[SEP] , identifier[icon] operator[SEP] identifier[isAddon] operator[SEP] operator[SEP] , literal[boolean] , literal[boolean] , identifier[awesome] operator[SEP] identifier[isBrand] operator[SEP] operator[SEP] , identifier[awesome] operator[SEP] identifier[isInverse] operator[SEP] operator[SEP] , identifier[awesome] operator[SEP] identifier[isLight] operator[SEP] operator[SEP] , identifier[awesome] operator[SEP] identifier[isPulse] operator[SEP] operator[SEP] , identifier[awesome] operator[SEP] identifier[isRegular] operator[SEP] operator[SEP] , identifier[awesome] operator[SEP] identifier[isSolid] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[encodeIcon] operator[SEP] identifier[context] operator[SEP] identifier[getResponseWriter] operator[SEP] operator[SEP] , identifier[icon] , identifier[nameOfIcon] , identifier[icon] Keyword[instanceof] identifier[IconAwesome] , identifier[size] , identifier[rotate] , identifier[flip] , identifier[spin] , identifier[styleClass] , identifier[style] , identifier[icon] operator[SEP] identifier[isDisabled] operator[SEP] operator[SEP] , identifier[icon] operator[SEP] identifier[isAddon] operator[SEP] operator[SEP] , literal[boolean] , literal[boolean] , literal[boolean] , literal[boolean] , literal[boolean] , literal[boolean] , literal[boolean] , literal[boolean] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[responsiveCSS] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] { identifier[writer] operator[SEP] identifier[endElement] operator[SEP] literal[String] operator[SEP] operator[SEP] } identifier[Tooltip] operator[SEP] identifier[activateTooltips] operator[SEP] identifier[context] , identifier[icon] operator[SEP] operator[SEP] }
public static Scanner getMetricScanner(final TSDB tsdb, final int salt_bucket, final byte[] metric, final int start, final int stop, final byte[] table, final byte[] family) { final short metric_width = TSDB.metrics_width(); final int metric_salt_width = metric_width + Const.SALT_WIDTH(); final byte[] start_row = new byte[metric_salt_width + Const.TIMESTAMP_BYTES]; final byte[] end_row = new byte[metric_salt_width + Const.TIMESTAMP_BYTES]; if (Const.SALT_WIDTH() > 0) { final byte[] salt = RowKey.getSaltBytes(salt_bucket); System.arraycopy(salt, 0, start_row, 0, Const.SALT_WIDTH()); System.arraycopy(salt, 0, end_row, 0, Const.SALT_WIDTH()); } Bytes.setInt(start_row, start, metric_salt_width); Bytes.setInt(end_row, stop, metric_salt_width); System.arraycopy(metric, 0, start_row, Const.SALT_WIDTH(), metric_width); System.arraycopy(metric, 0, end_row, Const.SALT_WIDTH(), metric_width); final Scanner scanner = tsdb.getClient().newScanner(table); scanner.setMaxNumRows(tsdb.getConfig().scanner_maxNumRows()); scanner.setStartKey(start_row); scanner.setStopKey(end_row); scanner.setFamily(family); return scanner; }
class class_name[name] begin[{] method[getMetricScanner, return_type[type[Scanner]], modifier[public static], parameter[tsdb, salt_bucket, metric, start, stop, table, family]] begin[{] local_variable[type[short], metric_width] local_variable[type[int], metric_salt_width] local_variable[type[byte], start_row] local_variable[type[byte], end_row] if[binary_operation[call[Const.SALT_WIDTH, parameter[]], >, literal[0]]] begin[{] local_variable[type[byte], salt] call[System.arraycopy, parameter[member[.salt], literal[0], member[.start_row], literal[0], call[Const.SALT_WIDTH, parameter[]]]] call[System.arraycopy, parameter[member[.salt], literal[0], member[.end_row], literal[0], call[Const.SALT_WIDTH, parameter[]]]] else begin[{] None end[}] call[Bytes.setInt, parameter[member[.start_row], member[.start], member[.metric_salt_width]]] call[Bytes.setInt, parameter[member[.end_row], member[.stop], member[.metric_salt_width]]] call[System.arraycopy, parameter[member[.metric], literal[0], member[.start_row], call[Const.SALT_WIDTH, parameter[]], member[.metric_width]]] call[System.arraycopy, parameter[member[.metric], literal[0], member[.end_row], call[Const.SALT_WIDTH, parameter[]], member[.metric_width]]] local_variable[type[Scanner], scanner] call[scanner.setMaxNumRows, parameter[call[tsdb.getConfig, parameter[]]]] call[scanner.setStartKey, parameter[member[.start_row]]] call[scanner.setStopKey, parameter[member[.end_row]]] call[scanner.setFamily, parameter[member[.family]]] return[member[.scanner]] end[}] END[}]
Keyword[public] Keyword[static] identifier[Scanner] identifier[getMetricScanner] operator[SEP] Keyword[final] identifier[TSDB] identifier[tsdb] , Keyword[final] Keyword[int] identifier[salt_bucket] , Keyword[final] Keyword[byte] operator[SEP] operator[SEP] identifier[metric] , Keyword[final] Keyword[int] identifier[start] , Keyword[final] Keyword[int] identifier[stop] , Keyword[final] Keyword[byte] operator[SEP] operator[SEP] identifier[table] , Keyword[final] Keyword[byte] operator[SEP] operator[SEP] identifier[family] operator[SEP] { Keyword[final] Keyword[short] identifier[metric_width] operator[=] identifier[TSDB] operator[SEP] identifier[metrics_width] operator[SEP] operator[SEP] operator[SEP] Keyword[final] Keyword[int] identifier[metric_salt_width] operator[=] identifier[metric_width] operator[+] identifier[Const] operator[SEP] identifier[SALT_WIDTH] operator[SEP] operator[SEP] operator[SEP] Keyword[final] Keyword[byte] operator[SEP] operator[SEP] identifier[start_row] operator[=] Keyword[new] Keyword[byte] operator[SEP] identifier[metric_salt_width] operator[+] identifier[Const] operator[SEP] identifier[TIMESTAMP_BYTES] operator[SEP] operator[SEP] Keyword[final] Keyword[byte] operator[SEP] operator[SEP] identifier[end_row] operator[=] Keyword[new] Keyword[byte] operator[SEP] identifier[metric_salt_width] operator[+] identifier[Const] operator[SEP] identifier[TIMESTAMP_BYTES] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[Const] operator[SEP] identifier[SALT_WIDTH] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] { Keyword[final] Keyword[byte] operator[SEP] operator[SEP] identifier[salt] operator[=] identifier[RowKey] operator[SEP] identifier[getSaltBytes] operator[SEP] identifier[salt_bucket] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[arraycopy] operator[SEP] identifier[salt] , Other[0] , identifier[start_row] , Other[0] , identifier[Const] operator[SEP] identifier[SALT_WIDTH] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[arraycopy] operator[SEP] identifier[salt] , Other[0] , identifier[end_row] , Other[0] , identifier[Const] operator[SEP] identifier[SALT_WIDTH] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[Bytes] operator[SEP] identifier[setInt] operator[SEP] identifier[start_row] , identifier[start] , identifier[metric_salt_width] operator[SEP] operator[SEP] identifier[Bytes] operator[SEP] identifier[setInt] operator[SEP] identifier[end_row] , identifier[stop] , identifier[metric_salt_width] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[arraycopy] operator[SEP] identifier[metric] , Other[0] , identifier[start_row] , identifier[Const] operator[SEP] identifier[SALT_WIDTH] operator[SEP] operator[SEP] , identifier[metric_width] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[arraycopy] operator[SEP] identifier[metric] , Other[0] , identifier[end_row] , identifier[Const] operator[SEP] identifier[SALT_WIDTH] operator[SEP] operator[SEP] , identifier[metric_width] operator[SEP] operator[SEP] Keyword[final] identifier[Scanner] identifier[scanner] operator[=] identifier[tsdb] operator[SEP] identifier[getClient] operator[SEP] operator[SEP] operator[SEP] identifier[newScanner] operator[SEP] identifier[table] operator[SEP] operator[SEP] identifier[scanner] operator[SEP] identifier[setMaxNumRows] operator[SEP] identifier[tsdb] operator[SEP] identifier[getConfig] operator[SEP] operator[SEP] operator[SEP] identifier[scanner_maxNumRows] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[scanner] operator[SEP] identifier[setStartKey] operator[SEP] identifier[start_row] operator[SEP] operator[SEP] identifier[scanner] operator[SEP] identifier[setStopKey] operator[SEP] identifier[end_row] operator[SEP] operator[SEP] identifier[scanner] operator[SEP] identifier[setFamily] operator[SEP] identifier[family] operator[SEP] operator[SEP] Keyword[return] identifier[scanner] operator[SEP] }
public List<BType> getBuilderList() { if (externalBuilderList == null) { externalBuilderList = new BuilderExternalList<MType, BType, IType>(this); } return externalBuilderList; }
class class_name[name] begin[{] method[getBuilderList, return_type[type[List]], modifier[public], parameter[]] begin[{] if[binary_operation[member[.externalBuilderList], ==, literal[null]]] begin[{] assign[member[.externalBuilderList], ClassCreator(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, 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=MType, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=BType, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=IType, sub_type=None))], dimensions=None, name=BuilderExternalList, sub_type=None))] else begin[{] None end[}] return[member[.externalBuilderList]] end[}] END[}]
Keyword[public] identifier[List] operator[<] identifier[BType] operator[>] identifier[getBuilderList] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[externalBuilderList] operator[==] Other[null] operator[SEP] { identifier[externalBuilderList] operator[=] Keyword[new] identifier[BuilderExternalList] operator[<] identifier[MType] , identifier[BType] , identifier[IType] operator[>] operator[SEP] Keyword[this] operator[SEP] operator[SEP] } Keyword[return] identifier[externalBuilderList] operator[SEP] }
public final Parser<T> otherwise(Parser<? extends T> fallback) { return new Parser<T>() { @Override boolean apply(ParseContext ctxt) { final Object result = ctxt.result; final int at = ctxt.at; final int step = ctxt.step; final int errorIndex = ctxt.errorIndex(); if (Parser.this.apply(ctxt)) return true; if (ctxt.errorIndex() != errorIndex) return false; ctxt.set(step, at, result); return fallback.apply(ctxt); } @Override public String toString() { return "otherwise"; } }; }
class class_name[name] begin[{] method[otherwise, return_type[type[Parser]], modifier[final public], parameter[fallback]] begin[{] return[ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=ctxt, selectors=[]), name=result)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=at, postfix_operators=[], prefix_operators=[], qualifier=ctxt, selectors=[]), name=at)], modifiers={'final'}, type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=step, postfix_operators=[], prefix_operators=[], qualifier=ctxt, selectors=[]), name=step)], modifiers={'final'}, type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=errorIndex, postfix_operators=[], prefix_operators=[], qualifier=ctxt, selectors=[], type_arguments=None), name=errorIndex)], modifiers={'final'}, type=BasicType(dimensions=[], name=int)), IfStatement(condition=This(postfix_operators=[], prefix_operators=[], qualifier=Parser, selectors=[MethodInvocation(arguments=[MemberReference(member=ctxt, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=apply, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), else_statement=None, label=None, then_statement=ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true), label=None)), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=errorIndex, postfix_operators=[], prefix_operators=[], qualifier=ctxt, selectors=[], type_arguments=None), operandr=MemberReference(member=errorIndex, 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=false), label=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=step, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=at, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=set, postfix_operators=[], prefix_operators=[], qualifier=ctxt, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=ctxt, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=apply, postfix_operators=[], prefix_operators=[], qualifier=fallback, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers=set(), name=apply, parameters=[FormalParameter(annotations=[], modifiers=set(), name=ctxt, type=ReferenceType(arguments=None, dimensions=[], name=ParseContext, sub_type=None), varargs=False)], return_type=BasicType(dimensions=[], name=boolean), throws=None, type_parameters=None), MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="otherwise"), label=None)], documentation=None, modifiers={'public'}, name=toString, parameters=[], return_type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None), throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None))], dimensions=None, name=Parser, sub_type=None))] end[}] END[}]
Keyword[public] Keyword[final] identifier[Parser] operator[<] identifier[T] operator[>] identifier[otherwise] operator[SEP] identifier[Parser] operator[<] operator[?] Keyword[extends] identifier[T] operator[>] identifier[fallback] operator[SEP] { Keyword[return] Keyword[new] identifier[Parser] operator[<] identifier[T] operator[>] operator[SEP] operator[SEP] { annotation[@] identifier[Override] Keyword[boolean] identifier[apply] operator[SEP] identifier[ParseContext] identifier[ctxt] operator[SEP] { Keyword[final] identifier[Object] identifier[result] operator[=] identifier[ctxt] operator[SEP] identifier[result] operator[SEP] Keyword[final] Keyword[int] identifier[at] operator[=] identifier[ctxt] operator[SEP] identifier[at] operator[SEP] Keyword[final] Keyword[int] identifier[step] operator[=] identifier[ctxt] operator[SEP] identifier[step] operator[SEP] Keyword[final] Keyword[int] identifier[errorIndex] operator[=] identifier[ctxt] operator[SEP] identifier[errorIndex] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[Parser] operator[SEP] Keyword[this] operator[SEP] identifier[apply] operator[SEP] identifier[ctxt] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP] Keyword[if] operator[SEP] identifier[ctxt] operator[SEP] identifier[errorIndex] operator[SEP] operator[SEP] operator[!=] identifier[errorIndex] operator[SEP] Keyword[return] literal[boolean] operator[SEP] identifier[ctxt] operator[SEP] identifier[set] operator[SEP] identifier[step] , identifier[at] , identifier[result] operator[SEP] operator[SEP] Keyword[return] identifier[fallback] operator[SEP] identifier[apply] operator[SEP] identifier[ctxt] operator[SEP] operator[SEP] } annotation[@] identifier[Override] Keyword[public] identifier[String] identifier[toString] operator[SEP] operator[SEP] { Keyword[return] literal[String] operator[SEP] } } operator[SEP] }
public void merge(GVRSkeleton newSkel) { int numBones = getNumBones(); List<Integer> parentBoneIds = new ArrayList<Integer>(numBones + newSkel.getNumBones()); List<String> newBoneNames = new ArrayList<String>(newSkel.getNumBones()); List<Matrix4f> newMatrices = new ArrayList<Matrix4f>(newSkel.getNumBones()); GVRPose oldBindPose = getBindPose(); GVRPose curPose = getPose(); for (int i = 0; i < numBones; ++i) { parentBoneIds.add(mParentBones[i]); } for (int j = 0; j < newSkel.getNumBones(); ++j) { String boneName = newSkel.getBoneName(j); int boneId = getBoneIndex(boneName); if (boneId < 0) { int parentId = newSkel.getParentBoneIndex(j); Matrix4f m = new Matrix4f(); newSkel.getBindPose().getLocalMatrix(j, m); newMatrices.add(m); newBoneNames.add(boneName); if (parentId >= 0) { boneName = newSkel.getBoneName(parentId); parentId = getBoneIndex(boneName); } parentBoneIds.add(parentId); } } if (parentBoneIds.size() == numBones) { return; } int n = numBones + parentBoneIds.size(); int[] parentIds = Arrays.copyOf(mParentBones, n); int[] boneOptions = Arrays.copyOf(mBoneOptions, n); String[] boneNames = Arrays.copyOf(mBoneNames, n); mBones = Arrays.copyOf(mBones, n); mPoseMatrices = new float[n * 16]; for (int i = 0; i < parentBoneIds.size(); ++i) { n = numBones + i; parentIds[n] = parentBoneIds.get(i); boneNames[n] = newBoneNames.get(i); boneOptions[n] = BONE_ANIMATE; } mBoneOptions = boneOptions; mBoneNames = boneNames; mParentBones = parentIds; mPose = new GVRPose(this); mBindPose = new GVRPose(this); mBindPose.copy(oldBindPose); mPose.copy(curPose); mBindPose.sync(); for (int j = 0; j < newSkel.getNumBones(); ++j) { mBindPose.setLocalMatrix(numBones + j, newMatrices.get(j)); mPose.setLocalMatrix(numBones + j, newMatrices.get(j)); } setBindPose(mBindPose); mPose.sync(); updateBonePose(); }
class class_name[name] begin[{] method[merge, return_type[void], modifier[public], parameter[newSkel]] begin[{] local_variable[type[int], numBones] local_variable[type[List], parentBoneIds] local_variable[type[List], newBoneNames] local_variable[type[List], newMatrices] local_variable[type[GVRPose], oldBindPose] local_variable[type[GVRPose], curPose] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=mParentBones, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])], member=add, postfix_operators=[], prefix_operators=[], qualifier=parentBoneIds, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=numBones, 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) ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getBoneName, postfix_operators=[], prefix_operators=[], qualifier=newSkel, selectors=[], type_arguments=None), name=boneName)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=boneName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getBoneIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=boneId)], modifiers=set(), type=BasicType(dimensions=[], name=int)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=boneId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=<), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getParentBoneIndex, postfix_operators=[], prefix_operators=[], qualifier=newSkel, selectors=[], type_arguments=None), name=parentId)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Matrix4f, sub_type=None)), name=m)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Matrix4f, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[], member=getBindPose, postfix_operators=[], prefix_operators=[], qualifier=newSkel, selectors=[MethodInvocation(arguments=[MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=m, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getLocalMatrix, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=m, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=newMatrices, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=boneName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=newBoneNames, selectors=[], type_arguments=None), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=parentId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=boneName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=parentId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getBoneName, postfix_operators=[], prefix_operators=[], qualifier=newSkel, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=parentId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=boneName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getBoneIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=parentId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=parentBoneIds, selectors=[], type_arguments=None), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=getNumBones, postfix_operators=[], prefix_operators=[], qualifier=newSkel, selectors=[], type_arguments=None), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=j)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=j, postfix_operators=[], prefix_operators=['++'], qualifier=, selectors=[])]), label=None) if[binary_operation[call[parentBoneIds.size, parameter[]], ==, member[.numBones]]] begin[{] return[None] else begin[{] None end[}] local_variable[type[int], n] local_variable[type[int], parentIds] local_variable[type[int], boneOptions] local_variable[type[String], boneNames] assign[member[.mBones], call[Arrays.copyOf, parameter[member[.mBones], member[.n]]]] assign[member[.mPoseMatrices], ArrayCreator(dimensions=[BinaryOperation(operandl=MemberReference(member=n, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=16), operator=*)], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=None, name=float))] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=n, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=BinaryOperation(operandl=MemberReference(member=numBones, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=parentIds, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=n, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=parentBoneIds, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=boneNames, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=n, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=newBoneNames, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=boneOptions, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=n, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MemberReference(member=BONE_ANIMATE, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=parentBoneIds, 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) assign[member[.mBoneOptions], member[.boneOptions]] assign[member[.mBoneNames], member[.boneNames]] assign[member[.mParentBones], member[.parentIds]] assign[member[.mPose], ClassCreator(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=GVRPose, sub_type=None))] assign[member[.mBindPose], ClassCreator(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=GVRPose, sub_type=None))] call[mBindPose.copy, parameter[member[.oldBindPose]]] call[mPose.copy, parameter[member[.curPose]]] call[mBindPose.sync, parameter[]] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=numBones, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), MethodInvocation(arguments=[MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=newMatrices, selectors=[], type_arguments=None)], member=setLocalMatrix, postfix_operators=[], prefix_operators=[], qualifier=mBindPose, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=numBones, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), MethodInvocation(arguments=[MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=newMatrices, selectors=[], type_arguments=None)], member=setLocalMatrix, postfix_operators=[], prefix_operators=[], qualifier=mPose, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=getNumBones, postfix_operators=[], prefix_operators=[], qualifier=newSkel, selectors=[], type_arguments=None), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=j)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=j, postfix_operators=[], prefix_operators=['++'], qualifier=, selectors=[])]), label=None) call[.setBindPose, parameter[member[.mBindPose]]] call[mPose.sync, parameter[]] call[.updateBonePose, parameter[]] end[}] END[}]
Keyword[public] Keyword[void] identifier[merge] operator[SEP] identifier[GVRSkeleton] identifier[newSkel] operator[SEP] { Keyword[int] identifier[numBones] operator[=] identifier[getNumBones] operator[SEP] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[Integer] operator[>] identifier[parentBoneIds] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[Integer] operator[>] operator[SEP] identifier[numBones] operator[+] identifier[newSkel] operator[SEP] identifier[getNumBones] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[String] operator[>] identifier[newBoneNames] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[String] operator[>] operator[SEP] identifier[newSkel] operator[SEP] identifier[getNumBones] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[Matrix4f] operator[>] identifier[newMatrices] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[Matrix4f] operator[>] operator[SEP] identifier[newSkel] operator[SEP] identifier[getNumBones] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[GVRPose] identifier[oldBindPose] operator[=] identifier[getBindPose] operator[SEP] operator[SEP] operator[SEP] identifier[GVRPose] identifier[curPose] operator[=] identifier[getPose] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[numBones] operator[SEP] operator[++] identifier[i] operator[SEP] { identifier[parentBoneIds] operator[SEP] identifier[add] operator[SEP] identifier[mParentBones] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP] } Keyword[for] operator[SEP] Keyword[int] identifier[j] operator[=] Other[0] operator[SEP] identifier[j] operator[<] identifier[newSkel] operator[SEP] identifier[getNumBones] operator[SEP] operator[SEP] operator[SEP] operator[++] identifier[j] operator[SEP] { identifier[String] identifier[boneName] operator[=] identifier[newSkel] operator[SEP] identifier[getBoneName] operator[SEP] identifier[j] operator[SEP] operator[SEP] Keyword[int] identifier[boneId] operator[=] identifier[getBoneIndex] operator[SEP] identifier[boneName] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[boneId] operator[<] Other[0] operator[SEP] { Keyword[int] identifier[parentId] operator[=] identifier[newSkel] operator[SEP] identifier[getParentBoneIndex] operator[SEP] identifier[j] operator[SEP] operator[SEP] identifier[Matrix4f] identifier[m] operator[=] Keyword[new] identifier[Matrix4f] operator[SEP] operator[SEP] operator[SEP] identifier[newSkel] operator[SEP] identifier[getBindPose] operator[SEP] operator[SEP] operator[SEP] identifier[getLocalMatrix] operator[SEP] identifier[j] , identifier[m] operator[SEP] operator[SEP] identifier[newMatrices] operator[SEP] identifier[add] operator[SEP] identifier[m] operator[SEP] operator[SEP] identifier[newBoneNames] operator[SEP] identifier[add] operator[SEP] identifier[boneName] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[parentId] operator[>=] Other[0] operator[SEP] { identifier[boneName] operator[=] identifier[newSkel] operator[SEP] identifier[getBoneName] operator[SEP] identifier[parentId] operator[SEP] operator[SEP] identifier[parentId] operator[=] identifier[getBoneIndex] operator[SEP] identifier[boneName] operator[SEP] operator[SEP] } identifier[parentBoneIds] operator[SEP] identifier[add] operator[SEP] identifier[parentId] operator[SEP] operator[SEP] } } Keyword[if] operator[SEP] identifier[parentBoneIds] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[==] identifier[numBones] operator[SEP] { Keyword[return] operator[SEP] } Keyword[int] identifier[n] operator[=] identifier[numBones] operator[+] identifier[parentBoneIds] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] Keyword[int] operator[SEP] operator[SEP] identifier[parentIds] operator[=] identifier[Arrays] operator[SEP] identifier[copyOf] operator[SEP] identifier[mParentBones] , identifier[n] operator[SEP] operator[SEP] Keyword[int] operator[SEP] operator[SEP] identifier[boneOptions] operator[=] identifier[Arrays] operator[SEP] identifier[copyOf] operator[SEP] identifier[mBoneOptions] , identifier[n] operator[SEP] operator[SEP] identifier[String] operator[SEP] operator[SEP] identifier[boneNames] operator[=] identifier[Arrays] operator[SEP] identifier[copyOf] operator[SEP] identifier[mBoneNames] , identifier[n] operator[SEP] operator[SEP] identifier[mBones] operator[=] identifier[Arrays] operator[SEP] identifier[copyOf] operator[SEP] identifier[mBones] , identifier[n] operator[SEP] operator[SEP] identifier[mPoseMatrices] operator[=] Keyword[new] Keyword[float] operator[SEP] identifier[n] operator[*] Other[16] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[parentBoneIds] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[++] identifier[i] operator[SEP] { identifier[n] operator[=] identifier[numBones] operator[+] identifier[i] operator[SEP] identifier[parentIds] operator[SEP] identifier[n] operator[SEP] operator[=] identifier[parentBoneIds] operator[SEP] identifier[get] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[boneNames] operator[SEP] identifier[n] operator[SEP] operator[=] identifier[newBoneNames] operator[SEP] identifier[get] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[boneOptions] operator[SEP] identifier[n] operator[SEP] operator[=] identifier[BONE_ANIMATE] operator[SEP] } identifier[mBoneOptions] operator[=] identifier[boneOptions] operator[SEP] identifier[mBoneNames] operator[=] identifier[boneNames] operator[SEP] identifier[mParentBones] operator[=] identifier[parentIds] operator[SEP] identifier[mPose] operator[=] Keyword[new] identifier[GVRPose] operator[SEP] Keyword[this] operator[SEP] operator[SEP] identifier[mBindPose] operator[=] Keyword[new] identifier[GVRPose] operator[SEP] Keyword[this] operator[SEP] operator[SEP] identifier[mBindPose] operator[SEP] identifier[copy] operator[SEP] identifier[oldBindPose] operator[SEP] operator[SEP] identifier[mPose] operator[SEP] identifier[copy] operator[SEP] identifier[curPose] operator[SEP] operator[SEP] identifier[mBindPose] operator[SEP] identifier[sync] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[j] operator[=] Other[0] operator[SEP] identifier[j] operator[<] identifier[newSkel] operator[SEP] identifier[getNumBones] operator[SEP] operator[SEP] operator[SEP] operator[++] identifier[j] operator[SEP] { identifier[mBindPose] operator[SEP] identifier[setLocalMatrix] operator[SEP] identifier[numBones] operator[+] identifier[j] , identifier[newMatrices] operator[SEP] identifier[get] operator[SEP] identifier[j] operator[SEP] operator[SEP] operator[SEP] identifier[mPose] operator[SEP] identifier[setLocalMatrix] operator[SEP] identifier[numBones] operator[+] identifier[j] , identifier[newMatrices] operator[SEP] identifier[get] operator[SEP] identifier[j] operator[SEP] operator[SEP] operator[SEP] } identifier[setBindPose] operator[SEP] identifier[mBindPose] operator[SEP] operator[SEP] identifier[mPose] operator[SEP] identifier[sync] operator[SEP] operator[SEP] operator[SEP] identifier[updateBonePose] operator[SEP] operator[SEP] operator[SEP] }
public Cursor query(SQLiteDatabase db, String[] columns, String groupBy, String having, String orderBy, String limit) { assertTable(); if (columns != null) mapColumns(columns); return db.query(mTable, columns, getSelection(), getSelectionArgs(), groupBy, having, orderBy, limit); }
class class_name[name] begin[{] method[query, return_type[type[Cursor]], modifier[public], parameter[db, columns, groupBy, having, orderBy, limit]] begin[{] call[.assertTable, parameter[]] if[binary_operation[member[.columns], !=, literal[null]]] begin[{] call[.mapColumns, parameter[member[.columns]]] else begin[{] None end[}] return[call[db.query, parameter[member[.mTable], member[.columns], call[.getSelection, parameter[]], call[.getSelectionArgs, parameter[]], member[.groupBy], member[.having], member[.orderBy], member[.limit]]]] end[}] END[}]
Keyword[public] identifier[Cursor] identifier[query] operator[SEP] identifier[SQLiteDatabase] identifier[db] , identifier[String] operator[SEP] operator[SEP] identifier[columns] , identifier[String] identifier[groupBy] , identifier[String] identifier[having] , identifier[String] identifier[orderBy] , identifier[String] identifier[limit] operator[SEP] { identifier[assertTable] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[columns] operator[!=] Other[null] operator[SEP] identifier[mapColumns] operator[SEP] identifier[columns] operator[SEP] operator[SEP] Keyword[return] identifier[db] operator[SEP] identifier[query] operator[SEP] identifier[mTable] , identifier[columns] , identifier[getSelection] operator[SEP] operator[SEP] , identifier[getSelectionArgs] operator[SEP] operator[SEP] , identifier[groupBy] , identifier[having] , identifier[orderBy] , identifier[limit] operator[SEP] operator[SEP] }
public ArrayList<OvhDisclaimerAttributeEnum> organizationName_service_exchangeService_domain_domainName_disclaimerAttribute_GET(String organizationName, String exchangeService, String domainName) throws IOException { String qPath = "/email/exchange/{organizationName}/service/{exchangeService}/domain/{domainName}/disclaimerAttribute"; StringBuilder sb = path(qPath, organizationName, exchangeService, domainName); String resp = exec(qPath, "GET", sb.toString(), null); return convertTo(resp, t3); }
class class_name[name] begin[{] method[organizationName_service_exchangeService_domain_domainName_disclaimerAttribute_GET, return_type[type[ArrayList]], modifier[public], parameter[organizationName, exchangeService, domainName]] begin[{] local_variable[type[String], qPath] local_variable[type[StringBuilder], sb] local_variable[type[String], resp] return[call[.convertTo, parameter[member[.resp], member[.t3]]]] end[}] END[}]
Keyword[public] identifier[ArrayList] operator[<] identifier[OvhDisclaimerAttributeEnum] operator[>] identifier[organizationName_service_exchangeService_domain_domainName_disclaimerAttribute_GET] operator[SEP] identifier[String] identifier[organizationName] , identifier[String] identifier[exchangeService] , identifier[String] identifier[domainName] operator[SEP] Keyword[throws] identifier[IOException] { identifier[String] identifier[qPath] operator[=] literal[String] operator[SEP] identifier[StringBuilder] identifier[sb] operator[=] identifier[path] operator[SEP] identifier[qPath] , identifier[organizationName] , identifier[exchangeService] , identifier[domainName] operator[SEP] operator[SEP] identifier[String] identifier[resp] operator[=] identifier[exec] operator[SEP] identifier[qPath] , literal[String] , identifier[sb] operator[SEP] identifier[toString] operator[SEP] operator[SEP] , Other[null] operator[SEP] operator[SEP] Keyword[return] identifier[convertTo] operator[SEP] identifier[resp] , identifier[t3] operator[SEP] operator[SEP] }
public static void invoke() { for (final Runnable instance : instances) { try { instance.run(); } catch (final Throwable t) { LOGGER.error(SHUTDOWN_HOOK_MARKER, "Caught exception executing shutdown hook {}", instance, t); } } }
class class_name[name] begin[{] method[invoke, return_type[void], modifier[public static], parameter[]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=run, postfix_operators=[], prefix_operators=[], qualifier=instance, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=SHUTDOWN_HOOK_MARKER, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Caught exception executing shutdown hook {}"), MemberReference(member=instance, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=t, 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=t, types=['Throwable']))], finally_block=None, label=None, resources=None)]), control=EnhancedForControl(iterable=MemberReference(member=instances, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=instance)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=Runnable, sub_type=None))), label=None) end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[invoke] operator[SEP] operator[SEP] { Keyword[for] operator[SEP] Keyword[final] identifier[Runnable] identifier[instance] operator[:] identifier[instances] operator[SEP] { Keyword[try] { identifier[instance] operator[SEP] identifier[run] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] Keyword[final] identifier[Throwable] identifier[t] operator[SEP] { identifier[LOGGER] operator[SEP] identifier[error] operator[SEP] identifier[SHUTDOWN_HOOK_MARKER] , literal[String] , identifier[instance] , identifier[t] operator[SEP] operator[SEP] } } }
@Override public String getCacheKey(String name, Tree params, String... keys) { if (params == null) { return name; } StringBuilder buffer = new StringBuilder(128); serializeKey(buffer, params, keys); String serializedParams = buffer.toString(); int paramsLength = serializedParams.length(); if (maxParamsLength < 44 || paramsLength <= maxParamsLength) { // Key = action name : serialized key return name + ':' + serializedParams; } // Length of unhashed part (begining of the serialized params) int prefixLength = maxParamsLength - 44; // Create SHA-256 hash from the entire key byte[] bytes = serializedParams.getBytes(StandardCharsets.UTF_8); MessageDigest hasher = hashers.poll(); if (hasher == null) { try { hasher = MessageDigest.getInstance("SHA-256"); } catch (Exception cause) { logger.warn("Unable to get SHA-256 hasher!", cause); return name + ':' + serializedParams; } } bytes = hasher.digest(bytes); hashers.add(hasher); // Concatenate key and the 44 character long hash String base64 = BASE64.encode(bytes); if (prefixLength < 1) { // Fully hashed key = action name : hash code return name + ':' + base64; } // Partly hashed key = action name : beginig of the prefix + hash code return name + ':' + serializedParams.substring(0, prefixLength) + base64; }
class class_name[name] begin[{] method[getCacheKey, return_type[type[String]], modifier[public], parameter[name, params, keys]] begin[{] if[binary_operation[member[.params], ==, literal[null]]] begin[{] return[member[.name]] else begin[{] None end[}] local_variable[type[StringBuilder], buffer] call[.serializeKey, parameter[member[.buffer], member[.params], member[.keys]]] local_variable[type[String], serializedParams] local_variable[type[int], paramsLength] if[binary_operation[binary_operation[member[.maxParamsLength], <, literal[44]], ||, binary_operation[member[.paramsLength], <=, member[.maxParamsLength]]]] begin[{] return[binary_operation[binary_operation[member[.name], +, literal[':']], +, member[.serializedParams]]] else begin[{] None end[}] local_variable[type[int], prefixLength] local_variable[type[byte], bytes] local_variable[type[MessageDigest], hasher] if[binary_operation[member[.hasher], ==, literal[null]]] begin[{] TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=hasher, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="SHA-256")], member=getInstance, postfix_operators=[], prefix_operators=[], qualifier=MessageDigest, selectors=[], type_arguments=None)), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unable to get SHA-256 hasher!"), MemberReference(member=cause, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=warn, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=':'), operator=+), operandr=MemberReference(member=serializedParams, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=cause, types=['Exception']))], finally_block=None, label=None, resources=None) else begin[{] None end[}] assign[member[.bytes], call[hasher.digest, parameter[member[.bytes]]]] call[hashers.add, parameter[member[.hasher]]] local_variable[type[String], base64] if[binary_operation[member[.prefixLength], <, literal[1]]] begin[{] return[binary_operation[binary_operation[member[.name], +, literal[':']], +, member[.base64]]] else begin[{] None end[}] return[binary_operation[binary_operation[binary_operation[member[.name], +, literal[':']], +, call[serializedParams.substring, parameter[literal[0], member[.prefixLength]]]], +, member[.base64]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[String] identifier[getCacheKey] operator[SEP] identifier[String] identifier[name] , identifier[Tree] identifier[params] , identifier[String] operator[...] identifier[keys] operator[SEP] { Keyword[if] operator[SEP] identifier[params] operator[==] Other[null] operator[SEP] { Keyword[return] identifier[name] operator[SEP] } identifier[StringBuilder] identifier[buffer] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] Other[128] operator[SEP] operator[SEP] identifier[serializeKey] operator[SEP] identifier[buffer] , identifier[params] , identifier[keys] operator[SEP] operator[SEP] identifier[String] identifier[serializedParams] operator[=] identifier[buffer] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[paramsLength] operator[=] identifier[serializedParams] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[maxParamsLength] operator[<] Other[44] operator[||] identifier[paramsLength] operator[<=] identifier[maxParamsLength] operator[SEP] { Keyword[return] identifier[name] operator[+] literal[String] operator[+] identifier[serializedParams] operator[SEP] } Keyword[int] identifier[prefixLength] operator[=] identifier[maxParamsLength] operator[-] Other[44] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[bytes] operator[=] identifier[serializedParams] operator[SEP] identifier[getBytes] operator[SEP] identifier[StandardCharsets] operator[SEP] identifier[UTF_8] operator[SEP] operator[SEP] identifier[MessageDigest] identifier[hasher] operator[=] identifier[hashers] operator[SEP] identifier[poll] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[hasher] operator[==] Other[null] operator[SEP] { Keyword[try] { identifier[hasher] operator[=] identifier[MessageDigest] operator[SEP] identifier[getInstance] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[cause] operator[SEP] { identifier[logger] operator[SEP] identifier[warn] operator[SEP] literal[String] , identifier[cause] operator[SEP] operator[SEP] Keyword[return] identifier[name] operator[+] literal[String] operator[+] identifier[serializedParams] operator[SEP] } } identifier[bytes] operator[=] identifier[hasher] operator[SEP] identifier[digest] operator[SEP] identifier[bytes] operator[SEP] operator[SEP] identifier[hashers] operator[SEP] identifier[add] operator[SEP] identifier[hasher] operator[SEP] operator[SEP] identifier[String] identifier[base64] operator[=] identifier[BASE64] operator[SEP] identifier[encode] operator[SEP] identifier[bytes] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[prefixLength] operator[<] Other[1] operator[SEP] { Keyword[return] identifier[name] operator[+] literal[String] operator[+] identifier[base64] operator[SEP] } Keyword[return] identifier[name] operator[+] literal[String] operator[+] identifier[serializedParams] operator[SEP] identifier[substring] operator[SEP] Other[0] , identifier[prefixLength] operator[SEP] operator[+] identifier[base64] operator[SEP] }
private String extractLanguage(String columnHeading) throws ParseException { int start = columnHeading.indexOf('('); int end = columnHeading.indexOf(')'); if (start == -1 || end == -1 || start >= end) { throwWrongHeaderException(); } return columnHeading.substring(start + 1, end); }
class class_name[name] begin[{] method[extractLanguage, return_type[type[String]], modifier[private], parameter[columnHeading]] begin[{] local_variable[type[int], start] local_variable[type[int], end] if[binary_operation[binary_operation[binary_operation[member[.start], ==, literal[1]], ||, binary_operation[member[.end], ==, literal[1]]], ||, binary_operation[member[.start], >=, member[.end]]]] begin[{] call[.throwWrongHeaderException, parameter[]] else begin[{] None end[}] return[call[columnHeading.substring, parameter[binary_operation[member[.start], +, literal[1]], member[.end]]]] end[}] END[}]
Keyword[private] identifier[String] identifier[extractLanguage] operator[SEP] identifier[String] identifier[columnHeading] operator[SEP] Keyword[throws] identifier[ParseException] { Keyword[int] identifier[start] operator[=] identifier[columnHeading] operator[SEP] identifier[indexOf] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[int] identifier[end] operator[=] identifier[columnHeading] operator[SEP] identifier[indexOf] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[start] operator[==] operator[-] Other[1] operator[||] identifier[end] operator[==] operator[-] Other[1] operator[||] identifier[start] operator[>=] identifier[end] operator[SEP] { identifier[throwWrongHeaderException] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[columnHeading] operator[SEP] identifier[substring] operator[SEP] identifier[start] operator[+] Other[1] , identifier[end] operator[SEP] operator[SEP] }
public BsonDocument asDocument() { BsonDocument document = new BsonDocument(); addW(document); addWTimeout(document); addFSync(document); addJ(document); return document; }
class class_name[name] begin[{] method[asDocument, return_type[type[BsonDocument]], modifier[public], parameter[]] begin[{] local_variable[type[BsonDocument], document] call[.addW, parameter[member[.document]]] call[.addWTimeout, parameter[member[.document]]] call[.addFSync, parameter[member[.document]]] call[.addJ, parameter[member[.document]]] return[member[.document]] end[}] END[}]
Keyword[public] identifier[BsonDocument] identifier[asDocument] operator[SEP] operator[SEP] { identifier[BsonDocument] identifier[document] operator[=] Keyword[new] identifier[BsonDocument] operator[SEP] operator[SEP] operator[SEP] identifier[addW] operator[SEP] identifier[document] operator[SEP] operator[SEP] identifier[addWTimeout] operator[SEP] identifier[document] operator[SEP] operator[SEP] identifier[addFSync] operator[SEP] identifier[document] operator[SEP] operator[SEP] identifier[addJ] operator[SEP] identifier[document] operator[SEP] operator[SEP] Keyword[return] identifier[document] operator[SEP] }
public static String getRequestIp(HttpServletRequest request) throws UnknownHostException { String ip = request.getHeader("x-forwarded-for"); if(ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) { ip = request.getHeader("Proxy-Client-IP"); } if(ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) { ip = request.getHeader("WL-Proxy-Client-IP"); } if(ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) { ip = request.getRemoteAddr(); if(ip.equals("127.0.0.1")){ //根据网卡取本机配置的IP InetAddress inetAddress = InetAddress.getLocalHost(); ip= inetAddress.getHostAddress(); } } // 对于通过多个代理的情况,第一个IP为客户端真实IP,多个IP按照','分割 if(ip != null && ip.length() > 15){ if(ip.indexOf(",")>0){ ip = ip.substring(0,ip.indexOf(",")); } } //return ip; return "0:0:0:0:0:0:0:1".equals(ip) ? "127.0.0.1" : ip; }
class class_name[name] begin[{] method[getRequestIp, return_type[type[String]], modifier[public static], parameter[request]] begin[{] local_variable[type[String], ip] if[binary_operation[binary_operation[binary_operation[member[.ip], ==, literal[null]], ||, binary_operation[call[ip.length, parameter[]], ==, literal[0]]], ||, literal["unknown"]]] begin[{] assign[member[.ip], call[request.getHeader, parameter[literal["Proxy-Client-IP"]]]] else begin[{] None end[}] if[binary_operation[binary_operation[binary_operation[member[.ip], ==, literal[null]], ||, binary_operation[call[ip.length, parameter[]], ==, literal[0]]], ||, literal["unknown"]]] begin[{] assign[member[.ip], call[request.getHeader, parameter[literal["WL-Proxy-Client-IP"]]]] else begin[{] None end[}] if[binary_operation[binary_operation[binary_operation[member[.ip], ==, literal[null]], ||, binary_operation[call[ip.length, parameter[]], ==, literal[0]]], ||, literal["unknown"]]] begin[{] assign[member[.ip], call[request.getRemoteAddr, parameter[]]] if[call[ip.equals, parameter[literal["127.0.0.1"]]]] begin[{] local_variable[type[InetAddress], inetAddress] assign[member[.ip], call[inetAddress.getHostAddress, parameter[]]] else begin[{] None end[}] else begin[{] None end[}] if[binary_operation[binary_operation[member[.ip], !=, literal[null]], &&, binary_operation[call[ip.length, parameter[]], >, literal[15]]]] begin[{] if[binary_operation[call[ip.indexOf, parameter[literal[","]]], >, literal[0]]] begin[{] assign[member[.ip], call[ip.substring, parameter[literal[0], call[ip.indexOf, parameter[literal[","]]]]]] else begin[{] None end[}] else begin[{] None end[}] return[TernaryExpression(condition=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=ip, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], value="0:0:0:0:0:0:0:1"), if_false=MemberReference(member=ip, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="127.0.0.1"))] end[}] END[}]
Keyword[public] Keyword[static] identifier[String] identifier[getRequestIp] operator[SEP] identifier[HttpServletRequest] identifier[request] operator[SEP] Keyword[throws] identifier[UnknownHostException] { identifier[String] identifier[ip] operator[=] identifier[request] operator[SEP] identifier[getHeader] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[ip] operator[==] Other[null] operator[||] identifier[ip] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[==] Other[0] operator[||] literal[String] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] identifier[ip] operator[SEP] operator[SEP] { identifier[ip] operator[=] identifier[request] operator[SEP] identifier[getHeader] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[ip] operator[==] Other[null] operator[||] identifier[ip] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[==] Other[0] operator[||] literal[String] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] identifier[ip] operator[SEP] operator[SEP] { identifier[ip] operator[=] identifier[request] operator[SEP] identifier[getHeader] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[ip] operator[==] Other[null] operator[||] identifier[ip] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[==] Other[0] operator[||] literal[String] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] identifier[ip] operator[SEP] operator[SEP] { identifier[ip] operator[=] identifier[request] operator[SEP] identifier[getRemoteAddr] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[ip] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] { identifier[InetAddress] identifier[inetAddress] operator[=] identifier[InetAddress] operator[SEP] identifier[getLocalHost] operator[SEP] operator[SEP] operator[SEP] identifier[ip] operator[=] identifier[inetAddress] operator[SEP] identifier[getHostAddress] operator[SEP] operator[SEP] operator[SEP] } } Keyword[if] operator[SEP] identifier[ip] operator[!=] Other[null] operator[&&] identifier[ip] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[>] Other[15] operator[SEP] { Keyword[if] operator[SEP] identifier[ip] operator[SEP] identifier[indexOf] operator[SEP] literal[String] operator[SEP] operator[>] Other[0] operator[SEP] { identifier[ip] operator[=] identifier[ip] operator[SEP] identifier[substring] operator[SEP] Other[0] , identifier[ip] operator[SEP] identifier[indexOf] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] } } Keyword[return] literal[String] operator[SEP] identifier[equals] operator[SEP] identifier[ip] operator[SEP] operator[?] literal[String] operator[:] identifier[ip] operator[SEP] }
public void marshall(CreateGlobalSecondaryIndexAction createGlobalSecondaryIndexAction, ProtocolMarshaller protocolMarshaller) { if (createGlobalSecondaryIndexAction == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(createGlobalSecondaryIndexAction.getIndexName(), INDEXNAME_BINDING); protocolMarshaller.marshall(createGlobalSecondaryIndexAction.getKeySchema(), KEYSCHEMA_BINDING); protocolMarshaller.marshall(createGlobalSecondaryIndexAction.getProjection(), PROJECTION_BINDING); protocolMarshaller.marshall(createGlobalSecondaryIndexAction.getProvisionedThroughput(), PROVISIONEDTHROUGHPUT_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[createGlobalSecondaryIndexAction, protocolMarshaller]] begin[{] if[binary_operation[member[.createGlobalSecondaryIndexAction], ==, 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=getIndexName, postfix_operators=[], prefix_operators=[], qualifier=createGlobalSecondaryIndexAction, selectors=[], type_arguments=None), MemberReference(member=INDEXNAME_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=getKeySchema, postfix_operators=[], prefix_operators=[], qualifier=createGlobalSecondaryIndexAction, selectors=[], type_arguments=None), MemberReference(member=KEYSCHEMA_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=getProjection, postfix_operators=[], prefix_operators=[], qualifier=createGlobalSecondaryIndexAction, selectors=[], type_arguments=None), MemberReference(member=PROJECTION_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=getProvisionedThroughput, postfix_operators=[], prefix_operators=[], qualifier=createGlobalSecondaryIndexAction, selectors=[], type_arguments=None), MemberReference(member=PROVISIONEDTHROUGHPUT_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[CreateGlobalSecondaryIndexAction] identifier[createGlobalSecondaryIndexAction] , identifier[ProtocolMarshaller] identifier[protocolMarshaller] operator[SEP] { Keyword[if] operator[SEP] identifier[createGlobalSecondaryIndexAction] 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[createGlobalSecondaryIndexAction] operator[SEP] identifier[getIndexName] operator[SEP] operator[SEP] , identifier[INDEXNAME_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[createGlobalSecondaryIndexAction] operator[SEP] identifier[getKeySchema] operator[SEP] operator[SEP] , identifier[KEYSCHEMA_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[createGlobalSecondaryIndexAction] operator[SEP] identifier[getProjection] operator[SEP] operator[SEP] , identifier[PROJECTION_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[createGlobalSecondaryIndexAction] operator[SEP] identifier[getProvisionedThroughput] operator[SEP] operator[SEP] , identifier[PROVISIONEDTHROUGHPUT_BINDING] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[SdkClientException] operator[SEP] literal[String] operator[+] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP] } }
public static void posixFadviseIfPossible( FileDescriptor fd, long offset, long len, int flags) throws NativeIOException { if (nativeLoaded && fadvisePossible) { try { posix_fadvise(fd, offset, len, flags); InjectionHandler.processEvent( InjectionEventCore.NATIVEIO_POSIX_FADVISE, flags); } catch (UnsupportedOperationException uoe) { LOG.warn("posixFadviseIfPossible() failed", uoe); fadvisePossible = false; } catch (UnsatisfiedLinkError ule) { LOG.warn("posixFadviseIfPossible() failed", ule); fadvisePossible = false; } catch (NativeIOException nie) { LOG.warn("posixFadviseIfPossible() failed", nie); throw nie; } } }
class class_name[name] begin[{] method[posixFadviseIfPossible, return_type[void], modifier[public static], parameter[fd, offset, len, flags]] begin[{] if[binary_operation[member[.nativeLoaded], &&, member[.fadvisePossible]]] begin[{] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=fd, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=offset, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=len, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=flags, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=posix_fadvise, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=NATIVEIO_POSIX_FADVISE, postfix_operators=[], prefix_operators=[], qualifier=InjectionEventCore, selectors=[]), MemberReference(member=flags, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=processEvent, postfix_operators=[], prefix_operators=[], qualifier=InjectionHandler, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="posixFadviseIfPossible() failed"), MemberReference(member=uoe, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=warn, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=fadvisePossible, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=uoe, types=['UnsupportedOperationException'])), CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="posixFadviseIfPossible() failed"), MemberReference(member=ule, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=warn, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=fadvisePossible, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ule, types=['UnsatisfiedLinkError'])), CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="posixFadviseIfPossible() failed"), MemberReference(member=nie, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=warn, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), label=None), ThrowStatement(expression=MemberReference(member=nie, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=nie, types=['NativeIOException']))], finally_block=None, label=None, resources=None) else begin[{] None end[}] end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[posixFadviseIfPossible] operator[SEP] identifier[FileDescriptor] identifier[fd] , Keyword[long] identifier[offset] , Keyword[long] identifier[len] , Keyword[int] identifier[flags] operator[SEP] Keyword[throws] identifier[NativeIOException] { Keyword[if] operator[SEP] identifier[nativeLoaded] operator[&&] identifier[fadvisePossible] operator[SEP] { Keyword[try] { identifier[posix_fadvise] operator[SEP] identifier[fd] , identifier[offset] , identifier[len] , identifier[flags] operator[SEP] operator[SEP] identifier[InjectionHandler] operator[SEP] identifier[processEvent] operator[SEP] identifier[InjectionEventCore] operator[SEP] identifier[NATIVEIO_POSIX_FADVISE] , identifier[flags] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[UnsupportedOperationException] identifier[uoe] operator[SEP] { identifier[LOG] operator[SEP] identifier[warn] operator[SEP] literal[String] , identifier[uoe] operator[SEP] operator[SEP] identifier[fadvisePossible] operator[=] literal[boolean] operator[SEP] } Keyword[catch] operator[SEP] identifier[UnsatisfiedLinkError] identifier[ule] operator[SEP] { identifier[LOG] operator[SEP] identifier[warn] operator[SEP] literal[String] , identifier[ule] operator[SEP] operator[SEP] identifier[fadvisePossible] operator[=] literal[boolean] operator[SEP] } Keyword[catch] operator[SEP] identifier[NativeIOException] identifier[nie] operator[SEP] { identifier[LOG] operator[SEP] identifier[warn] operator[SEP] literal[String] , identifier[nie] operator[SEP] operator[SEP] Keyword[throw] identifier[nie] operator[SEP] } } }
public ViaCEPEndereco getEndereco(String cep) throws IOException { char[] chars = cep.toCharArray(); StringBuilder builder = new StringBuilder(); for (int i = 0; i< chars.length; i++){ if (Character.isDigit(chars[i])){ builder.append(chars[i]); } } cep = builder.toString(); if (cep.length() != 8){ throw new IllegalArgumentException("CEP inválido - deve conter 8 dígitos: " + cep); } String urlString = getHost() + cep + "/json/"; URL url = new URL(urlString); HttpURLConnection urlConnection = (HttpURLConnection) url.openConnection(); try { InputStream in = new BufferedInputStream(urlConnection.getInputStream()); ViaCEPEndereco obj = getService().beanFrom(ViaCEPEndereco.class, in); if (obj == null || obj.getCep() == null){ return null; } return obj; } finally { urlConnection.disconnect(); } }
class class_name[name] begin[{] method[getEndereco, return_type[type[ViaCEPEndereco]], modifier[public], parameter[cep]] begin[{] local_variable[type[char], chars] local_variable[type[StringBuilder], builder] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=chars, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])], member=isDigit, postfix_operators=[], prefix_operators=[], qualifier=Character, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=chars, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])], member=append, postfix_operators=[], prefix_operators=[], qualifier=builder, selectors=[], type_arguments=None), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=chars, 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) assign[member[.cep], call[builder.toString, parameter[]]] if[binary_operation[call[cep.length, parameter[]], !=, literal[8]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="CEP inválido - deve conter 8 dígitos: "), operandr=MemberReference(member=cep, 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], urlString] local_variable[type[URL], url] local_variable[type[HttpURLConnection], urlConnection] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MethodInvocation(arguments=[], member=getInputStream, postfix_operators=[], prefix_operators=[], qualifier=urlConnection, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=BufferedInputStream, sub_type=None)), name=in)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=InputStream, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getService, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ViaCEPEndereco, sub_type=None)), MemberReference(member=in, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=beanFrom, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=obj)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ViaCEPEndereco, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=obj, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getCep, postfix_operators=[], prefix_operators=[], qualifier=obj, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), operator=||), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), label=None)])), ReturnStatement(expression=MemberReference(member=obj, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], catches=None, finally_block=[StatementExpression(expression=MethodInvocation(arguments=[], member=disconnect, postfix_operators=[], prefix_operators=[], qualifier=urlConnection, selectors=[], type_arguments=None), label=None)], label=None, resources=None) end[}] END[}]
Keyword[public] identifier[ViaCEPEndereco] identifier[getEndereco] operator[SEP] identifier[String] identifier[cep] operator[SEP] Keyword[throws] identifier[IOException] { Keyword[char] operator[SEP] operator[SEP] identifier[chars] operator[=] identifier[cep] operator[SEP] identifier[toCharArray] operator[SEP] operator[SEP] operator[SEP] identifier[StringBuilder] identifier[builder] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[chars] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] { Keyword[if] operator[SEP] identifier[Character] operator[SEP] identifier[isDigit] operator[SEP] identifier[chars] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP] { identifier[builder] operator[SEP] identifier[append] operator[SEP] identifier[chars] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP] } } identifier[cep] operator[=] identifier[builder] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[cep] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[!=] Other[8] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[+] identifier[cep] operator[SEP] operator[SEP] } identifier[String] identifier[urlString] operator[=] identifier[getHost] operator[SEP] operator[SEP] operator[+] identifier[cep] operator[+] literal[String] operator[SEP] identifier[URL] identifier[url] operator[=] Keyword[new] identifier[URL] operator[SEP] identifier[urlString] operator[SEP] operator[SEP] identifier[HttpURLConnection] identifier[urlConnection] operator[=] operator[SEP] identifier[HttpURLConnection] operator[SEP] identifier[url] operator[SEP] identifier[openConnection] operator[SEP] operator[SEP] operator[SEP] Keyword[try] { identifier[InputStream] identifier[in] operator[=] Keyword[new] identifier[BufferedInputStream] operator[SEP] identifier[urlConnection] operator[SEP] identifier[getInputStream] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[ViaCEPEndereco] identifier[obj] operator[=] identifier[getService] operator[SEP] operator[SEP] operator[SEP] identifier[beanFrom] operator[SEP] identifier[ViaCEPEndereco] operator[SEP] Keyword[class] , identifier[in] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[obj] operator[==] Other[null] operator[||] identifier[obj] operator[SEP] identifier[getCep] operator[SEP] operator[SEP] operator[==] Other[null] operator[SEP] { Keyword[return] Other[null] operator[SEP] } Keyword[return] identifier[obj] operator[SEP] } Keyword[finally] { identifier[urlConnection] operator[SEP] identifier[disconnect] operator[SEP] operator[SEP] operator[SEP] } }
private static PermutationParity fill3DCoordinates(IAtomContainer container, IAtom a, List<IBond> connected, Point3d[] coordinates, int offset) { int i = 0; int[] indices = new int[2]; for (IBond bond : connected) { if (!isDoubleBond(bond)) { IAtom other = bond.getOther(a); coordinates[i + offset] = other.getPoint3d(); indices[i] = container.indexOf(other); i++; } } // only one connection, use the coordinate of 'a' if (i == 1) { coordinates[offset + 1] = a.getPoint3d(); return PermutationParity.IDENTITY; } else { return new BasicPermutationParity(indices); } }
class class_name[name] begin[{] method[fill3DCoordinates, return_type[type[PermutationParity]], modifier[private static], parameter[container, a, connected, coordinates, offset]] begin[{] local_variable[type[int], i] local_variable[type[int], indices] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=bond, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isDoubleBond, postfix_operators=[], prefix_operators=['!'], qualifier=, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=a, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getOther, postfix_operators=[], prefix_operators=[], qualifier=bond, selectors=[], type_arguments=None), name=other)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=IAtom, sub_type=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=coordinates, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=offset, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+))]), type==, value=MethodInvocation(arguments=[], member=getPoint3d, postfix_operators=[], prefix_operators=[], qualifier=other, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=indices, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MethodInvocation(arguments=[MemberReference(member=other, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=indexOf, postfix_operators=[], prefix_operators=[], qualifier=container, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=connected, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=bond)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=IBond, sub_type=None))), label=None) if[binary_operation[member[.i], ==, literal[1]]] begin[{] assign[member[.coordinates], call[a.getPoint3d, parameter[]]] return[member[PermutationParity.IDENTITY]] else begin[{] return[ClassCreator(arguments=[MemberReference(member=indices, 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=BasicPermutationParity, sub_type=None))] end[}] end[}] END[}]
Keyword[private] Keyword[static] identifier[PermutationParity] identifier[fill3DCoordinates] operator[SEP] identifier[IAtomContainer] identifier[container] , identifier[IAtom] identifier[a] , identifier[List] operator[<] identifier[IBond] operator[>] identifier[connected] , identifier[Point3d] operator[SEP] operator[SEP] identifier[coordinates] , Keyword[int] identifier[offset] operator[SEP] { Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] Keyword[int] operator[SEP] operator[SEP] identifier[indices] operator[=] Keyword[new] Keyword[int] operator[SEP] Other[2] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[IBond] identifier[bond] operator[:] identifier[connected] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[isDoubleBond] operator[SEP] identifier[bond] operator[SEP] operator[SEP] { identifier[IAtom] identifier[other] operator[=] identifier[bond] operator[SEP] identifier[getOther] operator[SEP] identifier[a] operator[SEP] operator[SEP] identifier[coordinates] operator[SEP] identifier[i] operator[+] identifier[offset] operator[SEP] operator[=] identifier[other] operator[SEP] identifier[getPoint3d] operator[SEP] operator[SEP] operator[SEP] identifier[indices] operator[SEP] identifier[i] operator[SEP] operator[=] identifier[container] operator[SEP] identifier[indexOf] operator[SEP] identifier[other] operator[SEP] operator[SEP] identifier[i] operator[++] operator[SEP] } } Keyword[if] operator[SEP] identifier[i] operator[==] Other[1] operator[SEP] { identifier[coordinates] operator[SEP] identifier[offset] operator[+] Other[1] operator[SEP] operator[=] identifier[a] operator[SEP] identifier[getPoint3d] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[PermutationParity] operator[SEP] identifier[IDENTITY] operator[SEP] } Keyword[else] { Keyword[return] Keyword[new] identifier[BasicPermutationParity] operator[SEP] identifier[indices] operator[SEP] operator[SEP] } }
@Beta // TODO remove? This seems not necessary public Optional<PESection> maybeLoadSection(String name) throws IOException { Optional<SectionHeader> section = table.getSectionHeaderByName(name); if (section.isPresent()) { int sectionNr = section.get().getNumber(); return Optional.fromNullable(loadSection(sectionNr)); } return Optional.absent(); }
class class_name[name] begin[{] method[maybeLoadSection, return_type[type[Optional]], modifier[public], parameter[name]] begin[{] local_variable[type[Optional], section] if[call[section.isPresent, parameter[]]] begin[{] local_variable[type[int], sectionNr] return[call[Optional.fromNullable, parameter[call[.loadSection, parameter[member[.sectionNr]]]]]] else begin[{] None end[}] return[call[Optional.absent, parameter[]]] end[}] END[}]
annotation[@] identifier[Beta] Keyword[public] identifier[Optional] operator[<] identifier[PESection] operator[>] identifier[maybeLoadSection] operator[SEP] identifier[String] identifier[name] operator[SEP] Keyword[throws] identifier[IOException] { identifier[Optional] operator[<] identifier[SectionHeader] operator[>] identifier[section] operator[=] identifier[table] operator[SEP] identifier[getSectionHeaderByName] operator[SEP] identifier[name] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[section] operator[SEP] identifier[isPresent] operator[SEP] operator[SEP] operator[SEP] { Keyword[int] identifier[sectionNr] operator[=] identifier[section] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[getNumber] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[Optional] operator[SEP] identifier[fromNullable] operator[SEP] identifier[loadSection] operator[SEP] identifier[sectionNr] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[Optional] operator[SEP] identifier[absent] operator[SEP] operator[SEP] operator[SEP] }
public static String getUTCNow() { SimpleDateFormat dateFormatGmt = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); dateFormatGmt.setTimeZone(TimeZone.getTimeZone("GMT")); //Time in GMT return dateFormatGmt.format(new Date()); }
class class_name[name] begin[{] method[getUTCNow, return_type[type[String]], modifier[public static], parameter[]] begin[{] local_variable[type[SimpleDateFormat], dateFormatGmt] call[dateFormatGmt.setTimeZone, parameter[call[TimeZone.getTimeZone, parameter[literal["GMT"]]]]] return[call[dateFormatGmt.format, parameter[ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Date, sub_type=None))]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[String] identifier[getUTCNow] operator[SEP] operator[SEP] { identifier[SimpleDateFormat] identifier[dateFormatGmt] operator[=] Keyword[new] identifier[SimpleDateFormat] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[dateFormatGmt] operator[SEP] identifier[setTimeZone] operator[SEP] identifier[TimeZone] operator[SEP] identifier[getTimeZone] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[dateFormatGmt] operator[SEP] identifier[format] operator[SEP] Keyword[new] identifier[Date] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
private void addNodeIndex(EntityMetadata entityMetadata, Node node, Index<Node> nodeIndex, MetamodelImpl metaModel) { // MetamodelImpl metaModel = (MetamodelImpl) kunderaMetadata.getApplicationMetadata().getMetamodel( // entityMetadata.getPersistenceUnit()); // ID attribute has to be indexed necessarily String idColumnName = ((AbstractAttribute) entityMetadata.getIdAttribute()).getJPAColumnName(); nodeIndex.add(node, idColumnName, node.getProperty(idColumnName)); // Index all other fields, for whom indexing is enabled for (Attribute attribute : metaModel.entity(entityMetadata.getEntityClazz()).getSingularAttributes()) { Field field = (Field) attribute.getJavaMember(); if (!attribute.isCollection() && !attribute.isAssociation() && entityMetadata.getIndexProperties().keySet().contains(field.getName())) { String columnName = ((AbstractAttribute) attribute).getJPAColumnName(); nodeIndex.add(node, columnName, node.getProperty(columnName)); } } }
class class_name[name] begin[{] method[addNodeIndex, return_type[void], modifier[private], parameter[entityMetadata, node, nodeIndex, metaModel]] begin[{] local_variable[type[String], idColumnName] call[nodeIndex.add, parameter[member[.node], member[.idColumnName], call[node.getProperty, parameter[member[.idColumnName]]]]] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MethodInvocation(arguments=[], member=getJavaMember, postfix_operators=[], prefix_operators=[], qualifier=attribute, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=Field, sub_type=None)), name=field)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Field, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[], member=isCollection, postfix_operators=[], prefix_operators=['!'], qualifier=attribute, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[], member=isAssociation, postfix_operators=[], prefix_operators=['!'], qualifier=attribute, selectors=[], type_arguments=None), operator=&&), operandr=MethodInvocation(arguments=[], member=getIndexProperties, postfix_operators=[], prefix_operators=[], qualifier=entityMetadata, selectors=[MethodInvocation(arguments=[], member=keySet, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=field, selectors=[], type_arguments=None)], member=contains, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MemberReference(member=attribute, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=AbstractAttribute, sub_type=None)), name=columnName)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=node, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=columnName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[MemberReference(member=columnName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getProperty, postfix_operators=[], prefix_operators=[], qualifier=node, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=nodeIndex, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getEntityClazz, postfix_operators=[], prefix_operators=[], qualifier=entityMetadata, selectors=[], type_arguments=None)], member=entity, postfix_operators=[], prefix_operators=[], qualifier=metaModel, selectors=[MethodInvocation(arguments=[], member=getSingularAttributes, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=attribute)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Attribute, sub_type=None))), label=None) end[}] END[}]
Keyword[private] Keyword[void] identifier[addNodeIndex] operator[SEP] identifier[EntityMetadata] identifier[entityMetadata] , identifier[Node] identifier[node] , identifier[Index] operator[<] identifier[Node] operator[>] identifier[nodeIndex] , identifier[MetamodelImpl] identifier[metaModel] operator[SEP] { identifier[String] identifier[idColumnName] operator[=] operator[SEP] operator[SEP] identifier[AbstractAttribute] operator[SEP] identifier[entityMetadata] operator[SEP] identifier[getIdAttribute] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[getJPAColumnName] operator[SEP] operator[SEP] operator[SEP] identifier[nodeIndex] operator[SEP] identifier[add] operator[SEP] identifier[node] , identifier[idColumnName] , identifier[node] operator[SEP] identifier[getProperty] operator[SEP] identifier[idColumnName] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Attribute] identifier[attribute] operator[:] identifier[metaModel] operator[SEP] identifier[entity] operator[SEP] identifier[entityMetadata] operator[SEP] identifier[getEntityClazz] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[getSingularAttributes] operator[SEP] operator[SEP] operator[SEP] { identifier[Field] identifier[field] operator[=] operator[SEP] identifier[Field] operator[SEP] identifier[attribute] operator[SEP] identifier[getJavaMember] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[attribute] operator[SEP] identifier[isCollection] operator[SEP] operator[SEP] operator[&&] operator[!] identifier[attribute] operator[SEP] identifier[isAssociation] operator[SEP] operator[SEP] operator[&&] identifier[entityMetadata] operator[SEP] identifier[getIndexProperties] operator[SEP] operator[SEP] operator[SEP] identifier[keySet] operator[SEP] operator[SEP] operator[SEP] identifier[contains] operator[SEP] identifier[field] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { identifier[String] identifier[columnName] operator[=] operator[SEP] operator[SEP] identifier[AbstractAttribute] operator[SEP] identifier[attribute] operator[SEP] operator[SEP] identifier[getJPAColumnName] operator[SEP] operator[SEP] operator[SEP] identifier[nodeIndex] operator[SEP] identifier[add] operator[SEP] identifier[node] , identifier[columnName] , identifier[node] operator[SEP] identifier[getProperty] operator[SEP] identifier[columnName] operator[SEP] operator[SEP] operator[SEP] } } }
public static <T, M extends BytesReader<T> & BytesWriter<? super T>> ListMarshaller<T> of( M elementMarshaller) { return of(elementMarshaller, elementMarshaller); }
class class_name[name] begin[{] method[of, return_type[type[ListMarshaller]], modifier[public static], parameter[elementMarshaller]] begin[{] return[call[.of, parameter[member[.elementMarshaller], member[.elementMarshaller]]]] end[}] END[}]
Keyword[public] Keyword[static] operator[<] identifier[T] , identifier[M] Keyword[extends] identifier[BytesReader] operator[<] identifier[T] operator[>] operator[&] identifier[BytesWriter] operator[<] operator[?] Keyword[super] identifier[T] operator[>] operator[>] identifier[ListMarshaller] operator[<] identifier[T] operator[>] identifier[of] operator[SEP] identifier[M] identifier[elementMarshaller] operator[SEP] { Keyword[return] identifier[of] operator[SEP] identifier[elementMarshaller] , identifier[elementMarshaller] operator[SEP] operator[SEP] }
int computeReplicationWorkForBlocks(List<List<BlockInfo>> blocksToReplicate) { int requiredReplication, numEffectiveReplicas, priority; List<DatanodeDescriptor> containingNodes; DatanodeDescriptor srcNode; INodeFile fileINode = null; int scheduledWork = 0; List<ReplicationWork> work = new LinkedList<ReplicationWork>(); writeLock(); try { synchronized (neededReplications) { for (priority = 0; priority < blocksToReplicate.size(); priority++) { for (BlockInfo block : blocksToReplicate.get(priority)) { // block should belong to a file BlockInfo storedBlock = blocksMap.getBlockInfo(block); fileINode = (storedBlock == null) ? null : storedBlock.getINode(); // abandoned block not belong to a file if (fileINode == null) { neededReplications.remove(block, priority); // remove from neededReplications replIndex[priority]--; continue; } requiredReplication = fileINode.getBlockReplication(storedBlock); // get a source data-node containingNodes = new ArrayList<DatanodeDescriptor>(); NumberReplicas numReplicas = new NumberReplicas(); srcNode = chooseSourceDatanode(block, containingNodes, numReplicas); if (srcNode == null) // block can not be replicated from any node { continue; } // do not schedule more if enough replicas is already pending numEffectiveReplicas = numReplicas.liveReplicas() + pendingReplications.getNumReplicas(block); if (numEffectiveReplicas >= requiredReplication) { neededReplications.remove(block, priority); // remove from neededReplications replIndex[priority]--; continue; } work.add(new ReplicationWork(block, fileINode, requiredReplication - numEffectiveReplicas, srcNode, containingNodes, priority)); } } } } finally { writeUnlock(); } // choose replication targets: NOT HODING THE GLOBAL LOCK for(ReplicationWork rw : work){ DatanodeDescriptor targets[] = chooseTarget(rw); rw.targets = targets; } writeLock(); try { for(ReplicationWork rw : work){ DatanodeDescriptor[] targets = rw.targets; if(targets == null || targets.length == 0){ rw.targets = null; continue; } if (targets.length == 1 && !clusterMap.isOnSameRack(rw.srcNode, targets[0])) { // in case src & target are not on the same rack // see if there is an alternate valid source in the same rack // as the target that we can use instead. for (DatanodeDescriptor node : rw.containingNodes) { if (node != rw.srcNode && clusterMap.isOnSameRack(node, targets[0]) && isGoodReplica(node, rw.block)) { rw.srcNode = node; break; } } } synchronized (neededReplications) { BlockInfo block = rw.block; priority = rw.priority; // Recheck since global lock was released // block should belong to a file BlockInfo storedBlock = blocksMap.getBlockInfo(block); fileINode = (storedBlock == null) ? null : storedBlock.getINode(); // abandoned block not belong to a file if (fileINode == null ) { neededReplications.remove(block, priority); // remove from neededReplications rw.targets = null; replIndex[priority]--; continue; } requiredReplication = fileINode.getBlockReplication(storedBlock); // do not schedule more if enough replicas is already pending NumberReplicas numReplicas = countNodes(block); numEffectiveReplicas = numReplicas.liveReplicas() + pendingReplications.getNumReplicas(block); if (numEffectiveReplicas >= requiredReplication) { neededReplications.remove(block, priority); // remove from neededReplications replIndex[priority]--; rw.targets = null; continue; } // Add block to the to be replicated list rw.srcNode.addBlockToBeReplicated(block, targets); scheduledWork++; for (DatanodeDescriptor dn : targets) { dn.incBlocksScheduled(); } // Move the block-replication into a "pending" state. // The reason we use 'pending' is so we can retry // replications that fail after an appropriate amount of time. pendingReplications.add(block, targets.length); if (NameNode.stateChangeLog.isDebugEnabled()) { NameNode.stateChangeLog.debug( "BLOCK* block " + block + " is moved from neededReplications to pendingReplications"); } // remove from neededReplications if (numEffectiveReplicas + targets.length >= requiredReplication) { neededReplications.remove(block, priority); // remove from neededReplications replIndex[priority]--; } } } } finally { writeUnlock(); } // update metrics updateReplicationMetrics(work); // print debug information if(NameNode.stateChangeLog.isInfoEnabled()){ // log which blocks have been scheduled for replication for(ReplicationWork rw : work){ // report scheduled blocks DatanodeDescriptor[] targets = rw.targets; if (targets != null && targets.length != 0) { StringBuffer targetList = new StringBuffer("datanode(s)"); for (int k = 0; k < targets.length; k++) { targetList.append(' '); targetList.append(targets[k].getName()); } NameNode.stateChangeLog.info( "BLOCK* ask " + rw.srcNode.getName() + " to replicate " + rw.block + " to " + targetList); } } } // log once per call if (NameNode.stateChangeLog.isDebugEnabled()) { NameNode.stateChangeLog.debug("BLOCK* neededReplications = " + neededReplications.size() + " pendingReplications = " + pendingReplications.size()); } return scheduledWork; }
class class_name[name] begin[{] method[computeReplicationWorkForBlocks, return_type[type[int]], modifier[default], parameter[blocksToReplicate]] begin[{] local_variable[type[int], requiredReplication] local_variable[type[List], containingNodes] local_variable[type[DatanodeDescriptor], srcNode] local_variable[type[INodeFile], fileINode] local_variable[type[int], scheduledWork] local_variable[type[List], work] call[.writeLock, parameter[]] TryStatement(block=[SynchronizedStatement(block=[ForStatement(body=BlockStatement(label=None, statements=[ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=block, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getBlockInfo, postfix_operators=[], prefix_operators=[], qualifier=blocksMap, selectors=[], type_arguments=None), name=storedBlock)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=BlockInfo, sub_type=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=fileINode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=storedBlock, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), if_false=MethodInvocation(arguments=[], member=getINode, postfix_operators=[], prefix_operators=[], qualifier=storedBlock, selectors=[], type_arguments=None), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null))), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=fileINode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=block, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=priority, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=remove, postfix_operators=[], prefix_operators=[], qualifier=neededReplications, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MemberReference(member=replIndex, postfix_operators=['--'], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=priority, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), label=None), ContinueStatement(goto=None, label=None)])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=requiredReplication, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=storedBlock, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getBlockReplication, postfix_operators=[], prefix_operators=[], qualifier=fileINode, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=containingNodes, 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=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=DatanodeDescriptor, sub_type=None))], dimensions=None, name=ArrayList, sub_type=None))), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=NumberReplicas, sub_type=None)), name=numReplicas)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=NumberReplicas, sub_type=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=srcNode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=block, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=containingNodes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=numReplicas, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=chooseSourceDatanode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=srcNode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ContinueStatement(goto=None, label=None)])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=numEffectiveReplicas, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=BinaryOperation(operandl=MethodInvocation(arguments=[], member=liveReplicas, postfix_operators=[], prefix_operators=[], qualifier=numReplicas, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[MemberReference(member=block, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getNumReplicas, postfix_operators=[], prefix_operators=[], qualifier=pendingReplications, selectors=[], type_arguments=None), operator=+)), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=numEffectiveReplicas, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=requiredReplication, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=>=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=block, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=priority, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=remove, postfix_operators=[], prefix_operators=[], qualifier=neededReplications, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MemberReference(member=replIndex, postfix_operators=['--'], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=priority, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), label=None), ContinueStatement(goto=None, label=None)])), StatementExpression(expression=MethodInvocation(arguments=[ClassCreator(arguments=[MemberReference(member=block, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=fileINode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=MemberReference(member=requiredReplication, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=numEffectiveReplicas, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=-), MemberReference(member=srcNode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=containingNodes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=priority, 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=ReplicationWork, sub_type=None))], member=add, postfix_operators=[], prefix_operators=[], qualifier=work, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[MemberReference(member=priority, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=blocksToReplicate, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=block)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=BlockInfo, sub_type=None))), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=priority, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=blocksToReplicate, selectors=[], type_arguments=None), operator=<), init=[Assignment(expressionl=MemberReference(member=priority, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))], update=[MemberReference(member=priority, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)], label=None, lock=MemberReference(member=neededReplications, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))], catches=None, finally_block=[StatementExpression(expression=MethodInvocation(arguments=[], member=writeUnlock, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], label=None, resources=None) ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[None], initializer=MethodInvocation(arguments=[MemberReference(member=rw, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=chooseTarget, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=targets)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=DatanodeDescriptor, sub_type=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=targets, postfix_operators=[], prefix_operators=[], qualifier=rw, selectors=[]), type==, value=MemberReference(member=targets, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=work, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=rw)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ReplicationWork, sub_type=None))), label=None) call[.writeLock, parameter[]] TryStatement(block=[ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=targets, postfix_operators=[], prefix_operators=[], qualifier=rw, selectors=[]), name=targets)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[None], name=DatanodeDescriptor, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=targets, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), operandr=BinaryOperation(operandl=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=targets, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator===), operator=||), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=targets, postfix_operators=[], prefix_operators=[], qualifier=rw, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)), label=None), ContinueStatement(goto=None, label=None)])), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=targets, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator===), operandr=MethodInvocation(arguments=[MemberReference(member=srcNode, postfix_operators=[], prefix_operators=[], qualifier=rw, selectors=[]), MemberReference(member=targets, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))])], member=isOnSameRack, postfix_operators=[], prefix_operators=['!'], qualifier=clusterMap, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=node, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=srcNode, postfix_operators=[], prefix_operators=[], qualifier=rw, selectors=[]), operator=!=), operandr=MethodInvocation(arguments=[MemberReference(member=node, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=targets, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))])], member=isOnSameRack, postfix_operators=[], prefix_operators=[], qualifier=clusterMap, selectors=[], type_arguments=None), operator=&&), operandr=MethodInvocation(arguments=[MemberReference(member=node, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=block, postfix_operators=[], prefix_operators=[], qualifier=rw, selectors=[])], member=isGoodReplica, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=srcNode, postfix_operators=[], prefix_operators=[], qualifier=rw, selectors=[]), type==, value=MemberReference(member=node, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), BreakStatement(goto=None, label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=containingNodes, postfix_operators=[], prefix_operators=[], qualifier=rw, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=node)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=DatanodeDescriptor, sub_type=None))), label=None)])), SynchronizedStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=block, postfix_operators=[], prefix_operators=[], qualifier=rw, selectors=[]), name=block)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=BlockInfo, sub_type=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=priority, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=priority, postfix_operators=[], prefix_operators=[], qualifier=rw, selectors=[])), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=block, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getBlockInfo, postfix_operators=[], prefix_operators=[], qualifier=blocksMap, selectors=[], type_arguments=None), name=storedBlock)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=BlockInfo, sub_type=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=fileINode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=storedBlock, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), if_false=MethodInvocation(arguments=[], member=getINode, postfix_operators=[], prefix_operators=[], qualifier=storedBlock, selectors=[], type_arguments=None), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null))), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=fileINode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=block, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=priority, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=remove, postfix_operators=[], prefix_operators=[], qualifier=neededReplications, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=targets, postfix_operators=[], prefix_operators=[], qualifier=rw, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)), label=None), StatementExpression(expression=MemberReference(member=replIndex, postfix_operators=['--'], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=priority, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), label=None), ContinueStatement(goto=None, label=None)])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=requiredReplication, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=storedBlock, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getBlockReplication, postfix_operators=[], prefix_operators=[], qualifier=fileINode, selectors=[], type_arguments=None)), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=block, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=countNodes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=numReplicas)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=NumberReplicas, sub_type=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=numEffectiveReplicas, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=BinaryOperation(operandl=MethodInvocation(arguments=[], member=liveReplicas, postfix_operators=[], prefix_operators=[], qualifier=numReplicas, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[MemberReference(member=block, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getNumReplicas, postfix_operators=[], prefix_operators=[], qualifier=pendingReplications, selectors=[], type_arguments=None), operator=+)), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=numEffectiveReplicas, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=requiredReplication, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=>=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=block, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=priority, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=remove, postfix_operators=[], prefix_operators=[], qualifier=neededReplications, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MemberReference(member=replIndex, postfix_operators=['--'], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=priority, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=targets, postfix_operators=[], prefix_operators=[], qualifier=rw, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)), label=None), ContinueStatement(goto=None, label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=block, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=targets, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addBlockToBeReplicated, postfix_operators=[], prefix_operators=[], qualifier=rw.srcNode, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MemberReference(member=scheduledWork, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]), label=None), ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=incBlocksScheduled, postfix_operators=[], prefix_operators=[], qualifier=dn, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=targets, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=dn)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=DatanodeDescriptor, sub_type=None))), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=block, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=targets, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=pendingReplications, selectors=[], type_arguments=None), label=None), IfStatement(condition=MethodInvocation(arguments=[], member=isDebugEnabled, postfix_operators=[], prefix_operators=[], qualifier=NameNode.stateChangeLog, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="BLOCK* block "), operandr=MemberReference(member=block, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" is moved from neededReplications to pendingReplications"), operator=+)], member=debug, postfix_operators=[], prefix_operators=[], qualifier=NameNode.stateChangeLog, selectors=[], type_arguments=None), label=None)])), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=numEffectiveReplicas, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=targets, selectors=[]), operator=+), operandr=MemberReference(member=requiredReplication, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=>=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=block, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=priority, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=remove, postfix_operators=[], prefix_operators=[], qualifier=neededReplications, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MemberReference(member=replIndex, postfix_operators=['--'], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=priority, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), label=None)]))], label=None, lock=MemberReference(member=neededReplications, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), control=EnhancedForControl(iterable=MemberReference(member=work, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=rw)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ReplicationWork, sub_type=None))), label=None)], catches=None, finally_block=[StatementExpression(expression=MethodInvocation(arguments=[], member=writeUnlock, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], label=None, resources=None) call[.updateReplicationMetrics, parameter[member[.work]]] if[call[NameNode.stateChangeLog.isInfoEnabled, parameter[]]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=targets, postfix_operators=[], prefix_operators=[], qualifier=rw, selectors=[]), name=targets)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[None], name=DatanodeDescriptor, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=targets, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operandr=BinaryOperation(operandl=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=targets, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=!=), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="datanode(s)")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=StringBuffer, sub_type=None)), name=targetList)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=StringBuffer, sub_type=None)), ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=' ')], member=append, postfix_operators=[], prefix_operators=[], qualifier=targetList, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=targets, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=k, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MethodInvocation(arguments=[], member=getName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)])], member=append, postfix_operators=[], prefix_operators=[], qualifier=targetList, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=k, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=targets, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=k)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=k, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None), StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="BLOCK* ask "), operandr=MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=rw.srcNode, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" to replicate "), operator=+), operandr=MemberReference(member=block, postfix_operators=[], prefix_operators=[], qualifier=rw, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" to "), operator=+), operandr=MemberReference(member=targetList, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=info, postfix_operators=[], prefix_operators=[], qualifier=NameNode.stateChangeLog, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=work, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=rw)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ReplicationWork, sub_type=None))), label=None) else begin[{] None end[}] if[call[NameNode.stateChangeLog.isDebugEnabled, parameter[]]] begin[{] call[NameNode.stateChangeLog.debug, parameter[binary_operation[binary_operation[binary_operation[literal["BLOCK* neededReplications = "], +, call[neededReplications.size, parameter[]]], +, literal[" pendingReplications = "]], +, call[pendingReplications.size, parameter[]]]]] else begin[{] None end[}] return[member[.scheduledWork]] end[}] END[}]
Keyword[int] identifier[computeReplicationWorkForBlocks] operator[SEP] identifier[List] operator[<] identifier[List] operator[<] identifier[BlockInfo] operator[>] operator[>] identifier[blocksToReplicate] operator[SEP] { Keyword[int] identifier[requiredReplication] , identifier[numEffectiveReplicas] , identifier[priority] operator[SEP] identifier[List] operator[<] identifier[DatanodeDescriptor] operator[>] identifier[containingNodes] operator[SEP] identifier[DatanodeDescriptor] identifier[srcNode] operator[SEP] identifier[INodeFile] identifier[fileINode] operator[=] Other[null] operator[SEP] Keyword[int] identifier[scheduledWork] operator[=] Other[0] operator[SEP] identifier[List] operator[<] identifier[ReplicationWork] operator[>] identifier[work] operator[=] Keyword[new] identifier[LinkedList] operator[<] identifier[ReplicationWork] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[writeLock] operator[SEP] operator[SEP] operator[SEP] Keyword[try] { Keyword[synchronized] operator[SEP] identifier[neededReplications] operator[SEP] { Keyword[for] operator[SEP] identifier[priority] operator[=] Other[0] operator[SEP] identifier[priority] operator[<] identifier[blocksToReplicate] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] identifier[priority] operator[++] operator[SEP] { Keyword[for] operator[SEP] identifier[BlockInfo] identifier[block] operator[:] identifier[blocksToReplicate] operator[SEP] identifier[get] operator[SEP] identifier[priority] operator[SEP] operator[SEP] { identifier[BlockInfo] identifier[storedBlock] operator[=] identifier[blocksMap] operator[SEP] identifier[getBlockInfo] operator[SEP] identifier[block] operator[SEP] operator[SEP] identifier[fileINode] operator[=] operator[SEP] identifier[storedBlock] operator[==] Other[null] operator[SEP] operator[?] Other[null] operator[:] identifier[storedBlock] operator[SEP] identifier[getINode] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[fileINode] operator[==] Other[null] operator[SEP] { identifier[neededReplications] operator[SEP] identifier[remove] operator[SEP] identifier[block] , identifier[priority] operator[SEP] operator[SEP] identifier[replIndex] operator[SEP] identifier[priority] operator[SEP] operator[--] operator[SEP] Keyword[continue] operator[SEP] } identifier[requiredReplication] operator[=] identifier[fileINode] operator[SEP] identifier[getBlockReplication] operator[SEP] identifier[storedBlock] operator[SEP] operator[SEP] identifier[containingNodes] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[DatanodeDescriptor] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[NumberReplicas] identifier[numReplicas] operator[=] Keyword[new] identifier[NumberReplicas] operator[SEP] operator[SEP] operator[SEP] identifier[srcNode] operator[=] identifier[chooseSourceDatanode] operator[SEP] identifier[block] , identifier[containingNodes] , identifier[numReplicas] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[srcNode] operator[==] Other[null] operator[SEP] { Keyword[continue] operator[SEP] } identifier[numEffectiveReplicas] operator[=] identifier[numReplicas] operator[SEP] identifier[liveReplicas] operator[SEP] operator[SEP] operator[+] identifier[pendingReplications] operator[SEP] identifier[getNumReplicas] operator[SEP] identifier[block] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[numEffectiveReplicas] operator[>=] identifier[requiredReplication] operator[SEP] { identifier[neededReplications] operator[SEP] identifier[remove] operator[SEP] identifier[block] , identifier[priority] operator[SEP] operator[SEP] identifier[replIndex] operator[SEP] identifier[priority] operator[SEP] operator[--] operator[SEP] Keyword[continue] operator[SEP] } identifier[work] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[ReplicationWork] operator[SEP] identifier[block] , identifier[fileINode] , identifier[requiredReplication] operator[-] identifier[numEffectiveReplicas] , identifier[srcNode] , identifier[containingNodes] , identifier[priority] operator[SEP] operator[SEP] operator[SEP] } } } } Keyword[finally] { identifier[writeUnlock] operator[SEP] operator[SEP] operator[SEP] } Keyword[for] operator[SEP] identifier[ReplicationWork] identifier[rw] operator[:] identifier[work] operator[SEP] { identifier[DatanodeDescriptor] identifier[targets] operator[SEP] operator[SEP] operator[=] identifier[chooseTarget] operator[SEP] identifier[rw] operator[SEP] operator[SEP] identifier[rw] operator[SEP] identifier[targets] operator[=] identifier[targets] operator[SEP] } identifier[writeLock] operator[SEP] operator[SEP] operator[SEP] Keyword[try] { Keyword[for] operator[SEP] identifier[ReplicationWork] identifier[rw] operator[:] identifier[work] operator[SEP] { identifier[DatanodeDescriptor] operator[SEP] operator[SEP] identifier[targets] operator[=] identifier[rw] operator[SEP] identifier[targets] operator[SEP] Keyword[if] operator[SEP] identifier[targets] operator[==] Other[null] operator[||] identifier[targets] operator[SEP] identifier[length] operator[==] Other[0] operator[SEP] { identifier[rw] operator[SEP] identifier[targets] operator[=] Other[null] operator[SEP] Keyword[continue] operator[SEP] } Keyword[if] operator[SEP] identifier[targets] operator[SEP] identifier[length] operator[==] Other[1] operator[&&] operator[!] identifier[clusterMap] operator[SEP] identifier[isOnSameRack] operator[SEP] identifier[rw] operator[SEP] identifier[srcNode] , identifier[targets] operator[SEP] Other[0] operator[SEP] operator[SEP] operator[SEP] { Keyword[for] operator[SEP] identifier[DatanodeDescriptor] identifier[node] operator[:] identifier[rw] operator[SEP] identifier[containingNodes] operator[SEP] { Keyword[if] operator[SEP] identifier[node] operator[!=] identifier[rw] operator[SEP] identifier[srcNode] operator[&&] identifier[clusterMap] operator[SEP] identifier[isOnSameRack] operator[SEP] identifier[node] , identifier[targets] operator[SEP] Other[0] operator[SEP] operator[SEP] operator[&&] identifier[isGoodReplica] operator[SEP] identifier[node] , identifier[rw] operator[SEP] identifier[block] operator[SEP] operator[SEP] { identifier[rw] operator[SEP] identifier[srcNode] operator[=] identifier[node] operator[SEP] Keyword[break] operator[SEP] } } } Keyword[synchronized] operator[SEP] identifier[neededReplications] operator[SEP] { identifier[BlockInfo] identifier[block] operator[=] identifier[rw] operator[SEP] identifier[block] operator[SEP] identifier[priority] operator[=] identifier[rw] operator[SEP] identifier[priority] operator[SEP] identifier[BlockInfo] identifier[storedBlock] operator[=] identifier[blocksMap] operator[SEP] identifier[getBlockInfo] operator[SEP] identifier[block] operator[SEP] operator[SEP] identifier[fileINode] operator[=] operator[SEP] identifier[storedBlock] operator[==] Other[null] operator[SEP] operator[?] Other[null] operator[:] identifier[storedBlock] operator[SEP] identifier[getINode] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[fileINode] operator[==] Other[null] operator[SEP] { identifier[neededReplications] operator[SEP] identifier[remove] operator[SEP] identifier[block] , identifier[priority] operator[SEP] operator[SEP] identifier[rw] operator[SEP] identifier[targets] operator[=] Other[null] operator[SEP] identifier[replIndex] operator[SEP] identifier[priority] operator[SEP] operator[--] operator[SEP] Keyword[continue] operator[SEP] } identifier[requiredReplication] operator[=] identifier[fileINode] operator[SEP] identifier[getBlockReplication] operator[SEP] identifier[storedBlock] operator[SEP] operator[SEP] identifier[NumberReplicas] identifier[numReplicas] operator[=] identifier[countNodes] operator[SEP] identifier[block] operator[SEP] operator[SEP] identifier[numEffectiveReplicas] operator[=] identifier[numReplicas] operator[SEP] identifier[liveReplicas] operator[SEP] operator[SEP] operator[+] identifier[pendingReplications] operator[SEP] identifier[getNumReplicas] operator[SEP] identifier[block] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[numEffectiveReplicas] operator[>=] identifier[requiredReplication] operator[SEP] { identifier[neededReplications] operator[SEP] identifier[remove] operator[SEP] identifier[block] , identifier[priority] operator[SEP] operator[SEP] identifier[replIndex] operator[SEP] identifier[priority] operator[SEP] operator[--] operator[SEP] identifier[rw] operator[SEP] identifier[targets] operator[=] Other[null] operator[SEP] Keyword[continue] operator[SEP] } identifier[rw] operator[SEP] identifier[srcNode] operator[SEP] identifier[addBlockToBeReplicated] operator[SEP] identifier[block] , identifier[targets] operator[SEP] operator[SEP] identifier[scheduledWork] operator[++] operator[SEP] Keyword[for] operator[SEP] identifier[DatanodeDescriptor] identifier[dn] operator[:] identifier[targets] operator[SEP] { identifier[dn] operator[SEP] identifier[incBlocksScheduled] operator[SEP] operator[SEP] operator[SEP] } identifier[pendingReplications] operator[SEP] identifier[add] operator[SEP] identifier[block] , identifier[targets] operator[SEP] identifier[length] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[NameNode] operator[SEP] identifier[stateChangeLog] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] { identifier[NameNode] operator[SEP] identifier[stateChangeLog] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[+] identifier[block] operator[+] literal[String] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[numEffectiveReplicas] operator[+] identifier[targets] operator[SEP] identifier[length] operator[>=] identifier[requiredReplication] operator[SEP] { identifier[neededReplications] operator[SEP] identifier[remove] operator[SEP] identifier[block] , identifier[priority] operator[SEP] operator[SEP] identifier[replIndex] operator[SEP] identifier[priority] operator[SEP] operator[--] operator[SEP] } } } } Keyword[finally] { identifier[writeUnlock] operator[SEP] operator[SEP] operator[SEP] } identifier[updateReplicationMetrics] operator[SEP] identifier[work] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[NameNode] operator[SEP] identifier[stateChangeLog] operator[SEP] identifier[isInfoEnabled] operator[SEP] operator[SEP] operator[SEP] { Keyword[for] operator[SEP] identifier[ReplicationWork] identifier[rw] operator[:] identifier[work] operator[SEP] { identifier[DatanodeDescriptor] operator[SEP] operator[SEP] identifier[targets] operator[=] identifier[rw] operator[SEP] identifier[targets] operator[SEP] Keyword[if] operator[SEP] identifier[targets] operator[!=] Other[null] operator[&&] identifier[targets] operator[SEP] identifier[length] operator[!=] Other[0] operator[SEP] { identifier[StringBuffer] identifier[targetList] operator[=] Keyword[new] identifier[StringBuffer] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[k] operator[=] Other[0] operator[SEP] identifier[k] operator[<] identifier[targets] operator[SEP] identifier[length] operator[SEP] identifier[k] operator[++] operator[SEP] { identifier[targetList] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[targetList] operator[SEP] identifier[append] operator[SEP] identifier[targets] operator[SEP] identifier[k] operator[SEP] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[NameNode] operator[SEP] identifier[stateChangeLog] operator[SEP] identifier[info] operator[SEP] literal[String] operator[+] identifier[rw] operator[SEP] identifier[srcNode] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[rw] operator[SEP] identifier[block] operator[+] literal[String] operator[+] identifier[targetList] operator[SEP] operator[SEP] } } } Keyword[if] operator[SEP] identifier[NameNode] operator[SEP] identifier[stateChangeLog] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] { identifier[NameNode] operator[SEP] identifier[stateChangeLog] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[+] identifier[neededReplications] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[pendingReplications] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[scheduledWork] operator[SEP] }
@Override public void doFilter(ServletRequest req, ServletResponse resp, FilterChain chain) throws IOException, ServletException { //build compiler options //create compiler object //compile, get result //write result to output stream HttpServletRequest rq = (HttpServletRequest) req; HttpServletResponse rs = (HttpServletResponse) resp; String url = rq.getRequestURI(), lowerUrl = url.toLowerCase(); LOGGER.debug("Filtering URI: {}", url); boolean alreadyProcessed = req.getAttribute(PROCESSED_ATTR) != null; if (!alreadyProcessed && isURLAccepted(url) && isQueryStringAccepted(rq.getQueryString()) && isUserAgentAccepted(rq.getHeader(Constants.HTTP_USER_AGENT_HEADER)) && (lowerUrl.endsWith(EXT_JS) || lowerUrl.endsWith(EXT_JSON) || lowerUrl.endsWith(EXT_CSS))) { req.setAttribute(PROCESSED_ATTR, Boolean.TRUE); WebUtilitiesResponseWrapper wrapper = new WebUtilitiesResponseWrapper(rs); //Let the response be generated chain.doFilter(req, wrapper); wrapper.flushBuffer(); Writer out = resp.getWriter(); String mime = wrapper.getContentType(); if (!isMIMEAccepted(mime)) { out.write(wrapper.getContents()); out.flush(); LOGGER.trace("Not minifying. Mime {) not allowed.", mime); return; } ByteArrayInputStream is = new ByteArrayInputStream(wrapper.getBytes()); //work on generated response if (lowerUrl.endsWith(EXT_JS) || lowerUrl.endsWith(EXT_JSON) || (wrapper.getContentType() != null && (wrapper.getContentType().equals(MIME_JS) || wrapper.getContentType().equals(MIME_JSON)))) { Compiler closureCompiler = new Compiler(new BasicErrorManager() { @Override public void println(CheckLevel checkLevel, JSError jsError) { if (checkLevel.equals(CheckLevel.WARNING)) { LOGGER.warn("Warning. {}", jsError); } else if (checkLevel.equals(CheckLevel.ERROR)) { LOGGER.error("Error. {}", jsError); } } @Override protected void printSummary() { //!TODO implementation } }); LOGGER.trace("Compressing JS/JSON type"); CompilationLevel level = CompilationLevel.SIMPLE_OPTIMIZATIONS; CompilerOptions compilerOptions = buildCompilerOptionsFromConfig(filterConfig); level.setOptionsForCompilationLevel(compilerOptions); Result result = closureCompiler.compile(nullExtern, SourceFile.fromInputStream("NULL", is), compilerOptions); if (result.success) { out.append(closureCompiler.toSource()); } } else { LOGGER.trace("Not Compressing anything."); out.write(wrapper.getContents()); } out.flush(); } else { LOGGER.trace("Not minifying. URL/UserAgent not allowed."); chain.doFilter(req, resp); } }
class class_name[name] begin[{] method[doFilter, return_type[void], modifier[public], parameter[req, resp, chain]] begin[{] local_variable[type[HttpServletRequest], rq] local_variable[type[HttpServletResponse], rs] local_variable[type[String], url] call[LOGGER.debug, parameter[literal["Filtering URI: {}"], member[.url]]] local_variable[type[boolean], alreadyProcessed] if[binary_operation[binary_operation[binary_operation[binary_operation[member[.alreadyProcessed], &&, call[.isURLAccepted, parameter[member[.url]]]], &&, call[.isQueryStringAccepted, parameter[call[rq.getQueryString, parameter[]]]]], &&, call[.isUserAgentAccepted, parameter[call[rq.getHeader, parameter[member[Constants.HTTP_USER_AGENT_HEADER]]]]]], &&, binary_operation[binary_operation[call[lowerUrl.endsWith, parameter[member[.EXT_JS]]], ||, call[lowerUrl.endsWith, parameter[member[.EXT_JSON]]]], ||, call[lowerUrl.endsWith, parameter[member[.EXT_CSS]]]]]] begin[{] call[req.setAttribute, parameter[member[.PROCESSED_ATTR], member[Boolean.TRUE]]] local_variable[type[WebUtilitiesResponseWrapper], wrapper] call[chain.doFilter, parameter[member[.req], member[.wrapper]]] call[wrapper.flushBuffer, parameter[]] local_variable[type[Writer], out] local_variable[type[String], mime] if[call[.isMIMEAccepted, parameter[member[.mime]]]] begin[{] call[out.write, parameter[call[wrapper.getContents, parameter[]]]] call[out.flush, parameter[]] call[LOGGER.trace, parameter[literal["Not minifying. Mime {) not allowed."], member[.mime]]] return[None] else begin[{] None end[}] local_variable[type[ByteArrayInputStream], is] if[binary_operation[binary_operation[call[lowerUrl.endsWith, parameter[member[.EXT_JS]]], ||, call[lowerUrl.endsWith, parameter[member[.EXT_JSON]]]], ||, binary_operation[binary_operation[call[wrapper.getContentType, parameter[]], !=, literal[null]], &&, binary_operation[call[wrapper.getContentType, parameter[]], ||, call[wrapper.getContentType, parameter[]]]]]] begin[{] local_variable[type[Compiler], closureCompiler] call[LOGGER.trace, parameter[literal["Compressing JS/JSON type"]]] local_variable[type[CompilationLevel], level] local_variable[type[CompilerOptions], compilerOptions] call[level.setOptionsForCompilationLevel, parameter[member[.compilerOptions]]] local_variable[type[Result], result] if[member[result.success]] begin[{] call[out.append, parameter[call[closureCompiler.toSource, parameter[]]]] else begin[{] None end[}] else begin[{] call[LOGGER.trace, parameter[literal["Not Compressing anything."]]] call[out.write, parameter[call[wrapper.getContents, parameter[]]]] end[}] call[out.flush, parameter[]] else begin[{] call[LOGGER.trace, parameter[literal["Not minifying. URL/UserAgent not allowed."]]] call[chain.doFilter, parameter[member[.req], member[.resp]]] end[}] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[doFilter] operator[SEP] identifier[ServletRequest] identifier[req] , identifier[ServletResponse] identifier[resp] , identifier[FilterChain] identifier[chain] operator[SEP] Keyword[throws] identifier[IOException] , identifier[ServletException] { identifier[HttpServletRequest] identifier[rq] operator[=] operator[SEP] identifier[HttpServletRequest] operator[SEP] identifier[req] operator[SEP] identifier[HttpServletResponse] identifier[rs] operator[=] operator[SEP] identifier[HttpServletResponse] operator[SEP] identifier[resp] operator[SEP] identifier[String] identifier[url] operator[=] identifier[rq] operator[SEP] identifier[getRequestURI] operator[SEP] operator[SEP] , identifier[lowerUrl] operator[=] identifier[url] operator[SEP] identifier[toLowerCase] operator[SEP] operator[SEP] operator[SEP] identifier[LOGGER] operator[SEP] identifier[debug] operator[SEP] literal[String] , identifier[url] operator[SEP] operator[SEP] Keyword[boolean] identifier[alreadyProcessed] operator[=] identifier[req] operator[SEP] identifier[getAttribute] operator[SEP] identifier[PROCESSED_ATTR] operator[SEP] operator[!=] Other[null] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[alreadyProcessed] operator[&&] identifier[isURLAccepted] operator[SEP] identifier[url] operator[SEP] operator[&&] identifier[isQueryStringAccepted] operator[SEP] identifier[rq] operator[SEP] identifier[getQueryString] operator[SEP] operator[SEP] operator[SEP] operator[&&] identifier[isUserAgentAccepted] operator[SEP] identifier[rq] operator[SEP] identifier[getHeader] operator[SEP] identifier[Constants] operator[SEP] identifier[HTTP_USER_AGENT_HEADER] operator[SEP] operator[SEP] operator[&&] operator[SEP] identifier[lowerUrl] operator[SEP] identifier[endsWith] operator[SEP] identifier[EXT_JS] operator[SEP] operator[||] identifier[lowerUrl] operator[SEP] identifier[endsWith] operator[SEP] identifier[EXT_JSON] operator[SEP] operator[||] identifier[lowerUrl] operator[SEP] identifier[endsWith] operator[SEP] identifier[EXT_CSS] operator[SEP] operator[SEP] operator[SEP] { identifier[req] operator[SEP] identifier[setAttribute] operator[SEP] identifier[PROCESSED_ATTR] , identifier[Boolean] operator[SEP] identifier[TRUE] operator[SEP] operator[SEP] identifier[WebUtilitiesResponseWrapper] identifier[wrapper] operator[=] Keyword[new] identifier[WebUtilitiesResponseWrapper] operator[SEP] identifier[rs] operator[SEP] operator[SEP] identifier[chain] operator[SEP] identifier[doFilter] operator[SEP] identifier[req] , identifier[wrapper] operator[SEP] operator[SEP] identifier[wrapper] operator[SEP] identifier[flushBuffer] operator[SEP] operator[SEP] operator[SEP] identifier[Writer] identifier[out] operator[=] identifier[resp] operator[SEP] identifier[getWriter] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[mime] operator[=] identifier[wrapper] operator[SEP] identifier[getContentType] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[isMIMEAccepted] operator[SEP] identifier[mime] operator[SEP] operator[SEP] { identifier[out] operator[SEP] identifier[write] operator[SEP] identifier[wrapper] operator[SEP] identifier[getContents] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[out] operator[SEP] identifier[flush] operator[SEP] operator[SEP] operator[SEP] identifier[LOGGER] operator[SEP] identifier[trace] operator[SEP] literal[String] , identifier[mime] operator[SEP] operator[SEP] Keyword[return] operator[SEP] } identifier[ByteArrayInputStream] identifier[is] operator[=] Keyword[new] identifier[ByteArrayInputStream] operator[SEP] identifier[wrapper] operator[SEP] identifier[getBytes] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[lowerUrl] operator[SEP] identifier[endsWith] operator[SEP] identifier[EXT_JS] operator[SEP] operator[||] identifier[lowerUrl] operator[SEP] identifier[endsWith] operator[SEP] identifier[EXT_JSON] operator[SEP] operator[||] operator[SEP] identifier[wrapper] operator[SEP] identifier[getContentType] operator[SEP] operator[SEP] operator[!=] Other[null] operator[&&] operator[SEP] identifier[wrapper] operator[SEP] identifier[getContentType] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[MIME_JS] operator[SEP] operator[||] identifier[wrapper] operator[SEP] identifier[getContentType] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[MIME_JSON] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { identifier[Compiler] identifier[closureCompiler] operator[=] Keyword[new] identifier[Compiler] operator[SEP] Keyword[new] identifier[BasicErrorManager] operator[SEP] operator[SEP] { annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[println] operator[SEP] identifier[CheckLevel] identifier[checkLevel] , identifier[JSError] identifier[jsError] operator[SEP] { Keyword[if] operator[SEP] identifier[checkLevel] operator[SEP] identifier[equals] operator[SEP] identifier[CheckLevel] operator[SEP] identifier[WARNING] operator[SEP] operator[SEP] { identifier[LOGGER] operator[SEP] identifier[warn] operator[SEP] literal[String] , identifier[jsError] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[checkLevel] operator[SEP] identifier[equals] operator[SEP] identifier[CheckLevel] operator[SEP] identifier[ERROR] operator[SEP] operator[SEP] { identifier[LOGGER] operator[SEP] identifier[error] operator[SEP] literal[String] , identifier[jsError] operator[SEP] operator[SEP] } } annotation[@] identifier[Override] Keyword[protected] Keyword[void] identifier[printSummary] operator[SEP] operator[SEP] { } } operator[SEP] operator[SEP] identifier[LOGGER] operator[SEP] identifier[trace] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[CompilationLevel] identifier[level] operator[=] identifier[CompilationLevel] operator[SEP] identifier[SIMPLE_OPTIMIZATIONS] operator[SEP] identifier[CompilerOptions] identifier[compilerOptions] operator[=] identifier[buildCompilerOptionsFromConfig] operator[SEP] identifier[filterConfig] operator[SEP] operator[SEP] identifier[level] operator[SEP] identifier[setOptionsForCompilationLevel] operator[SEP] identifier[compilerOptions] operator[SEP] operator[SEP] identifier[Result] identifier[result] operator[=] identifier[closureCompiler] operator[SEP] identifier[compile] operator[SEP] identifier[nullExtern] , identifier[SourceFile] operator[SEP] identifier[fromInputStream] operator[SEP] literal[String] , identifier[is] operator[SEP] , identifier[compilerOptions] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[result] operator[SEP] identifier[success] operator[SEP] { identifier[out] operator[SEP] identifier[append] operator[SEP] identifier[closureCompiler] operator[SEP] identifier[toSource] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } Keyword[else] { identifier[LOGGER] operator[SEP] identifier[trace] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[out] operator[SEP] identifier[write] operator[SEP] identifier[wrapper] operator[SEP] identifier[getContents] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[out] operator[SEP] identifier[flush] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[LOGGER] operator[SEP] identifier[trace] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[chain] operator[SEP] identifier[doFilter] operator[SEP] identifier[req] , identifier[resp] operator[SEP] operator[SEP] } }
private void setUserGroupNames(String userName, String[] groupNames) { if (userName==null || userName.length()==0 || groupNames== null || groupNames.length==0) { throw new IllegalArgumentException( "Parameters should not be null or an empty string/array"); } for (int i=0; i<groupNames.length; i++) { if(groupNames[i] == null || groupNames[i].length() == 0) { throw new IllegalArgumentException("A null group name at index " + i); } } this.userName = userName; this.groupNames = groupNames; }
class class_name[name] begin[{] method[setUserGroupNames, return_type[void], modifier[private], parameter[userName, groupNames]] begin[{] if[binary_operation[binary_operation[binary_operation[binary_operation[member[.userName], ==, literal[null]], ||, binary_operation[call[userName.length, parameter[]], ==, literal[0]]], ||, binary_operation[member[.groupNames], ==, literal[null]]], ||, binary_operation[member[groupNames.length], ==, literal[0]]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Parameters should not be null or an empty string/array")], 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[}] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=groupNames, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), operandr=BinaryOperation(operandl=MemberReference(member=groupNames, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MethodInvocation(arguments=[], member=length, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator===), operator=||), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="A null group name at index "), operandr=MemberReference(member=i, 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)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=groupNames, 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) assign[THIS[member[None.userName]], member[.userName]] assign[THIS[member[None.groupNames]], member[.groupNames]] end[}] END[}]
Keyword[private] Keyword[void] identifier[setUserGroupNames] operator[SEP] identifier[String] identifier[userName] , identifier[String] operator[SEP] operator[SEP] identifier[groupNames] operator[SEP] { Keyword[if] operator[SEP] identifier[userName] operator[==] Other[null] operator[||] identifier[userName] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[==] Other[0] operator[||] identifier[groupNames] operator[==] Other[null] operator[||] identifier[groupNames] operator[SEP] identifier[length] operator[==] Other[0] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[groupNames] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] { Keyword[if] operator[SEP] identifier[groupNames] operator[SEP] identifier[i] operator[SEP] operator[==] Other[null] operator[||] identifier[groupNames] operator[SEP] identifier[i] operator[SEP] 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[i] operator[SEP] operator[SEP] } } Keyword[this] operator[SEP] identifier[userName] operator[=] identifier[userName] operator[SEP] Keyword[this] operator[SEP] identifier[groupNames] operator[=] identifier[groupNames] operator[SEP] }
public void marshall(CreateClusterRequest createClusterRequest, ProtocolMarshaller protocolMarshaller) { if (createClusterRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(createClusterRequest.getSubnetIds(), SUBNETIDS_BINDING); protocolMarshaller.marshall(createClusterRequest.getHsmType(), HSMTYPE_BINDING); protocolMarshaller.marshall(createClusterRequest.getSourceBackupId(), SOURCEBACKUPID_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[createClusterRequest, protocolMarshaller]] begin[{] if[binary_operation[member[.createClusterRequest], ==, 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=getSubnetIds, postfix_operators=[], prefix_operators=[], qualifier=createClusterRequest, selectors=[], type_arguments=None), MemberReference(member=SUBNETIDS_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=getHsmType, postfix_operators=[], prefix_operators=[], qualifier=createClusterRequest, selectors=[], type_arguments=None), MemberReference(member=HSMTYPE_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=getSourceBackupId, postfix_operators=[], prefix_operators=[], qualifier=createClusterRequest, selectors=[], type_arguments=None), MemberReference(member=SOURCEBACKUPID_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[CreateClusterRequest] identifier[createClusterRequest] , identifier[ProtocolMarshaller] identifier[protocolMarshaller] operator[SEP] { Keyword[if] operator[SEP] identifier[createClusterRequest] 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[createClusterRequest] operator[SEP] identifier[getSubnetIds] operator[SEP] operator[SEP] , identifier[SUBNETIDS_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[createClusterRequest] operator[SEP] identifier[getHsmType] operator[SEP] operator[SEP] , identifier[HSMTYPE_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[createClusterRequest] operator[SEP] identifier[getSourceBackupId] operator[SEP] operator[SEP] , identifier[SOURCEBACKUPID_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] } }
private String prepareEkstaziOptions() { return "force.all=" + getForceall() + ",force.failing=" + getForcefailing() + "," + getRootDirOption() + (getXargs() == null || getXargs().equals("") ? "" : "," + getXargs()); }
class class_name[name] begin[{] method[prepareEkstaziOptions, return_type[type[String]], modifier[private], parameter[]] begin[{] return[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[literal["force.all="], +, call[.getForceall, parameter[]]], +, literal[",force.failing="]], +, call[.getForcefailing, parameter[]]], +, literal[","]], +, call[.getRootDirOption, parameter[]]], +, TernaryExpression(condition=BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getXargs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), operandr=MethodInvocation(arguments=[], member=getXargs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="")], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operator=||), if_false=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=","), operandr=MethodInvocation(arguments=[], member=getXargs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), operator=+), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=""))]] end[}] END[}]
Keyword[private] identifier[String] identifier[prepareEkstaziOptions] operator[SEP] operator[SEP] { Keyword[return] literal[String] operator[+] identifier[getForceall] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[getForcefailing] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[getRootDirOption] operator[SEP] operator[SEP] operator[+] operator[SEP] identifier[getXargs] operator[SEP] operator[SEP] operator[==] Other[null] operator[||] identifier[getXargs] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[?] literal[String] operator[:] literal[String] operator[+] identifier[getXargs] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
@SuppressWarnings("unchecked") static <T> T getAttribute(ObjectName name, String attribute) throws JMException { return (T) MBEAN_SERVER.getAttribute(name, attribute); }
class class_name[name] begin[{] method[getAttribute, return_type[type[T]], modifier[static], parameter[name, attribute]] begin[{] return[Cast(expression=MethodInvocation(arguments=[MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=attribute, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getAttribute, postfix_operators=[], prefix_operators=[], qualifier=MBEAN_SERVER, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None))] end[}] END[}]
annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] Keyword[static] operator[<] identifier[T] operator[>] identifier[T] identifier[getAttribute] operator[SEP] identifier[ObjectName] identifier[name] , identifier[String] identifier[attribute] operator[SEP] Keyword[throws] identifier[JMException] { Keyword[return] operator[SEP] identifier[T] operator[SEP] identifier[MBEAN_SERVER] operator[SEP] identifier[getAttribute] operator[SEP] identifier[name] , identifier[attribute] operator[SEP] operator[SEP] }
private void fillCanComment(JsonObject summary) { if (summary != null && summary.get("can_comment") != null) { canComment = summary.get("can_comment").asBoolean(); } if (canComment == null && openGraphCanComment != null) { canComment = openGraphCanComment; } }
class class_name[name] begin[{] method[fillCanComment, return_type[void], modifier[private], parameter[summary]] begin[{] if[binary_operation[binary_operation[member[.summary], !=, literal[null]], &&, binary_operation[call[summary.get, parameter[literal["can_comment"]]], !=, literal[null]]]] begin[{] assign[member[.canComment], call[summary.get, parameter[literal["can_comment"]]]] else begin[{] None end[}] if[binary_operation[binary_operation[member[.canComment], ==, literal[null]], &&, binary_operation[member[.openGraphCanComment], !=, literal[null]]]] begin[{] assign[member[.canComment], member[.openGraphCanComment]] else begin[{] None end[}] end[}] END[}]
Keyword[private] Keyword[void] identifier[fillCanComment] operator[SEP] identifier[JsonObject] identifier[summary] operator[SEP] { Keyword[if] operator[SEP] identifier[summary] operator[!=] Other[null] operator[&&] identifier[summary] operator[SEP] identifier[get] operator[SEP] literal[String] operator[SEP] operator[!=] Other[null] operator[SEP] { identifier[canComment] operator[=] identifier[summary] operator[SEP] identifier[get] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[asBoolean] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[canComment] operator[==] Other[null] operator[&&] identifier[openGraphCanComment] operator[!=] Other[null] operator[SEP] { identifier[canComment] operator[=] identifier[openGraphCanComment] operator[SEP] } }
protected void sendInstallRequest(RaftMemberContext member, InstallRequest request) { // Start the install to the member. member.startInstall(); long timestamp = System.currentTimeMillis(); log.trace("Sending {} to {}", request, member.getMember().memberId()); raft.getProtocol().install(member.getMember().memberId(), request).whenCompleteAsync((response, error) -> { // Complete the install to the member. member.completeInstall(); if (open) { if (error == null) { log.trace("Received {} from {}", response, member.getMember().memberId()); handleInstallResponse(member, request, response, timestamp); } else { log.warn("Failed to install {}", member.getMember().memberId()); // Trigger reactions to the install response failure. handleInstallResponseFailure(member, request, error); } } }, raft.getThreadContext()); }
class class_name[name] begin[{] method[sendInstallRequest, return_type[void], modifier[protected], parameter[member, request]] begin[{] call[member.startInstall, parameter[]] local_variable[type[long], timestamp] call[log.trace, parameter[literal["Sending {} to {}"], member[.request], call[member.getMember, parameter[]]]] call[raft.getProtocol, parameter[]] end[}] END[}]
Keyword[protected] Keyword[void] identifier[sendInstallRequest] operator[SEP] identifier[RaftMemberContext] identifier[member] , identifier[InstallRequest] identifier[request] operator[SEP] { identifier[member] operator[SEP] identifier[startInstall] operator[SEP] operator[SEP] operator[SEP] Keyword[long] identifier[timestamp] operator[=] identifier[System] operator[SEP] identifier[currentTimeMillis] operator[SEP] operator[SEP] operator[SEP] identifier[log] operator[SEP] identifier[trace] operator[SEP] literal[String] , identifier[request] , identifier[member] operator[SEP] identifier[getMember] operator[SEP] operator[SEP] operator[SEP] identifier[memberId] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[raft] operator[SEP] identifier[getProtocol] operator[SEP] operator[SEP] operator[SEP] identifier[install] operator[SEP] identifier[member] operator[SEP] identifier[getMember] operator[SEP] operator[SEP] operator[SEP] identifier[memberId] operator[SEP] operator[SEP] , identifier[request] operator[SEP] operator[SEP] identifier[whenCompleteAsync] operator[SEP] operator[SEP] identifier[response] , identifier[error] operator[SEP] operator[->] { identifier[member] operator[SEP] identifier[completeInstall] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[open] operator[SEP] { Keyword[if] operator[SEP] identifier[error] operator[==] Other[null] operator[SEP] { identifier[log] operator[SEP] identifier[trace] operator[SEP] literal[String] , identifier[response] , identifier[member] operator[SEP] identifier[getMember] operator[SEP] operator[SEP] operator[SEP] identifier[memberId] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[handleInstallResponse] operator[SEP] identifier[member] , identifier[request] , identifier[response] , identifier[timestamp] operator[SEP] operator[SEP] } Keyword[else] { identifier[log] operator[SEP] identifier[warn] operator[SEP] literal[String] , identifier[member] operator[SEP] identifier[getMember] operator[SEP] operator[SEP] operator[SEP] identifier[memberId] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[handleInstallResponseFailure] operator[SEP] identifier[member] , identifier[request] , identifier[error] operator[SEP] operator[SEP] } } } , identifier[raft] operator[SEP] identifier[getThreadContext] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
@Override public void destroy() throws Exception { for (final InstanceHolder instanceHolder : this.instances.values()) { if (instanceHolder.destructionCallback != null) { try { instanceHolder.destructionCallback.run(); } catch (Exception e) { this.logger.warn( "Destruction callback for bean named '" + instanceHolder.name + "' failed.", e); } } } this.instances.clear(); }
class class_name[name] begin[{] method[destroy, return_type[void], modifier[public], parameter[]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=destructionCallback, postfix_operators=[], prefix_operators=[], qualifier=instanceHolder, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=run, postfix_operators=[], prefix_operators=[], qualifier=instanceHolder.destructionCallback, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=logger, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Destruction callback for bean named '"), operandr=MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=instanceHolder, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="' failed."), operator=+), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=warn, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None)]))]), control=EnhancedForControl(iterable=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=instances, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[], member=values, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=instanceHolder)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=InstanceHolder, sub_type=None))), label=None) THIS[member[None.instances]call[None.clear, parameter[]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[destroy] operator[SEP] operator[SEP] Keyword[throws] identifier[Exception] { Keyword[for] operator[SEP] Keyword[final] identifier[InstanceHolder] identifier[instanceHolder] operator[:] Keyword[this] operator[SEP] identifier[instances] operator[SEP] identifier[values] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[instanceHolder] operator[SEP] identifier[destructionCallback] operator[!=] Other[null] operator[SEP] { Keyword[try] { identifier[instanceHolder] operator[SEP] identifier[destructionCallback] operator[SEP] identifier[run] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { Keyword[this] operator[SEP] identifier[logger] operator[SEP] identifier[warn] operator[SEP] literal[String] operator[+] identifier[instanceHolder] operator[SEP] identifier[name] operator[+] literal[String] , identifier[e] operator[SEP] operator[SEP] } } } Keyword[this] operator[SEP] identifier[instances] operator[SEP] identifier[clear] operator[SEP] operator[SEP] operator[SEP] }
@SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { colorChooser = new javax.swing.JColorChooser(); okButton = new javax.swing.JButton(); cancelButton = new javax.swing.JButton(); setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); okButton.setText("OK"); okButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { okButtonActionPerformed(evt); } }); cancelButton.setText("Cancel"); cancelButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { cancelButtonActionPerformed(evt); } }); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addContainerGap() .addComponent(colorChooser, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addGroup(layout.createSequentialGroup() .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(cancelButton, javax.swing.GroupLayout.PREFERRED_SIZE, 96, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(okButton, javax.swing.GroupLayout.PREFERRED_SIZE, 106, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap()) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addContainerGap() .addComponent(colorChooser, javax.swing.GroupLayout.PREFERRED_SIZE, 370, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(cancelButton) .addComponent(okButton)) .addContainerGap()) ); pack(); }
class class_name[name] begin[{] method[initComponents, return_type[void], modifier[private], parameter[]] begin[{] assign[member[.colorChooser], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=javax, sub_type=ReferenceType(arguments=None, dimensions=None, name=swing, sub_type=ReferenceType(arguments=None, dimensions=None, name=JColorChooser, sub_type=None))))] assign[member[.okButton], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=javax, sub_type=ReferenceType(arguments=None, dimensions=None, name=swing, sub_type=ReferenceType(arguments=None, dimensions=None, name=JButton, sub_type=None))))] assign[member[.cancelButton], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=javax, sub_type=ReferenceType(arguments=None, dimensions=None, name=swing, sub_type=ReferenceType(arguments=None, dimensions=None, name=JButton, sub_type=None))))] call[.setDefaultCloseOperation, parameter[member[javax.swing.WindowConstants.DISPOSE_ON_CLOSE]]] call[okButton.setText, parameter[literal["OK"]]] call[okButton.addActionListener, parameter[ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[], body=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=evt, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=okButtonActionPerformed, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=actionPerformed, parameters=[FormalParameter(annotations=[], modifiers=set(), name=evt, type=ReferenceType(arguments=None, dimensions=[], name=java, sub_type=ReferenceType(arguments=None, dimensions=None, name=awt, sub_type=ReferenceType(arguments=None, dimensions=None, name=event, sub_type=ReferenceType(arguments=None, dimensions=None, name=ActionEvent, sub_type=None)))), varargs=False)], return_type=None, throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=java, sub_type=ReferenceType(arguments=None, dimensions=None, name=awt, sub_type=ReferenceType(arguments=None, dimensions=None, name=event, sub_type=ReferenceType(arguments=None, dimensions=None, name=ActionListener, sub_type=None)))))]] call[cancelButton.setText, parameter[literal["Cancel"]]] call[cancelButton.addActionListener, parameter[ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[], body=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=evt, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=cancelButtonActionPerformed, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=actionPerformed, parameters=[FormalParameter(annotations=[], modifiers=set(), name=evt, type=ReferenceType(arguments=None, dimensions=[], name=java, sub_type=ReferenceType(arguments=None, dimensions=None, name=awt, sub_type=ReferenceType(arguments=None, dimensions=None, name=event, sub_type=ReferenceType(arguments=None, dimensions=None, name=ActionEvent, sub_type=None)))), varargs=False)], return_type=None, throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=java, sub_type=ReferenceType(arguments=None, dimensions=None, name=awt, sub_type=ReferenceType(arguments=None, dimensions=None, name=event, sub_type=ReferenceType(arguments=None, dimensions=None, name=ActionListener, sub_type=None)))))]] local_variable[type[javax], layout] call[.getContentPane, parameter[]] call[layout.setHorizontalGroup, parameter[call[layout.createParallelGroup, parameter[member[javax.swing.GroupLayout.Alignment.LEADING]]]]] call[layout.setVerticalGroup, parameter[call[layout.createParallelGroup, parameter[member[javax.swing.GroupLayout.Alignment.LEADING]]]]] call[.pack, parameter[]] end[}] END[}]
annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] Keyword[private] Keyword[void] identifier[initComponents] operator[SEP] operator[SEP] { identifier[colorChooser] operator[=] Keyword[new] identifier[javax] operator[SEP] identifier[swing] operator[SEP] identifier[JColorChooser] operator[SEP] operator[SEP] operator[SEP] identifier[okButton] operator[=] Keyword[new] identifier[javax] operator[SEP] identifier[swing] operator[SEP] identifier[JButton] operator[SEP] operator[SEP] operator[SEP] identifier[cancelButton] operator[=] Keyword[new] identifier[javax] operator[SEP] identifier[swing] operator[SEP] identifier[JButton] operator[SEP] operator[SEP] operator[SEP] identifier[setDefaultCloseOperation] operator[SEP] identifier[javax] operator[SEP] identifier[swing] operator[SEP] identifier[WindowConstants] operator[SEP] identifier[DISPOSE_ON_CLOSE] operator[SEP] operator[SEP] identifier[okButton] operator[SEP] identifier[setText] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[okButton] operator[SEP] identifier[addActionListener] operator[SEP] Keyword[new] identifier[java] operator[SEP] identifier[awt] operator[SEP] identifier[event] operator[SEP] identifier[ActionListener] operator[SEP] operator[SEP] { Keyword[public] Keyword[void] identifier[actionPerformed] operator[SEP] identifier[java] operator[SEP] identifier[awt] operator[SEP] identifier[event] operator[SEP] identifier[ActionEvent] identifier[evt] operator[SEP] { identifier[okButtonActionPerformed] operator[SEP] identifier[evt] operator[SEP] operator[SEP] } } operator[SEP] operator[SEP] identifier[cancelButton] operator[SEP] identifier[setText] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[cancelButton] operator[SEP] identifier[addActionListener] operator[SEP] Keyword[new] identifier[java] operator[SEP] identifier[awt] operator[SEP] identifier[event] operator[SEP] identifier[ActionListener] operator[SEP] operator[SEP] { Keyword[public] Keyword[void] identifier[actionPerformed] operator[SEP] identifier[java] operator[SEP] identifier[awt] operator[SEP] identifier[event] operator[SEP] identifier[ActionEvent] identifier[evt] operator[SEP] { identifier[cancelButtonActionPerformed] operator[SEP] identifier[evt] operator[SEP] operator[SEP] } } operator[SEP] operator[SEP] identifier[javax] operator[SEP] identifier[swing] operator[SEP] identifier[GroupLayout] identifier[layout] operator[=] Keyword[new] identifier[javax] operator[SEP] identifier[swing] operator[SEP] identifier[GroupLayout] operator[SEP] identifier[getContentPane] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[getContentPane] operator[SEP] operator[SEP] operator[SEP] identifier[setLayout] operator[SEP] identifier[layout] operator[SEP] operator[SEP] identifier[layout] operator[SEP] identifier[setHorizontalGroup] operator[SEP] identifier[layout] operator[SEP] identifier[createParallelGroup] operator[SEP] identifier[javax] operator[SEP] identifier[swing] operator[SEP] identifier[GroupLayout] operator[SEP] identifier[Alignment] operator[SEP] identifier[LEADING] operator[SEP] operator[SEP] identifier[addGroup] operator[SEP] identifier[layout] operator[SEP] identifier[createSequentialGroup] operator[SEP] operator[SEP] operator[SEP] identifier[addContainerGap] operator[SEP] operator[SEP] operator[SEP] identifier[addComponent] operator[SEP] identifier[colorChooser] , identifier[javax] operator[SEP] identifier[swing] operator[SEP] identifier[GroupLayout] operator[SEP] identifier[PREFERRED_SIZE] , identifier[javax] operator[SEP] identifier[swing] operator[SEP] identifier[GroupLayout] operator[SEP] identifier[DEFAULT_SIZE] , identifier[javax] operator[SEP] identifier[swing] operator[SEP] identifier[GroupLayout] operator[SEP] identifier[PREFERRED_SIZE] operator[SEP] operator[SEP] identifier[addContainerGap] operator[SEP] identifier[javax] operator[SEP] identifier[swing] operator[SEP] identifier[GroupLayout] operator[SEP] identifier[DEFAULT_SIZE] , identifier[Short] operator[SEP] identifier[MAX_VALUE] operator[SEP] operator[SEP] operator[SEP] identifier[addGroup] operator[SEP] identifier[layout] operator[SEP] identifier[createSequentialGroup] operator[SEP] operator[SEP] operator[SEP] identifier[addContainerGap] operator[SEP] identifier[javax] operator[SEP] identifier[swing] operator[SEP] identifier[GroupLayout] operator[SEP] identifier[DEFAULT_SIZE] , identifier[Short] operator[SEP] identifier[MAX_VALUE] operator[SEP] operator[SEP] identifier[addComponent] operator[SEP] identifier[cancelButton] , identifier[javax] operator[SEP] identifier[swing] operator[SEP] identifier[GroupLayout] operator[SEP] identifier[PREFERRED_SIZE] , Other[96] , identifier[javax] operator[SEP] identifier[swing] operator[SEP] identifier[GroupLayout] operator[SEP] identifier[PREFERRED_SIZE] operator[SEP] operator[SEP] identifier[addPreferredGap] operator[SEP] identifier[javax] operator[SEP] identifier[swing] operator[SEP] identifier[LayoutStyle] operator[SEP] identifier[ComponentPlacement] operator[SEP] identifier[RELATED] operator[SEP] operator[SEP] identifier[addComponent] operator[SEP] identifier[okButton] , identifier[javax] operator[SEP] identifier[swing] operator[SEP] identifier[GroupLayout] operator[SEP] identifier[PREFERRED_SIZE] , Other[106] , identifier[javax] operator[SEP] identifier[swing] operator[SEP] identifier[GroupLayout] operator[SEP] identifier[PREFERRED_SIZE] operator[SEP] operator[SEP] identifier[addContainerGap] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[layout] operator[SEP] identifier[setVerticalGroup] operator[SEP] identifier[layout] operator[SEP] identifier[createParallelGroup] operator[SEP] identifier[javax] operator[SEP] identifier[swing] operator[SEP] identifier[GroupLayout] operator[SEP] identifier[Alignment] operator[SEP] identifier[LEADING] operator[SEP] operator[SEP] identifier[addGroup] operator[SEP] identifier[layout] operator[SEP] identifier[createSequentialGroup] operator[SEP] operator[SEP] operator[SEP] identifier[addContainerGap] operator[SEP] operator[SEP] operator[SEP] identifier[addComponent] operator[SEP] identifier[colorChooser] , identifier[javax] operator[SEP] identifier[swing] operator[SEP] identifier[GroupLayout] operator[SEP] identifier[PREFERRED_SIZE] , Other[370] , identifier[javax] operator[SEP] identifier[swing] operator[SEP] identifier[GroupLayout] operator[SEP] identifier[PREFERRED_SIZE] operator[SEP] operator[SEP] identifier[addPreferredGap] operator[SEP] identifier[javax] operator[SEP] identifier[swing] operator[SEP] identifier[LayoutStyle] operator[SEP] identifier[ComponentPlacement] operator[SEP] identifier[UNRELATED] operator[SEP] operator[SEP] identifier[addGroup] operator[SEP] identifier[layout] operator[SEP] identifier[createParallelGroup] operator[SEP] identifier[javax] operator[SEP] identifier[swing] operator[SEP] identifier[GroupLayout] operator[SEP] identifier[Alignment] operator[SEP] identifier[BASELINE] operator[SEP] operator[SEP] identifier[addComponent] operator[SEP] identifier[cancelButton] operator[SEP] operator[SEP] identifier[addComponent] operator[SEP] identifier[okButton] operator[SEP] operator[SEP] operator[SEP] identifier[addContainerGap] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[pack] operator[SEP] operator[SEP] operator[SEP] }
@Override void encode(byte[] in, int inPos, int inAvail) { if (eof) { return; } // inAvail < 0 is how we're informed of EOF in the underlying data we're // encoding. if (inAvail < 0) { eof = true; if (0 == modulus && lineLength == 0) { return; // no leftovers to process and not using chunking } ensureBufferSize(encodeSize); int savedPos = pos; switch (modulus) { // 0-2 case 1: // 8 bits = 6 + 2 buffer[pos++] = encodeTable[(bitWorkArea >> 2) & MASK_6BITS]; // top 6 bits buffer[pos++] = encodeTable[(bitWorkArea << 4) & MASK_6BITS]; // remaining 2 // URL-SAFE skips the padding to further reduce size. if (encodeTable == STANDARD_ENCODE_TABLE) { buffer[pos++] = PAD; buffer[pos++] = PAD; } break; case 2: // 16 bits = 6 + 6 + 4 buffer[pos++] = encodeTable[(bitWorkArea >> 10) & MASK_6BITS]; buffer[pos++] = encodeTable[(bitWorkArea >> 4) & MASK_6BITS]; buffer[pos++] = encodeTable[(bitWorkArea << 2) & MASK_6BITS]; // URL-SAFE skips the padding to further reduce size. if (encodeTable == STANDARD_ENCODE_TABLE) { buffer[pos++] = PAD; } break; } currentLinePos += pos - savedPos; // keep track of current line position // if currentPos == 0 we are at the start of a line, so don't add CRLF if (lineLength > 0 && currentLinePos > 0) { System.arraycopy(lineSeparator, 0, buffer, pos, lineSeparator.length); pos += lineSeparator.length; } } else { for (int i = 0; i < inAvail; i++) { ensureBufferSize(encodeSize); modulus = (modulus + 1) % BYTES_PER_UNENCODED_BLOCK; int b = in[inPos++]; if (b < 0) { b += 256; } bitWorkArea = (bitWorkArea << 8) + b; // BITS_PER_BYTE if (0 == modulus) { // 3 bytes = 24 bits = 4 * 6 bits to extract buffer[pos++] = encodeTable[(bitWorkArea >> 18) & MASK_6BITS]; buffer[pos++] = encodeTable[(bitWorkArea >> 12) & MASK_6BITS]; buffer[pos++] = encodeTable[(bitWorkArea >> 6) & MASK_6BITS]; buffer[pos++] = encodeTable[bitWorkArea & MASK_6BITS]; currentLinePos += BYTES_PER_ENCODED_BLOCK; if (lineLength > 0 && lineLength <= currentLinePos) { System.arraycopy(lineSeparator, 0, buffer, pos, lineSeparator.length); pos += lineSeparator.length; currentLinePos = 0; } } } } }
class class_name[name] begin[{] method[encode, return_type[void], modifier[default], parameter[in, inPos, inAvail]] begin[{] if[member[.eof]] begin[{] return[None] else begin[{] None end[}] if[binary_operation[member[.inAvail], <, literal[0]]] begin[{] assign[member[.eof], literal[true]] if[binary_operation[binary_operation[literal[0], ==, member[.modulus]], &&, binary_operation[member[.lineLength], ==, literal[0]]]] begin[{] return[None] else begin[{] None end[}] call[.ensureBufferSize, parameter[member[.encodeSize]]] local_variable[type[int], savedPos] SwitchStatement(cases=[SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=buffer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=pos, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MemberReference(member=encodeTable, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=bitWorkArea, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), operator=>>), operandr=MemberReference(member=MASK_6BITS, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=&))])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=buffer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=pos, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MemberReference(member=encodeTable, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=bitWorkArea, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=4), operator=<<), operandr=MemberReference(member=MASK_6BITS, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=&))])), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=encodeTable, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=STANDARD_ENCODE_TABLE, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=buffer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=pos, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MemberReference(member=PAD, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=buffer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=pos, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MemberReference(member=PAD, 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=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=buffer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=pos, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MemberReference(member=encodeTable, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=bitWorkArea, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=10), operator=>>), operandr=MemberReference(member=MASK_6BITS, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=&))])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=buffer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=pos, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MemberReference(member=encodeTable, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=bitWorkArea, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=4), operator=>>), operandr=MemberReference(member=MASK_6BITS, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=&))])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=buffer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=pos, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MemberReference(member=encodeTable, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=bitWorkArea, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), operator=<<), operandr=MemberReference(member=MASK_6BITS, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=&))])), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=encodeTable, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=STANDARD_ENCODE_TABLE, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=buffer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=pos, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MemberReference(member=PAD, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)])), BreakStatement(goto=None, label=None)])], expression=MemberReference(member=modulus, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None) assign[member[.currentLinePos], binary_operation[member[.pos], -, member[.savedPos]]] if[binary_operation[binary_operation[member[.lineLength], >, literal[0]], &&, binary_operation[member[.currentLinePos], >, literal[0]]]] begin[{] call[System.arraycopy, parameter[member[.lineSeparator], literal[0], member[.buffer], member[.pos], member[lineSeparator.length]]] assign[member[.pos], member[lineSeparator.length]] else begin[{] None end[}] else begin[{] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=encodeSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=ensureBufferSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=modulus, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=modulus, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+), operandr=MemberReference(member=BYTES_PER_UNENCODED_BLOCK, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=%)), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=in, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=inPos, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]))]), name=b)], modifiers=set(), type=BasicType(dimensions=[], name=int)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=b, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=<), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=b, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=256)), label=None)])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=bitWorkArea, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=bitWorkArea, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=8), operator=<<), operandr=MemberReference(member=b, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)), label=None), IfStatement(condition=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operandr=MemberReference(member=modulus, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=buffer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=pos, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MemberReference(member=encodeTable, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=bitWorkArea, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=18), operator=>>), operandr=MemberReference(member=MASK_6BITS, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=&))])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=buffer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=pos, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MemberReference(member=encodeTable, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=bitWorkArea, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=12), operator=>>), operandr=MemberReference(member=MASK_6BITS, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=&))])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=buffer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=pos, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MemberReference(member=encodeTable, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=bitWorkArea, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=6), operator=>>), operandr=MemberReference(member=MASK_6BITS, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=&))])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=buffer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=pos, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MemberReference(member=encodeTable, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=BinaryOperation(operandl=MemberReference(member=bitWorkArea, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=MASK_6BITS, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=&))])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=currentLinePos, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=MemberReference(member=BYTES_PER_ENCODED_BLOCK, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=lineLength, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>), operandr=BinaryOperation(operandl=MemberReference(member=lineLength, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=currentLinePos, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<=), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=lineSeparator, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), MemberReference(member=buffer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=pos, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=lineSeparator, selectors=[])], member=arraycopy, postfix_operators=[], prefix_operators=[], qualifier=System, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=pos, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=lineSeparator, selectors=[])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=currentLinePos, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)), label=None)]))]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=inAvail, 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[}] END[}]
annotation[@] identifier[Override] Keyword[void] identifier[encode] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[in] , Keyword[int] identifier[inPos] , Keyword[int] identifier[inAvail] operator[SEP] { Keyword[if] operator[SEP] identifier[eof] operator[SEP] { Keyword[return] operator[SEP] } Keyword[if] operator[SEP] identifier[inAvail] operator[<] Other[0] operator[SEP] { identifier[eof] operator[=] literal[boolean] operator[SEP] Keyword[if] operator[SEP] Other[0] operator[==] identifier[modulus] operator[&&] identifier[lineLength] operator[==] Other[0] operator[SEP] { Keyword[return] operator[SEP] } identifier[ensureBufferSize] operator[SEP] identifier[encodeSize] operator[SEP] operator[SEP] Keyword[int] identifier[savedPos] operator[=] identifier[pos] operator[SEP] Keyword[switch] operator[SEP] identifier[modulus] operator[SEP] { Keyword[case] Other[1] operator[:] identifier[buffer] operator[SEP] identifier[pos] operator[++] operator[SEP] operator[=] identifier[encodeTable] operator[SEP] operator[SEP] identifier[bitWorkArea] operator[>] operator[>] Other[2] operator[SEP] operator[&] identifier[MASK_6BITS] operator[SEP] operator[SEP] identifier[buffer] operator[SEP] identifier[pos] operator[++] operator[SEP] operator[=] identifier[encodeTable] operator[SEP] operator[SEP] identifier[bitWorkArea] operator[<<] Other[4] operator[SEP] operator[&] identifier[MASK_6BITS] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[encodeTable] operator[==] identifier[STANDARD_ENCODE_TABLE] operator[SEP] { identifier[buffer] operator[SEP] identifier[pos] operator[++] operator[SEP] operator[=] identifier[PAD] operator[SEP] identifier[buffer] operator[SEP] identifier[pos] operator[++] operator[SEP] operator[=] identifier[PAD] operator[SEP] } Keyword[break] operator[SEP] Keyword[case] Other[2] operator[:] identifier[buffer] operator[SEP] identifier[pos] operator[++] operator[SEP] operator[=] identifier[encodeTable] operator[SEP] operator[SEP] identifier[bitWorkArea] operator[>] operator[>] Other[10] operator[SEP] operator[&] identifier[MASK_6BITS] operator[SEP] operator[SEP] identifier[buffer] operator[SEP] identifier[pos] operator[++] operator[SEP] operator[=] identifier[encodeTable] operator[SEP] operator[SEP] identifier[bitWorkArea] operator[>] operator[>] Other[4] operator[SEP] operator[&] identifier[MASK_6BITS] operator[SEP] operator[SEP] identifier[buffer] operator[SEP] identifier[pos] operator[++] operator[SEP] operator[=] identifier[encodeTable] operator[SEP] operator[SEP] identifier[bitWorkArea] operator[<<] Other[2] operator[SEP] operator[&] identifier[MASK_6BITS] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[encodeTable] operator[==] identifier[STANDARD_ENCODE_TABLE] operator[SEP] { identifier[buffer] operator[SEP] identifier[pos] operator[++] operator[SEP] operator[=] identifier[PAD] operator[SEP] } Keyword[break] operator[SEP] } identifier[currentLinePos] operator[+=] identifier[pos] operator[-] identifier[savedPos] operator[SEP] Keyword[if] operator[SEP] identifier[lineLength] operator[>] Other[0] operator[&&] identifier[currentLinePos] operator[>] Other[0] operator[SEP] { identifier[System] operator[SEP] identifier[arraycopy] operator[SEP] identifier[lineSeparator] , Other[0] , identifier[buffer] , identifier[pos] , identifier[lineSeparator] operator[SEP] identifier[length] operator[SEP] operator[SEP] identifier[pos] operator[+=] identifier[lineSeparator] operator[SEP] identifier[length] operator[SEP] } } Keyword[else] { Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[inAvail] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[ensureBufferSize] operator[SEP] identifier[encodeSize] operator[SEP] operator[SEP] identifier[modulus] operator[=] operator[SEP] identifier[modulus] operator[+] Other[1] operator[SEP] operator[%] identifier[BYTES_PER_UNENCODED_BLOCK] operator[SEP] Keyword[int] identifier[b] operator[=] identifier[in] operator[SEP] identifier[inPos] operator[++] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[b] operator[<] Other[0] operator[SEP] { identifier[b] operator[+=] Other[256] operator[SEP] } identifier[bitWorkArea] operator[=] operator[SEP] identifier[bitWorkArea] operator[<<] Other[8] operator[SEP] operator[+] identifier[b] operator[SEP] Keyword[if] operator[SEP] Other[0] operator[==] identifier[modulus] operator[SEP] { identifier[buffer] operator[SEP] identifier[pos] operator[++] operator[SEP] operator[=] identifier[encodeTable] operator[SEP] operator[SEP] identifier[bitWorkArea] operator[>] operator[>] Other[18] operator[SEP] operator[&] identifier[MASK_6BITS] operator[SEP] operator[SEP] identifier[buffer] operator[SEP] identifier[pos] operator[++] operator[SEP] operator[=] identifier[encodeTable] operator[SEP] operator[SEP] identifier[bitWorkArea] operator[>] operator[>] Other[12] operator[SEP] operator[&] identifier[MASK_6BITS] operator[SEP] operator[SEP] identifier[buffer] operator[SEP] identifier[pos] operator[++] operator[SEP] operator[=] identifier[encodeTable] operator[SEP] operator[SEP] identifier[bitWorkArea] operator[>] operator[>] Other[6] operator[SEP] operator[&] identifier[MASK_6BITS] operator[SEP] operator[SEP] identifier[buffer] operator[SEP] identifier[pos] operator[++] operator[SEP] operator[=] identifier[encodeTable] operator[SEP] identifier[bitWorkArea] operator[&] identifier[MASK_6BITS] operator[SEP] operator[SEP] identifier[currentLinePos] operator[+=] identifier[BYTES_PER_ENCODED_BLOCK] operator[SEP] Keyword[if] operator[SEP] identifier[lineLength] operator[>] Other[0] operator[&&] identifier[lineLength] operator[<=] identifier[currentLinePos] operator[SEP] { identifier[System] operator[SEP] identifier[arraycopy] operator[SEP] identifier[lineSeparator] , Other[0] , identifier[buffer] , identifier[pos] , identifier[lineSeparator] operator[SEP] identifier[length] operator[SEP] operator[SEP] identifier[pos] operator[+=] identifier[lineSeparator] operator[SEP] identifier[length] operator[SEP] identifier[currentLinePos] operator[=] Other[0] operator[SEP] } } } } }
private void writeObject(ObjectOutputStream out) throws IOException { ClassRef.write(out, result); ClassRef.write(out, arg); out.writeUTF(name); }
class class_name[name] begin[{] method[writeObject, return_type[void], modifier[private], parameter[out]] begin[{] call[ClassRef.write, parameter[member[.out], member[.result]]] call[ClassRef.write, parameter[member[.out], member[.arg]]] call[out.writeUTF, parameter[member[.name]]] end[}] END[}]
Keyword[private] Keyword[void] identifier[writeObject] operator[SEP] identifier[ObjectOutputStream] identifier[out] operator[SEP] Keyword[throws] identifier[IOException] { identifier[ClassRef] operator[SEP] identifier[write] operator[SEP] identifier[out] , identifier[result] operator[SEP] operator[SEP] identifier[ClassRef] operator[SEP] identifier[write] operator[SEP] identifier[out] , identifier[arg] operator[SEP] operator[SEP] identifier[out] operator[SEP] identifier[writeUTF] operator[SEP] identifier[name] operator[SEP] operator[SEP] }
public static String compressNumber(String value, CompressionLevel compressionLevel) { value = value.replaceAll("([0-9])0+$", "$1"); if (compressionLevel.equals(CompressionLevel.NORMAL)) { value = value.replaceAll("\\.0+$", ".0"); } else if (compressionLevel.equals(CompressionLevel.WITHOUT_TRAILING_ZEROS)) { value = value.replaceAll("\\.0+$", ""); } return value; }
class class_name[name] begin[{] method[compressNumber, return_type[type[String]], modifier[public static], parameter[value, compressionLevel]] begin[{] assign[member[.value], call[value.replaceAll, parameter[literal["([0-9])0+$"], literal["$1"]]]] if[call[compressionLevel.equals, parameter[member[CompressionLevel.NORMAL]]]] begin[{] assign[member[.value], call[value.replaceAll, parameter[literal["\\.0+$"], literal[".0"]]]] else begin[{] if[call[compressionLevel.equals, parameter[member[CompressionLevel.WITHOUT_TRAILING_ZEROS]]]] begin[{] assign[member[.value], call[value.replaceAll, parameter[literal["\\.0+$"], literal[""]]]] else begin[{] None end[}] end[}] return[member[.value]] end[}] END[}]
Keyword[public] Keyword[static] identifier[String] identifier[compressNumber] operator[SEP] identifier[String] identifier[value] , identifier[CompressionLevel] identifier[compressionLevel] operator[SEP] { identifier[value] operator[=] identifier[value] operator[SEP] identifier[replaceAll] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[compressionLevel] operator[SEP] identifier[equals] operator[SEP] identifier[CompressionLevel] operator[SEP] identifier[NORMAL] operator[SEP] operator[SEP] { identifier[value] operator[=] identifier[value] operator[SEP] identifier[replaceAll] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[compressionLevel] operator[SEP] identifier[equals] operator[SEP] identifier[CompressionLevel] operator[SEP] identifier[WITHOUT_TRAILING_ZEROS] operator[SEP] operator[SEP] { identifier[value] operator[=] identifier[value] operator[SEP] identifier[replaceAll] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] } Keyword[return] identifier[value] operator[SEP] }
@Override public void eUnset(int featureID) { switch (featureID) { case AfplibPackage.CFC__CFIRG_LEN: setCFIRGLen(CFIRG_LEN_EDEFAULT); return; case AfplibPackage.CFC__RETIRED1: setRetired1(RETIRED1_EDEFAULT); return; case AfplibPackage.CFC__TRIPLETS: getTriplets().clear(); return; } super.eUnset(featureID); }
class class_name[name] begin[{] method[eUnset, return_type[void], modifier[public], parameter[featureID]] begin[{] SwitchStatement(cases=[SwitchStatementCase(case=[MemberReference(member=CFC__CFIRG_LEN, postfix_operators=[], prefix_operators=[], qualifier=AfplibPackage, selectors=[])], statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=CFIRG_LEN_EDEFAULT, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setCFIRGLen, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=None, label=None)]), SwitchStatementCase(case=[MemberReference(member=CFC__RETIRED1, postfix_operators=[], prefix_operators=[], qualifier=AfplibPackage, selectors=[])], statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=RETIRED1_EDEFAULT, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setRetired1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=None, label=None)]), SwitchStatementCase(case=[MemberReference(member=CFC__TRIPLETS, postfix_operators=[], prefix_operators=[], qualifier=AfplibPackage, selectors=[])], statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=getTriplets, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[], member=clear, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None), ReturnStatement(expression=None, label=None)])], expression=MemberReference(member=featureID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None) SuperMethodInvocation(arguments=[MemberReference(member=featureID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=eUnset, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None) end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[eUnset] operator[SEP] Keyword[int] identifier[featureID] operator[SEP] { Keyword[switch] operator[SEP] identifier[featureID] operator[SEP] { Keyword[case] identifier[AfplibPackage] operator[SEP] identifier[CFC__CFIRG_LEN] operator[:] identifier[setCFIRGLen] operator[SEP] identifier[CFIRG_LEN_EDEFAULT] operator[SEP] operator[SEP] Keyword[return] operator[SEP] Keyword[case] identifier[AfplibPackage] operator[SEP] identifier[CFC__RETIRED1] operator[:] identifier[setRetired1] operator[SEP] identifier[RETIRED1_EDEFAULT] operator[SEP] operator[SEP] Keyword[return] operator[SEP] Keyword[case] identifier[AfplibPackage] operator[SEP] identifier[CFC__TRIPLETS] operator[:] identifier[getTriplets] operator[SEP] operator[SEP] operator[SEP] identifier[clear] operator[SEP] operator[SEP] operator[SEP] Keyword[return] operator[SEP] } Keyword[super] operator[SEP] identifier[eUnset] operator[SEP] identifier[featureID] operator[SEP] operator[SEP] }
public void registerResourceManager(final JtxResourceManager resourceManager) { if ((oneResourceManager) && (!resourceManagers.isEmpty())) { throw new JtxException("TX manager allows only one resource manager"); } this.resourceManagers.put(resourceManager.getResourceType(), resourceManager); }
class class_name[name] begin[{] method[registerResourceManager, return_type[void], modifier[public], parameter[resourceManager]] begin[{] if[binary_operation[member[.oneResourceManager], &&, call[resourceManagers.isEmpty, parameter[]]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="TX manager allows only one resource manager")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=JtxException, sub_type=None)), label=None) else begin[{] None end[}] THIS[member[None.resourceManagers]call[None.put, parameter[call[resourceManager.getResourceType, parameter[]], member[.resourceManager]]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[registerResourceManager] operator[SEP] Keyword[final] identifier[JtxResourceManager] identifier[resourceManager] operator[SEP] { Keyword[if] operator[SEP] operator[SEP] identifier[oneResourceManager] operator[SEP] operator[&&] operator[SEP] operator[!] identifier[resourceManagers] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { Keyword[throw] Keyword[new] identifier[JtxException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[this] operator[SEP] identifier[resourceManagers] operator[SEP] identifier[put] operator[SEP] identifier[resourceManager] operator[SEP] identifier[getResourceType] operator[SEP] operator[SEP] , identifier[resourceManager] operator[SEP] operator[SEP] }
public static AiffData create(InputStream is) { try { return create( AudioSystem.getAudioInputStream(is)); } catch (Exception e) { org.lwjgl.LWJGLUtil.log("Unable to create from inputstream"); e.printStackTrace(); return null; } }
class class_name[name] begin[{] method[create, return_type[type[AiffData]], modifier[public static], parameter[is]] begin[{] TryStatement(block=[ReturnStatement(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=is, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getAudioInputStream, postfix_operators=[], prefix_operators=[], qualifier=AudioSystem, selectors=[], type_arguments=None)], member=create, 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 from inputstream")], member=log, postfix_operators=[], prefix_operators=[], qualifier=org.lwjgl.LWJGLUtil, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=printStackTrace, postfix_operators=[], prefix_operators=[], qualifier=e, 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=['Exception']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[public] Keyword[static] identifier[AiffData] identifier[create] operator[SEP] identifier[InputStream] identifier[is] operator[SEP] { Keyword[try] { Keyword[return] identifier[create] operator[SEP] identifier[AudioSystem] operator[SEP] identifier[getAudioInputStream] operator[SEP] identifier[is] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { identifier[org] operator[SEP] identifier[lwjgl] operator[SEP] identifier[LWJGLUtil] operator[SEP] identifier[log] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[e] operator[SEP] identifier[printStackTrace] operator[SEP] operator[SEP] operator[SEP] Keyword[return] Other[null] operator[SEP] } }
public static void cublasSsyr2k(char uplo, char trans, int n, int k, float alpha, Pointer A, int lda, Pointer B, int ldb, float beta, Pointer C, int ldc) { cublasSsyr2kNative(uplo, trans, n, k, alpha, A, lda, B, ldb, beta, C, ldc); checkResultBLAS(); }
class class_name[name] begin[{] method[cublasSsyr2k, return_type[void], modifier[public static], parameter[uplo, trans, n, k, alpha, A, lda, B, ldb, beta, C, ldc]] begin[{] call[.cublasSsyr2kNative, parameter[member[.uplo], member[.trans], member[.n], member[.k], member[.alpha], member[.A], member[.lda], member[.B], member[.ldb], member[.beta], member[.C], member[.ldc]]] call[.checkResultBLAS, parameter[]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[cublasSsyr2k] operator[SEP] Keyword[char] identifier[uplo] , Keyword[char] identifier[trans] , Keyword[int] identifier[n] , Keyword[int] identifier[k] , Keyword[float] identifier[alpha] , identifier[Pointer] identifier[A] , Keyword[int] identifier[lda] , identifier[Pointer] identifier[B] , Keyword[int] identifier[ldb] , Keyword[float] identifier[beta] , identifier[Pointer] identifier[C] , Keyword[int] identifier[ldc] operator[SEP] { identifier[cublasSsyr2kNative] operator[SEP] identifier[uplo] , identifier[trans] , identifier[n] , identifier[k] , identifier[alpha] , identifier[A] , identifier[lda] , identifier[B] , identifier[ldb] , identifier[beta] , identifier[C] , identifier[ldc] operator[SEP] operator[SEP] identifier[checkResultBLAS] operator[SEP] operator[SEP] operator[SEP] }
@Override public void writeExternal(ObjectOutput out) throws IOException { super.writeExternal(out); out.writeObject(approximation); }
class class_name[name] begin[{] method[writeExternal, return_type[void], modifier[public], parameter[out]] begin[{] SuperMethodInvocation(arguments=[MemberReference(member=out, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=writeExternal, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None) call[out.writeObject, parameter[member[.approximation]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[writeExternal] operator[SEP] identifier[ObjectOutput] identifier[out] operator[SEP] Keyword[throws] identifier[IOException] { Keyword[super] operator[SEP] identifier[writeExternal] operator[SEP] identifier[out] operator[SEP] operator[SEP] identifier[out] operator[SEP] identifier[writeObject] operator[SEP] identifier[approximation] operator[SEP] operator[SEP] }
public <T> Source<T> from(Supplier<T> supplier) { Assert.notNull(supplier, "Supplier must not be null"); Source<T> source = getSource(supplier); if (this.sourceOperator != null) { source = this.sourceOperator.apply(source); } return source; }
class class_name[name] begin[{] method[from, return_type[type[Source]], modifier[public], parameter[supplier]] begin[{] call[Assert.notNull, parameter[member[.supplier], literal["Supplier must not be null"]]] local_variable[type[Source], source] if[binary_operation[THIS[member[None.sourceOperator]], !=, literal[null]]] begin[{] assign[member[.source], THIS[member[None.sourceOperator]call[None.apply, parameter[member[.source]]]]] else begin[{] None end[}] return[member[.source]] end[}] END[}]
Keyword[public] operator[<] identifier[T] operator[>] identifier[Source] operator[<] identifier[T] operator[>] identifier[from] operator[SEP] identifier[Supplier] operator[<] identifier[T] operator[>] identifier[supplier] operator[SEP] { identifier[Assert] operator[SEP] identifier[notNull] operator[SEP] identifier[supplier] , literal[String] operator[SEP] operator[SEP] identifier[Source] operator[<] identifier[T] operator[>] identifier[source] operator[=] identifier[getSource] operator[SEP] identifier[supplier] operator[SEP] operator[SEP] Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[sourceOperator] operator[!=] Other[null] operator[SEP] { identifier[source] operator[=] Keyword[this] operator[SEP] identifier[sourceOperator] operator[SEP] identifier[apply] operator[SEP] identifier[source] operator[SEP] operator[SEP] } Keyword[return] identifier[source] operator[SEP] }
private String matchPatternInBuffer(Pattern pattern) { matchValid = false; matcher.usePattern(pattern); matcher.region(position, buf.limit()); if (matcher.lookingAt()) { if (matcher.hitEnd() && (!sourceClosed)) { // Get more input and try again needInput = true; return null; } position = matcher.end(); return matcher.group(); } if (sourceClosed) return null; // Read more to find pattern needInput = true; return null; }
class class_name[name] begin[{] method[matchPatternInBuffer, return_type[type[String]], modifier[private], parameter[pattern]] begin[{] assign[member[.matchValid], literal[false]] call[matcher.usePattern, parameter[member[.pattern]]] call[matcher.region, parameter[member[.position], call[buf.limit, parameter[]]]] if[call[matcher.lookingAt, parameter[]]] begin[{] if[binary_operation[call[matcher.hitEnd, parameter[]], &&, member[.sourceClosed]]] begin[{] assign[member[.needInput], literal[true]] return[literal[null]] else begin[{] None end[}] assign[member[.position], call[matcher.end, parameter[]]] return[call[matcher.group, parameter[]]] else begin[{] None end[}] if[member[.sourceClosed]] begin[{] return[literal[null]] else begin[{] None end[}] assign[member[.needInput], literal[true]] return[literal[null]] end[}] END[}]
Keyword[private] identifier[String] identifier[matchPatternInBuffer] operator[SEP] identifier[Pattern] identifier[pattern] operator[SEP] { identifier[matchValid] operator[=] literal[boolean] operator[SEP] identifier[matcher] operator[SEP] identifier[usePattern] operator[SEP] identifier[pattern] operator[SEP] operator[SEP] identifier[matcher] operator[SEP] identifier[region] operator[SEP] identifier[position] , identifier[buf] operator[SEP] identifier[limit] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[matcher] operator[SEP] identifier[lookingAt] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[matcher] operator[SEP] identifier[hitEnd] operator[SEP] operator[SEP] operator[&&] operator[SEP] operator[!] identifier[sourceClosed] operator[SEP] operator[SEP] { identifier[needInput] operator[=] literal[boolean] operator[SEP] Keyword[return] Other[null] operator[SEP] } identifier[position] operator[=] identifier[matcher] operator[SEP] identifier[end] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[matcher] operator[SEP] identifier[group] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[sourceClosed] operator[SEP] Keyword[return] Other[null] operator[SEP] identifier[needInput] operator[=] literal[boolean] operator[SEP] Keyword[return] Other[null] operator[SEP] }
public void addEmbeddedImage(final String name, final DataSource imagedata) { embeddedImages.add(new AttachmentResource(name, imagedata)); }
class class_name[name] begin[{] method[addEmbeddedImage, return_type[void], modifier[public], parameter[name, imagedata]] begin[{] call[embeddedImages.add, parameter[ClassCreator(arguments=[MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=imagedata, 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=AttachmentResource, sub_type=None))]] end[}] END[}]
Keyword[public] Keyword[void] identifier[addEmbeddedImage] operator[SEP] Keyword[final] identifier[String] identifier[name] , Keyword[final] identifier[DataSource] identifier[imagedata] operator[SEP] { identifier[embeddedImages] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[AttachmentResource] operator[SEP] identifier[name] , identifier[imagedata] operator[SEP] operator[SEP] operator[SEP] }
private void associateF2F() { quadViews.reset(); for( int i = 0; i < detector.getNumberOfSets(); i++ ) { SetMatches matches = setMatches[i]; // old left to new left assocSame.setSource(featsLeft0.location[i],featsLeft0.description[i]); assocSame.setDestination(featsLeft1.location[i], featsLeft1.description[i]); assocSame.associate(); setMatches(matches.match0to2, assocSame.getMatches(), featsLeft0.location[i].size); // old right to new right assocSame.setSource(featsRight0.location[i],featsRight0.description[i]); assocSame.setDestination(featsRight1.location[i], featsRight1.description[i]); assocSame.associate(); setMatches(matches.match1to3, assocSame.getMatches(), featsRight0.location[i].size); } }
class class_name[name] begin[{] method[associateF2F, return_type[void], modifier[private], parameter[]] begin[{] call[quadViews.reset, parameter[]] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=setMatches, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), name=matches)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=SetMatches, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=location, postfix_operators=[], prefix_operators=[], qualifier=featsLeft0, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), MemberReference(member=description, postfix_operators=[], prefix_operators=[], qualifier=featsLeft0, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])], member=setSource, postfix_operators=[], prefix_operators=[], qualifier=assocSame, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=location, postfix_operators=[], prefix_operators=[], qualifier=featsLeft1, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), MemberReference(member=description, postfix_operators=[], prefix_operators=[], qualifier=featsLeft1, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])], member=setDestination, postfix_operators=[], prefix_operators=[], qualifier=assocSame, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=associate, postfix_operators=[], prefix_operators=[], qualifier=assocSame, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=match0to2, postfix_operators=[], prefix_operators=[], qualifier=matches, selectors=[]), MethodInvocation(arguments=[], member=getMatches, postfix_operators=[], prefix_operators=[], qualifier=assocSame, selectors=[], type_arguments=None), MemberReference(member=location, postfix_operators=[], prefix_operators=[], qualifier=featsLeft0, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MemberReference(member=size, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)])], member=setMatches, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=location, postfix_operators=[], prefix_operators=[], qualifier=featsRight0, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), MemberReference(member=description, postfix_operators=[], prefix_operators=[], qualifier=featsRight0, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])], member=setSource, postfix_operators=[], prefix_operators=[], qualifier=assocSame, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=location, postfix_operators=[], prefix_operators=[], qualifier=featsRight1, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), MemberReference(member=description, postfix_operators=[], prefix_operators=[], qualifier=featsRight1, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])], member=setDestination, postfix_operators=[], prefix_operators=[], qualifier=assocSame, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=associate, postfix_operators=[], prefix_operators=[], qualifier=assocSame, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=match1to3, postfix_operators=[], prefix_operators=[], qualifier=matches, selectors=[]), MethodInvocation(arguments=[], member=getMatches, postfix_operators=[], prefix_operators=[], qualifier=assocSame, selectors=[], type_arguments=None), MemberReference(member=location, postfix_operators=[], prefix_operators=[], qualifier=featsRight0, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MemberReference(member=size, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)])], member=setMatches, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=getNumberOfSets, postfix_operators=[], prefix_operators=[], qualifier=detector, selectors=[], type_arguments=None), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) end[}] END[}]
Keyword[private] Keyword[void] identifier[associateF2F] operator[SEP] operator[SEP] { identifier[quadViews] operator[SEP] identifier[reset] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[detector] operator[SEP] identifier[getNumberOfSets] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[SetMatches] identifier[matches] operator[=] identifier[setMatches] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[assocSame] operator[SEP] identifier[setSource] operator[SEP] identifier[featsLeft0] operator[SEP] identifier[location] operator[SEP] identifier[i] operator[SEP] , identifier[featsLeft0] operator[SEP] identifier[description] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP] identifier[assocSame] operator[SEP] identifier[setDestination] operator[SEP] identifier[featsLeft1] operator[SEP] identifier[location] operator[SEP] identifier[i] operator[SEP] , identifier[featsLeft1] operator[SEP] identifier[description] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP] identifier[assocSame] operator[SEP] identifier[associate] operator[SEP] operator[SEP] operator[SEP] identifier[setMatches] operator[SEP] identifier[matches] operator[SEP] identifier[match0to2] , identifier[assocSame] operator[SEP] identifier[getMatches] operator[SEP] operator[SEP] , identifier[featsLeft0] operator[SEP] identifier[location] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[size] operator[SEP] operator[SEP] identifier[assocSame] operator[SEP] identifier[setSource] operator[SEP] identifier[featsRight0] operator[SEP] identifier[location] operator[SEP] identifier[i] operator[SEP] , identifier[featsRight0] operator[SEP] identifier[description] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP] identifier[assocSame] operator[SEP] identifier[setDestination] operator[SEP] identifier[featsRight1] operator[SEP] identifier[location] operator[SEP] identifier[i] operator[SEP] , identifier[featsRight1] operator[SEP] identifier[description] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP] identifier[assocSame] operator[SEP] identifier[associate] operator[SEP] operator[SEP] operator[SEP] identifier[setMatches] operator[SEP] identifier[matches] operator[SEP] identifier[match1to3] , identifier[assocSame] operator[SEP] identifier[getMatches] operator[SEP] operator[SEP] , identifier[featsRight0] operator[SEP] identifier[location] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[size] operator[SEP] operator[SEP] } }
@Override public LockResult lock(int waitWeight, String clientId) { return lock(waitWeight, clientId, DEFAULT_LOCK_DURATION_MS); }
class class_name[name] begin[{] method[lock, return_type[type[LockResult]], modifier[public], parameter[waitWeight, clientId]] begin[{] return[call[.lock, parameter[member[.waitWeight], member[.clientId], member[.DEFAULT_LOCK_DURATION_MS]]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[LockResult] identifier[lock] operator[SEP] Keyword[int] identifier[waitWeight] , identifier[String] identifier[clientId] operator[SEP] { Keyword[return] identifier[lock] operator[SEP] identifier[waitWeight] , identifier[clientId] , identifier[DEFAULT_LOCK_DURATION_MS] operator[SEP] operator[SEP] }
public void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { boolean fileFound = sendResourceFile(req, resp); if (!fileFound) resp.sendError(HttpServletResponse.SC_NOT_FOUND, "File not found"); // super.service(req, resp); }
class class_name[name] begin[{] method[service, return_type[void], modifier[public], parameter[req, resp]] begin[{] local_variable[type[boolean], fileFound] if[member[.fileFound]] begin[{] call[resp.sendError, parameter[member[HttpServletResponse.SC_NOT_FOUND], literal["File not found"]]] else begin[{] None end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[service] operator[SEP] identifier[HttpServletRequest] identifier[req] , identifier[HttpServletResponse] identifier[resp] operator[SEP] Keyword[throws] identifier[ServletException] , identifier[IOException] { Keyword[boolean] identifier[fileFound] operator[=] identifier[sendResourceFile] operator[SEP] identifier[req] , identifier[resp] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[fileFound] operator[SEP] identifier[resp] operator[SEP] identifier[sendError] operator[SEP] identifier[HttpServletResponse] operator[SEP] identifier[SC_NOT_FOUND] , literal[String] operator[SEP] operator[SEP] }
@Override public CPDAvailabilityEstimate getCPDAvailabilityEstimateByUuidAndGroupId( String uuid, long groupId) throws PortalException { return cpdAvailabilityEstimatePersistence.findByUUID_G(uuid, groupId); }
class class_name[name] begin[{] method[getCPDAvailabilityEstimateByUuidAndGroupId, return_type[type[CPDAvailabilityEstimate]], modifier[public], parameter[uuid, groupId]] begin[{] return[call[cpdAvailabilityEstimatePersistence.findByUUID_G, parameter[member[.uuid], member[.groupId]]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[CPDAvailabilityEstimate] identifier[getCPDAvailabilityEstimateByUuidAndGroupId] operator[SEP] identifier[String] identifier[uuid] , Keyword[long] identifier[groupId] operator[SEP] Keyword[throws] identifier[PortalException] { Keyword[return] identifier[cpdAvailabilityEstimatePersistence] operator[SEP] identifier[findByUUID_G] operator[SEP] identifier[uuid] , identifier[groupId] operator[SEP] operator[SEP] }
public String convertIfcProcedureTypeEnumToString(EDataType eDataType, Object instanceValue) { return instanceValue == null ? null : instanceValue.toString(); }
class class_name[name] begin[{] method[convertIfcProcedureTypeEnumToString, return_type[type[String]], modifier[public], parameter[eDataType, instanceValue]] begin[{] return[TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=instanceValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), if_false=MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=instanceValue, selectors=[], type_arguments=None), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null))] end[}] END[}]
Keyword[public] identifier[String] identifier[convertIfcProcedureTypeEnumToString] operator[SEP] identifier[EDataType] identifier[eDataType] , identifier[Object] identifier[instanceValue] operator[SEP] { Keyword[return] identifier[instanceValue] operator[==] Other[null] operator[?] Other[null] operator[:] identifier[instanceValue] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] }
private void _buildProperty( final String property, final StringBuilder stmt ) { if (property == null || property.length() == 0) { throw new IllegalArgumentException( "no property specified" ); } stmt.append( _alias ).append( "." ).append( property ); }
class class_name[name] begin[{] method[_buildProperty, return_type[void], modifier[private], parameter[property, stmt]] begin[{] if[binary_operation[binary_operation[member[.property], ==, literal[null]], ||, binary_operation[call[property.length, parameter[]], ==, literal[0]]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="no property specified")], 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[}] call[stmt.append, parameter[member[._alias]]] end[}] END[}]
Keyword[private] Keyword[void] identifier[_buildProperty] operator[SEP] Keyword[final] identifier[String] identifier[property] , Keyword[final] identifier[StringBuilder] identifier[stmt] operator[SEP] { Keyword[if] operator[SEP] identifier[property] operator[==] Other[null] operator[||] identifier[property] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[==] Other[0] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] } identifier[stmt] operator[SEP] identifier[append] operator[SEP] identifier[_alias] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[property] operator[SEP] operator[SEP] }
public String getURL(String url, Object optParam, boolean keepSettings) throws IOException { StringBuilder SB=new StringBuilder(); SB.append(url); List<String> finishedParams=new SortedArrayList<>(); boolean alreadyAppended=appendParams(SB, optParam, finishedParams, false); if(keepSettings) appendSettings(finishedParams, alreadyAppended, SB); return SB.toString(); }
class class_name[name] begin[{] method[getURL, return_type[type[String]], modifier[public], parameter[url, optParam, keepSettings]] begin[{] local_variable[type[StringBuilder], SB] call[SB.append, parameter[member[.url]]] local_variable[type[List], finishedParams] local_variable[type[boolean], alreadyAppended] if[member[.keepSettings]] begin[{] call[.appendSettings, parameter[member[.finishedParams], member[.alreadyAppended], member[.SB]]] else begin[{] None end[}] return[call[SB.toString, parameter[]]] end[}] END[}]
Keyword[public] identifier[String] identifier[getURL] operator[SEP] identifier[String] identifier[url] , identifier[Object] identifier[optParam] , Keyword[boolean] identifier[keepSettings] operator[SEP] Keyword[throws] identifier[IOException] { identifier[StringBuilder] identifier[SB] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[SB] operator[SEP] identifier[append] operator[SEP] identifier[url] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[String] operator[>] identifier[finishedParams] operator[=] Keyword[new] identifier[SortedArrayList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[boolean] identifier[alreadyAppended] operator[=] identifier[appendParams] operator[SEP] identifier[SB] , identifier[optParam] , identifier[finishedParams] , literal[boolean] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[keepSettings] operator[SEP] identifier[appendSettings] operator[SEP] identifier[finishedParams] , identifier[alreadyAppended] , identifier[SB] operator[SEP] operator[SEP] Keyword[return] identifier[SB] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] }
public void setBackRouteHeader(byte[] data) { // here in data is whole message, we want first 5 bytes! int thisPointCode = Mtp3.dpc(data, 1); int remotePointCode = Mtp3.opc(data, 1); int sls = Mtp3.sls(data, 1); int si = Mtp3.si(data); int ssi = Mtp3.ssi(data); // this.mtp3Header = new byte[5]; MTPUtility.writeRoutingLabel(mtp3Header, si, ssi, sls, remotePointCode, thisPointCode); if (logger.isInfoEnabled()) { logger.info("DPC[" + remotePointCode + "] OPC[" + thisPointCode + "] SLS[" + sls + "] SI[" + si + "] SSI[" + ssi + "] Label" + Arrays.toString(mtp3Header)); } }
class class_name[name] begin[{] method[setBackRouteHeader, return_type[void], modifier[public], parameter[data]] begin[{] local_variable[type[int], thisPointCode] local_variable[type[int], remotePointCode] local_variable[type[int], sls] local_variable[type[int], si] local_variable[type[int], ssi] call[MTPUtility.writeRoutingLabel, parameter[member[.mtp3Header], member[.si], member[.ssi], member[.sls], member[.remotePointCode], member[.thisPointCode]]] if[call[logger.isInfoEnabled, parameter[]]] begin[{] call[logger.info, parameter[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[literal["DPC["], +, member[.remotePointCode]], +, literal["] OPC["]], +, member[.thisPointCode]], +, literal["] SLS["]], +, member[.sls]], +, literal["] SI["]], +, member[.si]], +, literal["] SSI["]], +, member[.ssi]], +, literal["] Label"]], +, call[Arrays.toString, parameter[member[.mtp3Header]]]]]] else begin[{] None end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[setBackRouteHeader] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[data] operator[SEP] { Keyword[int] identifier[thisPointCode] operator[=] identifier[Mtp3] operator[SEP] identifier[dpc] operator[SEP] identifier[data] , Other[1] operator[SEP] operator[SEP] Keyword[int] identifier[remotePointCode] operator[=] identifier[Mtp3] operator[SEP] identifier[opc] operator[SEP] identifier[data] , Other[1] operator[SEP] operator[SEP] Keyword[int] identifier[sls] operator[=] identifier[Mtp3] operator[SEP] identifier[sls] operator[SEP] identifier[data] , Other[1] operator[SEP] operator[SEP] Keyword[int] identifier[si] operator[=] identifier[Mtp3] operator[SEP] identifier[si] operator[SEP] identifier[data] operator[SEP] operator[SEP] Keyword[int] identifier[ssi] operator[=] identifier[Mtp3] operator[SEP] identifier[ssi] operator[SEP] identifier[data] operator[SEP] operator[SEP] identifier[MTPUtility] operator[SEP] identifier[writeRoutingLabel] operator[SEP] identifier[mtp3Header] , identifier[si] , identifier[ssi] , identifier[sls] , identifier[remotePointCode] , identifier[thisPointCode] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[logger] operator[SEP] identifier[isInfoEnabled] operator[SEP] operator[SEP] operator[SEP] { identifier[logger] operator[SEP] identifier[info] operator[SEP] literal[String] operator[+] identifier[remotePointCode] operator[+] literal[String] operator[+] identifier[thisPointCode] operator[+] literal[String] operator[+] identifier[sls] operator[+] literal[String] operator[+] identifier[si] operator[+] literal[String] operator[+] identifier[ssi] operator[+] literal[String] operator[+] identifier[Arrays] operator[SEP] identifier[toString] operator[SEP] identifier[mtp3Header] operator[SEP] operator[SEP] operator[SEP] } }
public String getSFieldValue(boolean bDisplayFormat, boolean bRawData) { if ((bDisplayFormat == false) && (bRawData == false)) bRawData = true; // If you want the input format, don't go through the converters. // if (bRawData) return super.getSFieldValue(bDisplayFormat, bRawData); /* Converter converter = this.getConverter(); if (converter == null) return Constants.BLANK; if (m_vDisplays == null) { String strField = null; if (converter != null) if (converter.getField() != null) strField = converter.getField().getString(); this.scanTableItems(); if (converter != null) if (converter.getField() != null) converter.getField().setString(strField); } String string = DBConstants.BLANK; int iIndex = 0; if (converter != null) { // This is required for the display or popup fields because displayField() is never called to get the value. iIndex = converter.convertFieldToIndex(); if (iIndex == -1) return super.getSFieldValue(bDisplayFormat, bRawData); try { string = (String)m_vDisplays.get(iIndex); } catch (ArrayIndexOutOfBoundsException ex) { string = " "; } } return string; */ }
class class_name[name] begin[{] method[getSFieldValue, return_type[type[String]], modifier[public], parameter[bDisplayFormat, bRawData]] begin[{] if[binary_operation[binary_operation[member[.bDisplayFormat], ==, literal[false]], &&, binary_operation[member[.bRawData], ==, literal[false]]]] begin[{] assign[member[.bRawData], literal[true]] else begin[{] None end[}] return[SuperMethodInvocation(arguments=[MemberReference(member=bDisplayFormat, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=bRawData, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getSFieldValue, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None)] end[}] END[}]
Keyword[public] identifier[String] identifier[getSFieldValue] operator[SEP] Keyword[boolean] identifier[bDisplayFormat] , Keyword[boolean] identifier[bRawData] operator[SEP] { Keyword[if] operator[SEP] operator[SEP] identifier[bDisplayFormat] operator[==] literal[boolean] operator[SEP] operator[&&] operator[SEP] identifier[bRawData] operator[==] literal[boolean] operator[SEP] operator[SEP] identifier[bRawData] operator[=] literal[boolean] operator[SEP] Keyword[return] Keyword[super] operator[SEP] identifier[getSFieldValue] operator[SEP] identifier[bDisplayFormat] , identifier[bRawData] operator[SEP] operator[SEP] }
public static float round(float x, int scale, int roundingMethod) throws ArithmeticException, IllegalArgumentException { final float sign = FastMath.copySign(1f, x); final float factor = (float) FastMath.pow(10.0f, scale) * sign; return (float) roundUnscaled(x * factor, sign, roundingMethod) / factor; }
class class_name[name] begin[{] method[round, return_type[type[float]], modifier[public static], parameter[x, scale, roundingMethod]] begin[{] local_variable[type[float], sign] local_variable[type[float], factor] return[binary_operation[Cast(expression=MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=factor, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=*), MemberReference(member=sign, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=roundingMethod, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=roundUnscaled, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), type=BasicType(dimensions=[], name=float)), /, member[.factor]]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[float] identifier[round] operator[SEP] Keyword[float] identifier[x] , Keyword[int] identifier[scale] , Keyword[int] identifier[roundingMethod] operator[SEP] Keyword[throws] identifier[ArithmeticException] , identifier[IllegalArgumentException] { Keyword[final] Keyword[float] identifier[sign] operator[=] identifier[FastMath] operator[SEP] identifier[copySign] operator[SEP] literal[Float] , identifier[x] operator[SEP] operator[SEP] Keyword[final] Keyword[float] identifier[factor] operator[=] operator[SEP] Keyword[float] operator[SEP] identifier[FastMath] operator[SEP] identifier[pow] operator[SEP] literal[Float] , identifier[scale] operator[SEP] operator[*] identifier[sign] operator[SEP] Keyword[return] operator[SEP] Keyword[float] operator[SEP] identifier[roundUnscaled] operator[SEP] identifier[x] operator[*] identifier[factor] , identifier[sign] , identifier[roundingMethod] operator[SEP] operator[/] identifier[factor] operator[SEP] }
@POST @Path("/{dataSourceName}") @Consumes(MediaType.APPLICATION_JSON) @ResourceFilters(RulesResourceFilter.class) public Response setDatasourceRules( @PathParam("dataSourceName") final String dataSourceName, final List<Rule> rules, @HeaderParam(AuditManager.X_DRUID_AUTHOR) @DefaultValue("") final String author, @HeaderParam(AuditManager.X_DRUID_COMMENT) @DefaultValue("") final String comment, @Context HttpServletRequest req ) { if (databaseRuleManager.overrideRule( dataSourceName, rules, new AuditInfo(author, comment, req.getRemoteAddr()) )) { return Response.ok().build(); } return Response.status(Response.Status.INTERNAL_SERVER_ERROR).build(); }
class class_name[name] begin[{] method[setDatasourceRules, return_type[type[Response]], modifier[public], parameter[dataSourceName, rules, author, comment, req]] begin[{] if[call[databaseRuleManager.overrideRule, parameter[member[.dataSourceName], member[.rules], ClassCreator(arguments=[MemberReference(member=author, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=comment, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getRemoteAddr, postfix_operators=[], prefix_operators=[], qualifier=req, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=AuditInfo, sub_type=None))]]] begin[{] return[call[Response.ok, parameter[]]] else begin[{] None end[}] return[call[Response.status, parameter[member[Response.Status.INTERNAL_SERVER_ERROR]]]] end[}] END[}]
annotation[@] identifier[POST] annotation[@] identifier[Path] operator[SEP] literal[String] operator[SEP] annotation[@] identifier[Consumes] operator[SEP] identifier[MediaType] operator[SEP] identifier[APPLICATION_JSON] operator[SEP] annotation[@] identifier[ResourceFilters] operator[SEP] identifier[RulesResourceFilter] operator[SEP] Keyword[class] operator[SEP] Keyword[public] identifier[Response] identifier[setDatasourceRules] operator[SEP] annotation[@] identifier[PathParam] operator[SEP] literal[String] operator[SEP] Keyword[final] identifier[String] identifier[dataSourceName] , Keyword[final] identifier[List] operator[<] identifier[Rule] operator[>] identifier[rules] , annotation[@] identifier[HeaderParam] operator[SEP] identifier[AuditManager] operator[SEP] identifier[X_DRUID_AUTHOR] operator[SEP] annotation[@] identifier[DefaultValue] operator[SEP] literal[String] operator[SEP] Keyword[final] identifier[String] identifier[author] , annotation[@] identifier[HeaderParam] operator[SEP] identifier[AuditManager] operator[SEP] identifier[X_DRUID_COMMENT] operator[SEP] annotation[@] identifier[DefaultValue] operator[SEP] literal[String] operator[SEP] Keyword[final] identifier[String] identifier[comment] , annotation[@] identifier[Context] identifier[HttpServletRequest] identifier[req] operator[SEP] { Keyword[if] operator[SEP] identifier[databaseRuleManager] operator[SEP] identifier[overrideRule] operator[SEP] identifier[dataSourceName] , identifier[rules] , Keyword[new] identifier[AuditInfo] operator[SEP] identifier[author] , identifier[comment] , identifier[req] operator[SEP] identifier[getRemoteAddr] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] identifier[Response] operator[SEP] identifier[ok] operator[SEP] operator[SEP] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[Response] operator[SEP] identifier[status] operator[SEP] identifier[Response] operator[SEP] identifier[Status] operator[SEP] identifier[INTERNAL_SERVER_ERROR] operator[SEP] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP] }
@XmlElementDecl(namespace = "http://schema.intuit.com/finance/v3", name = "CustomerType", substitutionHeadNamespace = "http://schema.intuit.com/finance/v3", substitutionHeadName = "IntuitObject") public JAXBElement<CustomerType> createCustomerType(CustomerType value) { return new JAXBElement<CustomerType>(_CustomerType_QNAME, CustomerType.class, null, value); }
class class_name[name] begin[{] method[createCustomerType, return_type[type[JAXBElement]], modifier[public], parameter[value]] begin[{] return[ClassCreator(arguments=[MemberReference(member=_CustomerType_QNAME, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=CustomerType, sub_type=None)), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), MemberReference(member=value, 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=CustomerType, sub_type=None))], dimensions=None, name=JAXBElement, sub_type=None))] end[}] END[}]
annotation[@] identifier[XmlElementDecl] operator[SEP] identifier[namespace] operator[=] literal[String] , identifier[name] operator[=] literal[String] , identifier[substitutionHeadNamespace] operator[=] literal[String] , identifier[substitutionHeadName] operator[=] literal[String] operator[SEP] Keyword[public] identifier[JAXBElement] operator[<] identifier[CustomerType] operator[>] identifier[createCustomerType] operator[SEP] identifier[CustomerType] identifier[value] operator[SEP] { Keyword[return] Keyword[new] identifier[JAXBElement] operator[<] identifier[CustomerType] operator[>] operator[SEP] identifier[_CustomerType_QNAME] , identifier[CustomerType] operator[SEP] Keyword[class] , Other[null] , identifier[value] operator[SEP] operator[SEP] }
private static void convertCBLQueryRowsToMaps(Map<String, Object> allDocsResult) { List<Map<String, Object>> rowsAsMaps = new ArrayList<Map<String, Object>>(); List<QueryRow> rows = (List<QueryRow>) allDocsResult.get("rows"); if (rows != null) { for (QueryRow row : rows) { rowsAsMaps.add(row.asJSONDictionary()); } } allDocsResult.put("rows", rowsAsMaps); }
class class_name[name] begin[{] method[convertCBLQueryRowsToMaps, return_type[void], modifier[private static], parameter[allDocsResult]] begin[{] local_variable[type[List], rowsAsMaps] local_variable[type[List], rows] if[binary_operation[member[.rows], !=, literal[null]]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=asJSONDictionary, postfix_operators=[], prefix_operators=[], qualifier=row, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=rowsAsMaps, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=rows, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=row)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=QueryRow, sub_type=None))), label=None) else begin[{] None end[}] call[allDocsResult.put, parameter[literal["rows"], member[.rowsAsMaps]]] end[}] END[}]
Keyword[private] Keyword[static] Keyword[void] identifier[convertCBLQueryRowsToMaps] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] identifier[allDocsResult] operator[SEP] { identifier[List] operator[<] identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] operator[>] identifier[rowsAsMaps] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[QueryRow] operator[>] identifier[rows] operator[=] operator[SEP] identifier[List] operator[<] identifier[QueryRow] operator[>] operator[SEP] identifier[allDocsResult] operator[SEP] identifier[get] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[rows] operator[!=] Other[null] operator[SEP] { Keyword[for] operator[SEP] identifier[QueryRow] identifier[row] operator[:] identifier[rows] operator[SEP] { identifier[rowsAsMaps] operator[SEP] identifier[add] operator[SEP] identifier[row] operator[SEP] identifier[asJSONDictionary] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } identifier[allDocsResult] operator[SEP] identifier[put] operator[SEP] literal[String] , identifier[rowsAsMaps] operator[SEP] operator[SEP] }
public static String[] getParameterNames(CtMethod ctMethod) throws NotFoundException { MethodInfo methodInfo = ctMethod.getMethodInfo(); CodeAttribute codeAttribute = methodInfo.getCodeAttribute(); // logger.info("methodInfo.getConstPool().getSize():"); LocalVariableAttribute attribute = (LocalVariableAttribute) codeAttribute.getAttribute(LocalVariableAttribute.tag); // String[] names = new String[attribute.tableLength() - 1]; String[] paramNames = new String[ctMethod.getParameterTypes().length]; int pos = 0; if (true) { int size = attribute.tableLength(); if (size > 0) { String[] names = new String[size - 1]; for (int i = 0; i < names.length; i++) { names[i] = attribute.variableName(i); if ("this".equals(names[i])) { pos = i + 1; break; } } // logger.info(methodInfo.getName() + " pos:" + pos + " allNames:" + StringUtils.join(names, ", ")); } } // logger.info(methodInfo.getName() + " pos:" + pos); for (int i = 0; i < paramNames.length; i++) { // paramNames[i] = attribute.variableName(i + 1); try { paramNames[i] = attribute.variableName(i + pos); // logger.info("paramNames[" + i + "]:" + paramNames[i]); } catch (RuntimeException e) { throw e; } } // System.err.println("paramNames:" + StringUtils.join(paramNames)); return paramNames; }
class class_name[name] begin[{] method[getParameterNames, return_type[type[String]], modifier[public static], parameter[ctMethod]] begin[{] local_variable[type[MethodInfo], methodInfo] local_variable[type[CodeAttribute], codeAttribute] local_variable[type[LocalVariableAttribute], attribute] local_variable[type[String], paramNames] local_variable[type[int], pos] if[literal[true]] begin[{] local_variable[type[int], size] if[binary_operation[member[.size], >, literal[0]]] begin[{] local_variable[type[String], names] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=names, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=variableName, postfix_operators=[], prefix_operators=[], qualifier=attribute, selectors=[], type_arguments=None)), label=None), IfStatement(condition=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=names, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], value="this"), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=pos, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+)), 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=names, 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) else begin[{] None end[}] else begin[{] None end[}] ForStatement(body=BlockStatement(label=None, statements=[TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=paramNames, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=pos, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=variableName, postfix_operators=[], prefix_operators=[], qualifier=attribute, 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']))], finally_block=None, label=None, resources=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=paramNames, 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[.paramNames]] end[}] END[}]
Keyword[public] Keyword[static] identifier[String] operator[SEP] operator[SEP] identifier[getParameterNames] operator[SEP] identifier[CtMethod] identifier[ctMethod] operator[SEP] Keyword[throws] identifier[NotFoundException] { identifier[MethodInfo] identifier[methodInfo] operator[=] identifier[ctMethod] operator[SEP] identifier[getMethodInfo] operator[SEP] operator[SEP] operator[SEP] identifier[CodeAttribute] identifier[codeAttribute] operator[=] identifier[methodInfo] operator[SEP] identifier[getCodeAttribute] operator[SEP] operator[SEP] operator[SEP] identifier[LocalVariableAttribute] identifier[attribute] operator[=] operator[SEP] identifier[LocalVariableAttribute] operator[SEP] identifier[codeAttribute] operator[SEP] identifier[getAttribute] operator[SEP] identifier[LocalVariableAttribute] operator[SEP] identifier[tag] operator[SEP] operator[SEP] identifier[String] operator[SEP] operator[SEP] identifier[paramNames] operator[=] Keyword[new] identifier[String] operator[SEP] identifier[ctMethod] operator[SEP] identifier[getParameterTypes] operator[SEP] operator[SEP] operator[SEP] identifier[length] operator[SEP] operator[SEP] Keyword[int] identifier[pos] operator[=] Other[0] operator[SEP] Keyword[if] operator[SEP] literal[boolean] operator[SEP] { Keyword[int] identifier[size] operator[=] identifier[attribute] operator[SEP] identifier[tableLength] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[size] operator[>] Other[0] operator[SEP] { identifier[String] operator[SEP] operator[SEP] identifier[names] operator[=] Keyword[new] identifier[String] operator[SEP] identifier[size] operator[-] Other[1] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[names] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[names] operator[SEP] identifier[i] operator[SEP] operator[=] identifier[attribute] operator[SEP] identifier[variableName] operator[SEP] identifier[i] operator[SEP] operator[SEP] Keyword[if] operator[SEP] literal[String] operator[SEP] identifier[equals] operator[SEP] identifier[names] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP] { identifier[pos] operator[=] identifier[i] operator[+] Other[1] operator[SEP] Keyword[break] operator[SEP] } } } } Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[paramNames] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] { Keyword[try] { identifier[paramNames] operator[SEP] identifier[i] operator[SEP] operator[=] identifier[attribute] operator[SEP] identifier[variableName] operator[SEP] identifier[i] operator[+] identifier[pos] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[RuntimeException] identifier[e] operator[SEP] { Keyword[throw] identifier[e] operator[SEP] } } Keyword[return] identifier[paramNames] operator[SEP] }
public static X509Certificate getCertfromPEM(byte[] pemBytes) throws IOException, CertificateException, NoSuchProviderException { InputStream inStrm = new java.io.ByteArrayInputStream(pemBytes); X509Certificate cert = getCertfromPEM(inStrm); return cert; }
class class_name[name] begin[{] method[getCertfromPEM, return_type[type[X509Certificate]], modifier[public static], parameter[pemBytes]] begin[{] local_variable[type[InputStream], inStrm] local_variable[type[X509Certificate], cert] return[member[.cert]] end[}] END[}]
Keyword[public] Keyword[static] identifier[X509Certificate] identifier[getCertfromPEM] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[pemBytes] operator[SEP] Keyword[throws] identifier[IOException] , identifier[CertificateException] , identifier[NoSuchProviderException] { identifier[InputStream] identifier[inStrm] operator[=] Keyword[new] identifier[java] operator[SEP] identifier[io] operator[SEP] identifier[ByteArrayInputStream] operator[SEP] identifier[pemBytes] operator[SEP] operator[SEP] identifier[X509Certificate] identifier[cert] operator[=] identifier[getCertfromPEM] operator[SEP] identifier[inStrm] operator[SEP] operator[SEP] Keyword[return] identifier[cert] operator[SEP] }
private void makeLocalNamesUnique(Node fnNode, boolean isCallInLoop) { Supplier<String> idSupplier = compiler.getUniqueNameIdSupplier(); // Make variable names unique to this instance. NodeTraversal.traverseScopeRoots( compiler, null, ImmutableList.of(fnNode), new MakeDeclaredNamesUnique( new InlineRenamer( compiler.getCodingConvention(), idSupplier, "inline_", isCallInLoop, true, null), false), true); // Make label names unique to this instance. new RenameLabels(compiler, new LabelNameSupplier(idSupplier), false, false) .process(null, fnNode); }
class class_name[name] begin[{] method[makeLocalNamesUnique, return_type[void], modifier[private], parameter[fnNode, isCallInLoop]] begin[{] local_variable[type[Supplier], idSupplier] call[NodeTraversal.traverseScopeRoots, parameter[member[.compiler], literal[null], call[ImmutableList.of, parameter[member[.fnNode]]], ClassCreator(arguments=[ClassCreator(arguments=[MethodInvocation(arguments=[], member=getCodingConvention, postfix_operators=[], prefix_operators=[], qualifier=compiler, selectors=[], type_arguments=None), MemberReference(member=idSupplier, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="inline_"), MemberReference(member=isCallInLoop, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=InlineRenamer, sub_type=None)), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=MakeDeclaredNamesUnique, sub_type=None)), literal[true]]] ClassCreator(arguments=[MemberReference(member=compiler, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), ClassCreator(arguments=[MemberReference(member=idSupplier, 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=LabelNameSupplier, sub_type=None)), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), MemberReference(member=fnNode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=process, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=RenameLabels, sub_type=None)) end[}] END[}]
Keyword[private] Keyword[void] identifier[makeLocalNamesUnique] operator[SEP] identifier[Node] identifier[fnNode] , Keyword[boolean] identifier[isCallInLoop] operator[SEP] { identifier[Supplier] operator[<] identifier[String] operator[>] identifier[idSupplier] operator[=] identifier[compiler] operator[SEP] identifier[getUniqueNameIdSupplier] operator[SEP] operator[SEP] operator[SEP] identifier[NodeTraversal] operator[SEP] identifier[traverseScopeRoots] operator[SEP] identifier[compiler] , Other[null] , identifier[ImmutableList] operator[SEP] identifier[of] operator[SEP] identifier[fnNode] operator[SEP] , Keyword[new] identifier[MakeDeclaredNamesUnique] operator[SEP] Keyword[new] identifier[InlineRenamer] operator[SEP] identifier[compiler] operator[SEP] identifier[getCodingConvention] operator[SEP] operator[SEP] , identifier[idSupplier] , literal[String] , identifier[isCallInLoop] , literal[boolean] , Other[null] operator[SEP] , literal[boolean] operator[SEP] , literal[boolean] operator[SEP] operator[SEP] Keyword[new] identifier[RenameLabels] operator[SEP] identifier[compiler] , Keyword[new] identifier[LabelNameSupplier] operator[SEP] identifier[idSupplier] operator[SEP] , literal[boolean] , literal[boolean] operator[SEP] operator[SEP] identifier[process] operator[SEP] Other[null] , identifier[fnNode] operator[SEP] operator[SEP] }
@Override public EClass getIfcSweptDiskSolidPolygonal() { if (ifcSweptDiskSolidPolygonalEClass == null) { ifcSweptDiskSolidPolygonalEClass = (EClass) EPackage.Registry.INSTANCE.getEPackage(Ifc4Package.eNS_URI) .getEClassifiers().get(687); } return ifcSweptDiskSolidPolygonalEClass; }
class class_name[name] begin[{] method[getIfcSweptDiskSolidPolygonal, return_type[type[EClass]], modifier[public], parameter[]] begin[{] if[binary_operation[member[.ifcSweptDiskSolidPolygonalEClass], ==, literal[null]]] begin[{] assign[member[.ifcSweptDiskSolidPolygonalEClass], Cast(expression=MethodInvocation(arguments=[MemberReference(member=eNS_URI, postfix_operators=[], prefix_operators=[], qualifier=Ifc4Package, selectors=[])], member=getEPackage, postfix_operators=[], prefix_operators=[], qualifier=EPackage.Registry.INSTANCE, selectors=[MethodInvocation(arguments=[], member=getEClassifiers, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=687)], member=get, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=EClass, sub_type=None))] else begin[{] None end[}] return[member[.ifcSweptDiskSolidPolygonalEClass]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[EClass] identifier[getIfcSweptDiskSolidPolygonal] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[ifcSweptDiskSolidPolygonalEClass] operator[==] Other[null] operator[SEP] { identifier[ifcSweptDiskSolidPolygonalEClass] operator[=] operator[SEP] identifier[EClass] operator[SEP] identifier[EPackage] operator[SEP] identifier[Registry] operator[SEP] identifier[INSTANCE] operator[SEP] identifier[getEPackage] operator[SEP] identifier[Ifc4Package] operator[SEP] identifier[eNS_URI] operator[SEP] operator[SEP] identifier[getEClassifiers] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] Other[687] operator[SEP] operator[SEP] } Keyword[return] identifier[ifcSweptDiskSolidPolygonalEClass] operator[SEP] }
public static CmsXmlContainerPage createDocument( CmsObject cms, Locale locale, String encoding, CmsXmlContentDefinition contentDefinition) { // create the XML content CmsXmlContainerPage content = new CmsXmlContainerPage(cms, locale, encoding, contentDefinition); // call prepare for use content handler and return the result return (CmsXmlContainerPage)content.getHandler().prepareForUse(cms, content); }
class class_name[name] begin[{] method[createDocument, return_type[type[CmsXmlContainerPage]], modifier[public static], parameter[cms, locale, encoding, contentDefinition]] begin[{] local_variable[type[CmsXmlContainerPage], content] return[Cast(expression=MethodInvocation(arguments=[], member=getHandler, postfix_operators=[], prefix_operators=[], qualifier=content, selectors=[MethodInvocation(arguments=[MemberReference(member=cms, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=content, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=prepareForUse, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=CmsXmlContainerPage, sub_type=None))] end[}] END[}]
Keyword[public] Keyword[static] identifier[CmsXmlContainerPage] identifier[createDocument] operator[SEP] identifier[CmsObject] identifier[cms] , identifier[Locale] identifier[locale] , identifier[String] identifier[encoding] , identifier[CmsXmlContentDefinition] identifier[contentDefinition] operator[SEP] { identifier[CmsXmlContainerPage] identifier[content] operator[=] Keyword[new] identifier[CmsXmlContainerPage] operator[SEP] identifier[cms] , identifier[locale] , identifier[encoding] , identifier[contentDefinition] operator[SEP] operator[SEP] Keyword[return] operator[SEP] identifier[CmsXmlContainerPage] operator[SEP] identifier[content] operator[SEP] identifier[getHandler] operator[SEP] operator[SEP] operator[SEP] identifier[prepareForUse] operator[SEP] identifier[cms] , identifier[content] operator[SEP] operator[SEP] }
public void warn( String messagePattern, Object arg1, Object arg2 ) { if( m_delegate.isWarnEnabled() ) { String msgStr = MessageFormatter.format( messagePattern, arg1, arg2 ); m_delegate.warn( msgStr, null ); } }
class class_name[name] begin[{] method[warn, return_type[void], modifier[public], parameter[messagePattern, arg1, arg2]] begin[{] if[call[m_delegate.isWarnEnabled, parameter[]]] begin[{] local_variable[type[String], msgStr] call[m_delegate.warn, parameter[member[.msgStr], literal[null]]] else begin[{] None end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[warn] operator[SEP] identifier[String] identifier[messagePattern] , identifier[Object] identifier[arg1] , identifier[Object] identifier[arg2] operator[SEP] { Keyword[if] operator[SEP] identifier[m_delegate] operator[SEP] identifier[isWarnEnabled] operator[SEP] operator[SEP] operator[SEP] { identifier[String] identifier[msgStr] operator[=] identifier[MessageFormatter] operator[SEP] identifier[format] operator[SEP] identifier[messagePattern] , identifier[arg1] , identifier[arg2] operator[SEP] operator[SEP] identifier[m_delegate] operator[SEP] identifier[warn] operator[SEP] identifier[msgStr] , Other[null] operator[SEP] operator[SEP] } }
public ServiceFuture<ClusterInner> getAsync(String resourceGroupName, String workspaceName, String clusterName, final ServiceCallback<ClusterInner> serviceCallback) { return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, workspaceName, clusterName), serviceCallback); }
class class_name[name] begin[{] method[getAsync, return_type[type[ServiceFuture]], modifier[public], parameter[resourceGroupName, workspaceName, clusterName, serviceCallback]] begin[{] return[call[ServiceFuture.fromResponse, parameter[call[.getWithServiceResponseAsync, parameter[member[.resourceGroupName], member[.workspaceName], member[.clusterName]]], member[.serviceCallback]]]] end[}] END[}]
Keyword[public] identifier[ServiceFuture] operator[<] identifier[ClusterInner] operator[>] identifier[getAsync] operator[SEP] identifier[String] identifier[resourceGroupName] , identifier[String] identifier[workspaceName] , identifier[String] identifier[clusterName] , Keyword[final] identifier[ServiceCallback] operator[<] identifier[ClusterInner] operator[>] identifier[serviceCallback] operator[SEP] { Keyword[return] identifier[ServiceFuture] operator[SEP] identifier[fromResponse] operator[SEP] identifier[getWithServiceResponseAsync] operator[SEP] identifier[resourceGroupName] , identifier[workspaceName] , identifier[clusterName] operator[SEP] , identifier[serviceCallback] operator[SEP] operator[SEP] }
public static CmsSolrSpellchecker getInstance(CoreContainer container) { if (null == instance) { synchronized (CmsSolrSpellchecker.class) { if (null == instance) { @SuppressWarnings("resource") SolrCore spellcheckCore = container.getCore(CmsSolrSpellchecker.SPELLCHECKER_INDEX_CORE); if (spellcheckCore == null) { LOG.error( Messages.get().getBundle().key( Messages.ERR_SPELLCHECK_CORE_NOT_AVAILABLE_1, CmsSolrSpellchecker.SPELLCHECKER_INDEX_CORE)); return null; } instance = new CmsSolrSpellchecker(container, spellcheckCore); } } } return instance; }
class class_name[name] begin[{] method[getInstance, return_type[type[CmsSolrSpellchecker]], modifier[public static], parameter[container]] begin[{] if[binary_operation[literal[null], ==, member[.instance]]] begin[{] SYNCHRONIZED[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=CmsSolrSpellchecker, sub_type=None))] BEGIN[{] if[binary_operation[literal[null], ==, member[.instance]]] begin[{] local_variable[type[SolrCore], spellcheckCore] if[binary_operation[member[.spellcheckCore], ==, literal[null]]] begin[{] call[LOG.error, parameter[call[Messages.get, parameter[]]]] return[literal[null]] else begin[{] None end[}] assign[member[.instance], ClassCreator(arguments=[MemberReference(member=container, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=spellcheckCore, 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=CmsSolrSpellchecker, sub_type=None))] else begin[{] None end[}] END[}] else begin[{] None end[}] return[member[.instance]] end[}] END[}]
Keyword[public] Keyword[static] identifier[CmsSolrSpellchecker] identifier[getInstance] operator[SEP] identifier[CoreContainer] identifier[container] operator[SEP] { Keyword[if] operator[SEP] Other[null] operator[==] identifier[instance] operator[SEP] { Keyword[synchronized] operator[SEP] identifier[CmsSolrSpellchecker] operator[SEP] Keyword[class] operator[SEP] { Keyword[if] operator[SEP] Other[null] operator[==] identifier[instance] operator[SEP] { annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] identifier[SolrCore] identifier[spellcheckCore] operator[=] identifier[container] operator[SEP] identifier[getCore] operator[SEP] identifier[CmsSolrSpellchecker] operator[SEP] identifier[SPELLCHECKER_INDEX_CORE] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[spellcheckCore] operator[==] Other[null] operator[SEP] { identifier[LOG] operator[SEP] identifier[error] operator[SEP] identifier[Messages] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[getBundle] operator[SEP] operator[SEP] operator[SEP] identifier[key] operator[SEP] identifier[Messages] operator[SEP] identifier[ERR_SPELLCHECK_CORE_NOT_AVAILABLE_1] , identifier[CmsSolrSpellchecker] operator[SEP] identifier[SPELLCHECKER_INDEX_CORE] operator[SEP] operator[SEP] operator[SEP] Keyword[return] Other[null] operator[SEP] } identifier[instance] operator[=] Keyword[new] identifier[CmsSolrSpellchecker] operator[SEP] identifier[container] , identifier[spellcheckCore] operator[SEP] operator[SEP] } } } Keyword[return] identifier[instance] operator[SEP] }
public void failedTask(TaskInProgress tip, TaskAttemptID taskid, String reason, TaskStatus.Phase phase, TaskStatus.State state, String trackerName) { TaskStatus status = TaskStatus.createTaskStatus(tip.isMapTask(), taskid, 0.0f, tip.isMapTask() ? numSlotsPerMap : numSlotsPerReduce, state, reason, reason, trackerName, phase, new Counters()); // update the actual start-time of the attempt TaskStatus oldStatus = tip.getTaskStatus(taskid); long startTime = oldStatus == null ? JobTracker.getClock().getTime() : oldStatus.getStartTime(); status.setStartTime(startTime); long finishTime = JobTracker.getClock().getTime(); // update finish time only if needed, as map tasks can fail after completion if (tip.isMapTask() && oldStatus != null) { long oldFinishTime = oldStatus.getFinishTime(); if (oldFinishTime > 0) { finishTime = oldFinishTime; } } status.setFinishTime(finishTime); boolean wasComplete = tip.isComplete(); updateTaskStatus(tip, status); boolean isComplete = tip.isComplete(); if (wasComplete && !isComplete) { // mark a successful tip as failed String taskType = getTaskType(tip); JobHistory.Task.logFailed(tip.getTIPId(), taskType, tip.getExecFinishTime(), reason, taskid); } }
class class_name[name] begin[{] method[failedTask, return_type[void], modifier[public], parameter[tip, taskid, reason, phase, state, trackerName]] begin[{] local_variable[type[TaskStatus], status] local_variable[type[TaskStatus], oldStatus] local_variable[type[long], startTime] call[status.setStartTime, parameter[member[.startTime]]] local_variable[type[long], finishTime] if[binary_operation[call[tip.isMapTask, parameter[]], &&, binary_operation[member[.oldStatus], !=, literal[null]]]] begin[{] local_variable[type[long], oldFinishTime] if[binary_operation[member[.oldFinishTime], >, literal[0]]] begin[{] assign[member[.finishTime], member[.oldFinishTime]] else begin[{] None end[}] else begin[{] None end[}] call[status.setFinishTime, parameter[member[.finishTime]]] local_variable[type[boolean], wasComplete] call[.updateTaskStatus, parameter[member[.tip], member[.status]]] local_variable[type[boolean], isComplete] if[binary_operation[member[.wasComplete], &&, member[.isComplete]]] begin[{] local_variable[type[String], taskType] call[JobHistory.Task.logFailed, parameter[call[tip.getTIPId, parameter[]], member[.taskType], call[tip.getExecFinishTime, parameter[]], member[.reason], member[.taskid]]] else begin[{] None end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[failedTask] operator[SEP] identifier[TaskInProgress] identifier[tip] , identifier[TaskAttemptID] identifier[taskid] , identifier[String] identifier[reason] , identifier[TaskStatus] operator[SEP] identifier[Phase] identifier[phase] , identifier[TaskStatus] operator[SEP] identifier[State] identifier[state] , identifier[String] identifier[trackerName] operator[SEP] { identifier[TaskStatus] identifier[status] operator[=] identifier[TaskStatus] operator[SEP] identifier[createTaskStatus] operator[SEP] identifier[tip] operator[SEP] identifier[isMapTask] operator[SEP] operator[SEP] , identifier[taskid] , literal[Float] , identifier[tip] operator[SEP] identifier[isMapTask] operator[SEP] operator[SEP] operator[?] identifier[numSlotsPerMap] operator[:] identifier[numSlotsPerReduce] , identifier[state] , identifier[reason] , identifier[reason] , identifier[trackerName] , identifier[phase] , Keyword[new] identifier[Counters] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[TaskStatus] identifier[oldStatus] operator[=] identifier[tip] operator[SEP] identifier[getTaskStatus] operator[SEP] identifier[taskid] operator[SEP] operator[SEP] Keyword[long] identifier[startTime] operator[=] identifier[oldStatus] operator[==] Other[null] operator[?] identifier[JobTracker] operator[SEP] identifier[getClock] operator[SEP] operator[SEP] operator[SEP] identifier[getTime] operator[SEP] operator[SEP] operator[:] identifier[oldStatus] operator[SEP] identifier[getStartTime] operator[SEP] operator[SEP] operator[SEP] identifier[status] operator[SEP] identifier[setStartTime] operator[SEP] identifier[startTime] operator[SEP] operator[SEP] Keyword[long] identifier[finishTime] operator[=] identifier[JobTracker] operator[SEP] identifier[getClock] operator[SEP] operator[SEP] operator[SEP] identifier[getTime] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[tip] operator[SEP] identifier[isMapTask] operator[SEP] operator[SEP] operator[&&] identifier[oldStatus] operator[!=] Other[null] operator[SEP] { Keyword[long] identifier[oldFinishTime] operator[=] identifier[oldStatus] operator[SEP] identifier[getFinishTime] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[oldFinishTime] operator[>] Other[0] operator[SEP] { identifier[finishTime] operator[=] identifier[oldFinishTime] operator[SEP] } } identifier[status] operator[SEP] identifier[setFinishTime] operator[SEP] identifier[finishTime] operator[SEP] operator[SEP] Keyword[boolean] identifier[wasComplete] operator[=] identifier[tip] operator[SEP] identifier[isComplete] operator[SEP] operator[SEP] operator[SEP] identifier[updateTaskStatus] operator[SEP] identifier[tip] , identifier[status] operator[SEP] operator[SEP] Keyword[boolean] identifier[isComplete] operator[=] identifier[tip] operator[SEP] identifier[isComplete] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[wasComplete] operator[&&] operator[!] identifier[isComplete] operator[SEP] { identifier[String] identifier[taskType] operator[=] identifier[getTaskType] operator[SEP] identifier[tip] operator[SEP] operator[SEP] identifier[JobHistory] operator[SEP] identifier[Task] operator[SEP] identifier[logFailed] operator[SEP] identifier[tip] operator[SEP] identifier[getTIPId] operator[SEP] operator[SEP] , identifier[taskType] , identifier[tip] operator[SEP] identifier[getExecFinishTime] operator[SEP] operator[SEP] , identifier[reason] , identifier[taskid] operator[SEP] operator[SEP] } }
@SuppressWarnings("unchecked") @Override public Iterator<Map<String, String>> getChoices(final String _input) { final List<Map<String, String>> retList = new ArrayList<Map<String, String>>(); try { final AbstractUIPageObject pageObject = (AbstractUIPageObject) getPage().getDefaultModelObject(); final Map<String, String> uiID2Oid = pageObject == null ? null : pageObject.getUiID2Oid(); final List<Return> returns = this.autoComplete.getAutoCompletion(_input, uiID2Oid); for (final Return aReturn : returns) { final Object ob = aReturn.get(ReturnValues.VALUES); if (ob instanceof List) { retList.addAll((Collection<? extends Map<String, String>>) ob); } } } catch (final EFapsException e) { AutoCompleteComboBox.LOG.error("Error in getChoice()", e); } return retList.iterator(); }
class class_name[name] begin[{] method[getChoices, return_type[type[Iterator]], modifier[public], parameter[_input]] begin[{] local_variable[type[List], retList] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MethodInvocation(arguments=[], member=getPage, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[], member=getDefaultModelObject, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=AbstractUIPageObject, sub_type=None)), name=pageObject)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=AbstractUIPageObject, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=pageObject, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), if_false=MethodInvocation(arguments=[], member=getUiID2Oid, postfix_operators=[], prefix_operators=[], qualifier=pageObject, selectors=[], type_arguments=None), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)), name=uiID2Oid)], modifiers={'final'}, 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)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=autoComplete, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[MemberReference(member=_input, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=uiID2Oid, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getAutoCompletion, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), name=returns)], modifiers={'final'}, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Return, sub_type=None))], dimensions=[], name=List, sub_type=None)), ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=VALUES, postfix_operators=[], prefix_operators=[], qualifier=ReturnValues, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=aReturn, selectors=[], type_arguments=None), name=ob)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=ob, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=List, sub_type=None), operator=instanceof), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Cast(expression=MemberReference(member=ob, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=[TypeArgument(pattern_type=extends, 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))], dimensions=[], name=Collection, sub_type=None))], member=addAll, postfix_operators=[], prefix_operators=[], qualifier=retList, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=returns, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=aReturn)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=Return, sub_type=None))), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Error in getChoice()"), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=AutoCompleteComboBox.LOG, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['EFapsException']))], finally_block=None, label=None, resources=None) return[call[retList.iterator, parameter[]]] end[}] END[}]
annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] annotation[@] identifier[Override] Keyword[public] identifier[Iterator] operator[<] identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] operator[>] identifier[getChoices] operator[SEP] Keyword[final] identifier[String] identifier[_input] operator[SEP] { Keyword[final] identifier[List] operator[<] identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] operator[>] identifier[retList] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[try] { Keyword[final] identifier[AbstractUIPageObject] identifier[pageObject] operator[=] operator[SEP] identifier[AbstractUIPageObject] operator[SEP] identifier[getPage] operator[SEP] operator[SEP] operator[SEP] identifier[getDefaultModelObject] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[uiID2Oid] operator[=] identifier[pageObject] operator[==] Other[null] operator[?] Other[null] operator[:] identifier[pageObject] operator[SEP] identifier[getUiID2Oid] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[List] operator[<] identifier[Return] operator[>] identifier[returns] operator[=] Keyword[this] operator[SEP] identifier[autoComplete] operator[SEP] identifier[getAutoCompletion] operator[SEP] identifier[_input] , identifier[uiID2Oid] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[final] identifier[Return] identifier[aReturn] operator[:] identifier[returns] operator[SEP] { Keyword[final] identifier[Object] identifier[ob] operator[=] identifier[aReturn] operator[SEP] identifier[get] operator[SEP] identifier[ReturnValues] operator[SEP] identifier[VALUES] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[ob] Keyword[instanceof] identifier[List] operator[SEP] { identifier[retList] operator[SEP] identifier[addAll] operator[SEP] operator[SEP] identifier[Collection] operator[<] operator[?] Keyword[extends] identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] operator[>] operator[SEP] identifier[ob] operator[SEP] operator[SEP] } } } Keyword[catch] operator[SEP] Keyword[final] identifier[EFapsException] identifier[e] operator[SEP] { identifier[AutoCompleteComboBox] operator[SEP] identifier[LOG] operator[SEP] identifier[error] operator[SEP] literal[String] , identifier[e] operator[SEP] operator[SEP] } Keyword[return] identifier[retList] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] }
@Override public float readFloat() throws JMSException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "readFloat"); // don't need to call checkBodyReadable because it will be done in readInt() int savedEncoding = integerEncoding; // save this as we might corrupt it float result; try { switch (floatEncoding) { case ApiJmsConstants.ENC_FLOAT_IEEE_NORMAL: integerEncoding = ApiJmsConstants.ENC_INTEGER_NORMAL; result = Float.intBitsToFloat(readInt()); break; case ApiJmsConstants.ENC_FLOAT_IEEE_REVERSED: integerEncoding = ApiJmsConstants.ENC_INTEGER_REVERSED; result = Float.intBitsToFloat(readInt()); break; case ApiJmsConstants.ENC_FLOAT_S390: integerEncoding = ApiJmsConstants.ENC_INTEGER_NORMAL; result = JMS390FloatSupport.intS390BitsToFloat(readInt()); break; default: throw (JMSException) JmsErrorUtils.newThrowable( JMSException.class, "BAD_ENCODING_CWSIA0181", new Object[] { Integer.toHexString(floatEncoding) }, tc); } } // An error in the S390 floating point code may throw an IOException... catch (IOException ex) { // No FFDC code needed // d222942 review. Hopefully a rare and unusual case, default message ok. // d238447 review. Generate FFDC for this case. throw (JMSException) JmsErrorUtils.newThrowable( JMSException.class, "EXCEPTION_RECEIVED_CWSIA0190", new Object[] { ex, "JmsBytesMessageImpl.readFloat" }, ex, "JmsBytesMessageImpl.readFloat#1", this, tc ); } // Need to reinstate integerEncoding, in case it was affected finally { integerEncoding = savedEncoding; } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "readFloat", result); return result; }
class class_name[name] begin[{] method[readFloat, return_type[type[float]], modifier[public], parameter[]] begin[{] if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{] call[SibTr.entry, parameter[THIS[], member[.tc], literal["readFloat"]]] else begin[{] None end[}] local_variable[type[int], savedEncoding] local_variable[type[float], result] TryStatement(block=[SwitchStatement(cases=[SwitchStatementCase(case=[MemberReference(member=ENC_FLOAT_IEEE_NORMAL, postfix_operators=[], prefix_operators=[], qualifier=ApiJmsConstants, selectors=[])], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=integerEncoding, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=ENC_INTEGER_NORMAL, postfix_operators=[], prefix_operators=[], qualifier=ApiJmsConstants, selectors=[])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=readInt, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=intBitsToFloat, postfix_operators=[], prefix_operators=[], qualifier=Float, selectors=[], type_arguments=None)), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[MemberReference(member=ENC_FLOAT_IEEE_REVERSED, postfix_operators=[], prefix_operators=[], qualifier=ApiJmsConstants, selectors=[])], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=integerEncoding, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=ENC_INTEGER_REVERSED, postfix_operators=[], prefix_operators=[], qualifier=ApiJmsConstants, selectors=[])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=readInt, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=intBitsToFloat, postfix_operators=[], prefix_operators=[], qualifier=Float, selectors=[], type_arguments=None)), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[MemberReference(member=ENC_FLOAT_S390, postfix_operators=[], prefix_operators=[], qualifier=ApiJmsConstants, selectors=[])], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=integerEncoding, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=ENC_INTEGER_NORMAL, postfix_operators=[], prefix_operators=[], qualifier=ApiJmsConstants, selectors=[])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=readInt, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=intS390BitsToFloat, postfix_operators=[], prefix_operators=[], qualifier=JMS390FloatSupport, selectors=[], type_arguments=None)), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[], statements=[ThrowStatement(expression=Cast(expression=MethodInvocation(arguments=[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=JMSException, sub_type=None)), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="BAD_ENCODING_CWSIA0181"), ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MethodInvocation(arguments=[MemberReference(member=floatEncoding, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=toHexString, postfix_operators=[], prefix_operators=[], qualifier=Integer, selectors=[], type_arguments=None)]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Object, sub_type=None)), MemberReference(member=tc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=newThrowable, postfix_operators=[], prefix_operators=[], qualifier=JmsErrorUtils, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=JMSException, sub_type=None)), label=None)])], expression=MemberReference(member=floatEncoding, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=Cast(expression=MethodInvocation(arguments=[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=JMSException, sub_type=None)), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="EXCEPTION_RECEIVED_CWSIA0190"), ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MemberReference(member=ex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="JmsBytesMessageImpl.readFloat")]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Object, sub_type=None)), MemberReference(member=ex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="JmsBytesMessageImpl.readFloat#1"), This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), MemberReference(member=tc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=newThrowable, postfix_operators=[], prefix_operators=[], qualifier=JmsErrorUtils, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=JMSException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ex, types=['IOException']))], finally_block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=integerEncoding, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=savedEncoding, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)], label=None, resources=None) if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{] call[SibTr.exit, parameter[THIS[], member[.tc], literal["readFloat"], member[.result]]] else begin[{] None end[}] return[member[.result]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[float] identifier[readFloat] operator[SEP] operator[SEP] Keyword[throws] identifier[JMSException] { Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[entry] operator[SEP] Keyword[this] , identifier[tc] , literal[String] operator[SEP] operator[SEP] Keyword[int] identifier[savedEncoding] operator[=] identifier[integerEncoding] operator[SEP] Keyword[float] identifier[result] operator[SEP] Keyword[try] { Keyword[switch] operator[SEP] identifier[floatEncoding] operator[SEP] { Keyword[case] identifier[ApiJmsConstants] operator[SEP] identifier[ENC_FLOAT_IEEE_NORMAL] operator[:] identifier[integerEncoding] operator[=] identifier[ApiJmsConstants] operator[SEP] identifier[ENC_INTEGER_NORMAL] operator[SEP] identifier[result] operator[=] identifier[Float] operator[SEP] identifier[intBitsToFloat] operator[SEP] identifier[readInt] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[ApiJmsConstants] operator[SEP] identifier[ENC_FLOAT_IEEE_REVERSED] operator[:] identifier[integerEncoding] operator[=] identifier[ApiJmsConstants] operator[SEP] identifier[ENC_INTEGER_REVERSED] operator[SEP] identifier[result] operator[=] identifier[Float] operator[SEP] identifier[intBitsToFloat] operator[SEP] identifier[readInt] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[ApiJmsConstants] operator[SEP] identifier[ENC_FLOAT_S390] operator[:] identifier[integerEncoding] operator[=] identifier[ApiJmsConstants] operator[SEP] identifier[ENC_INTEGER_NORMAL] operator[SEP] identifier[result] operator[=] identifier[JMS390FloatSupport] operator[SEP] identifier[intS390BitsToFloat] operator[SEP] identifier[readInt] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[default] operator[:] Keyword[throw] operator[SEP] identifier[JMSException] operator[SEP] identifier[JmsErrorUtils] operator[SEP] identifier[newThrowable] operator[SEP] identifier[JMSException] operator[SEP] Keyword[class] , literal[String] , Keyword[new] identifier[Object] operator[SEP] operator[SEP] { identifier[Integer] operator[SEP] identifier[toHexString] operator[SEP] identifier[floatEncoding] operator[SEP] } , identifier[tc] operator[SEP] operator[SEP] } } Keyword[catch] operator[SEP] identifier[IOException] identifier[ex] operator[SEP] { Keyword[throw] operator[SEP] identifier[JMSException] operator[SEP] identifier[JmsErrorUtils] operator[SEP] identifier[newThrowable] operator[SEP] identifier[JMSException] operator[SEP] Keyword[class] , literal[String] , Keyword[new] identifier[Object] operator[SEP] operator[SEP] { identifier[ex] , literal[String] } , identifier[ex] , literal[String] , Keyword[this] , identifier[tc] operator[SEP] operator[SEP] } Keyword[finally] { identifier[integerEncoding] operator[=] identifier[savedEncoding] operator[SEP] } Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[exit] operator[SEP] Keyword[this] , identifier[tc] , literal[String] , identifier[result] operator[SEP] operator[SEP] Keyword[return] identifier[result] operator[SEP] }
@Override public EEnum getIfcFlowMeterTypeEnum() { if (ifcFlowMeterTypeEnumEEnum == null) { ifcFlowMeterTypeEnumEEnum = (EEnum) EPackage.Registry.INSTANCE.getEPackage(Ifc4Package.eNS_URI) .getEClassifiers().get(994); } return ifcFlowMeterTypeEnumEEnum; }
class class_name[name] begin[{] method[getIfcFlowMeterTypeEnum, return_type[type[EEnum]], modifier[public], parameter[]] begin[{] if[binary_operation[member[.ifcFlowMeterTypeEnumEEnum], ==, literal[null]]] begin[{] assign[member[.ifcFlowMeterTypeEnumEEnum], Cast(expression=MethodInvocation(arguments=[MemberReference(member=eNS_URI, postfix_operators=[], prefix_operators=[], qualifier=Ifc4Package, selectors=[])], member=getEPackage, postfix_operators=[], prefix_operators=[], qualifier=EPackage.Registry.INSTANCE, selectors=[MethodInvocation(arguments=[], member=getEClassifiers, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=994)], member=get, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=EEnum, sub_type=None))] else begin[{] None end[}] return[member[.ifcFlowMeterTypeEnumEEnum]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[EEnum] identifier[getIfcFlowMeterTypeEnum] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[ifcFlowMeterTypeEnumEEnum] operator[==] Other[null] operator[SEP] { identifier[ifcFlowMeterTypeEnumEEnum] operator[=] operator[SEP] identifier[EEnum] operator[SEP] identifier[EPackage] operator[SEP] identifier[Registry] operator[SEP] identifier[INSTANCE] operator[SEP] identifier[getEPackage] operator[SEP] identifier[Ifc4Package] operator[SEP] identifier[eNS_URI] operator[SEP] operator[SEP] identifier[getEClassifiers] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] Other[994] operator[SEP] operator[SEP] } Keyword[return] identifier[ifcFlowMeterTypeEnumEEnum] operator[SEP] }
private void _decompose (final char [] bits, final int bias, final int reserved, final int signIndex, final int signSize, final int exponentIndex, final int exponentSize, final int fractionIndex, final int fractionSize) { this.m_nBias = bias; // Extract the individual parts as strings of '0' and '1'. m_sSignBit = new String (bits, signIndex, signSize); m_sExponentBits = new String (bits, exponentIndex, exponentSize); m_sFractionBits = new String (bits, fractionIndex, fractionSize); try { m_nBiased = Integer.parseInt (m_sExponentBits, 2); m_nFraction = Long.parseLong (m_sFractionBits, 2); } catch (final NumberFormatException ex) {} m_bIsZero = (m_nBiased == 0) && (m_nFraction == 0); m_bIsDenormalized = (m_nBiased == 0) && (m_nFraction != 0); m_bIsReserved = (m_nBiased == reserved); m_sImpliedBit = m_bIsDenormalized || m_bIsZero || m_bIsReserved ? "0" : "1"; }
class class_name[name] begin[{] method[_decompose, return_type[void], modifier[private], parameter[bits, bias, reserved, signIndex, signSize, exponentIndex, exponentSize, fractionIndex, fractionSize]] begin[{] assign[THIS[member[None.m_nBias]], member[.bias]] assign[member[.m_sSignBit], ClassCreator(arguments=[MemberReference(member=bits, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=signIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=signSize, 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=String, sub_type=None))] assign[member[.m_sExponentBits], ClassCreator(arguments=[MemberReference(member=bits, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=exponentIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=exponentSize, 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=String, sub_type=None))] assign[member[.m_sFractionBits], ClassCreator(arguments=[MemberReference(member=bits, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=fractionIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=fractionSize, 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=String, sub_type=None))] TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=m_nBiased, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=m_sExponentBits, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2)], member=parseInt, postfix_operators=[], prefix_operators=[], qualifier=Integer, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=m_nFraction, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=m_sFractionBits, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2)], member=parseLong, postfix_operators=[], prefix_operators=[], qualifier=Long, selectors=[], type_arguments=None)), label=None)], catches=[CatchClause(block=[], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ex, types=['NumberFormatException']))], finally_block=None, label=None, resources=None) assign[member[.m_bIsZero], binary_operation[binary_operation[member[.m_nBiased], ==, literal[0]], &&, binary_operation[member[.m_nFraction], ==, literal[0]]]] assign[member[.m_bIsDenormalized], binary_operation[binary_operation[member[.m_nBiased], ==, literal[0]], &&, binary_operation[member[.m_nFraction], !=, literal[0]]]] assign[member[.m_bIsReserved], binary_operation[member[.m_nBiased], ==, member[.reserved]]] assign[member[.m_sImpliedBit], TernaryExpression(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=m_bIsDenormalized, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=m_bIsZero, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=||), operandr=MemberReference(member=m_bIsReserved, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=||), if_false=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="1"), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="0"))] end[}] END[}]
Keyword[private] Keyword[void] identifier[_decompose] operator[SEP] Keyword[final] Keyword[char] operator[SEP] operator[SEP] identifier[bits] , Keyword[final] Keyword[int] identifier[bias] , Keyword[final] Keyword[int] identifier[reserved] , Keyword[final] Keyword[int] identifier[signIndex] , Keyword[final] Keyword[int] identifier[signSize] , Keyword[final] Keyword[int] identifier[exponentIndex] , Keyword[final] Keyword[int] identifier[exponentSize] , Keyword[final] Keyword[int] identifier[fractionIndex] , Keyword[final] Keyword[int] identifier[fractionSize] operator[SEP] { Keyword[this] operator[SEP] identifier[m_nBias] operator[=] identifier[bias] operator[SEP] identifier[m_sSignBit] operator[=] Keyword[new] identifier[String] operator[SEP] identifier[bits] , identifier[signIndex] , identifier[signSize] operator[SEP] operator[SEP] identifier[m_sExponentBits] operator[=] Keyword[new] identifier[String] operator[SEP] identifier[bits] , identifier[exponentIndex] , identifier[exponentSize] operator[SEP] operator[SEP] identifier[m_sFractionBits] operator[=] Keyword[new] identifier[String] operator[SEP] identifier[bits] , identifier[fractionIndex] , identifier[fractionSize] operator[SEP] operator[SEP] Keyword[try] { identifier[m_nBiased] operator[=] identifier[Integer] operator[SEP] identifier[parseInt] operator[SEP] identifier[m_sExponentBits] , Other[2] operator[SEP] operator[SEP] identifier[m_nFraction] operator[=] identifier[Long] operator[SEP] identifier[parseLong] operator[SEP] identifier[m_sFractionBits] , Other[2] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] Keyword[final] identifier[NumberFormatException] identifier[ex] operator[SEP] { } identifier[m_bIsZero] operator[=] operator[SEP] identifier[m_nBiased] operator[==] Other[0] operator[SEP] operator[&&] operator[SEP] identifier[m_nFraction] operator[==] Other[0] operator[SEP] operator[SEP] identifier[m_bIsDenormalized] operator[=] operator[SEP] identifier[m_nBiased] operator[==] Other[0] operator[SEP] operator[&&] operator[SEP] identifier[m_nFraction] operator[!=] Other[0] operator[SEP] operator[SEP] identifier[m_bIsReserved] operator[=] operator[SEP] identifier[m_nBiased] operator[==] identifier[reserved] operator[SEP] operator[SEP] identifier[m_sImpliedBit] operator[=] identifier[m_bIsDenormalized] operator[||] identifier[m_bIsZero] operator[||] identifier[m_bIsReserved] operator[?] literal[String] operator[:] literal[String] operator[SEP] }
@Override public CommerceWishListItem findByCPInstanceUuid_First( String CPInstanceUuid, OrderByComparator<CommerceWishListItem> orderByComparator) throws NoSuchWishListItemException { CommerceWishListItem commerceWishListItem = fetchByCPInstanceUuid_First(CPInstanceUuid, orderByComparator); if (commerceWishListItem != null) { return commerceWishListItem; } StringBundler msg = new StringBundler(4); msg.append(_NO_SUCH_ENTITY_WITH_KEY); msg.append("CPInstanceUuid="); msg.append(CPInstanceUuid); msg.append("}"); throw new NoSuchWishListItemException(msg.toString()); }
class class_name[name] begin[{] method[findByCPInstanceUuid_First, return_type[type[CommerceWishListItem]], modifier[public], parameter[CPInstanceUuid, orderByComparator]] begin[{] local_variable[type[CommerceWishListItem], commerceWishListItem] if[binary_operation[member[.commerceWishListItem], !=, literal[null]]] begin[{] return[member[.commerceWishListItem]] else begin[{] None end[}] local_variable[type[StringBundler], msg] call[msg.append, parameter[member[._NO_SUCH_ENTITY_WITH_KEY]]] call[msg.append, parameter[literal["CPInstanceUuid="]]] call[msg.append, parameter[member[.CPInstanceUuid]]] call[msg.append, parameter[literal["}"]]] ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=msg, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=NoSuchWishListItemException, sub_type=None)), label=None) end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[CommerceWishListItem] identifier[findByCPInstanceUuid_First] operator[SEP] identifier[String] identifier[CPInstanceUuid] , identifier[OrderByComparator] operator[<] identifier[CommerceWishListItem] operator[>] identifier[orderByComparator] operator[SEP] Keyword[throws] identifier[NoSuchWishListItemException] { identifier[CommerceWishListItem] identifier[commerceWishListItem] operator[=] identifier[fetchByCPInstanceUuid_First] operator[SEP] identifier[CPInstanceUuid] , identifier[orderByComparator] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[commerceWishListItem] operator[!=] Other[null] operator[SEP] { Keyword[return] identifier[commerceWishListItem] operator[SEP] } identifier[StringBundler] identifier[msg] operator[=] Keyword[new] identifier[StringBundler] operator[SEP] Other[4] operator[SEP] operator[SEP] identifier[msg] operator[SEP] identifier[append] operator[SEP] identifier[_NO_SUCH_ENTITY_WITH_KEY] operator[SEP] operator[SEP] identifier[msg] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[msg] operator[SEP] identifier[append] operator[SEP] identifier[CPInstanceUuid] operator[SEP] operator[SEP] identifier[msg] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[NoSuchWishListItemException] operator[SEP] identifier[msg] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
public static MotionDirection getHorizontalMotionDirection(MotionEvent e1, MotionEvent e2) { return getHorizontalMotionDirection(e1, e2, DEFAULT_THRESHOLD); }
class class_name[name] begin[{] method[getHorizontalMotionDirection, return_type[type[MotionDirection]], modifier[public static], parameter[e1, e2]] begin[{] return[call[.getHorizontalMotionDirection, parameter[member[.e1], member[.e2], member[.DEFAULT_THRESHOLD]]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[MotionDirection] identifier[getHorizontalMotionDirection] operator[SEP] identifier[MotionEvent] identifier[e1] , identifier[MotionEvent] identifier[e2] operator[SEP] { Keyword[return] identifier[getHorizontalMotionDirection] operator[SEP] identifier[e1] , identifier[e2] , identifier[DEFAULT_THRESHOLD] operator[SEP] operator[SEP] }
public static double quantile(double val, double loc, double scale, double shape) { if(shape == 0.) { return loc - scale * FastMath.log((1 - val) / val); } return loc + scale * (1 - FastMath.pow((1 - val) / val, shape)) / shape; }
class class_name[name] begin[{] method[quantile, return_type[type[double]], modifier[public static], parameter[val, loc, scale, shape]] begin[{] if[binary_operation[member[.shape], ==, literal[0.]]] begin[{] return[binary_operation[member[.loc], -, binary_operation[member[.scale], *, call[FastMath.log, parameter[binary_operation[binary_operation[literal[1], -, member[.val]], /, member[.val]]]]]]] else begin[{] None end[}] return[binary_operation[member[.loc], +, binary_operation[binary_operation[member[.scale], *, binary_operation[literal[1], -, call[FastMath.pow, parameter[binary_operation[binary_operation[literal[1], -, member[.val]], /, member[.val]], member[.shape]]]]], /, member[.shape]]]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[double] identifier[quantile] operator[SEP] Keyword[double] identifier[val] , Keyword[double] identifier[loc] , Keyword[double] identifier[scale] , Keyword[double] identifier[shape] operator[SEP] { Keyword[if] operator[SEP] identifier[shape] operator[==] literal[Float] operator[SEP] { Keyword[return] identifier[loc] operator[-] identifier[scale] operator[*] identifier[FastMath] operator[SEP] identifier[log] operator[SEP] operator[SEP] Other[1] operator[-] identifier[val] operator[SEP] operator[/] identifier[val] operator[SEP] operator[SEP] } Keyword[return] identifier[loc] operator[+] identifier[scale] operator[*] operator[SEP] Other[1] operator[-] identifier[FastMath] operator[SEP] identifier[pow] operator[SEP] operator[SEP] Other[1] operator[-] identifier[val] operator[SEP] operator[/] identifier[val] , identifier[shape] operator[SEP] operator[SEP] operator[/] identifier[shape] operator[SEP] }
@Override public AttributesDao getAttributesDao(Contents contents) { if (contents == null) { throw new GeoPackageException("Non null " + Contents.class.getSimpleName() + " is required to create " + AttributesDao.class.getSimpleName()); } if (contents.getDataType() != ContentsDataType.ATTRIBUTES) { throw new GeoPackageException(Contents.class.getSimpleName() + " is required to be of type " + ContentsDataType.ATTRIBUTES + ". Actual: " + contents.getDataTypeString()); } // Read the existing table and create the dao AttributesTableReader tableReader = new AttributesTableReader( contents.getTableName()); AttributesConnection userDb = new AttributesConnection(database); final AttributesTable attributesTable = tableReader.readTable(userDb); attributesTable.setContents(contents); AttributesDao dao = new AttributesDao(getName(), database, userDb, attributesTable); return dao; }
class class_name[name] begin[{] method[getAttributesDao, return_type[type[AttributesDao]], modifier[public], parameter[contents]] begin[{] if[binary_operation[member[.contents], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Non null "), operandr=ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[], member=getSimpleName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=Contents, sub_type=None)), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" is required to create "), operator=+), operandr=ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[], member=getSimpleName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=AttributesDao, sub_type=None)), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=GeoPackageException, sub_type=None)), label=None) else begin[{] None end[}] if[binary_operation[call[contents.getDataType, parameter[]], !=, member[ContentsDataType.ATTRIBUTES]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[], member=getSimpleName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=Contents, sub_type=None)), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" is required to be of type "), operator=+), operandr=MemberReference(member=ATTRIBUTES, postfix_operators=[], prefix_operators=[], qualifier=ContentsDataType, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=". Actual: "), operator=+), operandr=MethodInvocation(arguments=[], member=getDataTypeString, postfix_operators=[], prefix_operators=[], qualifier=contents, selectors=[], type_arguments=None), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=GeoPackageException, sub_type=None)), label=None) else begin[{] None end[}] local_variable[type[AttributesTableReader], tableReader] local_variable[type[AttributesConnection], userDb] local_variable[type[AttributesTable], attributesTable] call[attributesTable.setContents, parameter[member[.contents]]] local_variable[type[AttributesDao], dao] return[member[.dao]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[AttributesDao] identifier[getAttributesDao] operator[SEP] identifier[Contents] identifier[contents] operator[SEP] { Keyword[if] operator[SEP] identifier[contents] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[GeoPackageException] operator[SEP] literal[String] operator[+] identifier[Contents] operator[SEP] Keyword[class] operator[SEP] identifier[getSimpleName] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[AttributesDao] operator[SEP] Keyword[class] operator[SEP] identifier[getSimpleName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[contents] operator[SEP] identifier[getDataType] operator[SEP] operator[SEP] operator[!=] identifier[ContentsDataType] operator[SEP] identifier[ATTRIBUTES] operator[SEP] { Keyword[throw] Keyword[new] identifier[GeoPackageException] operator[SEP] identifier[Contents] operator[SEP] Keyword[class] operator[SEP] identifier[getSimpleName] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[ContentsDataType] operator[SEP] identifier[ATTRIBUTES] operator[+] literal[String] operator[+] identifier[contents] operator[SEP] identifier[getDataTypeString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[AttributesTableReader] identifier[tableReader] operator[=] Keyword[new] identifier[AttributesTableReader] operator[SEP] identifier[contents] operator[SEP] identifier[getTableName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[AttributesConnection] identifier[userDb] operator[=] Keyword[new] identifier[AttributesConnection] operator[SEP] identifier[database] operator[SEP] operator[SEP] Keyword[final] identifier[AttributesTable] identifier[attributesTable] operator[=] identifier[tableReader] operator[SEP] identifier[readTable] operator[SEP] identifier[userDb] operator[SEP] operator[SEP] identifier[attributesTable] operator[SEP] identifier[setContents] operator[SEP] identifier[contents] operator[SEP] operator[SEP] identifier[AttributesDao] identifier[dao] operator[=] Keyword[new] identifier[AttributesDao] operator[SEP] identifier[getName] operator[SEP] operator[SEP] , identifier[database] , identifier[userDb] , identifier[attributesTable] operator[SEP] operator[SEP] Keyword[return] identifier[dao] operator[SEP] }
public Document.Calendars.Calendar.ExceptedDays.ExceptedDay.TimePeriods createDocumentCalendarsCalendarExceptedDaysExceptedDayTimePeriods() { return new Document.Calendars.Calendar.ExceptedDays.ExceptedDay.TimePeriods(); }
class class_name[name] begin[{] method[createDocumentCalendarsCalendarExceptedDaysExceptedDayTimePeriods, return_type[type[Document]], modifier[public], parameter[]] begin[{] return[ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Document, sub_type=ReferenceType(arguments=None, dimensions=None, name=Calendars, sub_type=ReferenceType(arguments=None, dimensions=None, name=Calendar, sub_type=ReferenceType(arguments=None, dimensions=None, name=ExceptedDays, sub_type=ReferenceType(arguments=None, dimensions=None, name=ExceptedDay, sub_type=ReferenceType(arguments=None, dimensions=None, name=TimePeriods, sub_type=None)))))))] end[}] END[}]
Keyword[public] identifier[Document] operator[SEP] identifier[Calendars] operator[SEP] identifier[Calendar] operator[SEP] identifier[ExceptedDays] operator[SEP] identifier[ExceptedDay] operator[SEP] identifier[TimePeriods] identifier[createDocumentCalendarsCalendarExceptedDaysExceptedDayTimePeriods] operator[SEP] operator[SEP] { Keyword[return] Keyword[new] identifier[Document] operator[SEP] identifier[Calendars] operator[SEP] identifier[Calendar] operator[SEP] identifier[ExceptedDays] operator[SEP] identifier[ExceptedDay] operator[SEP] identifier[TimePeriods] operator[SEP] operator[SEP] operator[SEP] }
public static String getESIDependencies(Enumeration e1, Enumeration e2) { if ((e1 == null || !e1.hasMoreElements())) if ((e2 == null || !e2.hasMoreElements())) return null; StringBuffer sb = new StringBuffer("dependencies=\""); if (e1 != null) while (e1.hasMoreElements()) { sb.append(" "); sb.append((String) e1.nextElement()); } if (e2 != null) while (e2.hasMoreElements()) { sb.append(" "); sb.append((String) e2.nextElement()); } //don't append a trailing double quote, since we have to add the cache id later return sb.toString(); }
class class_name[name] begin[{] method[getESIDependencies, return_type[type[String]], modifier[public static], parameter[e1, e2]] begin[{] if[binary_operation[binary_operation[member[.e1], ==, literal[null]], ||, call[e1.hasMoreElements, parameter[]]]] begin[{] if[binary_operation[binary_operation[member[.e2], ==, literal[null]], ||, call[e2.hasMoreElements, parameter[]]]] begin[{] return[literal[null]] else begin[{] None end[}] else begin[{] None end[}] local_variable[type[StringBuffer], sb] if[binary_operation[member[.e1], !=, literal[null]]] begin[{] while[call[e1.hasMoreElements, parameter[]]] begin[{] call[sb.append, parameter[literal[" "]]] call[sb.append, parameter[Cast(expression=MethodInvocation(arguments=[], member=nextElement, postfix_operators=[], prefix_operators=[], qualifier=e1, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))]] end[}] else begin[{] None end[}] if[binary_operation[member[.e2], !=, literal[null]]] begin[{] while[call[e2.hasMoreElements, parameter[]]] begin[{] call[sb.append, parameter[literal[" "]]] call[sb.append, parameter[Cast(expression=MethodInvocation(arguments=[], member=nextElement, postfix_operators=[], prefix_operators=[], qualifier=e2, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))]] end[}] else begin[{] None end[}] return[call[sb.toString, parameter[]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[String] identifier[getESIDependencies] operator[SEP] identifier[Enumeration] identifier[e1] , identifier[Enumeration] identifier[e2] operator[SEP] { Keyword[if] operator[SEP] operator[SEP] identifier[e1] operator[==] Other[null] operator[||] operator[!] identifier[e1] operator[SEP] identifier[hasMoreElements] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[SEP] identifier[e2] operator[==] Other[null] operator[||] operator[!] identifier[e2] operator[SEP] identifier[hasMoreElements] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] Other[null] operator[SEP] identifier[StringBuffer] identifier[sb] operator[=] Keyword[new] identifier[StringBuffer] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[e1] operator[!=] Other[null] operator[SEP] Keyword[while] operator[SEP] identifier[e1] operator[SEP] identifier[hasMoreElements] operator[SEP] operator[SEP] operator[SEP] { identifier[sb] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[sb] operator[SEP] identifier[append] operator[SEP] operator[SEP] identifier[String] operator[SEP] identifier[e1] operator[SEP] identifier[nextElement] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[e2] operator[!=] Other[null] operator[SEP] Keyword[while] operator[SEP] identifier[e2] operator[SEP] identifier[hasMoreElements] operator[SEP] operator[SEP] operator[SEP] { identifier[sb] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[sb] operator[SEP] identifier[append] operator[SEP] operator[SEP] identifier[String] operator[SEP] identifier[e2] operator[SEP] identifier[nextElement] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[sb] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] }
private static synchronized ProfileCredentialsService getProfileCredentialService() { if (STS_CREDENTIALS_SERVICE == null) { try { STS_CREDENTIALS_SERVICE = (ProfileCredentialsService) Class.forName(CLASS_NAME) .newInstance(); } catch (ClassNotFoundException ex) { throw new SdkClientException( "To use assume role profiles the aws-java-sdk-sts module must be on the class path.", ex); } catch (InstantiationException ex) { throw new SdkClientException("Failed to instantiate " + CLASS_NAME, ex); } catch (IllegalAccessException ex) { throw new SdkClientException("Failed to instantiate " + CLASS_NAME, ex); } } return STS_CREDENTIALS_SERVICE; }
class class_name[name] begin[{] method[getProfileCredentialService, return_type[type[ProfileCredentialsService]], modifier[synchronized private static], parameter[]] begin[{] if[binary_operation[member[.STS_CREDENTIALS_SERVICE], ==, literal[null]]] begin[{] TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=STS_CREDENTIALS_SERVICE, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Cast(expression=MethodInvocation(arguments=[MemberReference(member=CLASS_NAME, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=forName, postfix_operators=[], prefix_operators=[], qualifier=Class, selectors=[MethodInvocation(arguments=[], member=newInstance, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=ProfileCredentialsService, sub_type=None))), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="To use assume role profiles the aws-java-sdk-sts module must be on the class path."), MemberReference(member=ex, 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=ex, types=['ClassNotFoundException'])), CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Failed to instantiate "), operandr=MemberReference(member=CLASS_NAME, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), MemberReference(member=ex, 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=ex, types=['InstantiationException'])), CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Failed to instantiate "), operandr=MemberReference(member=CLASS_NAME, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), MemberReference(member=ex, 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=ex, types=['IllegalAccessException']))], finally_block=None, label=None, resources=None) else begin[{] None end[}] return[member[.STS_CREDENTIALS_SERVICE]] end[}] END[}]
Keyword[private] Keyword[static] Keyword[synchronized] identifier[ProfileCredentialsService] identifier[getProfileCredentialService] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[STS_CREDENTIALS_SERVICE] operator[==] Other[null] operator[SEP] { Keyword[try] { identifier[STS_CREDENTIALS_SERVICE] operator[=] operator[SEP] identifier[ProfileCredentialsService] operator[SEP] identifier[Class] operator[SEP] identifier[forName] operator[SEP] identifier[CLASS_NAME] operator[SEP] operator[SEP] identifier[newInstance] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[ClassNotFoundException] identifier[ex] operator[SEP] { Keyword[throw] Keyword[new] identifier[SdkClientException] operator[SEP] literal[String] , identifier[ex] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[InstantiationException] identifier[ex] operator[SEP] { Keyword[throw] Keyword[new] identifier[SdkClientException] operator[SEP] literal[String] operator[+] identifier[CLASS_NAME] , identifier[ex] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[IllegalAccessException] identifier[ex] operator[SEP] { Keyword[throw] Keyword[new] identifier[SdkClientException] operator[SEP] literal[String] operator[+] identifier[CLASS_NAME] , identifier[ex] operator[SEP] operator[SEP] } } Keyword[return] identifier[STS_CREDENTIALS_SERVICE] operator[SEP] }
public void readExternal(java.io.ObjectInput in) throws java.io.IOException, ClassNotFoundException { HashMap map = (HashMap)in.readObject(); this.putAll(map); }
class class_name[name] begin[{] method[readExternal, return_type[void], modifier[public], parameter[in]] begin[{] local_variable[type[HashMap], map] THIS[call[None.putAll, parameter[member[.map]]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[readExternal] operator[SEP] identifier[java] operator[SEP] identifier[io] operator[SEP] identifier[ObjectInput] identifier[in] operator[SEP] Keyword[throws] identifier[java] operator[SEP] identifier[io] operator[SEP] identifier[IOException] , identifier[ClassNotFoundException] { identifier[HashMap] identifier[map] operator[=] operator[SEP] identifier[HashMap] operator[SEP] identifier[in] operator[SEP] identifier[readObject] operator[SEP] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[putAll] operator[SEP] identifier[map] operator[SEP] operator[SEP] }
public Collection<JavaClassSource> allResources() { Set<JavaClassSource> result = new HashSet<>(); for (DTOPair pair : dtos.values()) { if (pair.rootDTO != null) { result.add(pair.rootDTO); } if (pair.nestedDTO != null) { result.add(pair.nestedDTO); } } return result; }
class class_name[name] begin[{] method[allResources, return_type[type[Collection]], modifier[public], parameter[]] begin[{] local_variable[type[Set], result] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=rootDTO, postfix_operators=[], prefix_operators=[], qualifier=pair, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=rootDTO, postfix_operators=[], prefix_operators=[], qualifier=pair, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[], type_arguments=None), label=None)])), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=nestedDTO, postfix_operators=[], prefix_operators=[], qualifier=pair, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=nestedDTO, postfix_operators=[], prefix_operators=[], qualifier=pair, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=values, postfix_operators=[], prefix_operators=[], qualifier=dtos, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=pair)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=DTOPair, sub_type=None))), label=None) return[member[.result]] end[}] END[}]
Keyword[public] identifier[Collection] operator[<] identifier[JavaClassSource] operator[>] identifier[allResources] operator[SEP] operator[SEP] { identifier[Set] operator[<] identifier[JavaClassSource] operator[>] identifier[result] operator[=] Keyword[new] identifier[HashSet] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[DTOPair] identifier[pair] operator[:] identifier[dtos] operator[SEP] identifier[values] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[pair] operator[SEP] identifier[rootDTO] operator[!=] Other[null] operator[SEP] { identifier[result] operator[SEP] identifier[add] operator[SEP] identifier[pair] operator[SEP] identifier[rootDTO] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[pair] operator[SEP] identifier[nestedDTO] operator[!=] Other[null] operator[SEP] { identifier[result] operator[SEP] identifier[add] operator[SEP] identifier[pair] operator[SEP] identifier[nestedDTO] operator[SEP] operator[SEP] } } Keyword[return] identifier[result] operator[SEP] }
private JsonSimple curation(JsonSimple message, String task, String oid) throws TransactionException { JsonSimple response = new JsonSimple(); // ******************* // Collect object data // Transformer config JsonSimple itemConfig = getConfigFromStorage(oid); if (itemConfig == null) { log.error("Error accessing item configuration!"); return new JsonSimple(); } // Object properties Properties metadata = getObjectMetadata(oid); if (metadata == null) { log.error("Error accessing item metadata!"); return new JsonSimple(); } // Object metadata JsonSimple data = getDataFromStorage(oid); if (data == null) { log.error("Error accessing item data!"); return new JsonSimple(); } // ******************* // Validate what we can see // Check object state boolean curated = false; boolean alreadyCurated = itemConfig.getBoolean(false, "curation", "alreadyCurated"); boolean errors = false; // Can we already see this PID? String thisPid = null; if (metadata.containsKey(pidProperty)) { curated = true; thisPid = metadata.getProperty(pidProperty); // Or does it claim to have one from pre-ingest curation? } else { if (alreadyCurated) { // Make sure we can actually see an ID String id = data.getString(null, "metadata", "dc.identifier"); if (id == null) { log.error("Item claims to be curated, but has no" + " 'dc.identifier': '{}'", oid); errors = true; // Let's fix this so it doesn't show up again } else { try { log.info("Update object properties with ingested" + " ID: '{}'", oid); // Metadata writes can be awkward... thankfully this is // code that should only ever execute once per object. DigitalObject object = storage.getObject(oid); metadata = object.getMetadata(); metadata.setProperty(pidProperty, id); storeProperties(object, metadata); metadata = getObjectMetadata(oid); curated = true; audit(response, oid, "Persitent ID set in properties"); } catch (StorageException ex) { log.error("Error accessing object '{}' in storage: ", oid, ex); errors = true; } } } } // ******************* // Decision making // Errors have occurred, email someone and do nothing if (errors) { emailObjectLink( response, oid, "An error occurred curating this object, some" + " manual intervention may be required; please see" + " the system logs."); audit(response, oid, "Errors during curation; aborted."); return response; } // *** // What should happen per task if we have already been curated? if (curated) { // Happy ending if (task.equals("curation-response")) { log.info("Confirmation of curated object '{}'.", oid); // Send out upstream responses to objects waiting JSONArray responses = data.writeArray("responses"); for (Object thisResponse : responses) { JsonSimple json = new JsonSimple((JsonObject) thisResponse); String broker = json.getString(brokerUrl, "broker"); String responseOid = json.getString(null, "oid"); String responseTask = json.getString(null, "task"); JsonObject responseObj = createTask(response, broker, responseOid, responseTask); // Don't forget to tell them where it came from responseObj.put("originOid", oid); responseObj.put("curatedPid", thisPid); } //We've responded so let's clear the response list for next time responses.clear(); saveObjectData(data, oid); // Set a flag to let publish events that may come in later // that this is ready to publish (if not already set) if (!metadata.containsKey(READY_PROPERTY)) { try { DigitalObject object = storage.getObject(oid); metadata = object.getMetadata(); metadata.setProperty(READY_PROPERTY, "ready"); storeProperties(object, metadata); metadata = getObjectMetadata(oid); audit(response, oid, "This object is ready for publication"); } catch (StorageException ex) { log.error("Error accessing object '{}' in storage: ", oid, ex); emailObjectLink( response, oid, "This object is ready for publication, but an" + " error occured writing to storage. Please" + " see the system log"); } // Since the flag hasn't been set we also know this is the // first time through, so generate some notifications emailObjectLink(response, oid, "This email is confirming that the object linked" + " below has completed curation."); audit(response, oid, "Curation completed."); // Schedule a followup to re-index and transform createTask(response, oid, "reharvest"); createTask(response, oid, "publish"); // This object was asked to curate again, so there may be // new 'children' who do need to publish, and external // updates required (like VITAL) } else { createTask(response, oid, "publish"); } return response; } // A response has come back from downstream if (task.equals("curation-pending")) { String childOid = message.getString(null, "originOid"); String childId = message.getString(null, "originId"); String curatedPid = message.getString(null, "curatedPid"); boolean isReady = false; try { // False here will make sure we aren't sending out a bunch // of requests again. isReady = checkChildren(response, data, oid, thisPid, false, childOid, childId, curatedPid); } catch (TransactionException ex) { log.error("Error updating related objects '{}': ", oid, ex); emailObjectLink( response, oid, "An error occurred curating this object, some" + " manual intervention may be required; please see" + " the system logs."); audit(response, oid, "Errors curating relations; aborted."); return response; } // If it is ready if (isReady) { createTask(response, oid, "curation-response"); } return response; } // The object has finished, work on downstream 'children' if (task.equals("curation-confirm")) { boolean isReady = false; try { isReady = checkChildren(response, data, oid, thisPid, true); } catch (TransactionException ex) { log.error("Error processing related objects '{}': ", oid, ex); emailObjectLink( response, oid, "An error occurred curating this object, some" + " manual intervention may be required; please see" + " the system logs."); audit(response, oid, "Errors curating relations; aborted."); return response; } // If it is ready ont he first pass... if (isReady) { createTask(response, oid, "curation-response"); } else { // Otherwise we are going to have to wait for children audit(response, oid, "Curation complete, but still waiting" + " on relations."); } return response; } // Since it is already curated, we are just storing any new // relationships / responses and passing things along if (task.equals("curation-request") || task.equals("curation-query")) { try { storeRequestData(message, oid); } catch (TransactionException ex) { log.error("Error storing request data '{}': ", oid, ex); emailObjectLink( response, oid, "An error occurred curating this object, some" + " manual intervention may be required; please see" + " the system logs."); audit(response, oid, "Errors during curation; aborted."); return response; } // Requests if (task.equals("curation-request")) { JsonObject taskObj = createTask(response, oid, "curation"); taskObj.put("alreadyCurated", true); // Queries } else { // Rather then push to 'curation-response' we are just // sending a single response to the querying object JsonSimple respond = new JsonSimple( message.getObject("respond")); String broker = respond.getString(brokerUrl, "broker"); String responseOid = respond.getString(null, "oid"); String responseTask = respond.getString(null, "task"); JsonObject responseObj = createTask(response, broker, responseOid, responseTask); // Don't forget to tell them where it came from responseObj.put("originOid", oid); responseObj.put("curatedPid", thisPid); } return response; } // Same as above, but this is a second stage request, let's be a // little sterner in case log filtering is occurring if (task.equals("curation")) { log.info("Request to curate ignored. This object '{}' has" + " already been curated.", oid); JsonObject taskObj = createTask(response, oid, "curation-confirm"); taskObj.put("alreadyCurated", true); return response; } // *** // What should happen per task if we have *NOT* already been // curated? } else { // Whoops! We shouldn't be confirming or responding to a non-curated // item!!! if (task.equals("curation-confirm") || task.equals("curation-pending")) { emailObjectLink( response, oid, "NOTICE: The system has received a '" + task + "'" + " event, but the record does not appear to be" + " curated. If your system is configured for VITAL" + " integration this should clear by itself soon."); return response; } // Standard stuff - a request to curate non-curated data if (task.equals("curation-request")) { try { storeRequestData(message, oid); } catch (TransactionException ex) { log.error("Error storing request data '{}': ", oid, ex); emailObjectLink( response, oid, "An error occurred curating this object, some" + " manual intervention may be required; please see" + " the system logs."); audit(response, oid, "Errors during curation; aborted."); return response; } // ReDBox will only curate if the workflow is finished if (!workflowCompleted(oid)) { log.warn("Curation request recieved, but object has" + " not finished workflow."); return response; } if (manualConfirmation) { emailObjectLink( response, oid, "A curation request has been recieved for this" + " object. You can find a link below to approve" + " the request."); audit(response, oid, "Curation request received. Pending"); } else { createTask(response, oid, "curation"); } return response; } // We can't do much here, just store the response address if (task.equals("curation-query")) { try { storeRequestData(message, oid); } catch (TransactionException ex) { log.error("Error storing request data '{}': ", oid, ex); emailObjectLink( response, oid, "An error occurred curating this object, some" + " manual intervention may be required; please see" + " the system logs."); audit(response, oid, "Errors during curation; aborted."); return response; } return response; } // The actual curation event if (task.equals("curation")) { audit(response, oid, "Object curation requested."); List<String> list = itemConfig.getStringList("transformer", "curation"); // Pass through whichever curation transformer are configured if (list != null && !list.isEmpty()) { for (String id : list) { JsonObject order = newTransform(response, id, oid); JsonObject config = (JsonObject) order.get("config"); JsonObject overrides = itemConfig.getObject( "transformerOverrides", id); if (overrides != null) { config.putAll(overrides); } } } else { log.warn("This object has no configured transformers!"); } // Force an index update after the ID has been created, // but before "curation-confirm" JsonObject order = newIndex(response, oid); order.put("forceCommit", true); // Don't forget to come back createTask(response, oid, "curation-confirm"); return response; } } log.error("Invalid message received. Unknown task:\n{}", message.toString(true)); emailObjectLink(response, oid, "The curation manager has received an invalid curation message" + " for this object. Please see the system logs."); return response; }
class class_name[name] begin[{] method[curation, return_type[type[JsonSimple]], modifier[private], parameter[message, task, oid]] begin[{] local_variable[type[JsonSimple], response] local_variable[type[JsonSimple], itemConfig] if[binary_operation[member[.itemConfig], ==, literal[null]]] begin[{] call[log.error, parameter[literal["Error accessing item configuration!"]]] return[ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=JsonSimple, sub_type=None))] else begin[{] None end[}] local_variable[type[Properties], metadata] if[binary_operation[member[.metadata], ==, literal[null]]] begin[{] call[log.error, parameter[literal["Error accessing item metadata!"]]] return[ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=JsonSimple, sub_type=None))] else begin[{] None end[}] local_variable[type[JsonSimple], data] if[binary_operation[member[.data], ==, literal[null]]] begin[{] call[log.error, parameter[literal["Error accessing item data!"]]] return[ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=JsonSimple, sub_type=None))] else begin[{] None end[}] local_variable[type[boolean], curated] local_variable[type[boolean], alreadyCurated] local_variable[type[boolean], errors] local_variable[type[String], thisPid] if[call[metadata.containsKey, parameter[member[.pidProperty]]]] begin[{] assign[member[.curated], literal[true]] assign[member[.thisPid], call[metadata.getProperty, parameter[member[.pidProperty]]]] else begin[{] if[member[.alreadyCurated]] begin[{] local_variable[type[String], id] if[binary_operation[member[.id], ==, literal[null]]] begin[{] call[log.error, parameter[binary_operation[literal["Item claims to be curated, but has no"], +, literal[" 'dc.identifier': '{}'"]], member[.oid]]] assign[member[.errors], literal[true]] else begin[{] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Update object properties with ingested"), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" ID: '{}'"), operator=+), MemberReference(member=oid, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=info, postfix_operators=[], prefix_operators=[], qualifier=log, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=oid, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getObject, postfix_operators=[], prefix_operators=[], qualifier=storage, selectors=[], type_arguments=None), name=object)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=DigitalObject, sub_type=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=metadata, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=getMetadata, postfix_operators=[], prefix_operators=[], qualifier=object, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=pidProperty, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=id, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setProperty, postfix_operators=[], prefix_operators=[], qualifier=metadata, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=object, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=metadata, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=storeProperties, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=metadata, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=oid, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getObjectMetadata, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=curated, 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=response, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=oid, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Persitent ID set in properties")], member=audit, 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="Error accessing object '{}' in storage: "), MemberReference(member=oid, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=ex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=log, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=errors, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ex, types=['StorageException']))], finally_block=None, label=None, resources=None) end[}] else begin[{] None end[}] end[}] if[member[.errors]] begin[{] call[.emailObjectLink, parameter[member[.response], member[.oid], binary_operation[binary_operation[literal["An error occurred curating this object, some"], +, literal[" manual intervention may be required; please see"]], +, literal[" the system logs."]]]] call[.audit, parameter[member[.response], member[.oid], literal["Errors during curation; aborted."]]] return[member[.response]] else begin[{] None end[}] if[member[.curated]] begin[{] if[call[task.equals, parameter[literal["curation-response"]]]] begin[{] call[log.info, parameter[literal["Confirmation of curated object '{}'."], member[.oid]]] local_variable[type[JSONArray], responses] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[Cast(expression=MemberReference(member=thisResponse, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=JsonObject, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=JsonSimple, sub_type=None)), name=json)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=JsonSimple, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=brokerUrl, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="broker")], member=getString, postfix_operators=[], prefix_operators=[], qualifier=json, selectors=[], type_arguments=None), name=broker)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="oid")], member=getString, postfix_operators=[], prefix_operators=[], qualifier=json, selectors=[], type_arguments=None), name=responseOid)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="task")], member=getString, postfix_operators=[], prefix_operators=[], qualifier=json, selectors=[], type_arguments=None), name=responseTask)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=response, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=broker, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=responseOid, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=responseTask, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=createTask, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=responseObj)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=JsonObject, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="originOid"), MemberReference(member=oid, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=put, postfix_operators=[], prefix_operators=[], qualifier=responseObj, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="curatedPid"), MemberReference(member=thisPid, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=put, postfix_operators=[], prefix_operators=[], qualifier=responseObj, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=responses, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=thisResponse)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))), label=None) call[responses.clear, parameter[]] call[.saveObjectData, parameter[member[.data], member[.oid]]] if[call[metadata.containsKey, parameter[member[.READY_PROPERTY]]]] begin[{] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=oid, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getObject, postfix_operators=[], prefix_operators=[], qualifier=storage, selectors=[], type_arguments=None), name=object)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=DigitalObject, sub_type=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=metadata, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=getMetadata, postfix_operators=[], prefix_operators=[], qualifier=object, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=READY_PROPERTY, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="ready")], member=setProperty, postfix_operators=[], prefix_operators=[], qualifier=metadata, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=object, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=metadata, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=storeProperties, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=metadata, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=oid, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getObjectMetadata, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=response, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=oid, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="This object is ready for publication")], member=audit, 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="Error accessing object '{}' in storage: "), MemberReference(member=oid, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=ex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=log, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=response, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=oid, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="This object is ready for publication, but an"), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" error occured writing to storage. Please"), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" see the system log"), operator=+)], member=emailObjectLink, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ex, types=['StorageException']))], finally_block=None, label=None, resources=None) call[.emailObjectLink, parameter[member[.response], member[.oid], binary_operation[literal["This email is confirming that the object linked"], +, literal[" below has completed curation."]]]] call[.audit, parameter[member[.response], member[.oid], literal["Curation completed."]]] call[.createTask, parameter[member[.response], member[.oid], literal["reharvest"]]] call[.createTask, parameter[member[.response], member[.oid], literal["publish"]]] else begin[{] call[.createTask, parameter[member[.response], member[.oid], literal["publish"]]] end[}] return[member[.response]] else begin[{] None end[}] if[call[task.equals, parameter[literal["curation-pending"]]]] begin[{] local_variable[type[String], childOid] local_variable[type[String], childId] local_variable[type[String], curatedPid] local_variable[type[boolean], isReady] TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=isReady, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=response, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=data, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=oid, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=thisPid, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), MemberReference(member=childOid, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=childId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=curatedPid, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=checkChildren, 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="Error updating related objects '{}': "), MemberReference(member=oid, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=ex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=log, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=response, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=oid, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="An error occurred curating this object, some"), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" manual intervention may be required; please see"), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" the system logs."), operator=+)], member=emailObjectLink, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=response, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=oid, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Errors curating relations; aborted.")], member=audit, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=MemberReference(member=response, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ex, types=['TransactionException']))], finally_block=None, label=None, resources=None) if[member[.isReady]] begin[{] call[.createTask, parameter[member[.response], member[.oid], literal["curation-response"]]] else begin[{] None end[}] return[member[.response]] else begin[{] None end[}] if[call[task.equals, parameter[literal["curation-confirm"]]]] begin[{] local_variable[type[boolean], isReady] TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=isReady, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=response, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=data, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=oid, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=thisPid, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], member=checkChildren, 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="Error processing related objects '{}': "), MemberReference(member=oid, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=ex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=log, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=response, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=oid, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="An error occurred curating this object, some"), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" manual intervention may be required; please see"), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" the system logs."), operator=+)], member=emailObjectLink, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=response, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=oid, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Errors curating relations; aborted.")], member=audit, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=MemberReference(member=response, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ex, types=['TransactionException']))], finally_block=None, label=None, resources=None) if[member[.isReady]] begin[{] call[.createTask, parameter[member[.response], member[.oid], literal["curation-response"]]] else begin[{] call[.audit, parameter[member[.response], member[.oid], binary_operation[literal["Curation complete, but still waiting"], +, literal[" on relations."]]]] end[}] return[member[.response]] else begin[{] None end[}] if[binary_operation[call[task.equals, parameter[literal["curation-request"]]], ||, call[task.equals, parameter[literal["curation-query"]]]]] begin[{] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=message, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=oid, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=storeRequestData, 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="Error storing request data '{}': "), MemberReference(member=oid, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=ex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=log, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=response, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=oid, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="An error occurred curating this object, some"), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" manual intervention may be required; please see"), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" the system logs."), operator=+)], member=emailObjectLink, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=response, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=oid, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Errors during curation; aborted.")], member=audit, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=MemberReference(member=response, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ex, types=['TransactionException']))], finally_block=None, label=None, resources=None) if[call[task.equals, parameter[literal["curation-request"]]]] begin[{] local_variable[type[JsonObject], taskObj] call[taskObj.put, parameter[literal["alreadyCurated"], literal[true]]] else begin[{] local_variable[type[JsonSimple], respond] local_variable[type[String], broker] local_variable[type[String], responseOid] local_variable[type[String], responseTask] local_variable[type[JsonObject], responseObj] call[responseObj.put, parameter[literal["originOid"], member[.oid]]] call[responseObj.put, parameter[literal["curatedPid"], member[.thisPid]]] end[}] return[member[.response]] else begin[{] None end[}] if[call[task.equals, parameter[literal["curation"]]]] begin[{] call[log.info, parameter[binary_operation[literal["Request to curate ignored. This object '{}' has"], +, literal[" already been curated."]], member[.oid]]] local_variable[type[JsonObject], taskObj] call[taskObj.put, parameter[literal["alreadyCurated"], literal[true]]] return[member[.response]] else begin[{] None end[}] else begin[{] if[binary_operation[call[task.equals, parameter[literal["curation-confirm"]]], ||, call[task.equals, parameter[literal["curation-pending"]]]]] begin[{] call[.emailObjectLink, parameter[member[.response], member[.oid], binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[literal["NOTICE: The system has received a '"], +, member[.task]], +, literal["'"]], +, literal[" event, but the record does not appear to be"]], +, literal[" curated. If your system is configured for VITAL"]], +, literal[" integration this should clear by itself soon."]]]] return[member[.response]] else begin[{] None end[}] if[call[task.equals, parameter[literal["curation-request"]]]] begin[{] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=message, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=oid, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=storeRequestData, 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="Error storing request data '{}': "), MemberReference(member=oid, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=ex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=log, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=response, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=oid, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="An error occurred curating this object, some"), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" manual intervention may be required; please see"), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" the system logs."), operator=+)], member=emailObjectLink, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=response, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=oid, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Errors during curation; aborted.")], member=audit, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=MemberReference(member=response, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ex, types=['TransactionException']))], finally_block=None, label=None, resources=None) if[call[.workflowCompleted, parameter[member[.oid]]]] begin[{] call[log.warn, parameter[binary_operation[literal["Curation request recieved, but object has"], +, literal[" not finished workflow."]]]] return[member[.response]] else begin[{] None end[}] if[member[.manualConfirmation]] begin[{] call[.emailObjectLink, parameter[member[.response], member[.oid], binary_operation[binary_operation[literal["A curation request has been recieved for this"], +, literal[" object. You can find a link below to approve"]], +, literal[" the request."]]]] call[.audit, parameter[member[.response], member[.oid], literal["Curation request received. Pending"]]] else begin[{] call[.createTask, parameter[member[.response], member[.oid], literal["curation"]]] end[}] return[member[.response]] else begin[{] None end[}] if[call[task.equals, parameter[literal["curation-query"]]]] begin[{] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=message, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=oid, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=storeRequestData, 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="Error storing request data '{}': "), MemberReference(member=oid, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=ex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=log, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=response, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=oid, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="An error occurred curating this object, some"), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" manual intervention may be required; please see"), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" the system logs."), operator=+)], member=emailObjectLink, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=response, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=oid, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Errors during curation; aborted.")], member=audit, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=MemberReference(member=response, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ex, types=['TransactionException']))], finally_block=None, label=None, resources=None) return[member[.response]] else begin[{] None end[}] if[call[task.equals, parameter[literal["curation"]]]] begin[{] call[.audit, parameter[member[.response], member[.oid], literal["Object curation requested."]]] local_variable[type[List], list] if[binary_operation[binary_operation[member[.list], !=, literal[null]], &&, call[list.isEmpty, parameter[]]]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=response, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=id, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=oid, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=newTransform, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=order)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=JsonObject, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="config")], member=get, postfix_operators=[], prefix_operators=[], qualifier=order, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=JsonObject, sub_type=None)), name=config)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=JsonObject, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="transformerOverrides"), MemberReference(member=id, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getObject, postfix_operators=[], prefix_operators=[], qualifier=itemConfig, selectors=[], type_arguments=None), name=overrides)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=JsonObject, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=overrides, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=overrides, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=putAll, postfix_operators=[], prefix_operators=[], qualifier=config, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=list, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=id)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None) else begin[{] call[log.warn, parameter[literal["This object has no configured transformers!"]]] end[}] local_variable[type[JsonObject], order] call[order.put, parameter[literal["forceCommit"], literal[true]]] call[.createTask, parameter[member[.response], member[.oid], literal["curation-confirm"]]] return[member[.response]] else begin[{] None end[}] end[}] call[log.error, parameter[literal["Invalid message received. Unknown task:\n{}"], call[message.toString, parameter[literal[true]]]]] call[.emailObjectLink, parameter[member[.response], member[.oid], binary_operation[literal["The curation manager has received an invalid curation message"], +, literal[" for this object. Please see the system logs."]]]] return[member[.response]] end[}] END[}]
Keyword[private] identifier[JsonSimple] identifier[curation] operator[SEP] identifier[JsonSimple] identifier[message] , identifier[String] identifier[task] , identifier[String] identifier[oid] operator[SEP] Keyword[throws] identifier[TransactionException] { identifier[JsonSimple] identifier[response] operator[=] Keyword[new] identifier[JsonSimple] operator[SEP] operator[SEP] operator[SEP] identifier[JsonSimple] identifier[itemConfig] operator[=] identifier[getConfigFromStorage] operator[SEP] identifier[oid] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[itemConfig] operator[==] Other[null] operator[SEP] { identifier[log] operator[SEP] identifier[error] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[JsonSimple] operator[SEP] operator[SEP] operator[SEP] } identifier[Properties] identifier[metadata] operator[=] identifier[getObjectMetadata] operator[SEP] identifier[oid] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[metadata] operator[==] Other[null] operator[SEP] { identifier[log] operator[SEP] identifier[error] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[JsonSimple] operator[SEP] operator[SEP] operator[SEP] } identifier[JsonSimple] identifier[data] operator[=] identifier[getDataFromStorage] operator[SEP] identifier[oid] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[data] operator[==] Other[null] operator[SEP] { identifier[log] operator[SEP] identifier[error] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[JsonSimple] operator[SEP] operator[SEP] operator[SEP] } Keyword[boolean] identifier[curated] operator[=] literal[boolean] operator[SEP] Keyword[boolean] identifier[alreadyCurated] operator[=] identifier[itemConfig] operator[SEP] identifier[getBoolean] operator[SEP] literal[boolean] , literal[String] , literal[String] operator[SEP] operator[SEP] Keyword[boolean] identifier[errors] operator[=] literal[boolean] operator[SEP] identifier[String] identifier[thisPid] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[metadata] operator[SEP] identifier[containsKey] operator[SEP] identifier[pidProperty] operator[SEP] operator[SEP] { identifier[curated] operator[=] literal[boolean] operator[SEP] identifier[thisPid] operator[=] identifier[metadata] operator[SEP] identifier[getProperty] operator[SEP] identifier[pidProperty] operator[SEP] operator[SEP] } Keyword[else] { Keyword[if] operator[SEP] identifier[alreadyCurated] operator[SEP] { identifier[String] identifier[id] operator[=] identifier[data] operator[SEP] identifier[getString] operator[SEP] Other[null] , literal[String] , literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[id] operator[==] Other[null] operator[SEP] { identifier[log] operator[SEP] identifier[error] operator[SEP] literal[String] operator[+] literal[String] , identifier[oid] operator[SEP] operator[SEP] identifier[errors] operator[=] literal[boolean] operator[SEP] } Keyword[else] { Keyword[try] { identifier[log] operator[SEP] identifier[info] operator[SEP] literal[String] operator[+] literal[String] , identifier[oid] operator[SEP] operator[SEP] identifier[DigitalObject] identifier[object] operator[=] identifier[storage] operator[SEP] identifier[getObject] operator[SEP] identifier[oid] operator[SEP] operator[SEP] identifier[metadata] operator[=] identifier[object] operator[SEP] identifier[getMetadata] operator[SEP] operator[SEP] operator[SEP] identifier[metadata] operator[SEP] identifier[setProperty] operator[SEP] identifier[pidProperty] , identifier[id] operator[SEP] operator[SEP] identifier[storeProperties] operator[SEP] identifier[object] , identifier[metadata] operator[SEP] operator[SEP] identifier[metadata] operator[=] identifier[getObjectMetadata] operator[SEP] identifier[oid] operator[SEP] operator[SEP] identifier[curated] operator[=] literal[boolean] operator[SEP] identifier[audit] operator[SEP] identifier[response] , identifier[oid] , literal[String] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[StorageException] identifier[ex] operator[SEP] { identifier[log] operator[SEP] identifier[error] operator[SEP] literal[String] , identifier[oid] , identifier[ex] operator[SEP] operator[SEP] identifier[errors] operator[=] literal[boolean] operator[SEP] } } } } Keyword[if] operator[SEP] identifier[errors] operator[SEP] { identifier[emailObjectLink] operator[SEP] identifier[response] , identifier[oid] , literal[String] operator[+] literal[String] operator[+] literal[String] operator[SEP] operator[SEP] identifier[audit] operator[SEP] identifier[response] , identifier[oid] , literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[response] operator[SEP] } Keyword[if] operator[SEP] identifier[curated] operator[SEP] { Keyword[if] operator[SEP] identifier[task] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] { identifier[log] operator[SEP] identifier[info] operator[SEP] literal[String] , identifier[oid] operator[SEP] operator[SEP] identifier[JSONArray] identifier[responses] operator[=] identifier[data] operator[SEP] identifier[writeArray] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Object] identifier[thisResponse] operator[:] identifier[responses] operator[SEP] { identifier[JsonSimple] identifier[json] operator[=] Keyword[new] identifier[JsonSimple] operator[SEP] operator[SEP] identifier[JsonObject] operator[SEP] identifier[thisResponse] operator[SEP] operator[SEP] identifier[String] identifier[broker] operator[=] identifier[json] operator[SEP] identifier[getString] operator[SEP] identifier[brokerUrl] , literal[String] operator[SEP] operator[SEP] identifier[String] identifier[responseOid] operator[=] identifier[json] operator[SEP] identifier[getString] operator[SEP] Other[null] , literal[String] operator[SEP] operator[SEP] identifier[String] identifier[responseTask] operator[=] identifier[json] operator[SEP] identifier[getString] operator[SEP] Other[null] , literal[String] operator[SEP] operator[SEP] identifier[JsonObject] identifier[responseObj] operator[=] identifier[createTask] operator[SEP] identifier[response] , identifier[broker] , identifier[responseOid] , identifier[responseTask] operator[SEP] operator[SEP] identifier[responseObj] operator[SEP] identifier[put] operator[SEP] literal[String] , identifier[oid] operator[SEP] operator[SEP] identifier[responseObj] operator[SEP] identifier[put] operator[SEP] literal[String] , identifier[thisPid] operator[SEP] operator[SEP] } identifier[responses] operator[SEP] identifier[clear] operator[SEP] operator[SEP] operator[SEP] identifier[saveObjectData] operator[SEP] identifier[data] , identifier[oid] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[metadata] operator[SEP] identifier[containsKey] operator[SEP] identifier[READY_PROPERTY] operator[SEP] operator[SEP] { Keyword[try] { identifier[DigitalObject] identifier[object] operator[=] identifier[storage] operator[SEP] identifier[getObject] operator[SEP] identifier[oid] operator[SEP] operator[SEP] identifier[metadata] operator[=] identifier[object] operator[SEP] identifier[getMetadata] operator[SEP] operator[SEP] operator[SEP] identifier[metadata] operator[SEP] identifier[setProperty] operator[SEP] identifier[READY_PROPERTY] , literal[String] operator[SEP] operator[SEP] identifier[storeProperties] operator[SEP] identifier[object] , identifier[metadata] operator[SEP] operator[SEP] identifier[metadata] operator[=] identifier[getObjectMetadata] operator[SEP] identifier[oid] operator[SEP] operator[SEP] identifier[audit] operator[SEP] identifier[response] , identifier[oid] , literal[String] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[StorageException] identifier[ex] operator[SEP] { identifier[log] operator[SEP] identifier[error] operator[SEP] literal[String] , identifier[oid] , identifier[ex] operator[SEP] operator[SEP] identifier[emailObjectLink] operator[SEP] identifier[response] , identifier[oid] , literal[String] operator[+] literal[String] operator[+] literal[String] operator[SEP] operator[SEP] } identifier[emailObjectLink] operator[SEP] identifier[response] , identifier[oid] , literal[String] operator[+] literal[String] operator[SEP] operator[SEP] identifier[audit] operator[SEP] identifier[response] , identifier[oid] , literal[String] operator[SEP] operator[SEP] identifier[createTask] operator[SEP] identifier[response] , identifier[oid] , literal[String] operator[SEP] operator[SEP] identifier[createTask] operator[SEP] identifier[response] , identifier[oid] , literal[String] operator[SEP] operator[SEP] } Keyword[else] { identifier[createTask] operator[SEP] identifier[response] , identifier[oid] , literal[String] operator[SEP] operator[SEP] } Keyword[return] identifier[response] operator[SEP] } Keyword[if] operator[SEP] identifier[task] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] { identifier[String] identifier[childOid] operator[=] identifier[message] operator[SEP] identifier[getString] operator[SEP] Other[null] , literal[String] operator[SEP] operator[SEP] identifier[String] identifier[childId] operator[=] identifier[message] operator[SEP] identifier[getString] operator[SEP] Other[null] , literal[String] operator[SEP] operator[SEP] identifier[String] identifier[curatedPid] operator[=] identifier[message] operator[SEP] identifier[getString] operator[SEP] Other[null] , literal[String] operator[SEP] operator[SEP] Keyword[boolean] identifier[isReady] operator[=] literal[boolean] operator[SEP] Keyword[try] { identifier[isReady] operator[=] identifier[checkChildren] operator[SEP] identifier[response] , identifier[data] , identifier[oid] , identifier[thisPid] , literal[boolean] , identifier[childOid] , identifier[childId] , identifier[curatedPid] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[TransactionException] identifier[ex] operator[SEP] { identifier[log] operator[SEP] identifier[error] operator[SEP] literal[String] , identifier[oid] , identifier[ex] operator[SEP] operator[SEP] identifier[emailObjectLink] operator[SEP] identifier[response] , identifier[oid] , literal[String] operator[+] literal[String] operator[+] literal[String] operator[SEP] operator[SEP] identifier[audit] operator[SEP] identifier[response] , identifier[oid] , literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[response] operator[SEP] } Keyword[if] operator[SEP] identifier[isReady] operator[SEP] { identifier[createTask] operator[SEP] identifier[response] , identifier[oid] , literal[String] operator[SEP] operator[SEP] } Keyword[return] identifier[response] operator[SEP] } Keyword[if] operator[SEP] identifier[task] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] { Keyword[boolean] identifier[isReady] operator[=] literal[boolean] operator[SEP] Keyword[try] { identifier[isReady] operator[=] identifier[checkChildren] operator[SEP] identifier[response] , identifier[data] , identifier[oid] , identifier[thisPid] , literal[boolean] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[TransactionException] identifier[ex] operator[SEP] { identifier[log] operator[SEP] identifier[error] operator[SEP] literal[String] , identifier[oid] , identifier[ex] operator[SEP] operator[SEP] identifier[emailObjectLink] operator[SEP] identifier[response] , identifier[oid] , literal[String] operator[+] literal[String] operator[+] literal[String] operator[SEP] operator[SEP] identifier[audit] operator[SEP] identifier[response] , identifier[oid] , literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[response] operator[SEP] } Keyword[if] operator[SEP] identifier[isReady] operator[SEP] { identifier[createTask] operator[SEP] identifier[response] , identifier[oid] , literal[String] operator[SEP] operator[SEP] } Keyword[else] { identifier[audit] operator[SEP] identifier[response] , identifier[oid] , literal[String] operator[+] literal[String] operator[SEP] operator[SEP] } Keyword[return] identifier[response] operator[SEP] } Keyword[if] operator[SEP] identifier[task] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[||] identifier[task] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] { Keyword[try] { identifier[storeRequestData] operator[SEP] identifier[message] , identifier[oid] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[TransactionException] identifier[ex] operator[SEP] { identifier[log] operator[SEP] identifier[error] operator[SEP] literal[String] , identifier[oid] , identifier[ex] operator[SEP] operator[SEP] identifier[emailObjectLink] operator[SEP] identifier[response] , identifier[oid] , literal[String] operator[+] literal[String] operator[+] literal[String] operator[SEP] operator[SEP] identifier[audit] operator[SEP] identifier[response] , identifier[oid] , literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[response] operator[SEP] } Keyword[if] operator[SEP] identifier[task] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] { identifier[JsonObject] identifier[taskObj] operator[=] identifier[createTask] operator[SEP] identifier[response] , identifier[oid] , literal[String] operator[SEP] operator[SEP] identifier[taskObj] operator[SEP] identifier[put] operator[SEP] literal[String] , literal[boolean] operator[SEP] operator[SEP] } Keyword[else] { identifier[JsonSimple] identifier[respond] operator[=] Keyword[new] identifier[JsonSimple] operator[SEP] identifier[message] operator[SEP] identifier[getObject] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[broker] operator[=] identifier[respond] operator[SEP] identifier[getString] operator[SEP] identifier[brokerUrl] , literal[String] operator[SEP] operator[SEP] identifier[String] identifier[responseOid] operator[=] identifier[respond] operator[SEP] identifier[getString] operator[SEP] Other[null] , literal[String] operator[SEP] operator[SEP] identifier[String] identifier[responseTask] operator[=] identifier[respond] operator[SEP] identifier[getString] operator[SEP] Other[null] , literal[String] operator[SEP] operator[SEP] identifier[JsonObject] identifier[responseObj] operator[=] identifier[createTask] operator[SEP] identifier[response] , identifier[broker] , identifier[responseOid] , identifier[responseTask] operator[SEP] operator[SEP] identifier[responseObj] operator[SEP] identifier[put] operator[SEP] literal[String] , identifier[oid] operator[SEP] operator[SEP] identifier[responseObj] operator[SEP] identifier[put] operator[SEP] literal[String] , identifier[thisPid] operator[SEP] operator[SEP] } Keyword[return] identifier[response] operator[SEP] } Keyword[if] operator[SEP] identifier[task] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] { identifier[log] operator[SEP] identifier[info] operator[SEP] literal[String] operator[+] literal[String] , identifier[oid] operator[SEP] operator[SEP] identifier[JsonObject] identifier[taskObj] operator[=] identifier[createTask] operator[SEP] identifier[response] , identifier[oid] , literal[String] operator[SEP] operator[SEP] identifier[taskObj] operator[SEP] identifier[put] operator[SEP] literal[String] , literal[boolean] operator[SEP] operator[SEP] Keyword[return] identifier[response] operator[SEP] } } Keyword[else] { Keyword[if] operator[SEP] identifier[task] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[||] identifier[task] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] { identifier[emailObjectLink] operator[SEP] identifier[response] , identifier[oid] , literal[String] operator[+] identifier[task] operator[+] literal[String] operator[+] literal[String] operator[+] literal[String] operator[+] literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[response] operator[SEP] } Keyword[if] operator[SEP] identifier[task] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] { Keyword[try] { identifier[storeRequestData] operator[SEP] identifier[message] , identifier[oid] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[TransactionException] identifier[ex] operator[SEP] { identifier[log] operator[SEP] identifier[error] operator[SEP] literal[String] , identifier[oid] , identifier[ex] operator[SEP] operator[SEP] identifier[emailObjectLink] operator[SEP] identifier[response] , identifier[oid] , literal[String] operator[+] literal[String] operator[+] literal[String] operator[SEP] operator[SEP] identifier[audit] operator[SEP] identifier[response] , identifier[oid] , literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[response] operator[SEP] } Keyword[if] operator[SEP] operator[!] identifier[workflowCompleted] operator[SEP] identifier[oid] operator[SEP] operator[SEP] { identifier[log] operator[SEP] identifier[warn] operator[SEP] literal[String] operator[+] literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[response] operator[SEP] } Keyword[if] operator[SEP] identifier[manualConfirmation] operator[SEP] { identifier[emailObjectLink] operator[SEP] identifier[response] , identifier[oid] , literal[String] operator[+] literal[String] operator[+] literal[String] operator[SEP] operator[SEP] identifier[audit] operator[SEP] identifier[response] , identifier[oid] , literal[String] operator[SEP] operator[SEP] } Keyword[else] { identifier[createTask] operator[SEP] identifier[response] , identifier[oid] , literal[String] operator[SEP] operator[SEP] } Keyword[return] identifier[response] operator[SEP] } Keyword[if] operator[SEP] identifier[task] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] { Keyword[try] { identifier[storeRequestData] operator[SEP] identifier[message] , identifier[oid] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[TransactionException] identifier[ex] operator[SEP] { identifier[log] operator[SEP] identifier[error] operator[SEP] literal[String] , identifier[oid] , identifier[ex] operator[SEP] operator[SEP] identifier[emailObjectLink] operator[SEP] identifier[response] , identifier[oid] , literal[String] operator[+] literal[String] operator[+] literal[String] operator[SEP] operator[SEP] identifier[audit] operator[SEP] identifier[response] , identifier[oid] , literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[response] operator[SEP] } Keyword[return] identifier[response] operator[SEP] } Keyword[if] operator[SEP] identifier[task] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] { identifier[audit] operator[SEP] identifier[response] , identifier[oid] , literal[String] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[String] operator[>] identifier[list] operator[=] identifier[itemConfig] operator[SEP] identifier[getStringList] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[list] operator[!=] Other[null] operator[&&] operator[!] identifier[list] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { Keyword[for] operator[SEP] identifier[String] identifier[id] operator[:] identifier[list] operator[SEP] { identifier[JsonObject] identifier[order] operator[=] identifier[newTransform] operator[SEP] identifier[response] , identifier[id] , identifier[oid] operator[SEP] operator[SEP] identifier[JsonObject] identifier[config] operator[=] operator[SEP] identifier[JsonObject] operator[SEP] identifier[order] operator[SEP] identifier[get] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[JsonObject] identifier[overrides] operator[=] identifier[itemConfig] operator[SEP] identifier[getObject] operator[SEP] literal[String] , identifier[id] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[overrides] operator[!=] Other[null] operator[SEP] { identifier[config] operator[SEP] identifier[putAll] operator[SEP] identifier[overrides] operator[SEP] operator[SEP] } } } Keyword[else] { identifier[log] operator[SEP] identifier[warn] operator[SEP] literal[String] operator[SEP] operator[SEP] } identifier[JsonObject] identifier[order] operator[=] identifier[newIndex] operator[SEP] identifier[response] , identifier[oid] operator[SEP] operator[SEP] identifier[order] operator[SEP] identifier[put] operator[SEP] literal[String] , literal[boolean] operator[SEP] operator[SEP] identifier[createTask] operator[SEP] identifier[response] , identifier[oid] , literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[response] operator[SEP] } } identifier[log] operator[SEP] identifier[error] operator[SEP] literal[String] , identifier[message] operator[SEP] identifier[toString] operator[SEP] literal[boolean] operator[SEP] operator[SEP] operator[SEP] identifier[emailObjectLink] operator[SEP] identifier[response] , identifier[oid] , literal[String] operator[+] literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[response] operator[SEP] }
static boolean isBinaryOperatorType(Token type) { switch (type) { case OR: case AND: case BITOR: case BITXOR: case BITAND: case EQ: case NE: case SHEQ: case SHNE: case LT: case GT: case LE: case GE: case INSTANCEOF: case IN: case LSH: case RSH: case URSH: case ADD: case SUB: case MUL: case DIV: case MOD: case EXPONENT: return true; default: return false; } }
class class_name[name] begin[{] method[isBinaryOperatorType, return_type[type[boolean]], modifier[static], parameter[type]] begin[{] SwitchStatement(cases=[SwitchStatementCase(case=['OR', 'AND', 'BITOR', 'BITXOR', 'BITAND', 'EQ', 'NE', 'SHEQ', 'SHNE', 'LT', 'GT', 'LE', 'GE', 'INSTANCEOF', 'IN', 'LSH', 'RSH', 'URSH', 'ADD', 'SUB', 'MUL', 'DIV', 'MOD', 'EXPONENT'], statements=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true), label=None)]), SwitchStatementCase(case=[], statements=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), label=None)])], expression=MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None) end[}] END[}]
Keyword[static] Keyword[boolean] identifier[isBinaryOperatorType] operator[SEP] identifier[Token] identifier[type] operator[SEP] { Keyword[switch] operator[SEP] identifier[type] operator[SEP] { Keyword[case] identifier[OR] operator[:] Keyword[case] identifier[AND] operator[:] Keyword[case] identifier[BITOR] operator[:] Keyword[case] identifier[BITXOR] operator[:] Keyword[case] identifier[BITAND] operator[:] Keyword[case] identifier[EQ] operator[:] Keyword[case] identifier[NE] operator[:] Keyword[case] identifier[SHEQ] operator[:] Keyword[case] identifier[SHNE] operator[:] Keyword[case] identifier[LT] operator[:] Keyword[case] identifier[GT] operator[:] Keyword[case] identifier[LE] operator[:] Keyword[case] identifier[GE] operator[:] Keyword[case] identifier[INSTANCEOF] operator[:] Keyword[case] identifier[IN] operator[:] Keyword[case] identifier[LSH] operator[:] Keyword[case] identifier[RSH] operator[:] Keyword[case] identifier[URSH] operator[:] Keyword[case] identifier[ADD] operator[:] Keyword[case] identifier[SUB] operator[:] Keyword[case] identifier[MUL] operator[:] Keyword[case] identifier[DIV] operator[:] Keyword[case] identifier[MOD] operator[:] Keyword[case] identifier[EXPONENT] operator[:] Keyword[return] literal[boolean] operator[SEP] Keyword[default] operator[:] Keyword[return] literal[boolean] operator[SEP] } }
public void deleteApplication(ApplicationDefinition appDef, String key) { checkServiceState(); String appKey = appDef.getKey(); if (Utils.isEmpty(appKey)) { Utils.require(Utils.isEmpty(key), "Application key does not match: %s", key); } else { Utils.require(appKey.equals(key), "Application key does not match: %s", key); } assert Tenant.getTenant(appDef) != null; // Delete storage service-specific data first. m_logger.info("Deleting application: {}", appDef.getAppName()); StorageService storageService = getStorageService(appDef); storageService.deleteApplication(appDef); TaskManagerService.instance().deleteApplicationTasks(appDef); deleteAppProperties(appDef); }
class class_name[name] begin[{] method[deleteApplication, return_type[void], modifier[public], parameter[appDef, key]] begin[{] call[.checkServiceState, parameter[]] local_variable[type[String], appKey] if[call[Utils.isEmpty, parameter[member[.appKey]]]] begin[{] call[Utils.require, parameter[call[Utils.isEmpty, parameter[member[.key]]], literal["Application key does not match: %s"], member[.key]]] else begin[{] call[Utils.require, parameter[call[appKey.equals, parameter[member[.key]]], literal["Application key does not match: %s"], member[.key]]] end[}] AssertStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=appDef, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getTenant, postfix_operators=[], prefix_operators=[], qualifier=Tenant, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), label=None, value=None) call[m_logger.info, parameter[literal["Deleting application: {}"], call[appDef.getAppName, parameter[]]]] local_variable[type[StorageService], storageService] call[storageService.deleteApplication, parameter[member[.appDef]]] call[TaskManagerService.instance, parameter[]] call[.deleteAppProperties, parameter[member[.appDef]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[deleteApplication] operator[SEP] identifier[ApplicationDefinition] identifier[appDef] , identifier[String] identifier[key] operator[SEP] { identifier[checkServiceState] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[appKey] operator[=] identifier[appDef] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[Utils] operator[SEP] identifier[isEmpty] operator[SEP] identifier[appKey] operator[SEP] operator[SEP] { identifier[Utils] operator[SEP] identifier[require] operator[SEP] identifier[Utils] operator[SEP] identifier[isEmpty] operator[SEP] identifier[key] operator[SEP] , literal[String] , identifier[key] operator[SEP] operator[SEP] } Keyword[else] { identifier[Utils] operator[SEP] identifier[require] operator[SEP] identifier[appKey] operator[SEP] identifier[equals] operator[SEP] identifier[key] operator[SEP] , literal[String] , identifier[key] operator[SEP] operator[SEP] } Keyword[assert] identifier[Tenant] operator[SEP] identifier[getTenant] operator[SEP] identifier[appDef] operator[SEP] operator[!=] Other[null] operator[SEP] identifier[m_logger] operator[SEP] identifier[info] operator[SEP] literal[String] , identifier[appDef] operator[SEP] identifier[getAppName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[StorageService] identifier[storageService] operator[=] identifier[getStorageService] operator[SEP] identifier[appDef] operator[SEP] operator[SEP] identifier[storageService] operator[SEP] identifier[deleteApplication] operator[SEP] identifier[appDef] operator[SEP] operator[SEP] identifier[TaskManagerService] operator[SEP] identifier[instance] operator[SEP] operator[SEP] operator[SEP] identifier[deleteApplicationTasks] operator[SEP] identifier[appDef] operator[SEP] operator[SEP] identifier[deleteAppProperties] operator[SEP] identifier[appDef] operator[SEP] operator[SEP] }
public static Widget createWidget(final GVRSceneObject root, final String childName) throws InstantiationException { GroupWidget widget = (GroupWidget)createWidget(root, childName, GroupWidget.class); widget.applyLayout(new AbsoluteLayout()); return widget; }
class class_name[name] begin[{] method[createWidget, return_type[type[Widget]], modifier[public static], parameter[root, childName]] begin[{] local_variable[type[GroupWidget], widget] call[widget.applyLayout, parameter[ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=AbsoluteLayout, sub_type=None))]] return[member[.widget]] end[}] END[}]
Keyword[public] Keyword[static] identifier[Widget] identifier[createWidget] operator[SEP] Keyword[final] identifier[GVRSceneObject] identifier[root] , Keyword[final] identifier[String] identifier[childName] operator[SEP] Keyword[throws] identifier[InstantiationException] { identifier[GroupWidget] identifier[widget] operator[=] operator[SEP] identifier[GroupWidget] operator[SEP] identifier[createWidget] operator[SEP] identifier[root] , identifier[childName] , identifier[GroupWidget] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[widget] operator[SEP] identifier[applyLayout] operator[SEP] Keyword[new] identifier[AbsoluteLayout] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[widget] operator[SEP] }
public @Nonnull String getRootUrlFromRequest() { StaplerRequest req = Stapler.getCurrentRequest(); if (req == null) { throw new IllegalStateException("cannot call getRootUrlFromRequest from outside a request handling thread"); } StringBuilder buf = new StringBuilder(); String scheme = getXForwardedHeader(req, "X-Forwarded-Proto", req.getScheme()); buf.append(scheme).append("://"); String host = getXForwardedHeader(req, "X-Forwarded-Host", req.getServerName()); int index = host.indexOf(':'); int port = req.getServerPort(); if (index == -1) { // Almost everyone else except Nginx put the host and port in separate headers buf.append(host); } else { // Nginx uses the same spec as for the Host header, i.e. hostname:port buf.append(host.substring(0, index)); if (index + 1 < host.length()) { try { port = Integer.parseInt(host.substring(index + 1)); } catch (NumberFormatException e) { // ignore } } // but if a user has configured Nginx with an X-Forwarded-Port, that will win out. } String forwardedPort = getXForwardedHeader(req, "X-Forwarded-Port", null); if (forwardedPort != null) { try { port = Integer.parseInt(forwardedPort); } catch (NumberFormatException e) { // ignore } } if (port != ("https".equals(scheme) ? 443 : 80)) { buf.append(':').append(port); } buf.append(req.getContextPath()).append('/'); return buf.toString(); }
class class_name[name] begin[{] method[getRootUrlFromRequest, return_type[type[String]], modifier[public], parameter[]] begin[{] local_variable[type[StaplerRequest], req] if[binary_operation[member[.req], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="cannot call getRootUrlFromRequest from outside a request handling thread")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalStateException, sub_type=None)), label=None) else begin[{] None end[}] local_variable[type[StringBuilder], buf] local_variable[type[String], scheme] call[buf.append, parameter[member[.scheme]]] local_variable[type[String], host] local_variable[type[int], index] local_variable[type[int], port] if[binary_operation[member[.index], ==, literal[1]]] begin[{] call[buf.append, parameter[member[.host]]] else begin[{] call[buf.append, parameter[call[host.substring, parameter[literal[0], member[.index]]]]] if[binary_operation[binary_operation[member[.index], +, literal[1]], <, call[host.length, parameter[]]]] begin[{] TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=port, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+)], member=substring, postfix_operators=[], prefix_operators=[], qualifier=host, selectors=[], type_arguments=None)], member=parseInt, postfix_operators=[], prefix_operators=[], qualifier=Integer, selectors=[], type_arguments=None)), label=None)], catches=[CatchClause(block=[], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['NumberFormatException']))], finally_block=None, label=None, resources=None) else begin[{] None end[}] end[}] local_variable[type[String], forwardedPort] if[binary_operation[member[.forwardedPort], !=, literal[null]]] begin[{] TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=port, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=forwardedPort, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=parseInt, postfix_operators=[], prefix_operators=[], qualifier=Integer, selectors=[], type_arguments=None)), label=None)], catches=[CatchClause(block=[], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['NumberFormatException']))], finally_block=None, label=None, resources=None) else begin[{] None end[}] if[binary_operation[member[.port], !=, TernaryExpression(condition=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=scheme, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], value="https"), if_false=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=80), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=443))]] begin[{] call[buf.append, parameter[literal[':']]] else begin[{] None end[}] call[buf.append, parameter[call[req.getContextPath, parameter[]]]] return[call[buf.toString, parameter[]]] end[}] END[}]
Keyword[public] annotation[@] identifier[Nonnull] identifier[String] identifier[getRootUrlFromRequest] operator[SEP] operator[SEP] { identifier[StaplerRequest] identifier[req] operator[=] identifier[Stapler] operator[SEP] identifier[getCurrentRequest] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[req] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] literal[String] operator[SEP] operator[SEP] } identifier[StringBuilder] identifier[buf] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[scheme] operator[=] identifier[getXForwardedHeader] operator[SEP] identifier[req] , literal[String] , identifier[req] operator[SEP] identifier[getScheme] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[buf] operator[SEP] identifier[append] operator[SEP] identifier[scheme] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[String] identifier[host] operator[=] identifier[getXForwardedHeader] operator[SEP] identifier[req] , literal[String] , identifier[req] operator[SEP] identifier[getServerName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[index] operator[=] identifier[host] operator[SEP] identifier[indexOf] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[int] identifier[port] operator[=] identifier[req] operator[SEP] identifier[getServerPort] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[index] operator[==] operator[-] Other[1] operator[SEP] { identifier[buf] operator[SEP] identifier[append] operator[SEP] identifier[host] operator[SEP] operator[SEP] } Keyword[else] { identifier[buf] operator[SEP] identifier[append] operator[SEP] identifier[host] operator[SEP] identifier[substring] operator[SEP] Other[0] , identifier[index] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[index] operator[+] Other[1] operator[<] identifier[host] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] { Keyword[try] { identifier[port] operator[=] identifier[Integer] operator[SEP] identifier[parseInt] operator[SEP] identifier[host] operator[SEP] identifier[substring] operator[SEP] identifier[index] operator[+] Other[1] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[NumberFormatException] identifier[e] operator[SEP] { } } } identifier[String] identifier[forwardedPort] operator[=] identifier[getXForwardedHeader] operator[SEP] identifier[req] , literal[String] , Other[null] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[forwardedPort] operator[!=] Other[null] operator[SEP] { Keyword[try] { identifier[port] operator[=] identifier[Integer] operator[SEP] identifier[parseInt] operator[SEP] identifier[forwardedPort] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[NumberFormatException] identifier[e] operator[SEP] { } } Keyword[if] operator[SEP] identifier[port] operator[!=] operator[SEP] literal[String] operator[SEP] identifier[equals] operator[SEP] identifier[scheme] operator[SEP] operator[?] Other[443] operator[:] Other[80] operator[SEP] operator[SEP] { identifier[buf] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[port] operator[SEP] operator[SEP] } identifier[buf] operator[SEP] identifier[append] operator[SEP] identifier[req] operator[SEP] identifier[getContextPath] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[buf] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] }
public void onRequest(HttpServletRequest request, HttpServletResponse response) { AbstractHttpServletActivity activity = null; final HttpServletRequestWrapper requestWrapper = new HttpServletRequestWrapper(request); final HttpSessionWrapper sessionWrapper = (HttpSessionWrapper) requestWrapper.getSession(false); final HttpServletRequestEvent requestEvent = new HttpServletRequestEventImpl(requestWrapper, response, this); final FireableEventType eventType = eventIdCache.getEventType(eventLookup, requestEvent, sessionWrapper); response.setStatus(HttpServletResponse.SC_NOT_IMPLEMENTED); if (eventIDFilter.filterEvent(eventType)) { if (tracer.isInfoEnabled()) { tracer.info("Request event filtered: " + requestEvent); } // dude, get out of here return; } boolean createActivity = true; if (sessionWrapper == null) { // create request activity activity = new HttpServletRequestActivityImpl(); } else { activity = new HttpSessionActivityImpl(sessionWrapper); if (sessionWrapper.getResourceEntryPoint() != null) { createActivity = false; } } if (createActivity) { // we have a session but its not activity yet, add it try { if (sessionWrapper != null) { sessionWrapper.setResourceEntryPoint(this.name); } sleeEndpoint.startActivity(activity, activity); } catch (ActivityAlreadyExistsException e) { if (tracer.isFineEnabled()) { tracer.fine("Failed to add activity " + activity, e); } // proceed, may be due to fail over } catch (Throwable e) { tracer.severe("Failed to add activity " + activity, e); return; } } if (tracer.isFineEnabled()) { tracer.fine("Firing event " + requestEvent + " in activity " + activity); } final Object lock = requestLock.getLock(requestEvent); synchronized (lock) { try { sleeEndpoint.fireEvent(activity, eventType, requestEvent, null, null, EventFlags.REQUEST_EVENT_UNREFERENCED_CALLBACK); // block thread until event has been processed lock.wait(httpRequestTimeout); // the event was unreferenced or 15s timeout, if the activity is the request then end it if (sessionWrapper == null) { endActivity(activity); } } catch (Throwable e) { tracer.severe("Failure while firing event " + requestEvent + " on activity " + activity, e); } } }
class class_name[name] begin[{] method[onRequest, return_type[void], modifier[public], parameter[request, response]] begin[{] local_variable[type[AbstractHttpServletActivity], activity] local_variable[type[HttpServletRequestWrapper], requestWrapper] local_variable[type[HttpSessionWrapper], sessionWrapper] local_variable[type[HttpServletRequestEvent], requestEvent] local_variable[type[FireableEventType], eventType] call[response.setStatus, parameter[member[HttpServletResponse.SC_NOT_IMPLEMENTED]]] if[call[eventIDFilter.filterEvent, parameter[member[.eventType]]]] begin[{] if[call[tracer.isInfoEnabled, parameter[]]] begin[{] call[tracer.info, parameter[binary_operation[literal["Request event filtered: "], +, member[.requestEvent]]]] else begin[{] None end[}] return[None] else begin[{] None end[}] local_variable[type[boolean], createActivity] if[binary_operation[member[.sessionWrapper], ==, literal[null]]] begin[{] assign[member[.activity], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=HttpServletRequestActivityImpl, sub_type=None))] else begin[{] assign[member[.activity], ClassCreator(arguments=[MemberReference(member=sessionWrapper, 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=HttpSessionActivityImpl, sub_type=None))] if[binary_operation[call[sessionWrapper.getResourceEntryPoint, parameter[]], !=, literal[null]]] begin[{] assign[member[.createActivity], literal[false]] else begin[{] None end[}] end[}] if[member[.createActivity]] begin[{] TryStatement(block=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=sessionWrapper, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=name, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)])], member=setResourceEntryPoint, postfix_operators=[], prefix_operators=[], qualifier=sessionWrapper, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=activity, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=activity, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=startActivity, postfix_operators=[], prefix_operators=[], qualifier=sleeEndpoint, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[IfStatement(condition=MethodInvocation(arguments=[], member=isFineEnabled, postfix_operators=[], prefix_operators=[], qualifier=tracer, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Failed to add activity "), operandr=MemberReference(member=activity, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=fine, postfix_operators=[], prefix_operators=[], qualifier=tracer, selectors=[], type_arguments=None), label=None)]))], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['ActivityAlreadyExistsException'])), CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Failed to add activity "), operandr=MemberReference(member=activity, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=severe, postfix_operators=[], prefix_operators=[], qualifier=tracer, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=None, label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Throwable']))], finally_block=None, label=None, resources=None) else begin[{] None end[}] if[call[tracer.isFineEnabled, parameter[]]] begin[{] call[tracer.fine, parameter[binary_operation[binary_operation[binary_operation[literal["Firing event "], +, member[.requestEvent]], +, literal[" in activity "]], +, member[.activity]]]] else begin[{] None end[}] local_variable[type[Object], lock] SYNCHRONIZED[member[.lock]] BEGIN[{] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=activity, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=eventType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=requestEvent, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), MemberReference(member=REQUEST_EVENT_UNREFERENCED_CALLBACK, postfix_operators=[], prefix_operators=[], qualifier=EventFlags, selectors=[])], member=fireEvent, postfix_operators=[], prefix_operators=[], qualifier=sleeEndpoint, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=httpRequestTimeout, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=wait, postfix_operators=[], prefix_operators=[], qualifier=lock, selectors=[], type_arguments=None), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=sessionWrapper, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=activity, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=endActivity, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]))], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Failure while firing event "), operandr=MemberReference(member=requestEvent, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" on activity "), operator=+), operandr=MemberReference(member=activity, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=severe, postfix_operators=[], prefix_operators=[], qualifier=tracer, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Throwable']))], finally_block=None, label=None, resources=None) END[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[onRequest] operator[SEP] identifier[HttpServletRequest] identifier[request] , identifier[HttpServletResponse] identifier[response] operator[SEP] { identifier[AbstractHttpServletActivity] identifier[activity] operator[=] Other[null] operator[SEP] Keyword[final] identifier[HttpServletRequestWrapper] identifier[requestWrapper] operator[=] Keyword[new] identifier[HttpServletRequestWrapper] operator[SEP] identifier[request] operator[SEP] operator[SEP] Keyword[final] identifier[HttpSessionWrapper] identifier[sessionWrapper] operator[=] operator[SEP] identifier[HttpSessionWrapper] operator[SEP] identifier[requestWrapper] operator[SEP] identifier[getSession] operator[SEP] literal[boolean] operator[SEP] operator[SEP] Keyword[final] identifier[HttpServletRequestEvent] identifier[requestEvent] operator[=] Keyword[new] identifier[HttpServletRequestEventImpl] operator[SEP] identifier[requestWrapper] , identifier[response] , Keyword[this] operator[SEP] operator[SEP] Keyword[final] identifier[FireableEventType] identifier[eventType] operator[=] identifier[eventIdCache] operator[SEP] identifier[getEventType] operator[SEP] identifier[eventLookup] , identifier[requestEvent] , identifier[sessionWrapper] operator[SEP] operator[SEP] identifier[response] operator[SEP] identifier[setStatus] operator[SEP] identifier[HttpServletResponse] operator[SEP] identifier[SC_NOT_IMPLEMENTED] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[eventIDFilter] operator[SEP] identifier[filterEvent] operator[SEP] identifier[eventType] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[tracer] operator[SEP] identifier[isInfoEnabled] operator[SEP] operator[SEP] operator[SEP] { identifier[tracer] operator[SEP] identifier[info] operator[SEP] literal[String] operator[+] identifier[requestEvent] operator[SEP] operator[SEP] } Keyword[return] operator[SEP] } Keyword[boolean] identifier[createActivity] operator[=] literal[boolean] operator[SEP] Keyword[if] operator[SEP] identifier[sessionWrapper] operator[==] Other[null] operator[SEP] { identifier[activity] operator[=] Keyword[new] identifier[HttpServletRequestActivityImpl] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[activity] operator[=] Keyword[new] identifier[HttpSessionActivityImpl] operator[SEP] identifier[sessionWrapper] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[sessionWrapper] operator[SEP] identifier[getResourceEntryPoint] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] { identifier[createActivity] operator[=] literal[boolean] operator[SEP] } } Keyword[if] operator[SEP] identifier[createActivity] operator[SEP] { Keyword[try] { Keyword[if] operator[SEP] identifier[sessionWrapper] operator[!=] Other[null] operator[SEP] { identifier[sessionWrapper] operator[SEP] identifier[setResourceEntryPoint] operator[SEP] Keyword[this] operator[SEP] identifier[name] operator[SEP] operator[SEP] } identifier[sleeEndpoint] operator[SEP] identifier[startActivity] operator[SEP] identifier[activity] , identifier[activity] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[ActivityAlreadyExistsException] identifier[e] operator[SEP] { Keyword[if] operator[SEP] identifier[tracer] operator[SEP] identifier[isFineEnabled] operator[SEP] operator[SEP] operator[SEP] { identifier[tracer] operator[SEP] identifier[fine] operator[SEP] literal[String] operator[+] identifier[activity] , identifier[e] operator[SEP] operator[SEP] } } Keyword[catch] operator[SEP] identifier[Throwable] identifier[e] operator[SEP] { identifier[tracer] operator[SEP] identifier[severe] operator[SEP] literal[String] operator[+] identifier[activity] , identifier[e] operator[SEP] operator[SEP] Keyword[return] operator[SEP] } } Keyword[if] operator[SEP] identifier[tracer] operator[SEP] identifier[isFineEnabled] operator[SEP] operator[SEP] operator[SEP] { identifier[tracer] operator[SEP] identifier[fine] operator[SEP] literal[String] operator[+] identifier[requestEvent] operator[+] literal[String] operator[+] identifier[activity] operator[SEP] operator[SEP] } Keyword[final] identifier[Object] identifier[lock] operator[=] identifier[requestLock] operator[SEP] identifier[getLock] operator[SEP] identifier[requestEvent] operator[SEP] operator[SEP] Keyword[synchronized] operator[SEP] identifier[lock] operator[SEP] { Keyword[try] { identifier[sleeEndpoint] operator[SEP] identifier[fireEvent] operator[SEP] identifier[activity] , identifier[eventType] , identifier[requestEvent] , Other[null] , Other[null] , identifier[EventFlags] operator[SEP] identifier[REQUEST_EVENT_UNREFERENCED_CALLBACK] operator[SEP] operator[SEP] identifier[lock] operator[SEP] identifier[wait] operator[SEP] identifier[httpRequestTimeout] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[sessionWrapper] operator[==] Other[null] operator[SEP] { identifier[endActivity] operator[SEP] identifier[activity] operator[SEP] operator[SEP] } } Keyword[catch] operator[SEP] identifier[Throwable] identifier[e] operator[SEP] { identifier[tracer] operator[SEP] identifier[severe] operator[SEP] literal[String] operator[+] identifier[requestEvent] operator[+] literal[String] operator[+] identifier[activity] , identifier[e] operator[SEP] operator[SEP] } } }