code
stringlengths
63
466k
code_sememe
stringlengths
141
3.79M
token_type
stringlengths
274
1.23M
public void marshall(StructValue structValue, ProtocolMarshaller protocolMarshaller) { if (structValue == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(structValue.getAttributes(), ATTRIBUTES_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[structValue, protocolMarshaller]] begin[{] if[binary_operation[member[.structValue], ==, 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=getAttributes, postfix_operators=[], prefix_operators=[], qualifier=structValue, selectors=[], type_arguments=None), MemberReference(member=ATTRIBUTES_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[StructValue] identifier[structValue] , identifier[ProtocolMarshaller] identifier[protocolMarshaller] operator[SEP] { Keyword[if] operator[SEP] identifier[structValue] 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[structValue] operator[SEP] identifier[getAttributes] operator[SEP] operator[SEP] , identifier[ATTRIBUTES_BINDING] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[SdkClientException] operator[SEP] literal[String] operator[+] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP] } }
@Override public Query setParameter(String name, Object value) { kunderaQuery.setParameter(name, value); return this; }
class class_name[name] begin[{] method[setParameter, return_type[type[Query]], modifier[public], parameter[name, value]] begin[{] call[kunderaQuery.setParameter, parameter[member[.name], member[.value]]] return[THIS[]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[Query] identifier[setParameter] operator[SEP] identifier[String] identifier[name] , identifier[Object] identifier[value] operator[SEP] { identifier[kunderaQuery] operator[SEP] identifier[setParameter] operator[SEP] identifier[name] , identifier[value] operator[SEP] operator[SEP] Keyword[return] Keyword[this] operator[SEP] }
public Throwable setThrowable(Throwable throwable, String resource) { if (m_throwable == null) { m_throwable = throwable; m_throwableResourceUri = resource; } else { if (LOG.isDebugEnabled()) { if (resource != null) { LOG.debug( Messages.get().getBundle().key(Messages.LOG_FLEXCONTROLLER_IGNORED_EXCEPTION_1, resource)); } else { LOG.debug(Messages.get().getBundle().key(Messages.LOG_FLEXCONTROLLER_IGNORED_EXCEPTION_0)); } } } return m_throwable; }
class class_name[name] begin[{] method[setThrowable, return_type[type[Throwable]], modifier[public], parameter[throwable, resource]] begin[{] if[binary_operation[member[.m_throwable], ==, literal[null]]] begin[{] assign[member[.m_throwable], member[.throwable]] assign[member[.m_throwableResourceUri], member[.resource]] else begin[{] if[call[LOG.isDebugEnabled, parameter[]]] begin[{] if[binary_operation[member[.resource], !=, literal[null]]] begin[{] call[LOG.debug, parameter[call[Messages.get, parameter[]]]] else begin[{] call[LOG.debug, parameter[call[Messages.get, parameter[]]]] end[}] else begin[{] None end[}] end[}] return[member[.m_throwable]] end[}] END[}]
Keyword[public] identifier[Throwable] identifier[setThrowable] operator[SEP] identifier[Throwable] identifier[throwable] , identifier[String] identifier[resource] operator[SEP] { Keyword[if] operator[SEP] identifier[m_throwable] operator[==] Other[null] operator[SEP] { identifier[m_throwable] operator[=] identifier[throwable] operator[SEP] identifier[m_throwableResourceUri] operator[=] identifier[resource] operator[SEP] } Keyword[else] { Keyword[if] operator[SEP] identifier[LOG] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[resource] operator[!=] Other[null] operator[SEP] { identifier[LOG] operator[SEP] identifier[debug] 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[LOG_FLEXCONTROLLER_IGNORED_EXCEPTION_1] , identifier[resource] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[LOG] operator[SEP] identifier[debug] 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[LOG_FLEXCONTROLLER_IGNORED_EXCEPTION_0] operator[SEP] operator[SEP] operator[SEP] } } } Keyword[return] identifier[m_throwable] operator[SEP] }
public void doAdd(Record record) throws DBException { record = this.moveRecordToBase(record); int iOpenMode = record.getOpenMode(); RecordChangedHandler recordChangeListener = (RecordChangedHandler)record.getListener(RecordChangedHandler.class); Object[] rgobjEnabledFields = record.setEnableFieldListeners(false); boolean[] rgbEnabled = record.setEnableListeners(false); if (recordChangeListener != null) recordChangeListener.setEnabledListener(true); // I may need this listener (for an update) to do the update =ID AND =LastChangeDate try { record.setOpenMode(0); // Normal add this.getNextTable().add(record); } catch (DBException ex) { throw ex; } finally { record.setOpenMode(iOpenMode); record.setEnableListeners(rgbEnabled); record.setEnableFieldListeners(rgobjEnabledFields); } }
class class_name[name] begin[{] method[doAdd, return_type[void], modifier[public], parameter[record]] begin[{] assign[member[.record], THIS[call[None.moveRecordToBase, parameter[member[.record]]]]] local_variable[type[int], iOpenMode] local_variable[type[RecordChangedHandler], recordChangeListener] local_variable[type[Object], rgobjEnabledFields] local_variable[type[boolean], rgbEnabled] if[binary_operation[member[.recordChangeListener], !=, literal[null]]] begin[{] call[recordChangeListener.setEnabledListener, parameter[literal[true]]] else begin[{] None end[}] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], member=setOpenMode, postfix_operators=[], prefix_operators=[], qualifier=record, selectors=[], type_arguments=None), label=None), StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[], member=getNextTable, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=record, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=MemberReference(member=ex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ex, types=['DBException']))], finally_block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=iOpenMode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setOpenMode, postfix_operators=[], prefix_operators=[], qualifier=record, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=rgbEnabled, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setEnableListeners, postfix_operators=[], prefix_operators=[], qualifier=record, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=rgobjEnabledFields, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setEnableFieldListeners, postfix_operators=[], prefix_operators=[], qualifier=record, selectors=[], type_arguments=None), label=None)], label=None, resources=None) end[}] END[}]
Keyword[public] Keyword[void] identifier[doAdd] operator[SEP] identifier[Record] identifier[record] operator[SEP] Keyword[throws] identifier[DBException] { identifier[record] operator[=] Keyword[this] operator[SEP] identifier[moveRecordToBase] operator[SEP] identifier[record] operator[SEP] operator[SEP] Keyword[int] identifier[iOpenMode] operator[=] identifier[record] operator[SEP] identifier[getOpenMode] operator[SEP] operator[SEP] operator[SEP] identifier[RecordChangedHandler] identifier[recordChangeListener] operator[=] operator[SEP] identifier[RecordChangedHandler] operator[SEP] identifier[record] operator[SEP] identifier[getListener] operator[SEP] identifier[RecordChangedHandler] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[Object] operator[SEP] operator[SEP] identifier[rgobjEnabledFields] operator[=] identifier[record] operator[SEP] identifier[setEnableFieldListeners] operator[SEP] literal[boolean] operator[SEP] operator[SEP] Keyword[boolean] operator[SEP] operator[SEP] identifier[rgbEnabled] operator[=] identifier[record] operator[SEP] identifier[setEnableListeners] operator[SEP] literal[boolean] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[recordChangeListener] operator[!=] Other[null] operator[SEP] identifier[recordChangeListener] operator[SEP] identifier[setEnabledListener] operator[SEP] literal[boolean] operator[SEP] operator[SEP] Keyword[try] { identifier[record] operator[SEP] identifier[setOpenMode] operator[SEP] Other[0] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[getNextTable] operator[SEP] operator[SEP] operator[SEP] identifier[add] operator[SEP] identifier[record] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[DBException] identifier[ex] operator[SEP] { Keyword[throw] identifier[ex] operator[SEP] } Keyword[finally] { identifier[record] operator[SEP] identifier[setOpenMode] operator[SEP] identifier[iOpenMode] operator[SEP] operator[SEP] identifier[record] operator[SEP] identifier[setEnableListeners] operator[SEP] identifier[rgbEnabled] operator[SEP] operator[SEP] identifier[record] operator[SEP] identifier[setEnableFieldListeners] operator[SEP] identifier[rgobjEnabledFields] operator[SEP] operator[SEP] } }
@Nonnull @ReturnsMutableCopy public static ICommonsList <File> getDirectoryContent (@Nonnull final File aDirectory, @Nonnull final FileFilter aFileFilter) { ValueEnforcer.notNull (aDirectory, "Directory"); ValueEnforcer.notNull (aFileFilter, "FileFilter"); return _getDirectoryContent (aDirectory, aDirectory.listFiles (aFileFilter)); }
class class_name[name] begin[{] method[getDirectoryContent, return_type[type[ICommonsList]], modifier[public static], parameter[aDirectory, aFileFilter]] begin[{] call[ValueEnforcer.notNull, parameter[member[.aDirectory], literal["Directory"]]] call[ValueEnforcer.notNull, parameter[member[.aFileFilter], literal["FileFilter"]]] return[call[._getDirectoryContent, parameter[member[.aDirectory], call[aDirectory.listFiles, parameter[member[.aFileFilter]]]]]] end[}] END[}]
annotation[@] identifier[Nonnull] annotation[@] identifier[ReturnsMutableCopy] Keyword[public] Keyword[static] identifier[ICommonsList] operator[<] identifier[File] operator[>] identifier[getDirectoryContent] operator[SEP] annotation[@] identifier[Nonnull] Keyword[final] identifier[File] identifier[aDirectory] , annotation[@] identifier[Nonnull] Keyword[final] identifier[FileFilter] identifier[aFileFilter] operator[SEP] { identifier[ValueEnforcer] operator[SEP] identifier[notNull] operator[SEP] identifier[aDirectory] , literal[String] operator[SEP] operator[SEP] identifier[ValueEnforcer] operator[SEP] identifier[notNull] operator[SEP] identifier[aFileFilter] , literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[_getDirectoryContent] operator[SEP] identifier[aDirectory] , identifier[aDirectory] operator[SEP] identifier[listFiles] operator[SEP] identifier[aFileFilter] operator[SEP] operator[SEP] operator[SEP] }
public static boolean mergeLTI1Custom(Properties custom, String customstr) { if ( customstr == null || customstr.length() < 1 ) return true; String [] params = customstr.split("[\n;]"); for (int i = 0 ; i < params.length; i++ ) { String param = params[i]; if ( param == null ) continue; if ( param.length() < 1 ) continue; int pos = param.indexOf("="); if ( pos < 1 ) continue; if ( pos+1 > param.length() ) continue; String key = mapKeyName(param.substring(0,pos)); if ( key == null ) continue; if ( custom.containsKey(key) ) continue; String value = param.substring(pos+1); if ( value == null ) continue; value = value.trim(); if ( value.length() < 1 ) continue; setProperty(custom, key, value); } return true; }
class class_name[name] begin[{] method[mergeLTI1Custom, return_type[type[boolean]], modifier[public static], parameter[custom, customstr]] begin[{] if[binary_operation[binary_operation[member[.customstr], ==, literal[null]], ||, binary_operation[call[customstr.length, parameter[]], <, literal[1]]]] begin[{] return[literal[true]] else begin[{] None end[}] local_variable[type[String], params] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=params, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), name=param)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=param, 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=ContinueStatement(goto=None, label=None)), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=param, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=<), else_statement=None, label=None, then_statement=ContinueStatement(goto=None, label=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="=")], member=indexOf, postfix_operators=[], prefix_operators=[], qualifier=param, selectors=[], type_arguments=None), name=pos)], modifiers=set(), type=BasicType(dimensions=[], name=int)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=pos, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=<), else_statement=None, label=None, then_statement=ContinueStatement(goto=None, label=None)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=pos, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+), operandr=MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=param, selectors=[], type_arguments=None), operator=>), else_statement=None, label=None, then_statement=ContinueStatement(goto=None, label=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), MemberReference(member=pos, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=substring, postfix_operators=[], prefix_operators=[], qualifier=param, selectors=[], type_arguments=None)], member=mapKeyName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=key)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=key, 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=ContinueStatement(goto=None, label=None)), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=containsKey, postfix_operators=[], prefix_operators=[], qualifier=custom, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=ContinueStatement(goto=None, label=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=pos, 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=param, selectors=[], type_arguments=None), name=value)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=value, 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=ContinueStatement(goto=None, label=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=trim, postfix_operators=[], prefix_operators=[], qualifier=value, selectors=[], type_arguments=None)), label=None), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=value, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=<), else_statement=None, label=None, then_statement=ContinueStatement(goto=None, label=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=custom, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setProperty, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=params, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) return[literal[true]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[boolean] identifier[mergeLTI1Custom] operator[SEP] identifier[Properties] identifier[custom] , identifier[String] identifier[customstr] operator[SEP] { Keyword[if] operator[SEP] identifier[customstr] operator[==] Other[null] operator[||] identifier[customstr] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[<] Other[1] operator[SEP] Keyword[return] literal[boolean] operator[SEP] identifier[String] operator[SEP] operator[SEP] identifier[params] operator[=] identifier[customstr] operator[SEP] identifier[split] 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[params] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[String] identifier[param] operator[=] identifier[params] operator[SEP] identifier[i] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[param] operator[==] Other[null] operator[SEP] Keyword[continue] operator[SEP] Keyword[if] operator[SEP] identifier[param] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[<] Other[1] operator[SEP] Keyword[continue] operator[SEP] Keyword[int] identifier[pos] operator[=] identifier[param] operator[SEP] identifier[indexOf] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[pos] operator[<] Other[1] operator[SEP] Keyword[continue] operator[SEP] Keyword[if] operator[SEP] identifier[pos] operator[+] Other[1] operator[>] identifier[param] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] Keyword[continue] operator[SEP] identifier[String] identifier[key] operator[=] identifier[mapKeyName] operator[SEP] identifier[param] operator[SEP] identifier[substring] operator[SEP] Other[0] , identifier[pos] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[key] operator[==] Other[null] operator[SEP] Keyword[continue] operator[SEP] Keyword[if] operator[SEP] identifier[custom] operator[SEP] identifier[containsKey] operator[SEP] identifier[key] operator[SEP] operator[SEP] Keyword[continue] operator[SEP] identifier[String] identifier[value] operator[=] identifier[param] operator[SEP] identifier[substring] operator[SEP] identifier[pos] operator[+] Other[1] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[value] operator[==] Other[null] operator[SEP] Keyword[continue] operator[SEP] identifier[value] operator[=] identifier[value] operator[SEP] identifier[trim] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[value] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[<] Other[1] operator[SEP] Keyword[continue] operator[SEP] identifier[setProperty] operator[SEP] identifier[custom] , identifier[key] , identifier[value] operator[SEP] operator[SEP] } Keyword[return] literal[boolean] operator[SEP] }
public static DMatrixRMaj createFundamental(DMatrixRMaj E, CameraPinhole intrinsic ) { DMatrixRMaj K = PerspectiveOps.pinholeToMatrix(intrinsic,(DMatrixRMaj)null); return createFundamental(E,K); }
class class_name[name] begin[{] method[createFundamental, return_type[type[DMatrixRMaj]], modifier[public static], parameter[E, intrinsic]] begin[{] local_variable[type[DMatrixRMaj], K] return[call[.createFundamental, parameter[member[.E], member[.K]]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[DMatrixRMaj] identifier[createFundamental] operator[SEP] identifier[DMatrixRMaj] identifier[E] , identifier[CameraPinhole] identifier[intrinsic] operator[SEP] { identifier[DMatrixRMaj] identifier[K] operator[=] identifier[PerspectiveOps] operator[SEP] identifier[pinholeToMatrix] operator[SEP] identifier[intrinsic] , operator[SEP] identifier[DMatrixRMaj] operator[SEP] Other[null] operator[SEP] operator[SEP] Keyword[return] identifier[createFundamental] operator[SEP] identifier[E] , identifier[K] operator[SEP] operator[SEP] }
protected void skipToBeDeleted() throws ObjectManagerException { if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.entry(this, cclass, "skipToBeDeleted"); Token nextToken = availableHead; // Move forward past any links that are to be deleted. These might be there // because other links ahead of them have now been removed, or because a // delete of a link backed out possibly reinstating it near the head of the list. // See Link.postBackout. skipToBeDeleted: while (nextToken != null) { Link nextLink = (Link) (nextToken.getManagedObject()); if (nextLink.state != Link.stateToBeDeleted && nextLink.state != Link.stateMustBeDeleted) break skipToBeDeleted; nextToken = nextLink.next; // Try the folowing link. } // while (nextToken != null ). availableHead = nextToken; // Remember what we skipped. if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.exit(this, cclass, "skipToBeDeleted" ); }
class class_name[name] begin[{] method[skipToBeDeleted, return_type[void], modifier[protected], parameter[]] begin[{] if[binary_operation[call[Tracing.isAnyTracingEnabled, parameter[]], &&, call[trace.isEntryEnabled, parameter[]]]] begin[{] call[trace.entry, parameter[THIS[], member[.cclass], literal["skipToBeDeleted"]]] else begin[{] None end[}] local_variable[type[Token], nextToken] while[binary_operation[member[.nextToken], !=, literal[null]]] begin[{] local_variable[type[Link], nextLink] if[binary_operation[binary_operation[member[nextLink.state], !=, member[Link.stateToBeDeleted]], &&, binary_operation[member[nextLink.state], !=, member[Link.stateMustBeDeleted]]]] begin[{] BreakStatement(goto=skipToBeDeleted, label=None) else begin[{] None end[}] assign[member[.nextToken], member[nextLink.next]] end[}] assign[member[.availableHead], member[.nextToken]] if[binary_operation[call[Tracing.isAnyTracingEnabled, parameter[]], &&, call[trace.isEntryEnabled, parameter[]]]] begin[{] call[trace.exit, parameter[THIS[], member[.cclass], literal["skipToBeDeleted"]]] else begin[{] None end[}] end[}] END[}]
Keyword[protected] Keyword[void] identifier[skipToBeDeleted] operator[SEP] operator[SEP] Keyword[throws] identifier[ObjectManagerException] { Keyword[if] operator[SEP] identifier[Tracing] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[trace] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[trace] operator[SEP] identifier[entry] operator[SEP] Keyword[this] , identifier[cclass] , literal[String] operator[SEP] operator[SEP] identifier[Token] identifier[nextToken] operator[=] identifier[availableHead] operator[SEP] identifier[skipToBeDeleted] operator[:] Keyword[while] operator[SEP] identifier[nextToken] operator[!=] Other[null] operator[SEP] { identifier[Link] identifier[nextLink] operator[=] operator[SEP] identifier[Link] operator[SEP] operator[SEP] identifier[nextToken] operator[SEP] identifier[getManagedObject] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[nextLink] operator[SEP] identifier[state] operator[!=] identifier[Link] operator[SEP] identifier[stateToBeDeleted] operator[&&] identifier[nextLink] operator[SEP] identifier[state] operator[!=] identifier[Link] operator[SEP] identifier[stateMustBeDeleted] operator[SEP] Keyword[break] identifier[skipToBeDeleted] operator[SEP] identifier[nextToken] operator[=] identifier[nextLink] operator[SEP] identifier[next] operator[SEP] } identifier[availableHead] operator[=] identifier[nextToken] operator[SEP] Keyword[if] operator[SEP] identifier[Tracing] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[trace] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[trace] operator[SEP] identifier[exit] operator[SEP] Keyword[this] , identifier[cclass] , literal[String] operator[SEP] operator[SEP] }
public AgreementTermsInner get(String publisherId, String offerId, String planId) { return getWithServiceResponseAsync(publisherId, offerId, planId).toBlocking().single().body(); }
class class_name[name] begin[{] method[get, return_type[type[AgreementTermsInner]], modifier[public], parameter[publisherId, offerId, planId]] begin[{] return[call[.getWithServiceResponseAsync, parameter[member[.publisherId], member[.offerId], member[.planId]]]] end[}] END[}]
Keyword[public] identifier[AgreementTermsInner] identifier[get] operator[SEP] identifier[String] identifier[publisherId] , identifier[String] identifier[offerId] , identifier[String] identifier[planId] operator[SEP] { Keyword[return] identifier[getWithServiceResponseAsync] operator[SEP] identifier[publisherId] , identifier[offerId] , identifier[planId] operator[SEP] operator[SEP] identifier[toBlocking] operator[SEP] operator[SEP] operator[SEP] identifier[single] operator[SEP] operator[SEP] operator[SEP] identifier[body] operator[SEP] operator[SEP] operator[SEP] }
public StandardModel extractStandardTransition(XEvent event) { String transition = extractTransition(event); if (transition != null) { return StandardModel.decode(transition); } else { return null; } }
class class_name[name] begin[{] method[extractStandardTransition, return_type[type[StandardModel]], modifier[public], parameter[event]] begin[{] local_variable[type[String], transition] if[binary_operation[member[.transition], !=, literal[null]]] begin[{] return[call[StandardModel.decode, parameter[member[.transition]]]] else begin[{] return[literal[null]] end[}] end[}] END[}]
Keyword[public] identifier[StandardModel] identifier[extractStandardTransition] operator[SEP] identifier[XEvent] identifier[event] operator[SEP] { identifier[String] identifier[transition] operator[=] identifier[extractTransition] operator[SEP] identifier[event] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[transition] operator[!=] Other[null] operator[SEP] { Keyword[return] identifier[StandardModel] operator[SEP] identifier[decode] operator[SEP] identifier[transition] operator[SEP] operator[SEP] } Keyword[else] { Keyword[return] Other[null] operator[SEP] } }
@Override public void write(String text, String contentType) { assertArgumentNotNull("text", text); assertArgumentNotNull("contentType", contentType); doWrite(text, contentType); }
class class_name[name] begin[{] method[write, return_type[void], modifier[public], parameter[text, contentType]] begin[{] call[.assertArgumentNotNull, parameter[literal["text"], member[.text]]] call[.assertArgumentNotNull, parameter[literal["contentType"], member[.contentType]]] call[.doWrite, parameter[member[.text], member[.contentType]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[write] operator[SEP] identifier[String] identifier[text] , identifier[String] identifier[contentType] operator[SEP] { identifier[assertArgumentNotNull] operator[SEP] literal[String] , identifier[text] operator[SEP] operator[SEP] identifier[assertArgumentNotNull] operator[SEP] literal[String] , identifier[contentType] operator[SEP] operator[SEP] identifier[doWrite] operator[SEP] identifier[text] , identifier[contentType] operator[SEP] operator[SEP] }
public static void writeGeneSequence(File file, Collection<GeneSequence> geneSequences,boolean showExonUppercase) throws Exception { FileOutputStream outputStream = new FileOutputStream(file); BufferedOutputStream bo = new BufferedOutputStream(outputStream); writeGeneSequence(bo, geneSequences,showExonUppercase); bo.close(); outputStream.close(); }
class class_name[name] begin[{] method[writeGeneSequence, return_type[void], modifier[public static], parameter[file, geneSequences, showExonUppercase]] begin[{] local_variable[type[FileOutputStream], outputStream] local_variable[type[BufferedOutputStream], bo] call[.writeGeneSequence, parameter[member[.bo], member[.geneSequences], member[.showExonUppercase]]] call[bo.close, parameter[]] call[outputStream.close, parameter[]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[writeGeneSequence] operator[SEP] identifier[File] identifier[file] , identifier[Collection] operator[<] identifier[GeneSequence] operator[>] identifier[geneSequences] , Keyword[boolean] identifier[showExonUppercase] operator[SEP] Keyword[throws] identifier[Exception] { identifier[FileOutputStream] identifier[outputStream] operator[=] Keyword[new] identifier[FileOutputStream] operator[SEP] identifier[file] operator[SEP] operator[SEP] identifier[BufferedOutputStream] identifier[bo] operator[=] Keyword[new] identifier[BufferedOutputStream] operator[SEP] identifier[outputStream] operator[SEP] operator[SEP] identifier[writeGeneSequence] operator[SEP] identifier[bo] , identifier[geneSequences] , identifier[showExonUppercase] operator[SEP] operator[SEP] identifier[bo] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP] identifier[outputStream] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP] }
public Mac getMac(final @NotNull String alias) { try { final Key secretKey = keys.get(alias); Mac mac = Mac.getInstance(secretKey.getAlgorithm()); mac.init(secretKey); return mac; } catch (NoSuchAlgorithmException | InvalidKeyException e) { throw new RuntimeException(e); } }
class class_name[name] begin[{] method[getMac, return_type[type[Mac]], modifier[public], parameter[alias]] begin[{] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=alias, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=keys, selectors=[], type_arguments=None), name=secretKey)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=Key, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getAlgorithm, postfix_operators=[], prefix_operators=[], qualifier=secretKey, selectors=[], type_arguments=None)], member=getInstance, postfix_operators=[], prefix_operators=[], qualifier=Mac, selectors=[], type_arguments=None), name=mac)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Mac, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=secretKey, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=init, postfix_operators=[], prefix_operators=[], qualifier=mac, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=MemberReference(member=mac, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=RuntimeException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['NoSuchAlgorithmException', 'InvalidKeyException']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[public] identifier[Mac] identifier[getMac] operator[SEP] Keyword[final] annotation[@] identifier[NotNull] identifier[String] identifier[alias] operator[SEP] { Keyword[try] { Keyword[final] identifier[Key] identifier[secretKey] operator[=] identifier[keys] operator[SEP] identifier[get] operator[SEP] identifier[alias] operator[SEP] operator[SEP] identifier[Mac] identifier[mac] operator[=] identifier[Mac] operator[SEP] identifier[getInstance] operator[SEP] identifier[secretKey] operator[SEP] identifier[getAlgorithm] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[mac] operator[SEP] identifier[init] operator[SEP] identifier[secretKey] operator[SEP] operator[SEP] Keyword[return] identifier[mac] operator[SEP] } Keyword[catch] operator[SEP] identifier[NoSuchAlgorithmException] operator[|] identifier[InvalidKeyException] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[RuntimeException] operator[SEP] identifier[e] operator[SEP] operator[SEP] } }
@Override public void endElement(String uri, String localName, String qName) throws SAXException { // currentElement represents the last string encountered in the document setCurrentElement(getElementNames().pop()); if (getCurrentElement().equalsIgnoreCase(GPXTags.RTE)) { Coordinate[] rteArray = new Coordinate[rteList.size()]; rteArray = rteList.toArray(rteArray); // If there are more than one routepoint, we can set a geometry to the route if (rteList.size() > 1) { LineString geometry = getGeometryFactory().createLineString(rteArray); geometry.setSRID(4326); getCurrentLine().setGeometry(geometry); } // if </rte> markup is found, the currentLine is added in the table rtedbd and the default contentHandler is setted. try { PreparedStatement pStm = getRtePreparedStmt(); int i = 1; Object[] values = getCurrentLine().getValues(); for (Object object : values) { pStm.setObject(i, object); i++; } pStm.execute(); } catch (SQLException ex) { throw new SAXException("Cannot import the route line ", ex); } getReader().setContentHandler(parent); } else if (getCurrentElement().equalsIgnoreCase(GPXTags.RTEPT)) { // if </rtept> markup is found, the currentPoint is added in the table rteptdbd. point = false; try { PreparedStatement pStm = getRteptPreparedStmt(); int i = 1; Object[] values = getCurrentPoint().getValues(); for (Object object : values) { pStm.setObject(i, object); i++; } pStm.execute(); } catch (SQLException ex) { throw new SAXException("Cannot import the route points ", ex); } } else if (point) { getCurrentPoint().setAttribute(getCurrentElement(), getContentBuffer()); } else { getCurrentLine().setAttribute(getCurrentElement(), getContentBuffer()); } }
class class_name[name] begin[{] method[endElement, return_type[void], modifier[public], parameter[uri, localName, qName]] begin[{] call[.setCurrentElement, parameter[call[.getElementNames, parameter[]]]] if[call[.getCurrentElement, parameter[]]] begin[{] local_variable[type[Coordinate], rteArray] assign[member[.rteArray], call[rteList.toArray, parameter[member[.rteArray]]]] if[binary_operation[call[rteList.size, parameter[]], >, literal[1]]] begin[{] local_variable[type[LineString], geometry] call[geometry.setSRID, parameter[literal[4326]]] call[.getCurrentLine, parameter[]] else begin[{] None end[}] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getRtePreparedStmt, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=pStm)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=PreparedStatement, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getCurrentLine, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[], member=getValues, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=values)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[None], name=Object, sub_type=None)), ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=object, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setObject, postfix_operators=[], prefix_operators=[], qualifier=pStm, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=values, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=object)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=execute, postfix_operators=[], prefix_operators=[], qualifier=pStm, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Cannot import the route line "), 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=SAXException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ex, types=['SQLException']))], finally_block=None, label=None, resources=None) call[.getReader, parameter[]] else begin[{] if[call[.getCurrentElement, parameter[]]] begin[{] assign[member[.point], literal[false]] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getRteptPreparedStmt, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=pStm)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=PreparedStatement, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getCurrentPoint, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[], member=getValues, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=values)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[None], name=Object, sub_type=None)), ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=object, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setObject, postfix_operators=[], prefix_operators=[], qualifier=pStm, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=values, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=object)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=execute, postfix_operators=[], prefix_operators=[], qualifier=pStm, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Cannot import the route points "), 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=SAXException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ex, types=['SQLException']))], finally_block=None, label=None, resources=None) else begin[{] if[member[.point]] begin[{] call[.getCurrentPoint, parameter[]] else begin[{] call[.getCurrentLine, parameter[]] end[}] end[}] end[}] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[endElement] operator[SEP] identifier[String] identifier[uri] , identifier[String] identifier[localName] , identifier[String] identifier[qName] operator[SEP] Keyword[throws] identifier[SAXException] { identifier[setCurrentElement] operator[SEP] identifier[getElementNames] operator[SEP] operator[SEP] operator[SEP] identifier[pop] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[getCurrentElement] operator[SEP] operator[SEP] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] identifier[GPXTags] operator[SEP] identifier[RTE] operator[SEP] operator[SEP] { identifier[Coordinate] operator[SEP] operator[SEP] identifier[rteArray] operator[=] Keyword[new] identifier[Coordinate] operator[SEP] identifier[rteList] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[rteArray] operator[=] identifier[rteList] operator[SEP] identifier[toArray] operator[SEP] identifier[rteArray] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[rteList] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[>] Other[1] operator[SEP] { identifier[LineString] identifier[geometry] operator[=] identifier[getGeometryFactory] operator[SEP] operator[SEP] operator[SEP] identifier[createLineString] operator[SEP] identifier[rteArray] operator[SEP] operator[SEP] identifier[geometry] operator[SEP] identifier[setSRID] operator[SEP] Other[4326] operator[SEP] operator[SEP] identifier[getCurrentLine] operator[SEP] operator[SEP] operator[SEP] identifier[setGeometry] operator[SEP] identifier[geometry] operator[SEP] operator[SEP] } Keyword[try] { identifier[PreparedStatement] identifier[pStm] operator[=] identifier[getRtePreparedStmt] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[i] operator[=] Other[1] operator[SEP] identifier[Object] operator[SEP] operator[SEP] identifier[values] operator[=] identifier[getCurrentLine] operator[SEP] operator[SEP] operator[SEP] identifier[getValues] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Object] identifier[object] operator[:] identifier[values] operator[SEP] { identifier[pStm] operator[SEP] identifier[setObject] operator[SEP] identifier[i] , identifier[object] operator[SEP] operator[SEP] identifier[i] operator[++] operator[SEP] } identifier[pStm] operator[SEP] identifier[execute] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[SQLException] identifier[ex] operator[SEP] { Keyword[throw] Keyword[new] identifier[SAXException] operator[SEP] literal[String] , identifier[ex] operator[SEP] operator[SEP] } identifier[getReader] operator[SEP] operator[SEP] operator[SEP] identifier[setContentHandler] operator[SEP] identifier[parent] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[getCurrentElement] operator[SEP] operator[SEP] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] identifier[GPXTags] operator[SEP] identifier[RTEPT] operator[SEP] operator[SEP] { identifier[point] operator[=] literal[boolean] operator[SEP] Keyword[try] { identifier[PreparedStatement] identifier[pStm] operator[=] identifier[getRteptPreparedStmt] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[i] operator[=] Other[1] operator[SEP] identifier[Object] operator[SEP] operator[SEP] identifier[values] operator[=] identifier[getCurrentPoint] operator[SEP] operator[SEP] operator[SEP] identifier[getValues] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Object] identifier[object] operator[:] identifier[values] operator[SEP] { identifier[pStm] operator[SEP] identifier[setObject] operator[SEP] identifier[i] , identifier[object] operator[SEP] operator[SEP] identifier[i] operator[++] operator[SEP] } identifier[pStm] operator[SEP] identifier[execute] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[SQLException] identifier[ex] operator[SEP] { Keyword[throw] Keyword[new] identifier[SAXException] operator[SEP] literal[String] , identifier[ex] operator[SEP] operator[SEP] } } Keyword[else] Keyword[if] operator[SEP] identifier[point] operator[SEP] { identifier[getCurrentPoint] operator[SEP] operator[SEP] operator[SEP] identifier[setAttribute] operator[SEP] identifier[getCurrentElement] operator[SEP] operator[SEP] , identifier[getContentBuffer] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[getCurrentLine] operator[SEP] operator[SEP] operator[SEP] identifier[setAttribute] operator[SEP] identifier[getCurrentElement] operator[SEP] operator[SEP] , identifier[getContentBuffer] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } }
private List<Member> getNonLocalReplicaAddresses() { final Collection<Member> dataMembers = nodeEngine.getClusterService().getMembers(DATA_MEMBER_SELECTOR); final ArrayList<Member> nonLocalDataMembers = new ArrayList<Member>(dataMembers); nonLocalDataMembers.remove(nodeEngine.getLocalMember()); return nonLocalDataMembers; }
class class_name[name] begin[{] method[getNonLocalReplicaAddresses, return_type[type[List]], modifier[private], parameter[]] begin[{] local_variable[type[Collection], dataMembers] local_variable[type[ArrayList], nonLocalDataMembers] call[nonLocalDataMembers.remove, parameter[call[nodeEngine.getLocalMember, parameter[]]]] return[member[.nonLocalDataMembers]] end[}] END[}]
Keyword[private] identifier[List] operator[<] identifier[Member] operator[>] identifier[getNonLocalReplicaAddresses] operator[SEP] operator[SEP] { Keyword[final] identifier[Collection] operator[<] identifier[Member] operator[>] identifier[dataMembers] operator[=] identifier[nodeEngine] operator[SEP] identifier[getClusterService] operator[SEP] operator[SEP] operator[SEP] identifier[getMembers] operator[SEP] identifier[DATA_MEMBER_SELECTOR] operator[SEP] operator[SEP] Keyword[final] identifier[ArrayList] operator[<] identifier[Member] operator[>] identifier[nonLocalDataMembers] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[Member] operator[>] operator[SEP] identifier[dataMembers] operator[SEP] operator[SEP] identifier[nonLocalDataMembers] operator[SEP] identifier[remove] operator[SEP] identifier[nodeEngine] operator[SEP] identifier[getLocalMember] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[nonLocalDataMembers] operator[SEP] }
@Programmatic public List<DocumentTemplate> findByTypeAndApplicableToAtPathAndCurrent(final DocumentType documentType, final String atPath) { final LocalDate now = clockService.now(); return repositoryService.allMatches( new QueryDefault<>(DocumentTemplate.class, "findByTypeAndApplicableToAtPathAndCurrent", "type", documentType, "atPath", atPath, "now", now)); }
class class_name[name] begin[{] method[findByTypeAndApplicableToAtPathAndCurrent, return_type[type[List]], modifier[public], parameter[documentType, atPath]] begin[{] local_variable[type[LocalDate], now] return[call[repositoryService.allMatches, parameter[ClassCreator(arguments=[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=DocumentTemplate, sub_type=None)), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="findByTypeAndApplicableToAtPathAndCurrent"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="type"), MemberReference(member=documentType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="atPath"), MemberReference(member=atPath, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="now"), MemberReference(member=now, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=QueryDefault, sub_type=None))]]] end[}] END[}]
annotation[@] identifier[Programmatic] Keyword[public] identifier[List] operator[<] identifier[DocumentTemplate] operator[>] identifier[findByTypeAndApplicableToAtPathAndCurrent] operator[SEP] Keyword[final] identifier[DocumentType] identifier[documentType] , Keyword[final] identifier[String] identifier[atPath] operator[SEP] { Keyword[final] identifier[LocalDate] identifier[now] operator[=] identifier[clockService] operator[SEP] identifier[now] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[repositoryService] operator[SEP] identifier[allMatches] operator[SEP] Keyword[new] identifier[QueryDefault] operator[<] operator[>] operator[SEP] identifier[DocumentTemplate] operator[SEP] Keyword[class] , literal[String] , literal[String] , identifier[documentType] , literal[String] , identifier[atPath] , literal[String] , identifier[now] operator[SEP] operator[SEP] operator[SEP] }
final void signalWork() { long c; int u; while ((u = (int)((c = ctl) >>> 32)) < 0) { // too few active WorkQueue[] ws = workQueues; int e, i; WorkQueue w; Thread p; if ((e = (int)c) > 0) { // at least one waiting if (ws != null && (i = e & SMASK) < ws.length && (w = ws[i]) != null && w.eventCount == (e | INT_SIGN)) { long nc = (((long)(w.nextWait & E_MASK)) | ((long)(u + UAC_UNIT) << 32)); if (U.compareAndSwapLong(this, CTL, c, nc)) { w.eventCount = (e + E_SEQ) & E_MASK; if ((p = w.parker) != null) U.unpark(p); // activate and release break; } } else break; } else if (e == 0 && (u & SHORT_SIGN) != 0) { // too few total long nc = (long)(((u + UTC_UNIT) & UTC_MASK) | ((u + UAC_UNIT) & UAC_MASK)) << 32; if (U.compareAndSwapLong(this, CTL, c, nc)) { addWorker(); break; } } else break; } }
class class_name[name] begin[{] method[signalWork, return_type[void], modifier[final], parameter[]] begin[{] local_variable[type[long], c] local_variable[type[int], u] while[binary_operation[assign[member[.u], Cast(expression=BinaryOperation(operandl=Assignment(expressionl=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=ctl, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=32), operator=>>>), type=BasicType(dimensions=[], name=int))], <, literal[0]]] begin[{] local_variable[type[WorkQueue], ws] local_variable[type[int], e] local_variable[type[WorkQueue], w] local_variable[type[Thread], p] if[binary_operation[assign[member[.e], Cast(expression=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=BasicType(dimensions=[], name=int))], >, literal[0]]] begin[{] if[binary_operation[binary_operation[binary_operation[binary_operation[member[.ws], !=, literal[null]], &&, binary_operation[assign[member[.i], binary_operation[member[.e], &, member[.SMASK]]], <, member[ws.length]]], &&, binary_operation[assign[member[.w], member[.ws]], !=, literal[null]]], &&, binary_operation[member[w.eventCount], ==, binary_operation[member[.e], |, member[.INT_SIGN]]]]] begin[{] local_variable[type[long], nc] if[call[U.compareAndSwapLong, parameter[THIS[], member[.CTL], member[.c], member[.nc]]]] begin[{] assign[member[w.eventCount], binary_operation[binary_operation[member[.e], +, member[.E_SEQ]], &, member[.E_MASK]]] if[binary_operation[assign[member[.p], member[w.parker]], !=, literal[null]]] begin[{] call[U.unpark, parameter[member[.p]]] else begin[{] None end[}] BreakStatement(goto=None, label=None) else begin[{] None end[}] else begin[{] BreakStatement(goto=None, label=None) end[}] else begin[{] if[binary_operation[binary_operation[member[.e], ==, literal[0]], &&, binary_operation[binary_operation[member[.u], &, member[.SHORT_SIGN]], !=, literal[0]]]] begin[{] local_variable[type[long], nc] if[call[U.compareAndSwapLong, parameter[THIS[], member[.CTL], member[.c], member[.nc]]]] begin[{] call[.addWorker, parameter[]] BreakStatement(goto=None, label=None) else begin[{] None end[}] else begin[{] BreakStatement(goto=None, label=None) end[}] end[}] end[}] end[}] END[}]
Keyword[final] Keyword[void] identifier[signalWork] operator[SEP] operator[SEP] { Keyword[long] identifier[c] operator[SEP] Keyword[int] identifier[u] operator[SEP] Keyword[while] operator[SEP] operator[SEP] identifier[u] operator[=] operator[SEP] Keyword[int] operator[SEP] operator[SEP] operator[SEP] identifier[c] operator[=] identifier[ctl] operator[SEP] operator[>] operator[>] operator[>] Other[32] operator[SEP] operator[SEP] operator[<] Other[0] operator[SEP] { identifier[WorkQueue] operator[SEP] operator[SEP] identifier[ws] operator[=] identifier[workQueues] operator[SEP] Keyword[int] identifier[e] , identifier[i] operator[SEP] identifier[WorkQueue] identifier[w] operator[SEP] identifier[Thread] identifier[p] operator[SEP] Keyword[if] operator[SEP] operator[SEP] identifier[e] operator[=] operator[SEP] Keyword[int] operator[SEP] identifier[c] operator[SEP] operator[>] Other[0] operator[SEP] { Keyword[if] operator[SEP] identifier[ws] operator[!=] Other[null] operator[&&] operator[SEP] identifier[i] operator[=] identifier[e] operator[&] identifier[SMASK] operator[SEP] operator[<] identifier[ws] operator[SEP] identifier[length] operator[&&] operator[SEP] identifier[w] operator[=] identifier[ws] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[!=] Other[null] operator[&&] identifier[w] operator[SEP] identifier[eventCount] operator[==] operator[SEP] identifier[e] operator[|] identifier[INT_SIGN] operator[SEP] operator[SEP] { Keyword[long] identifier[nc] operator[=] operator[SEP] operator[SEP] operator[SEP] Keyword[long] operator[SEP] operator[SEP] identifier[w] operator[SEP] identifier[nextWait] operator[&] identifier[E_MASK] operator[SEP] operator[SEP] operator[|] operator[SEP] operator[SEP] Keyword[long] operator[SEP] operator[SEP] identifier[u] operator[+] identifier[UAC_UNIT] operator[SEP] operator[<<] Other[32] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[U] operator[SEP] identifier[compareAndSwapLong] operator[SEP] Keyword[this] , identifier[CTL] , identifier[c] , identifier[nc] operator[SEP] operator[SEP] { identifier[w] operator[SEP] identifier[eventCount] operator[=] operator[SEP] identifier[e] operator[+] identifier[E_SEQ] operator[SEP] operator[&] identifier[E_MASK] operator[SEP] Keyword[if] operator[SEP] operator[SEP] identifier[p] operator[=] identifier[w] operator[SEP] identifier[parker] operator[SEP] operator[!=] Other[null] operator[SEP] identifier[U] operator[SEP] identifier[unpark] operator[SEP] identifier[p] operator[SEP] operator[SEP] Keyword[break] operator[SEP] } } Keyword[else] Keyword[break] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[e] operator[==] Other[0] operator[&&] operator[SEP] identifier[u] operator[&] identifier[SHORT_SIGN] operator[SEP] operator[!=] Other[0] operator[SEP] { Keyword[long] identifier[nc] operator[=] operator[SEP] Keyword[long] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[u] operator[+] identifier[UTC_UNIT] operator[SEP] operator[&] identifier[UTC_MASK] operator[SEP] operator[|] operator[SEP] operator[SEP] identifier[u] operator[+] identifier[UAC_UNIT] operator[SEP] operator[&] identifier[UAC_MASK] operator[SEP] operator[SEP] operator[<<] Other[32] operator[SEP] Keyword[if] operator[SEP] identifier[U] operator[SEP] identifier[compareAndSwapLong] operator[SEP] Keyword[this] , identifier[CTL] , identifier[c] , identifier[nc] operator[SEP] operator[SEP] { identifier[addWorker] operator[SEP] operator[SEP] operator[SEP] Keyword[break] operator[SEP] } } Keyword[else] Keyword[break] operator[SEP] } }
public void run() { while( running ) { long interval_end = System.currentTimeMillis() + interval; while( interval_end > System.currentTimeMillis() ) { Thread.yield(); } fireIntervalElapsed(); } running = false; }
class class_name[name] begin[{] method[run, return_type[void], modifier[public], parameter[]] begin[{] while[member[.running]] begin[{] local_variable[type[long], interval_end] while[binary_operation[member[.interval_end], >, call[System.currentTimeMillis, parameter[]]]] begin[{] call[Thread.yield, parameter[]] end[}] call[.fireIntervalElapsed, parameter[]] end[}] assign[member[.running], literal[false]] end[}] END[}]
Keyword[public] Keyword[void] identifier[run] operator[SEP] operator[SEP] { Keyword[while] operator[SEP] identifier[running] operator[SEP] { Keyword[long] identifier[interval_end] operator[=] identifier[System] operator[SEP] identifier[currentTimeMillis] operator[SEP] operator[SEP] operator[+] identifier[interval] operator[SEP] Keyword[while] operator[SEP] identifier[interval_end] operator[>] identifier[System] operator[SEP] identifier[currentTimeMillis] operator[SEP] operator[SEP] operator[SEP] { identifier[Thread] operator[SEP] identifier[yield] operator[SEP] operator[SEP] operator[SEP] } identifier[fireIntervalElapsed] operator[SEP] operator[SEP] operator[SEP] } identifier[running] operator[=] literal[boolean] operator[SEP] }
public void setAutoHideOnResize(boolean autoHideOnResize) { if (autoHideOnResize) { autoHideViewport = ViewPort.when(getClosingBoundary()).then(param1 -> hide()); } else { if (autoHideViewport != null) { autoHideViewport.destroy(); autoHideViewport = null; } } }
class class_name[name] begin[{] method[setAutoHideOnResize, return_type[void], modifier[public], parameter[autoHideOnResize]] begin[{] if[member[.autoHideOnResize]] begin[{] assign[member[.autoHideViewport], call[ViewPort.when, parameter[call[.getClosingBoundary, parameter[]]]]] else begin[{] if[binary_operation[member[.autoHideViewport], !=, literal[null]]] begin[{] call[autoHideViewport.destroy, parameter[]] assign[member[.autoHideViewport], literal[null]] else begin[{] None end[}] end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[setAutoHideOnResize] operator[SEP] Keyword[boolean] identifier[autoHideOnResize] operator[SEP] { Keyword[if] operator[SEP] identifier[autoHideOnResize] operator[SEP] { identifier[autoHideViewport] operator[=] identifier[ViewPort] operator[SEP] identifier[when] operator[SEP] identifier[getClosingBoundary] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[then] operator[SEP] identifier[param1] operator[->] identifier[hide] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { Keyword[if] operator[SEP] identifier[autoHideViewport] operator[!=] Other[null] operator[SEP] { identifier[autoHideViewport] operator[SEP] identifier[destroy] operator[SEP] operator[SEP] operator[SEP] identifier[autoHideViewport] operator[=] Other[null] operator[SEP] } } }
public Owner getOwner() throws MalformedElementException { Element owner = getLastChild(root, "owner"); //$NON-NLS-1$ if (owner == null) return null; return new Owner(owner); }
class class_name[name] begin[{] method[getOwner, return_type[type[Owner]], modifier[public], parameter[]] begin[{] local_variable[type[Element], owner] if[binary_operation[member[.owner], ==, literal[null]]] begin[{] return[literal[null]] else begin[{] None end[}] return[ClassCreator(arguments=[MemberReference(member=owner, 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=Owner, sub_type=None))] end[}] END[}]
Keyword[public] identifier[Owner] identifier[getOwner] operator[SEP] operator[SEP] Keyword[throws] identifier[MalformedElementException] { identifier[Element] identifier[owner] operator[=] identifier[getLastChild] operator[SEP] identifier[root] , literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[owner] operator[==] Other[null] operator[SEP] Keyword[return] Other[null] operator[SEP] Keyword[return] Keyword[new] identifier[Owner] operator[SEP] identifier[owner] operator[SEP] operator[SEP] }
static public void register (EndPoint endPoint) { Kryo kryo = endPoint.getKryo(); // This must be called in order to use ObjectSpaces. ObjectSpace.registerClasses(kryo); // The interfaces that will be used as remote objects must be registered. kryo.register(IPlayer.class); kryo.register(IChatFrame.class); // The classes of all method parameters and return values // for remote objects must also be registered. kryo.register(String[].class); }
class class_name[name] begin[{] method[register, return_type[void], modifier[public static], parameter[endPoint]] begin[{] local_variable[type[Kryo], kryo] call[ObjectSpace.registerClasses, parameter[member[.kryo]]] call[kryo.register, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IPlayer, sub_type=None))]] call[kryo.register, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IChatFrame, sub_type=None))]] call[kryo.register, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=String, sub_type=None))]] end[}] END[}]
Keyword[static] Keyword[public] Keyword[void] identifier[register] operator[SEP] identifier[EndPoint] identifier[endPoint] operator[SEP] { identifier[Kryo] identifier[kryo] operator[=] identifier[endPoint] operator[SEP] identifier[getKryo] operator[SEP] operator[SEP] operator[SEP] identifier[ObjectSpace] operator[SEP] identifier[registerClasses] operator[SEP] identifier[kryo] operator[SEP] operator[SEP] identifier[kryo] operator[SEP] identifier[register] operator[SEP] identifier[IPlayer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[kryo] operator[SEP] identifier[register] operator[SEP] identifier[IChatFrame] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[kryo] operator[SEP] identifier[register] operator[SEP] identifier[String] operator[SEP] operator[SEP] operator[SEP] Keyword[class] operator[SEP] operator[SEP] }
private int parseInteger(String value, int defaultValue) { try { return Integer.parseInt(value); } catch (NumberFormatException e) { return defaultValue; } }
class class_name[name] begin[{] method[parseInteger, return_type[type[int]], modifier[private], parameter[value, defaultValue]] begin[{] TryStatement(block=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=parseInt, postfix_operators=[], prefix_operators=[], qualifier=Integer, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ReturnStatement(expression=MemberReference(member=defaultValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['NumberFormatException']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[private] Keyword[int] identifier[parseInteger] operator[SEP] identifier[String] identifier[value] , Keyword[int] identifier[defaultValue] operator[SEP] { Keyword[try] { Keyword[return] identifier[Integer] operator[SEP] identifier[parseInt] operator[SEP] identifier[value] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[NumberFormatException] identifier[e] operator[SEP] { Keyword[return] identifier[defaultValue] operator[SEP] } }
protected Response createResponse(Throwable exception, ValidationErrorUserException error, Map<String, List<String>> errorsMap) { LOG.warn("Service failed due to validation failure.", error); if (exception == error) { return createResponse(Status.BAD_REQUEST, error, errorsMap); } else { return createResponse(Status.BAD_REQUEST, error, exception.getMessage(), errorsMap); } }
class class_name[name] begin[{] method[createResponse, return_type[type[Response]], modifier[protected], parameter[exception, error, errorsMap]] begin[{] call[LOG.warn, parameter[literal["Service failed due to validation failure."], member[.error]]] if[binary_operation[member[.exception], ==, member[.error]]] begin[{] return[call[.createResponse, parameter[member[Status.BAD_REQUEST], member[.error], member[.errorsMap]]]] else begin[{] return[call[.createResponse, parameter[member[Status.BAD_REQUEST], member[.error], call[exception.getMessage, parameter[]], member[.errorsMap]]]] end[}] end[}] END[}]
Keyword[protected] identifier[Response] identifier[createResponse] operator[SEP] identifier[Throwable] identifier[exception] , identifier[ValidationErrorUserException] identifier[error] , identifier[Map] operator[<] identifier[String] , identifier[List] operator[<] identifier[String] operator[>] operator[>] identifier[errorsMap] operator[SEP] { identifier[LOG] operator[SEP] identifier[warn] operator[SEP] literal[String] , identifier[error] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[exception] operator[==] identifier[error] operator[SEP] { Keyword[return] identifier[createResponse] operator[SEP] identifier[Status] operator[SEP] identifier[BAD_REQUEST] , identifier[error] , identifier[errorsMap] operator[SEP] operator[SEP] } Keyword[else] { Keyword[return] identifier[createResponse] operator[SEP] identifier[Status] operator[SEP] identifier[BAD_REQUEST] , identifier[error] , identifier[exception] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[errorsMap] operator[SEP] operator[SEP] } }
public boolean parse(Context context, ProcPatternElement terminator) throws NestingException { // Prepare a child context Context child = new Context(context); child.checkNesting(); StringBuilder target = new StringBuilder(); child.setTarget(target); if (scope != null) { child.setScope(scope); } child.setTerminator(terminator); // Parse it boolean parsed = child.getScope().process(child); if (parsed) { // If parsing success if (transparent) { child.mergeWithParent(); } setAttribute(context, target); return true; } else { return false; } }
class class_name[name] begin[{] method[parse, return_type[type[boolean]], modifier[public], parameter[context, terminator]] begin[{] local_variable[type[Context], child] call[child.checkNesting, parameter[]] local_variable[type[StringBuilder], target] call[child.setTarget, parameter[member[.target]]] if[binary_operation[member[.scope], !=, literal[null]]] begin[{] call[child.setScope, parameter[member[.scope]]] else begin[{] None end[}] call[child.setTerminator, parameter[member[.terminator]]] local_variable[type[boolean], parsed] if[member[.parsed]] begin[{] if[member[.transparent]] begin[{] call[child.mergeWithParent, parameter[]] else begin[{] None end[}] call[.setAttribute, parameter[member[.context], member[.target]]] return[literal[true]] else begin[{] return[literal[false]] end[}] end[}] END[}]
Keyword[public] Keyword[boolean] identifier[parse] operator[SEP] identifier[Context] identifier[context] , identifier[ProcPatternElement] identifier[terminator] operator[SEP] Keyword[throws] identifier[NestingException] { identifier[Context] identifier[child] operator[=] Keyword[new] identifier[Context] operator[SEP] identifier[context] operator[SEP] operator[SEP] identifier[child] operator[SEP] identifier[checkNesting] operator[SEP] operator[SEP] operator[SEP] identifier[StringBuilder] identifier[target] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[child] operator[SEP] identifier[setTarget] operator[SEP] identifier[target] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[scope] operator[!=] Other[null] operator[SEP] { identifier[child] operator[SEP] identifier[setScope] operator[SEP] identifier[scope] operator[SEP] operator[SEP] } identifier[child] operator[SEP] identifier[setTerminator] operator[SEP] identifier[terminator] operator[SEP] operator[SEP] Keyword[boolean] identifier[parsed] operator[=] identifier[child] operator[SEP] identifier[getScope] operator[SEP] operator[SEP] operator[SEP] identifier[process] operator[SEP] identifier[child] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[parsed] operator[SEP] { Keyword[if] operator[SEP] identifier[transparent] operator[SEP] { identifier[child] operator[SEP] identifier[mergeWithParent] operator[SEP] operator[SEP] operator[SEP] } identifier[setAttribute] operator[SEP] identifier[context] , identifier[target] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP] } Keyword[else] { Keyword[return] literal[boolean] operator[SEP] } }
public ListListenersResult withListeners(Listener... listeners) { if (this.listeners == null) { setListeners(new java.util.ArrayList<Listener>(listeners.length)); } for (Listener ele : listeners) { this.listeners.add(ele); } return this; }
class class_name[name] begin[{] method[withListeners, return_type[type[ListListenersResult]], modifier[public], parameter[listeners]] begin[{] if[binary_operation[THIS[member[None.listeners]], ==, literal[null]]] begin[{] call[.setListeners, parameter[ClassCreator(arguments=[MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=listeners, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=java, sub_type=ReferenceType(arguments=None, dimensions=None, name=util, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Listener, sub_type=None))], dimensions=None, name=ArrayList, sub_type=None))))]] else begin[{] None end[}] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=listeners, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[MemberReference(member=ele, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=listeners, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=ele)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Listener, sub_type=None))), label=None) return[THIS[]] end[}] END[}]
Keyword[public] identifier[ListListenersResult] identifier[withListeners] operator[SEP] identifier[Listener] operator[...] identifier[listeners] operator[SEP] { Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[listeners] operator[==] Other[null] operator[SEP] { identifier[setListeners] operator[SEP] Keyword[new] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[ArrayList] operator[<] identifier[Listener] operator[>] operator[SEP] identifier[listeners] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] } Keyword[for] operator[SEP] identifier[Listener] identifier[ele] operator[:] identifier[listeners] operator[SEP] { Keyword[this] operator[SEP] identifier[listeners] operator[SEP] identifier[add] operator[SEP] identifier[ele] operator[SEP] operator[SEP] } Keyword[return] Keyword[this] operator[SEP] }
public boolean isValid(K key, UUID ticket) { if (timeouts.containsKey(key)) { Timeout<K> timeout = timeouts.get(key); return timeout.getTicket().equals(ticket); } else { return false; } }
class class_name[name] begin[{] method[isValid, return_type[type[boolean]], modifier[public], parameter[key, ticket]] begin[{] if[call[timeouts.containsKey, parameter[member[.key]]]] begin[{] local_variable[type[Timeout], timeout] return[call[timeout.getTicket, parameter[]]] else begin[{] return[literal[false]] end[}] end[}] END[}]
Keyword[public] Keyword[boolean] identifier[isValid] operator[SEP] identifier[K] identifier[key] , identifier[UUID] identifier[ticket] operator[SEP] { Keyword[if] operator[SEP] identifier[timeouts] operator[SEP] identifier[containsKey] operator[SEP] identifier[key] operator[SEP] operator[SEP] { identifier[Timeout] operator[<] identifier[K] operator[>] identifier[timeout] operator[=] identifier[timeouts] operator[SEP] identifier[get] operator[SEP] identifier[key] operator[SEP] operator[SEP] Keyword[return] identifier[timeout] operator[SEP] identifier[getTicket] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[ticket] operator[SEP] operator[SEP] } Keyword[else] { Keyword[return] literal[boolean] operator[SEP] } }
public JsonResponse getAlert(String email) throws IOException { Map<String, Object> data = new HashMap<String, Object>(); data.put(Alert.PARAM_EMAIL, email); return apiGet(ApiAction.alert, data); }
class class_name[name] begin[{] method[getAlert, return_type[type[JsonResponse]], modifier[public], parameter[email]] begin[{] local_variable[type[Map], data] call[data.put, parameter[member[Alert.PARAM_EMAIL], member[.email]]] return[call[.apiGet, parameter[member[ApiAction.alert], member[.data]]]] end[}] END[}]
Keyword[public] identifier[JsonResponse] identifier[getAlert] operator[SEP] identifier[String] identifier[email] operator[SEP] Keyword[throws] identifier[IOException] { identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] identifier[data] operator[=] Keyword[new] identifier[HashMap] operator[<] identifier[String] , identifier[Object] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[data] operator[SEP] identifier[put] operator[SEP] identifier[Alert] operator[SEP] identifier[PARAM_EMAIL] , identifier[email] operator[SEP] operator[SEP] Keyword[return] identifier[apiGet] operator[SEP] identifier[ApiAction] operator[SEP] identifier[alert] , identifier[data] operator[SEP] operator[SEP] }
public List<CmsResource> readPath(CmsDbContext dbc, String path, CmsResourceFilter filter) throws CmsException { // splits the path into folder and filename tokens List<String> tokens = CmsStringUtil.splitAsList(path, '/'); // the root folder is no token in the path but a resource which has to be added to the path int count = tokens.size() + 1; // holds the CmsResource instances in the path List<CmsResource> pathList = new ArrayList<CmsResource>(count); // true if the path doesn't end with a folder boolean lastResourceIsFile = false; // number of folders in the path int folderCount = count; if (!path.endsWith("/")) { folderCount--; lastResourceIsFile = true; } // read the root folder, because it's ID is required to read any sub-resources String currentResourceName = "/"; StringBuffer currentPath = new StringBuffer(64); currentPath.append('/'); String cp = currentPath.toString(); CmsUUID projectId = getProjectIdForContext(dbc); // key to cache the resources String cacheKey = getCacheKey(null, false, projectId, cp); // the current resource CmsResource currentResource = m_monitor.getCachedResource(cacheKey); if ((currentResource == null) || !dbc.getProjectId().isNullUUID()) { currentResource = getVfsDriver(dbc).readFolder(dbc, projectId, cp); if (dbc.getProjectId().isNullUUID()) { m_monitor.cacheResource(cacheKey, currentResource); } } pathList.add(0, currentResource); if (count == 1) { // the root folder was requested- no further operations required return pathList; } Iterator<String> it = tokens.iterator(); currentResourceName = it.next(); // read the folder resources in the path /a/b/c/ int i = 0; for (i = 1; i < folderCount; i++) { currentPath.append(currentResourceName); currentPath.append('/'); // read the folder cp = currentPath.toString(); cacheKey = getCacheKey(null, false, projectId, cp); currentResource = m_monitor.getCachedResource(cacheKey); if ((currentResource == null) || !dbc.getProjectId().isNullUUID()) { currentResource = getVfsDriver(dbc).readFolder(dbc, projectId, cp); if (dbc.getProjectId().isNullUUID()) { m_monitor.cacheResource(cacheKey, currentResource); } } pathList.add(i, currentResource); if (i < (folderCount - 1)) { currentResourceName = it.next(); } } // read the (optional) last file resource in the path /x.html if (lastResourceIsFile) { if (it.hasNext()) { // this will only be false if a resource in the // top level root folder (e.g. "/index.html") was requested currentResourceName = it.next(); } currentPath.append(currentResourceName); // read the file cp = currentPath.toString(); cacheKey = getCacheKey(null, false, projectId, cp); currentResource = m_monitor.getCachedResource(cacheKey); if ((currentResource == null) || !dbc.getProjectId().isNullUUID()) { currentResource = getVfsDriver(dbc).readResource(dbc, projectId, cp, filter.includeDeleted()); if (dbc.getProjectId().isNullUUID()) { m_monitor.cacheResource(cacheKey, currentResource); } } pathList.add(i, currentResource); } return pathList; }
class class_name[name] begin[{] method[readPath, return_type[type[List]], modifier[public], parameter[dbc, path, filter]] begin[{] local_variable[type[List], tokens] local_variable[type[int], count] local_variable[type[List], pathList] local_variable[type[boolean], lastResourceIsFile] local_variable[type[int], folderCount] if[call[path.endsWith, parameter[literal["/"]]]] begin[{] member[.folderCount] assign[member[.lastResourceIsFile], literal[true]] else begin[{] None end[}] local_variable[type[String], currentResourceName] local_variable[type[StringBuffer], currentPath] call[currentPath.append, parameter[literal['/']]] local_variable[type[String], cp] local_variable[type[CmsUUID], projectId] local_variable[type[String], cacheKey] local_variable[type[CmsResource], currentResource] if[binary_operation[binary_operation[member[.currentResource], ==, literal[null]], ||, call[dbc.getProjectId, parameter[]]]] begin[{] assign[member[.currentResource], call[.getVfsDriver, parameter[member[.dbc]]]] if[call[dbc.getProjectId, parameter[]]] begin[{] call[m_monitor.cacheResource, parameter[member[.cacheKey], member[.currentResource]]] else begin[{] None end[}] else begin[{] None end[}] call[pathList.add, parameter[literal[0], member[.currentResource]]] if[binary_operation[member[.count], ==, literal[1]]] begin[{] return[member[.pathList]] else begin[{] None end[}] local_variable[type[Iterator], it] assign[member[.currentResourceName], call[it.next, parameter[]]] local_variable[type[int], i] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=currentResourceName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=append, postfix_operators=[], prefix_operators=[], qualifier=currentPath, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='/')], member=append, postfix_operators=[], prefix_operators=[], qualifier=currentPath, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=cp, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=currentPath, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=cacheKey, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), MemberReference(member=projectId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=cp, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getCacheKey, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=currentResource, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=cacheKey, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getCachedResource, postfix_operators=[], prefix_operators=[], qualifier=m_monitor, selectors=[], type_arguments=None)), label=None), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=currentResource, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), operandr=MethodInvocation(arguments=[], member=getProjectId, postfix_operators=[], prefix_operators=['!'], qualifier=dbc, selectors=[MethodInvocation(arguments=[], member=isNullUUID, 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=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=currentResource, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=dbc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getVfsDriver, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[MemberReference(member=dbc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=projectId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=cp, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=readFolder, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)), label=None), IfStatement(condition=MethodInvocation(arguments=[], member=getProjectId, postfix_operators=[], prefix_operators=[], qualifier=dbc, selectors=[MethodInvocation(arguments=[], member=isNullUUID, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=cacheKey, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=currentResource, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=cacheResource, postfix_operators=[], prefix_operators=[], qualifier=m_monitor, selectors=[], type_arguments=None), label=None)]))])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=currentResource, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=pathList, selectors=[], type_arguments=None), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=BinaryOperation(operandl=MemberReference(member=folderCount, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-), operator=<), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=currentResourceName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=next, postfix_operators=[], prefix_operators=[], qualifier=it, selectors=[], type_arguments=None)), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=folderCount, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=[Assignment(expressionl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1))], update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) if[member[.lastResourceIsFile]] begin[{] if[call[it.hasNext, parameter[]]] begin[{] assign[member[.currentResourceName], call[it.next, parameter[]]] else begin[{] None end[}] call[currentPath.append, parameter[member[.currentResourceName]]] assign[member[.cp], call[currentPath.toString, parameter[]]] assign[member[.cacheKey], call[.getCacheKey, parameter[literal[null], literal[false], member[.projectId], member[.cp]]]] assign[member[.currentResource], call[m_monitor.getCachedResource, parameter[member[.cacheKey]]]] if[binary_operation[binary_operation[member[.currentResource], ==, literal[null]], ||, call[dbc.getProjectId, parameter[]]]] begin[{] assign[member[.currentResource], call[.getVfsDriver, parameter[member[.dbc]]]] if[call[dbc.getProjectId, parameter[]]] begin[{] call[m_monitor.cacheResource, parameter[member[.cacheKey], member[.currentResource]]] else begin[{] None end[}] else begin[{] None end[}] call[pathList.add, parameter[member[.i], member[.currentResource]]] else begin[{] None end[}] return[member[.pathList]] end[}] END[}]
Keyword[public] identifier[List] operator[<] identifier[CmsResource] operator[>] identifier[readPath] operator[SEP] identifier[CmsDbContext] identifier[dbc] , identifier[String] identifier[path] , identifier[CmsResourceFilter] identifier[filter] operator[SEP] Keyword[throws] identifier[CmsException] { identifier[List] operator[<] identifier[String] operator[>] identifier[tokens] operator[=] identifier[CmsStringUtil] operator[SEP] identifier[splitAsList] operator[SEP] identifier[path] , literal[String] operator[SEP] operator[SEP] Keyword[int] identifier[count] operator[=] identifier[tokens] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[+] Other[1] operator[SEP] identifier[List] operator[<] identifier[CmsResource] operator[>] identifier[pathList] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[CmsResource] operator[>] operator[SEP] identifier[count] operator[SEP] operator[SEP] Keyword[boolean] identifier[lastResourceIsFile] operator[=] literal[boolean] operator[SEP] Keyword[int] identifier[folderCount] operator[=] identifier[count] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[path] operator[SEP] identifier[endsWith] operator[SEP] literal[String] operator[SEP] operator[SEP] { identifier[folderCount] operator[--] operator[SEP] identifier[lastResourceIsFile] operator[=] literal[boolean] operator[SEP] } identifier[String] identifier[currentResourceName] operator[=] literal[String] operator[SEP] identifier[StringBuffer] identifier[currentPath] operator[=] Keyword[new] identifier[StringBuffer] operator[SEP] Other[64] operator[SEP] operator[SEP] identifier[currentPath] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[String] identifier[cp] operator[=] identifier[currentPath] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] identifier[CmsUUID] identifier[projectId] operator[=] identifier[getProjectIdForContext] operator[SEP] identifier[dbc] operator[SEP] operator[SEP] identifier[String] identifier[cacheKey] operator[=] identifier[getCacheKey] operator[SEP] Other[null] , literal[boolean] , identifier[projectId] , identifier[cp] operator[SEP] operator[SEP] identifier[CmsResource] identifier[currentResource] operator[=] identifier[m_monitor] operator[SEP] identifier[getCachedResource] operator[SEP] identifier[cacheKey] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[SEP] identifier[currentResource] operator[==] Other[null] operator[SEP] operator[||] operator[!] identifier[dbc] operator[SEP] identifier[getProjectId] operator[SEP] operator[SEP] operator[SEP] identifier[isNullUUID] operator[SEP] operator[SEP] operator[SEP] { identifier[currentResource] operator[=] identifier[getVfsDriver] operator[SEP] identifier[dbc] operator[SEP] operator[SEP] identifier[readFolder] operator[SEP] identifier[dbc] , identifier[projectId] , identifier[cp] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[dbc] operator[SEP] identifier[getProjectId] operator[SEP] operator[SEP] operator[SEP] identifier[isNullUUID] operator[SEP] operator[SEP] operator[SEP] { identifier[m_monitor] operator[SEP] identifier[cacheResource] operator[SEP] identifier[cacheKey] , identifier[currentResource] operator[SEP] operator[SEP] } } identifier[pathList] operator[SEP] identifier[add] operator[SEP] Other[0] , identifier[currentResource] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[count] operator[==] Other[1] operator[SEP] { Keyword[return] identifier[pathList] operator[SEP] } identifier[Iterator] operator[<] identifier[String] operator[>] identifier[it] operator[=] identifier[tokens] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] identifier[currentResourceName] operator[=] identifier[it] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] Keyword[for] operator[SEP] identifier[i] operator[=] Other[1] operator[SEP] identifier[i] operator[<] identifier[folderCount] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[currentPath] operator[SEP] identifier[append] operator[SEP] identifier[currentResourceName] operator[SEP] operator[SEP] identifier[currentPath] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[cp] operator[=] identifier[currentPath] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] identifier[cacheKey] operator[=] identifier[getCacheKey] operator[SEP] Other[null] , literal[boolean] , identifier[projectId] , identifier[cp] operator[SEP] operator[SEP] identifier[currentResource] operator[=] identifier[m_monitor] operator[SEP] identifier[getCachedResource] operator[SEP] identifier[cacheKey] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[SEP] identifier[currentResource] operator[==] Other[null] operator[SEP] operator[||] operator[!] identifier[dbc] operator[SEP] identifier[getProjectId] operator[SEP] operator[SEP] operator[SEP] identifier[isNullUUID] operator[SEP] operator[SEP] operator[SEP] { identifier[currentResource] operator[=] identifier[getVfsDriver] operator[SEP] identifier[dbc] operator[SEP] operator[SEP] identifier[readFolder] operator[SEP] identifier[dbc] , identifier[projectId] , identifier[cp] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[dbc] operator[SEP] identifier[getProjectId] operator[SEP] operator[SEP] operator[SEP] identifier[isNullUUID] operator[SEP] operator[SEP] operator[SEP] { identifier[m_monitor] operator[SEP] identifier[cacheResource] operator[SEP] identifier[cacheKey] , identifier[currentResource] operator[SEP] operator[SEP] } } identifier[pathList] operator[SEP] identifier[add] operator[SEP] identifier[i] , identifier[currentResource] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[i] operator[<] operator[SEP] identifier[folderCount] operator[-] Other[1] operator[SEP] operator[SEP] { identifier[currentResourceName] operator[=] identifier[it] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] } } Keyword[if] operator[SEP] identifier[lastResourceIsFile] operator[SEP] { Keyword[if] operator[SEP] identifier[it] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] { identifier[currentResourceName] operator[=] identifier[it] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] } identifier[currentPath] operator[SEP] identifier[append] operator[SEP] identifier[currentResourceName] operator[SEP] operator[SEP] identifier[cp] operator[=] identifier[currentPath] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] identifier[cacheKey] operator[=] identifier[getCacheKey] operator[SEP] Other[null] , literal[boolean] , identifier[projectId] , identifier[cp] operator[SEP] operator[SEP] identifier[currentResource] operator[=] identifier[m_monitor] operator[SEP] identifier[getCachedResource] operator[SEP] identifier[cacheKey] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[SEP] identifier[currentResource] operator[==] Other[null] operator[SEP] operator[||] operator[!] identifier[dbc] operator[SEP] identifier[getProjectId] operator[SEP] operator[SEP] operator[SEP] identifier[isNullUUID] operator[SEP] operator[SEP] operator[SEP] { identifier[currentResource] operator[=] identifier[getVfsDriver] operator[SEP] identifier[dbc] operator[SEP] operator[SEP] identifier[readResource] operator[SEP] identifier[dbc] , identifier[projectId] , identifier[cp] , identifier[filter] operator[SEP] identifier[includeDeleted] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[dbc] operator[SEP] identifier[getProjectId] operator[SEP] operator[SEP] operator[SEP] identifier[isNullUUID] operator[SEP] operator[SEP] operator[SEP] { identifier[m_monitor] operator[SEP] identifier[cacheResource] operator[SEP] identifier[cacheKey] , identifier[currentResource] operator[SEP] operator[SEP] } } identifier[pathList] operator[SEP] identifier[add] operator[SEP] identifier[i] , identifier[currentResource] operator[SEP] operator[SEP] } Keyword[return] identifier[pathList] operator[SEP] }
@Override protected Class<?> resolveClass(ObjectStreamClass desc) throws IOException, ClassNotFoundException { return Class.forName(desc.getName(), true, loader); }
class class_name[name] begin[{] method[resolveClass, return_type[type[Class]], modifier[protected], parameter[desc]] begin[{] return[call[Class.forName, parameter[call[desc.getName, parameter[]], literal[true], member[.loader]]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[protected] identifier[Class] operator[<] operator[?] operator[>] identifier[resolveClass] operator[SEP] identifier[ObjectStreamClass] identifier[desc] operator[SEP] Keyword[throws] identifier[IOException] , identifier[ClassNotFoundException] { Keyword[return] identifier[Class] operator[SEP] identifier[forName] operator[SEP] identifier[desc] operator[SEP] identifier[getName] operator[SEP] operator[SEP] , literal[boolean] , identifier[loader] operator[SEP] operator[SEP] }
public static boolean exportSupported(@NonNull JavaSparkContext sc) { try { return exportSupported(sc.master(), FileSystem.get(sc.hadoopConfiguration())); } catch (IOException ex) { throw new RuntimeException(ex); } }
class class_name[name] begin[{] method[exportSupported, return_type[type[boolean]], modifier[public static], parameter[sc]] begin[{] TryStatement(block=[ReturnStatement(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=master, postfix_operators=[], prefix_operators=[], qualifier=sc, selectors=[], type_arguments=None), MethodInvocation(arguments=[MethodInvocation(arguments=[], member=hadoopConfiguration, postfix_operators=[], prefix_operators=[], qualifier=sc, selectors=[], type_arguments=None)], member=get, postfix_operators=[], prefix_operators=[], qualifier=FileSystem, selectors=[], type_arguments=None)], member=exportSupported, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[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=RuntimeException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ex, types=['IOException']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[public] Keyword[static] Keyword[boolean] identifier[exportSupported] operator[SEP] annotation[@] identifier[NonNull] identifier[JavaSparkContext] identifier[sc] operator[SEP] { Keyword[try] { Keyword[return] identifier[exportSupported] operator[SEP] identifier[sc] operator[SEP] identifier[master] operator[SEP] operator[SEP] , identifier[FileSystem] operator[SEP] identifier[get] operator[SEP] identifier[sc] operator[SEP] identifier[hadoopConfiguration] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[IOException] identifier[ex] operator[SEP] { Keyword[throw] Keyword[new] identifier[RuntimeException] operator[SEP] identifier[ex] operator[SEP] operator[SEP] } }
public static boolean compareStreams( InputStream in1, InputStream in2 ) throws IOException { boolean moreOnIn1; do { int v1 = in1.read(); int v2 = in2.read(); if( v1 != v2 ) { return false; } moreOnIn1 = v1 != -1; } while( moreOnIn1 ); boolean noMoreOnIn2Either = in2.read() == -1; return noMoreOnIn2Either; }
class class_name[name] begin[{] method[compareStreams, return_type[type[boolean]], modifier[public static], parameter[in1, in2]] begin[{] local_variable[type[boolean], moreOnIn1] do[member[.moreOnIn1]] begin[{] local_variable[type[int], v1] local_variable[type[int], v2] if[binary_operation[member[.v1], !=, member[.v2]]] begin[{] return[literal[false]] else begin[{] None end[}] assign[member[.moreOnIn1], binary_operation[member[.v1], !=, literal[1]]] end[}] local_variable[type[boolean], noMoreOnIn2Either] return[member[.noMoreOnIn2Either]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[boolean] identifier[compareStreams] operator[SEP] identifier[InputStream] identifier[in1] , identifier[InputStream] identifier[in2] operator[SEP] Keyword[throws] identifier[IOException] { Keyword[boolean] identifier[moreOnIn1] operator[SEP] Keyword[do] { Keyword[int] identifier[v1] operator[=] identifier[in1] operator[SEP] identifier[read] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[v2] operator[=] identifier[in2] operator[SEP] identifier[read] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[v1] operator[!=] identifier[v2] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } identifier[moreOnIn1] operator[=] identifier[v1] operator[!=] operator[-] Other[1] operator[SEP] } Keyword[while] operator[SEP] identifier[moreOnIn1] operator[SEP] operator[SEP] Keyword[boolean] identifier[noMoreOnIn2Either] operator[=] identifier[in2] operator[SEP] identifier[read] operator[SEP] operator[SEP] operator[==] operator[-] Other[1] operator[SEP] Keyword[return] identifier[noMoreOnIn2Either] operator[SEP] }
@Override public void setup(Context context) throws IOException ,InterruptedException { this.context = context; inputLabels = context.getConfiguration().getStrings(SimpleJob.FILETER_OUTPUT_LABELS); if (inputLabels == null) { inputLabels = context.getConfiguration().getStrings(SimpleJob.BEFORE_SUMMARIZER_OUTPUT_LABELS); } boolean label = context.getConfiguration().getStrings(SimpleJob.SUMMARIZER_OUTPUT_LABELS) == null ? true : false; writer = new BasicWriter(label); summarizerSetup(); }
class class_name[name] begin[{] method[setup, return_type[void], modifier[public], parameter[context]] begin[{] assign[THIS[member[None.context]], member[.context]] assign[member[.inputLabels], call[context.getConfiguration, parameter[]]] if[binary_operation[member[.inputLabels], ==, literal[null]]] begin[{] assign[member[.inputLabels], call[context.getConfiguration, parameter[]]] else begin[{] None end[}] local_variable[type[boolean], label] assign[member[.writer], ClassCreator(arguments=[MemberReference(member=label, 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=BasicWriter, sub_type=None))] call[.summarizerSetup, parameter[]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[setup] operator[SEP] identifier[Context] identifier[context] operator[SEP] Keyword[throws] identifier[IOException] , identifier[InterruptedException] { Keyword[this] operator[SEP] identifier[context] operator[=] identifier[context] operator[SEP] identifier[inputLabels] operator[=] identifier[context] operator[SEP] identifier[getConfiguration] operator[SEP] operator[SEP] operator[SEP] identifier[getStrings] operator[SEP] identifier[SimpleJob] operator[SEP] identifier[FILETER_OUTPUT_LABELS] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[inputLabels] operator[==] Other[null] operator[SEP] { identifier[inputLabels] operator[=] identifier[context] operator[SEP] identifier[getConfiguration] operator[SEP] operator[SEP] operator[SEP] identifier[getStrings] operator[SEP] identifier[SimpleJob] operator[SEP] identifier[BEFORE_SUMMARIZER_OUTPUT_LABELS] operator[SEP] operator[SEP] } Keyword[boolean] identifier[label] operator[=] identifier[context] operator[SEP] identifier[getConfiguration] operator[SEP] operator[SEP] operator[SEP] identifier[getStrings] operator[SEP] identifier[SimpleJob] operator[SEP] identifier[SUMMARIZER_OUTPUT_LABELS] operator[SEP] operator[==] Other[null] operator[?] literal[boolean] operator[:] literal[boolean] operator[SEP] identifier[writer] operator[=] Keyword[new] identifier[BasicWriter] operator[SEP] identifier[label] operator[SEP] operator[SEP] identifier[summarizerSetup] operator[SEP] operator[SEP] operator[SEP] }
public static Double largest(Iterator<Double> elements, int k) { Iterator<Double> oppositeElements = new Iterator<Double>() { /** {@inheritDoc} */ @Override public boolean hasNext() { return elements.hasNext(); } /** {@inheritDoc} */ @Override public Double next() { return -elements.next(); //reverse the sign of every value } }; return -smallest(oppositeElements,k); //reverse the sign of the retrieved value }
class class_name[name] begin[{] method[largest, return_type[type[Double]], modifier[public static], parameter[elements, k]] begin[{] local_variable[type[Iterator], oppositeElements] return[call[.smallest, parameter[member[.oppositeElements], member[.k]]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[Double] identifier[largest] operator[SEP] identifier[Iterator] operator[<] identifier[Double] operator[>] identifier[elements] , Keyword[int] identifier[k] operator[SEP] { identifier[Iterator] operator[<] identifier[Double] operator[>] identifier[oppositeElements] operator[=] Keyword[new] identifier[Iterator] operator[<] identifier[Double] operator[>] operator[SEP] operator[SEP] { annotation[@] identifier[Override] Keyword[public] Keyword[boolean] identifier[hasNext] operator[SEP] operator[SEP] { Keyword[return] identifier[elements] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] } annotation[@] identifier[Override] Keyword[public] identifier[Double] identifier[next] operator[SEP] operator[SEP] { Keyword[return] operator[-] identifier[elements] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] } } operator[SEP] Keyword[return] operator[-] identifier[smallest] operator[SEP] identifier[oppositeElements] , identifier[k] operator[SEP] operator[SEP] }
public boolean isValueSet(String s) { return (s != null && s.trim().isEmpty() == false) ? true : false; }
class class_name[name] begin[{] method[isValueSet, return_type[type[boolean]], modifier[public], parameter[s]] begin[{] return[TernaryExpression(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=s, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[], member=trim, postfix_operators=[], prefix_operators=[], qualifier=s, selectors=[MethodInvocation(arguments=[], member=isEmpty, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), operator===), operator=&&), if_false=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true))] end[}] END[}]
Keyword[public] Keyword[boolean] identifier[isValueSet] operator[SEP] identifier[String] identifier[s] operator[SEP] { Keyword[return] operator[SEP] identifier[s] operator[!=] Other[null] operator[&&] identifier[s] operator[SEP] identifier[trim] operator[SEP] operator[SEP] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[==] literal[boolean] operator[SEP] operator[?] literal[boolean] operator[:] literal[boolean] operator[SEP] }
@Override public GetPullRequestResult getPullRequest(GetPullRequestRequest request) { request = beforeClientExecution(request); return executeGetPullRequest(request); }
class class_name[name] begin[{] method[getPullRequest, return_type[type[GetPullRequestResult]], modifier[public], parameter[request]] begin[{] assign[member[.request], call[.beforeClientExecution, parameter[member[.request]]]] return[call[.executeGetPullRequest, parameter[member[.request]]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[GetPullRequestResult] identifier[getPullRequest] operator[SEP] identifier[GetPullRequestRequest] identifier[request] operator[SEP] { identifier[request] operator[=] identifier[beforeClientExecution] operator[SEP] identifier[request] operator[SEP] operator[SEP] Keyword[return] identifier[executeGetPullRequest] operator[SEP] identifier[request] operator[SEP] operator[SEP] }
private static Locale findFormattingMatch(Locale pref, Locale[] avail) { Locale match = null; boolean langAndCountryMatch = false; for (Locale locale : avail) { if (pref.equals(locale)) { // Exact match match = locale; break; } else if ( !"".equals(pref.getVariant()) && "".equals(locale.getVariant()) && pref.getLanguage().equals(locale.getLanguage()) && pref.getCountry().equals(locale.getCountry())) { // Language and country match; different variant match = locale; langAndCountryMatch = true; } else if ( !langAndCountryMatch && pref.getLanguage().equals(locale.getLanguage()) && ("".equals(locale.getCountry()))) { // Language match if (match == null) { match = locale; } } } return match; }
class class_name[name] begin[{] method[findFormattingMatch, return_type[type[Locale]], modifier[private static], parameter[pref, avail]] begin[{] local_variable[type[Locale], match] local_variable[type[boolean], langAndCountryMatch] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=locale, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equals, postfix_operators=[], prefix_operators=[], qualifier=pref, selectors=[], type_arguments=None), else_statement=IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=['!'], qualifier=None, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getVariant, postfix_operators=[], prefix_operators=[], qualifier=pref, selectors=[], type_arguments=None)], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], value=""), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getVariant, postfix_operators=[], prefix_operators=[], qualifier=locale, selectors=[], type_arguments=None)], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], value=""), operator=&&), operandr=MethodInvocation(arguments=[], member=getLanguage, postfix_operators=[], prefix_operators=[], qualifier=pref, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getLanguage, postfix_operators=[], prefix_operators=[], qualifier=locale, selectors=[], type_arguments=None)], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operator=&&), operandr=MethodInvocation(arguments=[], member=getCountry, postfix_operators=[], prefix_operators=[], qualifier=pref, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getCountry, postfix_operators=[], prefix_operators=[], qualifier=locale, selectors=[], type_arguments=None)], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operator=&&), else_statement=IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=langAndCountryMatch, postfix_operators=[], prefix_operators=['!'], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=getLanguage, postfix_operators=[], prefix_operators=[], qualifier=pref, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getLanguage, postfix_operators=[], prefix_operators=[], qualifier=locale, selectors=[], type_arguments=None)], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operator=&&), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=""), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=match, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=match, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=locale, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)]))])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=match, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=locale, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=langAndCountryMatch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=match, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=locale, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), BreakStatement(goto=None, label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=avail, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=locale)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Locale, sub_type=None))), label=None) return[member[.match]] end[}] END[}]
Keyword[private] Keyword[static] identifier[Locale] identifier[findFormattingMatch] operator[SEP] identifier[Locale] identifier[pref] , identifier[Locale] operator[SEP] operator[SEP] identifier[avail] operator[SEP] { identifier[Locale] identifier[match] operator[=] Other[null] operator[SEP] Keyword[boolean] identifier[langAndCountryMatch] operator[=] literal[boolean] operator[SEP] Keyword[for] operator[SEP] identifier[Locale] identifier[locale] operator[:] identifier[avail] operator[SEP] { Keyword[if] operator[SEP] identifier[pref] operator[SEP] identifier[equals] operator[SEP] identifier[locale] operator[SEP] operator[SEP] { identifier[match] operator[=] identifier[locale] operator[SEP] Keyword[break] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] operator[!] literal[String] operator[SEP] identifier[equals] operator[SEP] identifier[pref] operator[SEP] identifier[getVariant] operator[SEP] operator[SEP] operator[SEP] operator[&&] literal[String] operator[SEP] identifier[equals] operator[SEP] identifier[locale] operator[SEP] identifier[getVariant] operator[SEP] operator[SEP] operator[SEP] operator[&&] identifier[pref] operator[SEP] identifier[getLanguage] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[locale] operator[SEP] identifier[getLanguage] operator[SEP] operator[SEP] operator[SEP] operator[&&] identifier[pref] operator[SEP] identifier[getCountry] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[locale] operator[SEP] identifier[getCountry] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { identifier[match] operator[=] identifier[locale] operator[SEP] identifier[langAndCountryMatch] operator[=] literal[boolean] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] operator[!] identifier[langAndCountryMatch] operator[&&] identifier[pref] operator[SEP] identifier[getLanguage] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[locale] operator[SEP] identifier[getLanguage] operator[SEP] operator[SEP] operator[SEP] operator[&&] operator[SEP] literal[String] operator[SEP] identifier[equals] operator[SEP] identifier[locale] operator[SEP] identifier[getCountry] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[match] operator[==] Other[null] operator[SEP] { identifier[match] operator[=] identifier[locale] operator[SEP] } } } Keyword[return] identifier[match] operator[SEP] }
public void update(int delta) { emitter.updateParticle(this, delta); life -= delta; if (life > 0) { x += delta * velx; y += delta * vely; } else { engine.release(this); } }
class class_name[name] begin[{] method[update, return_type[void], modifier[public], parameter[delta]] begin[{] call[emitter.updateParticle, parameter[THIS[], member[.delta]]] assign[member[.life], member[.delta]] if[binary_operation[member[.life], >, literal[0]]] begin[{] assign[member[.x], binary_operation[member[.delta], *, member[.velx]]] assign[member[.y], binary_operation[member[.delta], *, member[.vely]]] else begin[{] call[engine.release, parameter[THIS[]]] end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[update] operator[SEP] Keyword[int] identifier[delta] operator[SEP] { identifier[emitter] operator[SEP] identifier[updateParticle] operator[SEP] Keyword[this] , identifier[delta] operator[SEP] operator[SEP] identifier[life] operator[-=] identifier[delta] operator[SEP] Keyword[if] operator[SEP] identifier[life] operator[>] Other[0] operator[SEP] { identifier[x] operator[+=] identifier[delta] operator[*] identifier[velx] operator[SEP] identifier[y] operator[+=] identifier[delta] operator[*] identifier[vely] operator[SEP] } Keyword[else] { identifier[engine] operator[SEP] identifier[release] operator[SEP] Keyword[this] operator[SEP] operator[SEP] } }
protected synchronized PrefixedProperties createProperties() { if (myProperties == null) { PrefixedProperties resultProperties = null; String environment = defaultPrefix; if (environmentFactory != null) { environment = environmentFactory.getEnvironment(); } else if (defaultPrefixSystemPropertyKey != null) { environment = System.getProperty(defaultPrefixSystemPropertyKey); if (environment == null) { if (logger.isWarnEnabled()) { logger.warn(String.format("Didn't found system property key to set default prefix: %1s", defaultPrefixSystemPropertyKey)); } } } if (prefixConfigList != null) { resultProperties = PrefixedProperties.createCascadingPrefixProperties(prefixConfigList); } else { if (environment != null) { resultProperties = PrefixedProperties.createCascadingPrefixProperties(environment); } else { resultProperties = new PrefixedProperties(); } } resultProperties.setDefaultPrefix(environment); if (logger.isInfoEnabled()) { logger.info(String.format("Setting default prefix to: %1s", environment)); } resultProperties.setMixDefaultAndLocalPrefixSettings(mixDefaultAndLocalPrefixConfigurations); myProperties = resultProperties; } return myProperties; }
class class_name[name] begin[{] method[createProperties, return_type[type[PrefixedProperties]], modifier[synchronized protected], parameter[]] begin[{] if[binary_operation[member[.myProperties], ==, literal[null]]] begin[{] local_variable[type[PrefixedProperties], resultProperties] local_variable[type[String], environment] if[binary_operation[member[.environmentFactory], !=, literal[null]]] begin[{] assign[member[.environment], call[environmentFactory.getEnvironment, parameter[]]] else begin[{] if[binary_operation[member[.defaultPrefixSystemPropertyKey], !=, literal[null]]] begin[{] assign[member[.environment], call[System.getProperty, parameter[member[.defaultPrefixSystemPropertyKey]]]] if[binary_operation[member[.environment], ==, literal[null]]] begin[{] if[call[logger.isWarnEnabled, parameter[]]] begin[{] call[logger.warn, parameter[call[String.format, parameter[literal["Didn't found system property key to set default prefix: %1s"], member[.defaultPrefixSystemPropertyKey]]]]] else begin[{] None end[}] else begin[{] None end[}] else begin[{] None end[}] end[}] if[binary_operation[member[.prefixConfigList], !=, literal[null]]] begin[{] assign[member[.resultProperties], call[PrefixedProperties.createCascadingPrefixProperties, parameter[member[.prefixConfigList]]]] else begin[{] if[binary_operation[member[.environment], !=, literal[null]]] begin[{] assign[member[.resultProperties], call[PrefixedProperties.createCascadingPrefixProperties, parameter[member[.environment]]]] else begin[{] assign[member[.resultProperties], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=PrefixedProperties, sub_type=None))] end[}] end[}] call[resultProperties.setDefaultPrefix, parameter[member[.environment]]] if[call[logger.isInfoEnabled, parameter[]]] begin[{] call[logger.info, parameter[call[String.format, parameter[literal["Setting default prefix to: %1s"], member[.environment]]]]] else begin[{] None end[}] call[resultProperties.setMixDefaultAndLocalPrefixSettings, parameter[member[.mixDefaultAndLocalPrefixConfigurations]]] assign[member[.myProperties], member[.resultProperties]] else begin[{] None end[}] return[member[.myProperties]] end[}] END[}]
Keyword[protected] Keyword[synchronized] identifier[PrefixedProperties] identifier[createProperties] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[myProperties] operator[==] Other[null] operator[SEP] { identifier[PrefixedProperties] identifier[resultProperties] operator[=] Other[null] operator[SEP] identifier[String] identifier[environment] operator[=] identifier[defaultPrefix] operator[SEP] Keyword[if] operator[SEP] identifier[environmentFactory] operator[!=] Other[null] operator[SEP] { identifier[environment] operator[=] identifier[environmentFactory] operator[SEP] identifier[getEnvironment] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[defaultPrefixSystemPropertyKey] operator[!=] Other[null] operator[SEP] { identifier[environment] operator[=] identifier[System] operator[SEP] identifier[getProperty] operator[SEP] identifier[defaultPrefixSystemPropertyKey] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[environment] operator[==] Other[null] operator[SEP] { Keyword[if] operator[SEP] identifier[logger] operator[SEP] identifier[isWarnEnabled] operator[SEP] operator[SEP] operator[SEP] { identifier[logger] operator[SEP] identifier[warn] operator[SEP] identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[defaultPrefixSystemPropertyKey] operator[SEP] operator[SEP] operator[SEP] } } } Keyword[if] operator[SEP] identifier[prefixConfigList] operator[!=] Other[null] operator[SEP] { identifier[resultProperties] operator[=] identifier[PrefixedProperties] operator[SEP] identifier[createCascadingPrefixProperties] operator[SEP] identifier[prefixConfigList] operator[SEP] operator[SEP] } Keyword[else] { Keyword[if] operator[SEP] identifier[environment] operator[!=] Other[null] operator[SEP] { identifier[resultProperties] operator[=] identifier[PrefixedProperties] operator[SEP] identifier[createCascadingPrefixProperties] operator[SEP] identifier[environment] operator[SEP] operator[SEP] } Keyword[else] { identifier[resultProperties] operator[=] Keyword[new] identifier[PrefixedProperties] operator[SEP] operator[SEP] operator[SEP] } } identifier[resultProperties] operator[SEP] identifier[setDefaultPrefix] operator[SEP] identifier[environment] 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] identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[environment] operator[SEP] operator[SEP] operator[SEP] } identifier[resultProperties] operator[SEP] identifier[setMixDefaultAndLocalPrefixSettings] operator[SEP] identifier[mixDefaultAndLocalPrefixConfigurations] operator[SEP] operator[SEP] identifier[myProperties] operator[=] identifier[resultProperties] operator[SEP] } Keyword[return] identifier[myProperties] operator[SEP] }
@Factory public static Matcher<Element> hasAttribute(final String attributeName, final Matcher<? super String> attributeValueMatcher) { return new ElementWithAttribute(attributeName, attributeValueMatcher); }
class class_name[name] begin[{] method[hasAttribute, return_type[type[Matcher]], modifier[public static], parameter[attributeName, attributeValueMatcher]] begin[{] return[ClassCreator(arguments=[MemberReference(member=attributeName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=attributeValueMatcher, 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=ElementWithAttribute, sub_type=None))] end[}] END[}]
annotation[@] identifier[Factory] Keyword[public] Keyword[static] identifier[Matcher] operator[<] identifier[Element] operator[>] identifier[hasAttribute] operator[SEP] Keyword[final] identifier[String] identifier[attributeName] , Keyword[final] identifier[Matcher] operator[<] operator[?] Keyword[super] identifier[String] operator[>] identifier[attributeValueMatcher] operator[SEP] { Keyword[return] Keyword[new] identifier[ElementWithAttribute] operator[SEP] identifier[attributeName] , identifier[attributeValueMatcher] operator[SEP] operator[SEP] }
@Override public void serializeInByteBufferObject(OIdentifiable object, ByteBuffer buffer, Object... hints) { final ORID r = object.getIdentity(); buffer.putShort((short) r.getClusterId()); // Wrong implementation but needed for binary compatibility byte[] stream = new byte[OLongSerializer.LONG_SIZE]; OLongSerializer.INSTANCE.serialize(r.getClusterPosition(), stream, 0); buffer.put(stream); }
class class_name[name] begin[{] method[serializeInByteBufferObject, return_type[void], modifier[public], parameter[object, buffer, hints]] begin[{] local_variable[type[ORID], r] call[buffer.putShort, parameter[Cast(expression=MethodInvocation(arguments=[], member=getClusterId, postfix_operators=[], prefix_operators=[], qualifier=r, selectors=[], type_arguments=None), type=BasicType(dimensions=[], name=short))]] local_variable[type[byte], stream] call[OLongSerializer.INSTANCE.serialize, parameter[call[r.getClusterPosition, parameter[]], member[.stream], literal[0]]] call[buffer.put, parameter[member[.stream]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[serializeInByteBufferObject] operator[SEP] identifier[OIdentifiable] identifier[object] , identifier[ByteBuffer] identifier[buffer] , identifier[Object] operator[...] identifier[hints] operator[SEP] { Keyword[final] identifier[ORID] identifier[r] operator[=] identifier[object] operator[SEP] identifier[getIdentity] operator[SEP] operator[SEP] operator[SEP] identifier[buffer] operator[SEP] identifier[putShort] operator[SEP] operator[SEP] Keyword[short] operator[SEP] identifier[r] operator[SEP] identifier[getClusterId] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[stream] operator[=] Keyword[new] Keyword[byte] operator[SEP] identifier[OLongSerializer] operator[SEP] identifier[LONG_SIZE] operator[SEP] operator[SEP] identifier[OLongSerializer] operator[SEP] identifier[INSTANCE] operator[SEP] identifier[serialize] operator[SEP] identifier[r] operator[SEP] identifier[getClusterPosition] operator[SEP] operator[SEP] , identifier[stream] , Other[0] operator[SEP] operator[SEP] identifier[buffer] operator[SEP] identifier[put] operator[SEP] identifier[stream] operator[SEP] operator[SEP] }
@Override public Object readValue(final Attribute _attribute, final List<Object> _objectList) { final List<String> ret = new ArrayList<String>(); for (final Object object : _objectList) { final StringBuilder oid = new StringBuilder(); if (object instanceof Object[]) { final Object[] temp = (Object[]) object; oid.append(temp[0]).append(".").append(temp[1]); } else { oid.append(_attribute.getParentId()).append(".").append(object); } ret.add(oid.toString()); } return _objectList.size() > 0 ? (ret.size() > 1 ? ret : ret.get(0)) : null; }
class class_name[name] begin[{] method[readValue, return_type[type[Object]], modifier[public], parameter[_attribute, _objectList]] begin[{] local_variable[type[List], ret] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=StringBuilder, sub_type=None)), name=oid)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=StringBuilder, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=object, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[None], name=Object, sub_type=None), operator=instanceof), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getParentId, postfix_operators=[], prefix_operators=[], qualifier=_attribute, selectors=[], type_arguments=None)], member=append, postfix_operators=[], prefix_operators=[], qualifier=oid, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=".")], member=append, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=object, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=append, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MemberReference(member=object, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[None], name=Object, sub_type=None)), name=temp)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[None], name=Object, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=temp, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))])], member=append, postfix_operators=[], prefix_operators=[], qualifier=oid, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=".")], member=append, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=temp, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1))])], member=append, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=oid, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=ret, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=_objectList, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=object)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))), label=None) return[TernaryExpression(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=_objectList, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>), if_false=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), if_true=TernaryExpression(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=ret, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=>), if_false=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], member=get, postfix_operators=[], prefix_operators=[], qualifier=ret, selectors=[], type_arguments=None), if_true=MemberReference(member=ret, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])))] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[Object] identifier[readValue] operator[SEP] Keyword[final] identifier[Attribute] identifier[_attribute] , Keyword[final] identifier[List] operator[<] identifier[Object] operator[>] identifier[_objectList] operator[SEP] { Keyword[final] identifier[List] operator[<] identifier[String] operator[>] identifier[ret] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[String] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[final] identifier[Object] identifier[object] operator[:] identifier[_objectList] operator[SEP] { Keyword[final] identifier[StringBuilder] identifier[oid] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[object] Keyword[instanceof] identifier[Object] operator[SEP] operator[SEP] operator[SEP] { Keyword[final] identifier[Object] operator[SEP] operator[SEP] identifier[temp] operator[=] operator[SEP] identifier[Object] operator[SEP] operator[SEP] operator[SEP] identifier[object] operator[SEP] identifier[oid] operator[SEP] identifier[append] operator[SEP] identifier[temp] operator[SEP] Other[0] operator[SEP] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[temp] operator[SEP] Other[1] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[oid] operator[SEP] identifier[append] operator[SEP] identifier[_attribute] operator[SEP] identifier[getParentId] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[object] operator[SEP] operator[SEP] } identifier[ret] operator[SEP] identifier[add] operator[SEP] identifier[oid] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[_objectList] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[>] Other[0] operator[?] operator[SEP] identifier[ret] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[>] Other[1] operator[?] identifier[ret] operator[:] identifier[ret] operator[SEP] identifier[get] operator[SEP] Other[0] operator[SEP] operator[SEP] operator[:] Other[null] operator[SEP] }
public static String[] partitionCommandLine(final String command) { final ArrayList<String> commands = new ArrayList<>(); int index = 0; StringBuffer buffer = new StringBuffer(command.length()); boolean isApos = false; boolean isQuote = false; while (index < command.length()) { final char c = command.charAt(index); switch (c) { case ' ': if (!isQuote && !isApos) { final String arg = buffer.toString(); buffer = new StringBuffer(command.length() - index); if (arg.length() > 0) { commands.add(arg); } } else { buffer.append(c); } break; case '\'': if (!isQuote) { isApos = !isApos; } else { buffer.append(c); } break; case '"': if (!isApos) { isQuote = !isQuote; } else { buffer.append(c); } break; default: buffer.append(c); } index++; } if (buffer.length() > 0) { final String arg = buffer.toString(); commands.add(arg); } return commands.toArray(new String[commands.size()]); }
class class_name[name] begin[{] method[partitionCommandLine, return_type[type[String]], modifier[public static], parameter[command]] begin[{] local_variable[type[ArrayList], commands] local_variable[type[int], index] local_variable[type[StringBuffer], buffer] local_variable[type[boolean], isApos] local_variable[type[boolean], isQuote] while[binary_operation[member[.index], <, call[command.length, parameter[]]]] begin[{] local_variable[type[char], c] SwitchStatement(cases=[SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=' ')], statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=isQuote, postfix_operators=[], prefix_operators=['!'], qualifier=, selectors=[]), operandr=MemberReference(member=isApos, postfix_operators=[], prefix_operators=['!'], qualifier=, selectors=[]), operator=&&), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=append, postfix_operators=[], prefix_operators=[], qualifier=buffer, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=buffer, selectors=[], type_arguments=None), name=arg)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=buffer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[BinaryOperation(operandl=MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=command, selectors=[], type_arguments=None), operandr=MemberReference(member=index, 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=StringBuffer, sub_type=None))), label=None), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=arg, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=arg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=commands, selectors=[], type_arguments=None), label=None)]))])), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='\'')], statements=[IfStatement(condition=MemberReference(member=isQuote, postfix_operators=[], prefix_operators=['!'], qualifier=, selectors=[]), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=append, postfix_operators=[], prefix_operators=[], qualifier=buffer, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=isApos, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=isApos, postfix_operators=[], prefix_operators=['!'], qualifier=, selectors=[])), label=None)])), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='"')], statements=[IfStatement(condition=MemberReference(member=isApos, postfix_operators=[], prefix_operators=['!'], qualifier=, selectors=[]), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=append, postfix_operators=[], prefix_operators=[], qualifier=buffer, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=isQuote, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=isQuote, postfix_operators=[], prefix_operators=['!'], qualifier=, selectors=[])), label=None)])), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[], statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=append, postfix_operators=[], prefix_operators=[], qualifier=buffer, selectors=[], type_arguments=None), label=None)])], expression=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None) member[.index] end[}] if[binary_operation[call[buffer.length, parameter[]], >, literal[0]]] begin[{] local_variable[type[String], arg] call[commands.add, parameter[member[.arg]]] else begin[{] None end[}] return[call[commands.toArray, parameter[ArrayCreator(dimensions=[MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=commands, 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[partitionCommandLine] operator[SEP] Keyword[final] identifier[String] identifier[command] operator[SEP] { Keyword[final] identifier[ArrayList] operator[<] identifier[String] operator[>] identifier[commands] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[index] operator[=] Other[0] operator[SEP] identifier[StringBuffer] identifier[buffer] operator[=] Keyword[new] identifier[StringBuffer] operator[SEP] identifier[command] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[boolean] identifier[isApos] operator[=] literal[boolean] operator[SEP] Keyword[boolean] identifier[isQuote] operator[=] literal[boolean] operator[SEP] Keyword[while] operator[SEP] identifier[index] operator[<] identifier[command] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] { Keyword[final] Keyword[char] identifier[c] operator[=] identifier[command] operator[SEP] identifier[charAt] operator[SEP] identifier[index] operator[SEP] operator[SEP] Keyword[switch] operator[SEP] identifier[c] operator[SEP] { Keyword[case] literal[String] operator[:] Keyword[if] operator[SEP] operator[!] identifier[isQuote] operator[&&] operator[!] identifier[isApos] operator[SEP] { Keyword[final] identifier[String] identifier[arg] operator[=] identifier[buffer] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] identifier[buffer] operator[=] Keyword[new] identifier[StringBuffer] operator[SEP] identifier[command] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[-] identifier[index] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[arg] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] { identifier[commands] operator[SEP] identifier[add] operator[SEP] identifier[arg] operator[SEP] operator[SEP] } } Keyword[else] { identifier[buffer] operator[SEP] identifier[append] operator[SEP] identifier[c] operator[SEP] operator[SEP] } Keyword[break] operator[SEP] Keyword[case] literal[String] operator[:] Keyword[if] operator[SEP] operator[!] identifier[isQuote] operator[SEP] { identifier[isApos] operator[=] operator[!] identifier[isApos] operator[SEP] } Keyword[else] { identifier[buffer] operator[SEP] identifier[append] operator[SEP] identifier[c] operator[SEP] operator[SEP] } Keyword[break] operator[SEP] Keyword[case] literal[String] operator[:] Keyword[if] operator[SEP] operator[!] identifier[isApos] operator[SEP] { identifier[isQuote] operator[=] operator[!] identifier[isQuote] operator[SEP] } Keyword[else] { identifier[buffer] operator[SEP] identifier[append] operator[SEP] identifier[c] operator[SEP] operator[SEP] } Keyword[break] operator[SEP] Keyword[default] operator[:] identifier[buffer] operator[SEP] identifier[append] operator[SEP] identifier[c] operator[SEP] operator[SEP] } identifier[index] operator[++] operator[SEP] } Keyword[if] operator[SEP] identifier[buffer] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] { Keyword[final] identifier[String] identifier[arg] operator[=] identifier[buffer] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] identifier[commands] operator[SEP] identifier[add] operator[SEP] identifier[arg] operator[SEP] operator[SEP] } Keyword[return] identifier[commands] operator[SEP] identifier[toArray] operator[SEP] Keyword[new] identifier[String] operator[SEP] identifier[commands] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
public static byte[] encode(String str, int off, int len) { return encode(str.substring(off, off + len)); }
class class_name[name] begin[{] method[encode, return_type[type[byte]], modifier[public static], parameter[str, off, len]] begin[{] return[call[.encode, parameter[call[str.substring, parameter[member[.off], binary_operation[member[.off], +, member[.len]]]]]]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[byte] operator[SEP] operator[SEP] identifier[encode] operator[SEP] identifier[String] identifier[str] , Keyword[int] identifier[off] , Keyword[int] identifier[len] operator[SEP] { Keyword[return] identifier[encode] operator[SEP] identifier[str] operator[SEP] identifier[substring] operator[SEP] identifier[off] , identifier[off] operator[+] identifier[len] operator[SEP] operator[SEP] operator[SEP] }
public void setSettings(EnhancedMap settings) { bufferSize = settings.getIntegerProperty(ReportConstants.DEFAULTBUFFERSIZE, ReportConstants.BUFFERSIZE); this.settings = settings; StylerFactoryHelper.SETTINGS_ANNOTATION_PROCESSOR.initSettings(elementProducer, settings); StylerFactoryHelper.SETTINGS_ANNOTATION_PROCESSOR.initSettings(stylerFactory, settings); StylerFactoryHelper.SETTINGS_ANNOTATION_PROCESSOR.initSettings(eventHelper, settings); itextHelper = new ItextHelper(); StylerFactoryHelper.SETTINGS_ANNOTATION_PROCESSOR.initSettings(itextHelper, settings); }
class class_name[name] begin[{] method[setSettings, return_type[void], modifier[public], parameter[settings]] begin[{] assign[member[.bufferSize], call[settings.getIntegerProperty, parameter[member[ReportConstants.DEFAULTBUFFERSIZE], member[ReportConstants.BUFFERSIZE]]]] assign[THIS[member[None.settings]], member[.settings]] call[StylerFactoryHelper.SETTINGS_ANNOTATION_PROCESSOR.initSettings, parameter[member[.elementProducer], member[.settings]]] call[StylerFactoryHelper.SETTINGS_ANNOTATION_PROCESSOR.initSettings, parameter[member[.stylerFactory], member[.settings]]] call[StylerFactoryHelper.SETTINGS_ANNOTATION_PROCESSOR.initSettings, parameter[member[.eventHelper], member[.settings]]] assign[member[.itextHelper], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ItextHelper, sub_type=None))] call[StylerFactoryHelper.SETTINGS_ANNOTATION_PROCESSOR.initSettings, parameter[member[.itextHelper], member[.settings]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[setSettings] operator[SEP] identifier[EnhancedMap] identifier[settings] operator[SEP] { identifier[bufferSize] operator[=] identifier[settings] operator[SEP] identifier[getIntegerProperty] operator[SEP] identifier[ReportConstants] operator[SEP] identifier[DEFAULTBUFFERSIZE] , identifier[ReportConstants] operator[SEP] identifier[BUFFERSIZE] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[settings] operator[=] identifier[settings] operator[SEP] identifier[StylerFactoryHelper] operator[SEP] identifier[SETTINGS_ANNOTATION_PROCESSOR] operator[SEP] identifier[initSettings] operator[SEP] identifier[elementProducer] , identifier[settings] operator[SEP] operator[SEP] identifier[StylerFactoryHelper] operator[SEP] identifier[SETTINGS_ANNOTATION_PROCESSOR] operator[SEP] identifier[initSettings] operator[SEP] identifier[stylerFactory] , identifier[settings] operator[SEP] operator[SEP] identifier[StylerFactoryHelper] operator[SEP] identifier[SETTINGS_ANNOTATION_PROCESSOR] operator[SEP] identifier[initSettings] operator[SEP] identifier[eventHelper] , identifier[settings] operator[SEP] operator[SEP] identifier[itextHelper] operator[=] Keyword[new] identifier[ItextHelper] operator[SEP] operator[SEP] operator[SEP] identifier[StylerFactoryHelper] operator[SEP] identifier[SETTINGS_ANNOTATION_PROCESSOR] operator[SEP] identifier[initSettings] operator[SEP] identifier[itextHelper] , identifier[settings] operator[SEP] operator[SEP] }
public void storeInCache(@Nullable String rawPath) { if (CACHE != null && rawPath != null) { CACHE.put(rawPath, this); } }
class class_name[name] begin[{] method[storeInCache, return_type[void], modifier[public], parameter[rawPath]] begin[{] if[binary_operation[binary_operation[member[.CACHE], !=, literal[null]], &&, binary_operation[member[.rawPath], !=, literal[null]]]] begin[{] call[CACHE.put, parameter[member[.rawPath], THIS[]]] else begin[{] None end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[storeInCache] operator[SEP] annotation[@] identifier[Nullable] identifier[String] identifier[rawPath] operator[SEP] { Keyword[if] operator[SEP] identifier[CACHE] operator[!=] Other[null] operator[&&] identifier[rawPath] operator[!=] Other[null] operator[SEP] { identifier[CACHE] operator[SEP] identifier[put] operator[SEP] identifier[rawPath] , Keyword[this] operator[SEP] operator[SEP] } }
public static Source retrieve(String source) throws StripeException { return retrieve(source, (Map<String, Object>) null, (RequestOptions) null); }
class class_name[name] begin[{] method[retrieve, return_type[type[Source]], modifier[public static], parameter[source]] begin[{] return[call[.retrieve, parameter[member[.source], Cast(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))], dimensions=[], name=Map, sub_type=None)), Cast(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), type=ReferenceType(arguments=None, dimensions=[], name=RequestOptions, sub_type=None))]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[Source] identifier[retrieve] operator[SEP] identifier[String] identifier[source] operator[SEP] Keyword[throws] identifier[StripeException] { Keyword[return] identifier[retrieve] operator[SEP] identifier[source] , operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] operator[SEP] Other[null] , operator[SEP] identifier[RequestOptions] operator[SEP] Other[null] operator[SEP] operator[SEP] }
public static RegionMetadata getRegionMetadata() { RegionMetadata rval = regionMetadata; if (rval != null) { return rval; } synchronized (RegionUtils.class) { if (regionMetadata == null) { initialize(); } } return regionMetadata; }
class class_name[name] begin[{] method[getRegionMetadata, return_type[type[RegionMetadata]], modifier[public static], parameter[]] begin[{] local_variable[type[RegionMetadata], rval] if[binary_operation[member[.rval], !=, literal[null]]] begin[{] return[member[.rval]] else begin[{] None end[}] SYNCHRONIZED[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=RegionUtils, sub_type=None))] BEGIN[{] if[binary_operation[member[.regionMetadata], ==, literal[null]]] begin[{] call[.initialize, parameter[]] else begin[{] None end[}] END[}] return[member[.regionMetadata]] end[}] END[}]
Keyword[public] Keyword[static] identifier[RegionMetadata] identifier[getRegionMetadata] operator[SEP] operator[SEP] { identifier[RegionMetadata] identifier[rval] operator[=] identifier[regionMetadata] operator[SEP] Keyword[if] operator[SEP] identifier[rval] operator[!=] Other[null] operator[SEP] { Keyword[return] identifier[rval] operator[SEP] } Keyword[synchronized] operator[SEP] identifier[RegionUtils] operator[SEP] Keyword[class] operator[SEP] { Keyword[if] operator[SEP] identifier[regionMetadata] operator[==] Other[null] operator[SEP] { identifier[initialize] operator[SEP] operator[SEP] operator[SEP] } } Keyword[return] identifier[regionMetadata] operator[SEP] }
public Integer getAssistedQueryColumnCount(final String logicTableName) { if (Collections2.filter(columns, new Predicate<ColumnNode>() { @Override public boolean apply(final ColumnNode input) { return input.getTableName().equals(logicTableName); } }).isEmpty()) { return 0; } return Collections2.filter(assistedQueryColumns, new Predicate<ColumnNode>() { @Override public boolean apply(final ColumnNode input) { return input.getTableName().equals(logicTableName); } }).size(); }
class class_name[name] begin[{] method[getAssistedQueryColumnCount, return_type[type[Integer]], modifier[public], parameter[logicTableName]] begin[{] if[call[Collections2.filter, parameter[member[.columns], ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[ReturnStatement(expression=MethodInvocation(arguments=[], member=getTableName, postfix_operators=[], prefix_operators=[], qualifier=input, selectors=[MethodInvocation(arguments=[MemberReference(member=logicTableName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=apply, parameters=[FormalParameter(annotations=[], modifiers={'final'}, name=input, type=ReferenceType(arguments=None, dimensions=[], name=ColumnNode, sub_type=None), varargs=False)], return_type=BasicType(dimensions=[], name=boolean), throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=ColumnNode, sub_type=None))], dimensions=None, name=Predicate, sub_type=None))]]] begin[{] return[literal[0]] else begin[{] None end[}] return[call[Collections2.filter, parameter[member[.assistedQueryColumns], ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[ReturnStatement(expression=MethodInvocation(arguments=[], member=getTableName, postfix_operators=[], prefix_operators=[], qualifier=input, selectors=[MethodInvocation(arguments=[MemberReference(member=logicTableName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=apply, parameters=[FormalParameter(annotations=[], modifiers={'final'}, name=input, type=ReferenceType(arguments=None, dimensions=[], name=ColumnNode, sub_type=None), varargs=False)], return_type=BasicType(dimensions=[], name=boolean), throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=ColumnNode, sub_type=None))], dimensions=None, name=Predicate, sub_type=None))]]] end[}] END[}]
Keyword[public] identifier[Integer] identifier[getAssistedQueryColumnCount] operator[SEP] Keyword[final] identifier[String] identifier[logicTableName] operator[SEP] { Keyword[if] operator[SEP] identifier[Collections2] operator[SEP] identifier[filter] operator[SEP] identifier[columns] , Keyword[new] identifier[Predicate] operator[<] identifier[ColumnNode] operator[>] operator[SEP] operator[SEP] { annotation[@] identifier[Override] Keyword[public] Keyword[boolean] identifier[apply] operator[SEP] Keyword[final] identifier[ColumnNode] identifier[input] operator[SEP] { Keyword[return] identifier[input] operator[SEP] identifier[getTableName] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[logicTableName] operator[SEP] operator[SEP] } } operator[SEP] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] Other[0] operator[SEP] } Keyword[return] identifier[Collections2] operator[SEP] identifier[filter] operator[SEP] identifier[assistedQueryColumns] , Keyword[new] identifier[Predicate] operator[<] identifier[ColumnNode] operator[>] operator[SEP] operator[SEP] { annotation[@] identifier[Override] Keyword[public] Keyword[boolean] identifier[apply] operator[SEP] Keyword[final] identifier[ColumnNode] identifier[input] operator[SEP] { Keyword[return] identifier[input] operator[SEP] identifier[getTableName] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[logicTableName] operator[SEP] operator[SEP] } } operator[SEP] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] }
private String formatExemplarLocation(TimeZone tz) { String location = getTimeZoneNames().getExemplarLocationName(ZoneMeta.getCanonicalCLDRID(tz)); if (location == null) { // Use "unknown" location location = getTimeZoneNames().getExemplarLocationName(UNKNOWN_ZONE_ID); if (location == null) { // last resort location = UNKNOWN_LOCATION; } } return location; }
class class_name[name] begin[{] method[formatExemplarLocation, return_type[type[String]], modifier[private], parameter[tz]] begin[{] local_variable[type[String], location] if[binary_operation[member[.location], ==, literal[null]]] begin[{] assign[member[.location], call[.getTimeZoneNames, parameter[]]] if[binary_operation[member[.location], ==, literal[null]]] begin[{] assign[member[.location], member[.UNKNOWN_LOCATION]] else begin[{] None end[}] else begin[{] None end[}] return[member[.location]] end[}] END[}]
Keyword[private] identifier[String] identifier[formatExemplarLocation] operator[SEP] identifier[TimeZone] identifier[tz] operator[SEP] { identifier[String] identifier[location] operator[=] identifier[getTimeZoneNames] operator[SEP] operator[SEP] operator[SEP] identifier[getExemplarLocationName] operator[SEP] identifier[ZoneMeta] operator[SEP] identifier[getCanonicalCLDRID] operator[SEP] identifier[tz] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[location] operator[==] Other[null] operator[SEP] { identifier[location] operator[=] identifier[getTimeZoneNames] operator[SEP] operator[SEP] operator[SEP] identifier[getExemplarLocationName] operator[SEP] identifier[UNKNOWN_ZONE_ID] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[location] operator[==] Other[null] operator[SEP] { identifier[location] operator[=] identifier[UNKNOWN_LOCATION] operator[SEP] } } Keyword[return] identifier[location] operator[SEP] }
public long getPosition() { initialize(); long position = scoreNodes.getPosition() - invalid; // scoreNode.getPosition() is one ahead // if there is a prefetched node if (next != null) { position--; } return position; }
class class_name[name] begin[{] method[getPosition, return_type[type[long]], modifier[public], parameter[]] begin[{] call[.initialize, parameter[]] local_variable[type[long], position] if[binary_operation[member[.next], !=, literal[null]]] begin[{] member[.position] else begin[{] None end[}] return[member[.position]] end[}] END[}]
Keyword[public] Keyword[long] identifier[getPosition] operator[SEP] operator[SEP] { identifier[initialize] operator[SEP] operator[SEP] operator[SEP] Keyword[long] identifier[position] operator[=] identifier[scoreNodes] operator[SEP] identifier[getPosition] operator[SEP] operator[SEP] operator[-] identifier[invalid] operator[SEP] Keyword[if] operator[SEP] identifier[next] operator[!=] Other[null] operator[SEP] { identifier[position] operator[--] operator[SEP] } Keyword[return] identifier[position] operator[SEP] }
protected String findBestNameForUrlNameMapping(CmsDbContext dbc, String name, CmsUUID structureId) throws CmsDataAccessException { List<CmsUrlNameMappingEntry> entriesStartingWithName = getVfsDriver(dbc).readUrlNameMappingEntries( dbc, false, CmsUrlNameMappingFilter.ALL.filterNamePattern(name + "%").filterRejectStructureId(structureId)); Set<String> usedNames = new HashSet<String>(); for (CmsUrlNameMappingEntry entry : entriesStartingWithName) { usedNames.add(entry.getName()); } int counter = 0; String numberedName; do { numberedName = getNumberedName(name, counter); counter += 1; } while (usedNames.contains(numberedName)); return numberedName; }
class class_name[name] begin[{] method[findBestNameForUrlNameMapping, return_type[type[String]], modifier[protected], parameter[dbc, name, structureId]] begin[{] local_variable[type[List], entriesStartingWithName] local_variable[type[Set], usedNames] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=usedNames, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=entriesStartingWithName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=entry)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=CmsUrlNameMappingEntry, sub_type=None))), label=None) local_variable[type[int], counter] local_variable[type[String], numberedName] do[call[usedNames.contains, parameter[member[.numberedName]]]] begin[{] assign[member[.numberedName], call[.getNumberedName, parameter[member[.name], member[.counter]]]] assign[member[.counter], literal[1]] end[}] return[member[.numberedName]] end[}] END[}]
Keyword[protected] identifier[String] identifier[findBestNameForUrlNameMapping] operator[SEP] identifier[CmsDbContext] identifier[dbc] , identifier[String] identifier[name] , identifier[CmsUUID] identifier[structureId] operator[SEP] Keyword[throws] identifier[CmsDataAccessException] { identifier[List] operator[<] identifier[CmsUrlNameMappingEntry] operator[>] identifier[entriesStartingWithName] operator[=] identifier[getVfsDriver] operator[SEP] identifier[dbc] operator[SEP] operator[SEP] identifier[readUrlNameMappingEntries] operator[SEP] identifier[dbc] , literal[boolean] , identifier[CmsUrlNameMappingFilter] operator[SEP] identifier[ALL] operator[SEP] identifier[filterNamePattern] operator[SEP] identifier[name] operator[+] literal[String] operator[SEP] operator[SEP] identifier[filterRejectStructureId] operator[SEP] identifier[structureId] operator[SEP] operator[SEP] operator[SEP] identifier[Set] operator[<] identifier[String] operator[>] identifier[usedNames] operator[=] Keyword[new] identifier[HashSet] operator[<] identifier[String] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[CmsUrlNameMappingEntry] identifier[entry] operator[:] identifier[entriesStartingWithName] operator[SEP] { identifier[usedNames] operator[SEP] identifier[add] operator[SEP] identifier[entry] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[int] identifier[counter] operator[=] Other[0] operator[SEP] identifier[String] identifier[numberedName] operator[SEP] Keyword[do] { identifier[numberedName] operator[=] identifier[getNumberedName] operator[SEP] identifier[name] , identifier[counter] operator[SEP] operator[SEP] identifier[counter] operator[+=] Other[1] operator[SEP] } Keyword[while] operator[SEP] identifier[usedNames] operator[SEP] identifier[contains] operator[SEP] identifier[numberedName] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[numberedName] operator[SEP] }
public static void closeQuietly(Closeable closeable) { try { // Here we've instructed Guava to swallow the IOException Closeables.close(closeable, true); } catch ( IOException e ) { // We instructed Guava to swallow the IOException, so this should // never happen. Since it did, log it. log.error("IOException should not have been thrown.", e); } }
class class_name[name] begin[{] method[closeQuietly, return_type[void], modifier[public static], parameter[closeable]] begin[{] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=closeable, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], member=close, postfix_operators=[], prefix_operators=[], qualifier=Closeables, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="IOException should not have been thrown."), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=log, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IOException']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[closeQuietly] operator[SEP] identifier[Closeable] identifier[closeable] operator[SEP] { Keyword[try] { identifier[Closeables] operator[SEP] identifier[close] operator[SEP] identifier[closeable] , literal[boolean] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[IOException] identifier[e] operator[SEP] { identifier[log] operator[SEP] identifier[error] operator[SEP] literal[String] , identifier[e] operator[SEP] operator[SEP] } }
public String encodeBookmarkableURL(String baseUrl, Map<String, List<String>> parameters) { if (defaultExternalContext != null) { return defaultExternalContext.encodeBookmarkableURL(baseUrl, parameters); } throw new UnsupportedOperationException(); }
class class_name[name] begin[{] method[encodeBookmarkableURL, return_type[type[String]], modifier[public], parameter[baseUrl, parameters]] begin[{] if[binary_operation[member[.defaultExternalContext], !=, literal[null]]] begin[{] return[call[defaultExternalContext.encodeBookmarkableURL, parameter[member[.baseUrl], member[.parameters]]]] else begin[{] None end[}] ThrowStatement(expression=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=UnsupportedOperationException, sub_type=None)), label=None) end[}] END[}]
Keyword[public] identifier[String] identifier[encodeBookmarkableURL] operator[SEP] identifier[String] identifier[baseUrl] , identifier[Map] operator[<] identifier[String] , identifier[List] operator[<] identifier[String] operator[>] operator[>] identifier[parameters] operator[SEP] { Keyword[if] operator[SEP] identifier[defaultExternalContext] operator[!=] Other[null] operator[SEP] { Keyword[return] identifier[defaultExternalContext] operator[SEP] identifier[encodeBookmarkableURL] operator[SEP] identifier[baseUrl] , identifier[parameters] operator[SEP] operator[SEP] } Keyword[throw] Keyword[new] identifier[UnsupportedOperationException] operator[SEP] operator[SEP] operator[SEP] }
protected void intialiseNonPersistent(MultiMEProxyHandler proxyHandler, Neighbours neighbours) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "intialiseNonPersistent"); iProxyHandler = proxyHandler; iNeighbours = neighbours; iDestinationManager = iProxyHandler.getMessageProcessor().getDestinationManager(); iRemoteQueue = SIMPUtils.createJsSystemDestinationAddress( SIMPConstants.PROXY_SYSTEM_DESTINATION_PREFIX, iMEUuid, iBusId); if (iMEUuid == null) iMEUuid = iRemoteQueue.getME(); iProxies = new Hashtable(); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "intialiseNonPersistent"); }
class class_name[name] begin[{] method[intialiseNonPersistent, return_type[void], modifier[protected], parameter[proxyHandler, neighbours]] begin[{] if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{] call[SibTr.entry, parameter[member[.tc], literal["intialiseNonPersistent"]]] else begin[{] None end[}] assign[member[.iProxyHandler], member[.proxyHandler]] assign[member[.iNeighbours], member[.neighbours]] assign[member[.iDestinationManager], call[iProxyHandler.getMessageProcessor, parameter[]]] assign[member[.iRemoteQueue], call[SIMPUtils.createJsSystemDestinationAddress, parameter[member[SIMPConstants.PROXY_SYSTEM_DESTINATION_PREFIX], member[.iMEUuid], member[.iBusId]]]] if[binary_operation[member[.iMEUuid], ==, literal[null]]] begin[{] assign[member[.iMEUuid], call[iRemoteQueue.getME, parameter[]]] else begin[{] None end[}] assign[member[.iProxies], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Hashtable, sub_type=None))] if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{] call[SibTr.exit, parameter[member[.tc], literal["intialiseNonPersistent"]]] else begin[{] None end[}] end[}] END[}]
Keyword[protected] Keyword[void] identifier[intialiseNonPersistent] operator[SEP] identifier[MultiMEProxyHandler] identifier[proxyHandler] , identifier[Neighbours] identifier[neighbours] operator[SEP] { Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[entry] operator[SEP] identifier[tc] , literal[String] operator[SEP] operator[SEP] identifier[iProxyHandler] operator[=] identifier[proxyHandler] operator[SEP] identifier[iNeighbours] operator[=] identifier[neighbours] operator[SEP] identifier[iDestinationManager] operator[=] identifier[iProxyHandler] operator[SEP] identifier[getMessageProcessor] operator[SEP] operator[SEP] operator[SEP] identifier[getDestinationManager] operator[SEP] operator[SEP] operator[SEP] identifier[iRemoteQueue] operator[=] identifier[SIMPUtils] operator[SEP] identifier[createJsSystemDestinationAddress] operator[SEP] identifier[SIMPConstants] operator[SEP] identifier[PROXY_SYSTEM_DESTINATION_PREFIX] , identifier[iMEUuid] , identifier[iBusId] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[iMEUuid] operator[==] Other[null] operator[SEP] identifier[iMEUuid] operator[=] identifier[iRemoteQueue] operator[SEP] identifier[getME] operator[SEP] operator[SEP] operator[SEP] identifier[iProxies] operator[=] Keyword[new] identifier[Hashtable] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[exit] operator[SEP] identifier[tc] , literal[String] operator[SEP] operator[SEP] }
private static String getHelp() { StringBuffer sb = new StringBuffer(); // SRE sb.append("\njSRE: Simple Relation Extraction V1.10\t 30.08.06\n"); sb.append("developed by Claudio Giuliano (giuliano@itc.it)\n\n"); // License sb.append("Copyright 2005 FBK-irst (http://www.fbk.eu)\n"); sb.append("\n"); sb.append("Licensed under the Apache License, Version 2.0 (the \"License\");\n"); sb.append("you may not use this file except in compliance with the License.\n"); sb.append("You may obtain a copy of the License at\n"); sb.append("\n"); sb.append(" http://www.apache.org/licenses/LICENSE-2.0\n"); sb.append("\n"); sb.append("Unless required by applicable law or agreed to in writing, software\n"); sb.append("distributed under the License is distributed on an \"AS IS\" BASIS,\n"); sb.append("WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n"); sb.append("See the License for the specific language governing permissions and\n"); sb.append("limitations under the License.\n\n"); // Usage sb.append("Usage: java org.itc.irst.tcc.sre.SentenceSet2VectorSet [options] example-file model-file output-file\n\n"); // Arguments sb.append("Arguments:\n"); sb.append("\ttest-file\t-> file with test data (SRE format)\n"); sb.append("\tmodel-file\t-> file from which to load the learned model\n"); sb.append("\toutput-file\t-> file in which to store resulting output\n"); sb.append("Options:\n"); sb.append("\t-h\t\t-> this help\n"); return sb.toString(); }
class class_name[name] begin[{] method[getHelp, return_type[type[String]], modifier[private static], parameter[]] begin[{] local_variable[type[StringBuffer], sb] call[sb.append, parameter[literal["\njSRE: Simple Relation Extraction V1.10\t 30.08.06\n"]]] call[sb.append, parameter[literal["developed by Claudio Giuliano (giuliano@itc.it)\n\n"]]] call[sb.append, parameter[literal["Copyright 2005 FBK-irst (http://www.fbk.eu)\n"]]] call[sb.append, parameter[literal["\n"]]] call[sb.append, parameter[literal["Licensed under the Apache License, Version 2.0 (the \"License\");\n"]]] call[sb.append, parameter[literal["you may not use this file except in compliance with the License.\n"]]] call[sb.append, parameter[literal["You may obtain a copy of the License at\n"]]] call[sb.append, parameter[literal["\n"]]] call[sb.append, parameter[literal[" http://www.apache.org/licenses/LICENSE-2.0\n"]]] call[sb.append, parameter[literal["\n"]]] call[sb.append, parameter[literal["Unless required by applicable law or agreed to in writing, software\n"]]] call[sb.append, parameter[literal["distributed under the License is distributed on an \"AS IS\" BASIS,\n"]]] call[sb.append, parameter[literal["WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n"]]] call[sb.append, parameter[literal["See the License for the specific language governing permissions and\n"]]] call[sb.append, parameter[literal["limitations under the License.\n\n"]]] call[sb.append, parameter[literal["Usage: java org.itc.irst.tcc.sre.SentenceSet2VectorSet [options] example-file model-file output-file\n\n"]]] call[sb.append, parameter[literal["Arguments:\n"]]] call[sb.append, parameter[literal["\ttest-file\t-> file with test data (SRE format)\n"]]] call[sb.append, parameter[literal["\tmodel-file\t-> file from which to load the learned model\n"]]] call[sb.append, parameter[literal["\toutput-file\t-> file in which to store resulting output\n"]]] call[sb.append, parameter[literal["Options:\n"]]] call[sb.append, parameter[literal["\t-h\t\t-> this help\n"]]] return[call[sb.toString, parameter[]]] end[}] END[}]
Keyword[private] Keyword[static] identifier[String] identifier[getHelp] operator[SEP] operator[SEP] { identifier[StringBuffer] identifier[sb] operator[=] Keyword[new] identifier[StringBuffer] 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] literal[String] 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] literal[String] 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] literal[String] 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] literal[String] 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] literal[String] 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] literal[String] 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] literal[String] 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] literal[String] 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] literal[String] 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] literal[String] 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] literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[sb] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] }
public List<Element> nodesSimple(Element context, String path) { String[] steps; steps = simples.get(path); if (steps == null) { steps = Strings.toArray(Filesystem.SEPARATOR.split(path)); simples.put(path, steps); } return Dom.getChildElements(context, steps); }
class class_name[name] begin[{] method[nodesSimple, return_type[type[List]], modifier[public], parameter[context, path]] begin[{] local_variable[type[String], steps] assign[member[.steps], call[simples.get, parameter[member[.path]]]] if[binary_operation[member[.steps], ==, literal[null]]] begin[{] assign[member[.steps], call[Strings.toArray, parameter[call[Filesystem.SEPARATOR.split, parameter[member[.path]]]]]] call[simples.put, parameter[member[.path], member[.steps]]] else begin[{] None end[}] return[call[Dom.getChildElements, parameter[member[.context], member[.steps]]]] end[}] END[}]
Keyword[public] identifier[List] operator[<] identifier[Element] operator[>] identifier[nodesSimple] operator[SEP] identifier[Element] identifier[context] , identifier[String] identifier[path] operator[SEP] { identifier[String] operator[SEP] operator[SEP] identifier[steps] operator[SEP] identifier[steps] operator[=] identifier[simples] operator[SEP] identifier[get] operator[SEP] identifier[path] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[steps] operator[==] Other[null] operator[SEP] { identifier[steps] operator[=] identifier[Strings] operator[SEP] identifier[toArray] operator[SEP] identifier[Filesystem] operator[SEP] identifier[SEPARATOR] operator[SEP] identifier[split] operator[SEP] identifier[path] operator[SEP] operator[SEP] operator[SEP] identifier[simples] operator[SEP] identifier[put] operator[SEP] identifier[path] , identifier[steps] operator[SEP] operator[SEP] } Keyword[return] identifier[Dom] operator[SEP] identifier[getChildElements] operator[SEP] identifier[context] , identifier[steps] operator[SEP] operator[SEP] }
public static String join(Iterable self, String separator) { StringBuilder buffer = new StringBuilder(); boolean first = true; if (separator == null) separator = ""; for (Object value : self) { if (first) { first = false; } else { buffer.append(separator); } buffer.append(InvokerHelper.toString(value)); } return buffer.toString(); }
class class_name[name] begin[{] method[join, return_type[type[String]], modifier[public static], parameter[self, separator]] begin[{] local_variable[type[StringBuilder], buffer] local_variable[type[boolean], first] if[binary_operation[member[.separator], ==, literal[null]]] begin[{] assign[member[.separator], literal[""]] else begin[{] None end[}] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MemberReference(member=first, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=separator, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=append, postfix_operators=[], prefix_operators=[], qualifier=buffer, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=first, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=toString, postfix_operators=[], prefix_operators=[], qualifier=InvokerHelper, selectors=[], type_arguments=None)], member=append, postfix_operators=[], prefix_operators=[], qualifier=buffer, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=self, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=value)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))), label=None) return[call[buffer.toString, parameter[]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[String] identifier[join] operator[SEP] identifier[Iterable] identifier[self] , identifier[String] identifier[separator] operator[SEP] { identifier[StringBuilder] identifier[buffer] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] operator[SEP] operator[SEP] Keyword[boolean] identifier[first] operator[=] literal[boolean] operator[SEP] Keyword[if] operator[SEP] identifier[separator] operator[==] Other[null] operator[SEP] identifier[separator] operator[=] literal[String] operator[SEP] Keyword[for] operator[SEP] identifier[Object] identifier[value] operator[:] identifier[self] operator[SEP] { Keyword[if] operator[SEP] identifier[first] operator[SEP] { identifier[first] operator[=] literal[boolean] operator[SEP] } Keyword[else] { identifier[buffer] operator[SEP] identifier[append] operator[SEP] identifier[separator] operator[SEP] operator[SEP] } identifier[buffer] operator[SEP] identifier[append] operator[SEP] identifier[InvokerHelper] operator[SEP] identifier[toString] operator[SEP] identifier[value] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[buffer] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] }
public void removeExtension(Resource rootResource, String moduleName, ManagementResourceRegistration rootRegistration) throws IllegalStateException { final ManagementResourceRegistration profileReg; if (rootRegistration.getPathAddress().size() == 0) { //domain or server extension // Can't use processType.isServer() to determine where to look for profile reg because a lot of test infrastructure // doesn't add the profile mrr even in HC-based tests ManagementResourceRegistration reg = rootRegistration.getSubModel(PathAddress.pathAddress(PathElement.pathElement(PROFILE))); if (reg == null) { reg = rootRegistration; } profileReg = reg; } else { //host model extension profileReg = rootRegistration; } ManagementResourceRegistration deploymentsReg = processType.isServer() ? rootRegistration.getSubModel(PathAddress.pathAddress(PathElement.pathElement(DEPLOYMENT))) : null; ExtensionInfo extension = extensions.remove(moduleName); if (extension != null) { //noinspection SynchronizationOnLocalVariableOrMethodParameter synchronized (extension) { Set<String> subsystemNames = extension.subsystems.keySet(); final boolean dcExtension = processType.isHostController() ? rootRegistration.getPathAddress().size() == 0 : false; for (String subsystem : subsystemNames) { if (hasSubsystemsRegistered(rootResource, subsystem, dcExtension)) { // Restore the data extensions.put(moduleName, extension); throw ControllerLogger.ROOT_LOGGER.removingExtensionWithRegisteredSubsystem(moduleName, subsystem); } } for (Map.Entry<String, SubsystemInformation> entry : extension.subsystems.entrySet()) { String subsystem = entry.getKey(); profileReg.unregisterSubModel(PathElement.pathElement(ModelDescriptionConstants.SUBSYSTEM, subsystem)); if (deploymentsReg != null) { deploymentsReg.unregisterSubModel(PathElement.pathElement(ModelDescriptionConstants.SUBSYSTEM, subsystem)); deploymentsReg.unregisterSubModel(PathElement.pathElement(ModelDescriptionConstants.SUBDEPLOYMENT, subsystem)); } if (extension.xmlMapper != null) { SubsystemInformationImpl subsystemInformation = SubsystemInformationImpl.class.cast(entry.getValue()); for (String namespace : subsystemInformation.getXMLNamespaces()) { extension.xmlMapper.unregisterRootElement(new QName(namespace, SUBSYSTEM)); } } } } } }
class class_name[name] begin[{] method[removeExtension, return_type[void], modifier[public], parameter[rootResource, moduleName, rootRegistration]] begin[{] local_variable[type[ManagementResourceRegistration], profileReg] if[binary_operation[call[rootRegistration.getPathAddress, parameter[]], ==, literal[0]]] begin[{] local_variable[type[ManagementResourceRegistration], reg] if[binary_operation[member[.reg], ==, literal[null]]] begin[{] assign[member[.reg], member[.rootRegistration]] else begin[{] None end[}] assign[member[.profileReg], member[.reg]] else begin[{] assign[member[.profileReg], member[.rootRegistration]] end[}] local_variable[type[ManagementResourceRegistration], deploymentsReg] local_variable[type[ExtensionInfo], extension] if[binary_operation[member[.extension], !=, literal[null]]] begin[{] SYNCHRONIZED[member[.extension]] BEGIN[{] local_variable[type[Set], subsystemNames] local_variable[type[boolean], dcExtension] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=rootResource, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=subsystem, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=dcExtension, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=hasSubsystemsRegistered, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=moduleName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=extension, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=put, postfix_operators=[], prefix_operators=[], qualifier=extensions, selectors=[], type_arguments=None), label=None), ThrowStatement(expression=MethodInvocation(arguments=[MemberReference(member=moduleName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=subsystem, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=removingExtensionWithRegisteredSubsystem, postfix_operators=[], prefix_operators=[], qualifier=ControllerLogger.ROOT_LOGGER, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=subsystemNames, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=subsystem)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None) ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getKey, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None), name=subsystem)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=SUBSYSTEM, postfix_operators=[], prefix_operators=[], qualifier=ModelDescriptionConstants, selectors=[]), MemberReference(member=subsystem, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=pathElement, postfix_operators=[], prefix_operators=[], qualifier=PathElement, selectors=[], type_arguments=None)], member=unregisterSubModel, postfix_operators=[], prefix_operators=[], qualifier=profileReg, selectors=[], type_arguments=None), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=deploymentsReg, 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=[MethodInvocation(arguments=[MemberReference(member=SUBSYSTEM, postfix_operators=[], prefix_operators=[], qualifier=ModelDescriptionConstants, selectors=[]), MemberReference(member=subsystem, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=pathElement, postfix_operators=[], prefix_operators=[], qualifier=PathElement, selectors=[], type_arguments=None)], member=unregisterSubModel, postfix_operators=[], prefix_operators=[], qualifier=deploymentsReg, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=SUBDEPLOYMENT, postfix_operators=[], prefix_operators=[], qualifier=ModelDescriptionConstants, selectors=[]), MemberReference(member=subsystem, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=pathElement, postfix_operators=[], prefix_operators=[], qualifier=PathElement, selectors=[], type_arguments=None)], member=unregisterSubModel, postfix_operators=[], prefix_operators=[], qualifier=deploymentsReg, selectors=[], type_arguments=None), label=None)])), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=xmlMapper, postfix_operators=[], prefix_operators=[], qualifier=extension, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None)], member=cast, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=SubsystemInformationImpl, sub_type=None)), name=subsystemInformation)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=SubsystemInformationImpl, sub_type=None)), ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[ClassCreator(arguments=[MemberReference(member=namespace, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=SUBSYSTEM, 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=QName, sub_type=None))], member=unregisterRootElement, postfix_operators=[], prefix_operators=[], qualifier=extension.xmlMapper, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getXMLNamespaces, postfix_operators=[], prefix_operators=[], qualifier=subsystemInformation, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=namespace)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=entrySet, postfix_operators=[], prefix_operators=[], qualifier=extension.subsystems, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=entry)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Map, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=SubsystemInformation, sub_type=None))], dimensions=None, name=Entry, sub_type=None)))), label=None) END[}] else begin[{] None end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[removeExtension] operator[SEP] identifier[Resource] identifier[rootResource] , identifier[String] identifier[moduleName] , identifier[ManagementResourceRegistration] identifier[rootRegistration] operator[SEP] Keyword[throws] identifier[IllegalStateException] { Keyword[final] identifier[ManagementResourceRegistration] identifier[profileReg] operator[SEP] Keyword[if] operator[SEP] identifier[rootRegistration] operator[SEP] identifier[getPathAddress] operator[SEP] operator[SEP] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[==] Other[0] operator[SEP] { identifier[ManagementResourceRegistration] identifier[reg] operator[=] identifier[rootRegistration] operator[SEP] identifier[getSubModel] operator[SEP] identifier[PathAddress] operator[SEP] identifier[pathAddress] operator[SEP] identifier[PathElement] operator[SEP] identifier[pathElement] operator[SEP] identifier[PROFILE] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[reg] operator[==] Other[null] operator[SEP] { identifier[reg] operator[=] identifier[rootRegistration] operator[SEP] } identifier[profileReg] operator[=] identifier[reg] operator[SEP] } Keyword[else] { identifier[profileReg] operator[=] identifier[rootRegistration] operator[SEP] } identifier[ManagementResourceRegistration] identifier[deploymentsReg] operator[=] identifier[processType] operator[SEP] identifier[isServer] operator[SEP] operator[SEP] operator[?] identifier[rootRegistration] operator[SEP] identifier[getSubModel] operator[SEP] identifier[PathAddress] operator[SEP] identifier[pathAddress] operator[SEP] identifier[PathElement] operator[SEP] identifier[pathElement] operator[SEP] identifier[DEPLOYMENT] operator[SEP] operator[SEP] operator[SEP] operator[:] Other[null] operator[SEP] identifier[ExtensionInfo] identifier[extension] operator[=] identifier[extensions] operator[SEP] identifier[remove] operator[SEP] identifier[moduleName] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[extension] operator[!=] Other[null] operator[SEP] { Keyword[synchronized] operator[SEP] identifier[extension] operator[SEP] { identifier[Set] operator[<] identifier[String] operator[>] identifier[subsystemNames] operator[=] identifier[extension] operator[SEP] identifier[subsystems] operator[SEP] identifier[keySet] operator[SEP] operator[SEP] operator[SEP] Keyword[final] Keyword[boolean] identifier[dcExtension] operator[=] identifier[processType] operator[SEP] identifier[isHostController] operator[SEP] operator[SEP] operator[?] identifier[rootRegistration] operator[SEP] identifier[getPathAddress] operator[SEP] operator[SEP] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[==] Other[0] operator[:] literal[boolean] operator[SEP] Keyword[for] operator[SEP] identifier[String] identifier[subsystem] operator[:] identifier[subsystemNames] operator[SEP] { Keyword[if] operator[SEP] identifier[hasSubsystemsRegistered] operator[SEP] identifier[rootResource] , identifier[subsystem] , identifier[dcExtension] operator[SEP] operator[SEP] { identifier[extensions] operator[SEP] identifier[put] operator[SEP] identifier[moduleName] , identifier[extension] operator[SEP] operator[SEP] Keyword[throw] identifier[ControllerLogger] operator[SEP] identifier[ROOT_LOGGER] operator[SEP] identifier[removingExtensionWithRegisteredSubsystem] operator[SEP] identifier[moduleName] , identifier[subsystem] operator[SEP] operator[SEP] } } Keyword[for] operator[SEP] identifier[Map] operator[SEP] identifier[Entry] operator[<] identifier[String] , identifier[SubsystemInformation] operator[>] identifier[entry] operator[:] identifier[extension] operator[SEP] identifier[subsystems] operator[SEP] identifier[entrySet] operator[SEP] operator[SEP] operator[SEP] { identifier[String] identifier[subsystem] operator[=] identifier[entry] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] operator[SEP] identifier[profileReg] operator[SEP] identifier[unregisterSubModel] operator[SEP] identifier[PathElement] operator[SEP] identifier[pathElement] operator[SEP] identifier[ModelDescriptionConstants] operator[SEP] identifier[SUBSYSTEM] , identifier[subsystem] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[deploymentsReg] operator[!=] Other[null] operator[SEP] { identifier[deploymentsReg] operator[SEP] identifier[unregisterSubModel] operator[SEP] identifier[PathElement] operator[SEP] identifier[pathElement] operator[SEP] identifier[ModelDescriptionConstants] operator[SEP] identifier[SUBSYSTEM] , identifier[subsystem] operator[SEP] operator[SEP] operator[SEP] identifier[deploymentsReg] operator[SEP] identifier[unregisterSubModel] operator[SEP] identifier[PathElement] operator[SEP] identifier[pathElement] operator[SEP] identifier[ModelDescriptionConstants] operator[SEP] identifier[SUBDEPLOYMENT] , identifier[subsystem] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[extension] operator[SEP] identifier[xmlMapper] operator[!=] Other[null] operator[SEP] { identifier[SubsystemInformationImpl] identifier[subsystemInformation] operator[=] identifier[SubsystemInformationImpl] operator[SEP] Keyword[class] operator[SEP] identifier[cast] operator[SEP] identifier[entry] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[String] identifier[namespace] operator[:] identifier[subsystemInformation] operator[SEP] identifier[getXMLNamespaces] operator[SEP] operator[SEP] operator[SEP] { identifier[extension] operator[SEP] identifier[xmlMapper] operator[SEP] identifier[unregisterRootElement] operator[SEP] Keyword[new] identifier[QName] operator[SEP] identifier[namespace] , identifier[SUBSYSTEM] operator[SEP] operator[SEP] operator[SEP] } } } } } }
@XmlElementDecl(namespace = "http://docs.oasis-open.org/ns/cmis/messaging/200908/", name = "addACEs", scope = CreateItem.class) public JAXBElement<CmisAccessControlListType> createCreateItemAddACEs( CmisAccessControlListType value) { return new JAXBElement<CmisAccessControlListType>( _CreateDocumentAddACEs_QNAME, CmisAccessControlListType.class, CreateItem.class, value); }
class class_name[name] begin[{] method[createCreateItemAddACEs, return_type[type[JAXBElement]], modifier[public], parameter[value]] begin[{] return[ClassCreator(arguments=[MemberReference(member=_CreateDocumentAddACEs_QNAME, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=CmisAccessControlListType, sub_type=None)), ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=CreateItem, sub_type=None)), 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=CmisAccessControlListType, 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[scope] operator[=] identifier[CreateItem] operator[SEP] Keyword[class] operator[SEP] Keyword[public] identifier[JAXBElement] operator[<] identifier[CmisAccessControlListType] operator[>] identifier[createCreateItemAddACEs] operator[SEP] identifier[CmisAccessControlListType] identifier[value] operator[SEP] { Keyword[return] Keyword[new] identifier[JAXBElement] operator[<] identifier[CmisAccessControlListType] operator[>] operator[SEP] identifier[_CreateDocumentAddACEs_QNAME] , identifier[CmisAccessControlListType] operator[SEP] Keyword[class] , identifier[CreateItem] operator[SEP] Keyword[class] , identifier[value] operator[SEP] operator[SEP] }
public static Manifest getManifest(Location jarLocation) throws IOException { URI uri = jarLocation.toURI(); // Small optimization if the location is local if ("file".equals(uri.getScheme())) { JarFile jarFile = new JarFile(new File(uri)); try { return jarFile.getManifest(); } finally { jarFile.close(); } } // Otherwise, need to search it with JarInputStream JarInputStream is = new JarInputStream(new BufferedInputStream(jarLocation.getInputStream())); try { // This only looks at the first entry, which if is created with jar util, then it'll be there. Manifest manifest = is.getManifest(); if (manifest != null) { return manifest; } // Otherwise, slow path. Need to goes through the entries JarEntry jarEntry = is.getNextJarEntry(); while (jarEntry != null) { if (JarFile.MANIFEST_NAME.equals(jarEntry.getName())) { return new Manifest(is); } jarEntry = is.getNextJarEntry(); } } finally { is.close(); } return null; }
class class_name[name] begin[{] method[getManifest, return_type[type[Manifest]], modifier[public static], parameter[jarLocation]] begin[{] local_variable[type[URI], uri] if[literal["file"]] begin[{] local_variable[type[JarFile], jarFile] TryStatement(block=[ReturnStatement(expression=MethodInvocation(arguments=[], member=getManifest, postfix_operators=[], prefix_operators=[], qualifier=jarFile, selectors=[], type_arguments=None), label=None)], catches=None, finally_block=[StatementExpression(expression=MethodInvocation(arguments=[], member=close, postfix_operators=[], prefix_operators=[], qualifier=jarFile, selectors=[], type_arguments=None), label=None)], label=None, resources=None) else begin[{] None end[}] local_variable[type[JarInputStream], is] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getManifest, postfix_operators=[], prefix_operators=[], qualifier=is, selectors=[], type_arguments=None), name=manifest)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Manifest, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=manifest, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=MemberReference(member=manifest, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getNextJarEntry, postfix_operators=[], prefix_operators=[], qualifier=is, selectors=[], type_arguments=None), name=jarEntry)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=JarEntry, sub_type=None)), WhileStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=jarEntry, selectors=[], type_arguments=None)], member=equals, postfix_operators=[], prefix_operators=[], qualifier=JarFile.MANIFEST_NAME, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=ClassCreator(arguments=[MemberReference(member=is, 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=Manifest, sub_type=None)), label=None)])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=jarEntry, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=getNextJarEntry, postfix_operators=[], prefix_operators=[], qualifier=is, selectors=[], type_arguments=None)), label=None)]), condition=BinaryOperation(operandl=MemberReference(member=jarEntry, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), label=None)], catches=None, finally_block=[StatementExpression(expression=MethodInvocation(arguments=[], member=close, postfix_operators=[], prefix_operators=[], qualifier=is, selectors=[], type_arguments=None), label=None)], label=None, resources=None) return[literal[null]] end[}] END[}]
Keyword[public] Keyword[static] identifier[Manifest] identifier[getManifest] operator[SEP] identifier[Location] identifier[jarLocation] operator[SEP] Keyword[throws] identifier[IOException] { identifier[URI] identifier[uri] operator[=] identifier[jarLocation] operator[SEP] identifier[toURI] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] literal[String] operator[SEP] identifier[equals] operator[SEP] identifier[uri] operator[SEP] identifier[getScheme] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { identifier[JarFile] identifier[jarFile] operator[=] Keyword[new] identifier[JarFile] operator[SEP] Keyword[new] identifier[File] operator[SEP] identifier[uri] operator[SEP] operator[SEP] operator[SEP] Keyword[try] { Keyword[return] identifier[jarFile] operator[SEP] identifier[getManifest] operator[SEP] operator[SEP] operator[SEP] } Keyword[finally] { identifier[jarFile] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP] } } identifier[JarInputStream] identifier[is] operator[=] Keyword[new] identifier[JarInputStream] operator[SEP] Keyword[new] identifier[BufferedInputStream] operator[SEP] identifier[jarLocation] operator[SEP] identifier[getInputStream] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[try] { identifier[Manifest] identifier[manifest] operator[=] identifier[is] operator[SEP] identifier[getManifest] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[manifest] operator[!=] Other[null] operator[SEP] { Keyword[return] identifier[manifest] operator[SEP] } identifier[JarEntry] identifier[jarEntry] operator[=] identifier[is] operator[SEP] identifier[getNextJarEntry] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[jarEntry] operator[!=] Other[null] operator[SEP] { Keyword[if] operator[SEP] identifier[JarFile] operator[SEP] identifier[MANIFEST_NAME] operator[SEP] identifier[equals] operator[SEP] identifier[jarEntry] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] Keyword[new] identifier[Manifest] operator[SEP] identifier[is] operator[SEP] operator[SEP] } identifier[jarEntry] operator[=] identifier[is] operator[SEP] identifier[getNextJarEntry] operator[SEP] operator[SEP] operator[SEP] } } Keyword[finally] { identifier[is] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] Other[null] operator[SEP] }
private void _initializeInbox() { synchronized (inboxControllerLock) { if (this.ctInboxController != null) { _notifyInboxInitialized(); return; } this.ctInboxController = new CTInboxController(getCleverTapID(), loadDBAdapter(context), haveVideoPlayerSupport); _notifyInboxInitialized(); } }
class class_name[name] begin[{] method[_initializeInbox, return_type[void], modifier[private], parameter[]] begin[{] SYNCHRONIZED[member[.inboxControllerLock]] BEGIN[{] if[binary_operation[THIS[member[None.ctInboxController]], !=, literal[null]]] begin[{] call[._notifyInboxInitialized, parameter[]] return[None] else begin[{] None end[}] assign[THIS[member[None.ctInboxController]], ClassCreator(arguments=[MethodInvocation(arguments=[], member=getCleverTapID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), MethodInvocation(arguments=[MemberReference(member=context, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=loadDBAdapter, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), MemberReference(member=haveVideoPlayerSupport, 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=CTInboxController, sub_type=None))] call[._notifyInboxInitialized, parameter[]] END[}] end[}] END[}]
Keyword[private] Keyword[void] identifier[_initializeInbox] operator[SEP] operator[SEP] { Keyword[synchronized] operator[SEP] identifier[inboxControllerLock] operator[SEP] { Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[ctInboxController] operator[!=] Other[null] operator[SEP] { identifier[_notifyInboxInitialized] operator[SEP] operator[SEP] operator[SEP] Keyword[return] operator[SEP] } Keyword[this] operator[SEP] identifier[ctInboxController] operator[=] Keyword[new] identifier[CTInboxController] operator[SEP] identifier[getCleverTapID] operator[SEP] operator[SEP] , identifier[loadDBAdapter] operator[SEP] identifier[context] operator[SEP] , identifier[haveVideoPlayerSupport] operator[SEP] operator[SEP] identifier[_notifyInboxInitialized] operator[SEP] operator[SEP] operator[SEP] } }
public EList<RuleElement> getElements() { if (elements == null) { elements = new EObjectContainmentEList<RuleElement>(RuleElement.class, this, SimpleAntlrPackage.GROUP__ELEMENTS); } return elements; }
class class_name[name] begin[{] method[getElements, return_type[type[EList]], modifier[public], parameter[]] begin[{] if[binary_operation[member[.elements], ==, literal[null]]] begin[{] assign[member[.elements], ClassCreator(arguments=[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=RuleElement, sub_type=None)), This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), MemberReference(member=GROUP__ELEMENTS, postfix_operators=[], prefix_operators=[], qualifier=SimpleAntlrPackage, 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=RuleElement, sub_type=None))], dimensions=None, name=EObjectContainmentEList, sub_type=None))] else begin[{] None end[}] return[member[.elements]] end[}] END[}]
Keyword[public] identifier[EList] operator[<] identifier[RuleElement] operator[>] identifier[getElements] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[elements] operator[==] Other[null] operator[SEP] { identifier[elements] operator[=] Keyword[new] identifier[EObjectContainmentEList] operator[<] identifier[RuleElement] operator[>] operator[SEP] identifier[RuleElement] operator[SEP] Keyword[class] , Keyword[this] , identifier[SimpleAntlrPackage] operator[SEP] identifier[GROUP__ELEMENTS] operator[SEP] operator[SEP] } Keyword[return] identifier[elements] operator[SEP] }
public Object addFeatureToCollection(Object featureCollection, Object feature) { features.add(featureCount++, feature); return featureCollection; }
class class_name[name] begin[{] method[addFeatureToCollection, return_type[type[Object]], modifier[public], parameter[featureCollection, feature]] begin[{] call[features.add, parameter[member[.featureCount], member[.feature]]] return[member[.featureCollection]] end[}] END[}]
Keyword[public] identifier[Object] identifier[addFeatureToCollection] operator[SEP] identifier[Object] identifier[featureCollection] , identifier[Object] identifier[feature] operator[SEP] { identifier[features] operator[SEP] identifier[add] operator[SEP] identifier[featureCount] operator[++] , identifier[feature] operator[SEP] operator[SEP] Keyword[return] identifier[featureCollection] operator[SEP] }
public ISarlClassBuilder addSarlClass(String name) { ISarlClassBuilder builder = this.iSarlClassBuilderProvider.get(); builder.eInit(getSarlBehavior(), name, getTypeResolutionContext()); return builder; }
class class_name[name] begin[{] method[addSarlClass, return_type[type[ISarlClassBuilder]], modifier[public], parameter[name]] begin[{] local_variable[type[ISarlClassBuilder], builder] call[builder.eInit, parameter[call[.getSarlBehavior, parameter[]], member[.name], call[.getTypeResolutionContext, parameter[]]]] return[member[.builder]] end[}] END[}]
Keyword[public] identifier[ISarlClassBuilder] identifier[addSarlClass] operator[SEP] identifier[String] identifier[name] operator[SEP] { identifier[ISarlClassBuilder] identifier[builder] operator[=] Keyword[this] operator[SEP] identifier[iSarlClassBuilderProvider] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[builder] operator[SEP] identifier[eInit] operator[SEP] identifier[getSarlBehavior] operator[SEP] operator[SEP] , identifier[name] , identifier[getTypeResolutionContext] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[builder] operator[SEP] }
public static <A extends Comparable<A>> Restriction lessThan(String property, A value) { return new LessThan(property, value); }
class class_name[name] begin[{] method[lessThan, return_type[type[Restriction]], modifier[public static], parameter[property, value]] begin[{] return[ClassCreator(arguments=[MemberReference(member=property, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), 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=None, dimensions=None, name=LessThan, sub_type=None))] end[}] END[}]
Keyword[public] Keyword[static] operator[<] identifier[A] Keyword[extends] identifier[Comparable] operator[<] identifier[A] operator[>] operator[>] identifier[Restriction] identifier[lessThan] operator[SEP] identifier[String] identifier[property] , identifier[A] identifier[value] operator[SEP] { Keyword[return] Keyword[new] identifier[LessThan] operator[SEP] identifier[property] , identifier[value] operator[SEP] operator[SEP] }
protected final Lifecycle getLifecycleSkill() { if (this.skillBufferLifecycle == null || this.skillBufferLifecycle.get() == null) { this.skillBufferLifecycle = $getSkill(Lifecycle.class); } return $castSkill(Lifecycle.class, this.skillBufferLifecycle); }
class class_name[name] begin[{] method[getLifecycleSkill, return_type[type[Lifecycle]], modifier[final protected], parameter[]] begin[{] if[binary_operation[binary_operation[THIS[member[None.skillBufferLifecycle]], ==, literal[null]], ||, binary_operation[THIS[member[None.skillBufferLifecycle]call[None.get, parameter[]]], ==, literal[null]]]] begin[{] assign[THIS[member[None.skillBufferLifecycle]], call[.$getSkill, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Lifecycle, sub_type=None))]]] else begin[{] None end[}] return[call[.$castSkill, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Lifecycle, sub_type=None)), THIS[member[None.skillBufferLifecycle]]]]] end[}] END[}]
Keyword[protected] Keyword[final] identifier[Lifecycle] identifier[getLifecycleSkill] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[skillBufferLifecycle] operator[==] Other[null] operator[||] Keyword[this] operator[SEP] identifier[skillBufferLifecycle] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[==] Other[null] operator[SEP] { Keyword[this] operator[SEP] identifier[skillBufferLifecycle] operator[=] identifier[$getSkill] operator[SEP] identifier[Lifecycle] operator[SEP] Keyword[class] operator[SEP] operator[SEP] } Keyword[return] identifier[$castSkill] operator[SEP] identifier[Lifecycle] operator[SEP] Keyword[class] , Keyword[this] operator[SEP] identifier[skillBufferLifecycle] operator[SEP] operator[SEP] }
public static void printSizes(Component c) { System.out.println("minimumSize = " + c.getMinimumSize()); System.out.println("preferredSize = " + c.getPreferredSize()); System.out.println("maximumSize = " + c.getMaximumSize()); }
class class_name[name] begin[{] method[printSizes, return_type[void], modifier[public static], parameter[c]] begin[{] call[System.out.println, parameter[binary_operation[literal["minimumSize = "], +, call[c.getMinimumSize, parameter[]]]]] call[System.out.println, parameter[binary_operation[literal["preferredSize = "], +, call[c.getPreferredSize, parameter[]]]]] call[System.out.println, parameter[binary_operation[literal["maximumSize = "], +, call[c.getMaximumSize, parameter[]]]]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[printSizes] operator[SEP] identifier[Component] identifier[c] operator[SEP] { identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[println] operator[SEP] literal[String] operator[+] identifier[c] operator[SEP] identifier[getMinimumSize] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[println] operator[SEP] literal[String] operator[+] identifier[c] operator[SEP] identifier[getPreferredSize] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[println] operator[SEP] literal[String] operator[+] identifier[c] operator[SEP] identifier[getMaximumSize] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
protected void peerUpdatedLock (String nodeName, NodeObject.Lock lock) { // notify the handler, if any LockHandler handler = _locks.get(lock); if (handler != null) { handler.peerUpdatedLock(nodeName); } }
class class_name[name] begin[{] method[peerUpdatedLock, return_type[void], modifier[protected], parameter[nodeName, lock]] begin[{] local_variable[type[LockHandler], handler] if[binary_operation[member[.handler], !=, literal[null]]] begin[{] call[handler.peerUpdatedLock, parameter[member[.nodeName]]] else begin[{] None end[}] end[}] END[}]
Keyword[protected] Keyword[void] identifier[peerUpdatedLock] operator[SEP] identifier[String] identifier[nodeName] , identifier[NodeObject] operator[SEP] identifier[Lock] identifier[lock] operator[SEP] { identifier[LockHandler] identifier[handler] operator[=] identifier[_locks] operator[SEP] identifier[get] operator[SEP] identifier[lock] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[handler] operator[!=] Other[null] operator[SEP] { identifier[handler] operator[SEP] identifier[peerUpdatedLock] operator[SEP] identifier[nodeName] operator[SEP] operator[SEP] } }
private static boolean nodeHasAncestor(Node node, Node possibleAncestor) { // Note node is not in node.getAncestors() for (Node ancestor : node.getAncestors()) { if (ancestor == possibleAncestor) { return true; } } return false; }
class class_name[name] begin[{] method[nodeHasAncestor, return_type[type[boolean]], modifier[private static], parameter[node, possibleAncestor]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=ancestor, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=possibleAncestor, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getAncestors, postfix_operators=[], prefix_operators=[], qualifier=node, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=ancestor)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Node, sub_type=None))), label=None) return[literal[false]] end[}] END[}]
Keyword[private] Keyword[static] Keyword[boolean] identifier[nodeHasAncestor] operator[SEP] identifier[Node] identifier[node] , identifier[Node] identifier[possibleAncestor] operator[SEP] { Keyword[for] operator[SEP] identifier[Node] identifier[ancestor] operator[:] identifier[node] operator[SEP] identifier[getAncestors] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[ancestor] operator[==] identifier[possibleAncestor] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } } Keyword[return] literal[boolean] operator[SEP] }
public static <T1, T2, T3, T4, T5> Func5<T1, T2, T3, T4, T5, Void> toFunc( final Action5<T1, T2, T3, T4, T5> action) { return toFunc(action, (Void) null); }
class class_name[name] begin[{] method[toFunc, return_type[type[Func5]], modifier[public static], parameter[action]] begin[{] return[call[.toFunc, parameter[member[.action], Cast(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), type=ReferenceType(arguments=None, dimensions=[], name=Void, sub_type=None))]]] end[}] END[}]
Keyword[public] Keyword[static] operator[<] identifier[T1] , identifier[T2] , identifier[T3] , identifier[T4] , identifier[T5] operator[>] identifier[Func5] operator[<] identifier[T1] , identifier[T2] , identifier[T3] , identifier[T4] , identifier[T5] , identifier[Void] operator[>] identifier[toFunc] operator[SEP] Keyword[final] identifier[Action5] operator[<] identifier[T1] , identifier[T2] , identifier[T3] , identifier[T4] , identifier[T5] operator[>] identifier[action] operator[SEP] { Keyword[return] identifier[toFunc] operator[SEP] identifier[action] , operator[SEP] identifier[Void] operator[SEP] Other[null] operator[SEP] operator[SEP] }
public ImageRegionCreateSummary createImageRegions(UUID projectId, CreateImageRegionsOptionalParameter createImageRegionsOptionalParameter) { return createImageRegionsWithServiceResponseAsync(projectId, createImageRegionsOptionalParameter).toBlocking().single().body(); }
class class_name[name] begin[{] method[createImageRegions, return_type[type[ImageRegionCreateSummary]], modifier[public], parameter[projectId, createImageRegionsOptionalParameter]] begin[{] return[call[.createImageRegionsWithServiceResponseAsync, parameter[member[.projectId], member[.createImageRegionsOptionalParameter]]]] end[}] END[}]
Keyword[public] identifier[ImageRegionCreateSummary] identifier[createImageRegions] operator[SEP] identifier[UUID] identifier[projectId] , identifier[CreateImageRegionsOptionalParameter] identifier[createImageRegionsOptionalParameter] operator[SEP] { Keyword[return] identifier[createImageRegionsWithServiceResponseAsync] operator[SEP] identifier[projectId] , identifier[createImageRegionsOptionalParameter] operator[SEP] operator[SEP] identifier[toBlocking] operator[SEP] operator[SEP] operator[SEP] identifier[single] operator[SEP] operator[SEP] operator[SEP] identifier[body] operator[SEP] operator[SEP] operator[SEP] }
@Pure public static boolean intersectsTriangleSegment( double tx1, double ty1, double tz1, double tx2, double ty2, double tz2, double tx3, double ty3, double tz3, double sx1, double sy1, double sz1, double sx2, double sy2, double sz2) { double factor = getTriangleSegmentIntersectionFactorWithJimenezAlgorithm( tx1, ty1, tz1, tx2, ty2, tz2, tx3, ty3, tz3, sx1, sy1, sz1, sx2, sy2, sz2); return !Double.isNaN(factor); }
class class_name[name] begin[{] method[intersectsTriangleSegment, return_type[type[boolean]], modifier[public static], parameter[tx1, ty1, tz1, tx2, ty2, tz2, tx3, ty3, tz3, sx1, sy1, sz1, sx2, sy2, sz2]] begin[{] local_variable[type[double], factor] return[call[Double.isNaN, parameter[member[.factor]]]] end[}] END[}]
annotation[@] identifier[Pure] Keyword[public] Keyword[static] Keyword[boolean] identifier[intersectsTriangleSegment] operator[SEP] Keyword[double] identifier[tx1] , Keyword[double] identifier[ty1] , Keyword[double] identifier[tz1] , Keyword[double] identifier[tx2] , Keyword[double] identifier[ty2] , Keyword[double] identifier[tz2] , Keyword[double] identifier[tx3] , Keyword[double] identifier[ty3] , Keyword[double] identifier[tz3] , Keyword[double] identifier[sx1] , Keyword[double] identifier[sy1] , Keyword[double] identifier[sz1] , Keyword[double] identifier[sx2] , Keyword[double] identifier[sy2] , Keyword[double] identifier[sz2] operator[SEP] { Keyword[double] identifier[factor] operator[=] identifier[getTriangleSegmentIntersectionFactorWithJimenezAlgorithm] operator[SEP] identifier[tx1] , identifier[ty1] , identifier[tz1] , identifier[tx2] , identifier[ty2] , identifier[tz2] , identifier[tx3] , identifier[ty3] , identifier[tz3] , identifier[sx1] , identifier[sy1] , identifier[sz1] , identifier[sx2] , identifier[sy2] , identifier[sz2] operator[SEP] operator[SEP] Keyword[return] operator[!] identifier[Double] operator[SEP] identifier[isNaN] operator[SEP] identifier[factor] operator[SEP] operator[SEP] }
public String getDisplayName(Locale locale) { Stem stem = this.getStem(); Branch branch = this.getBranch(); String sep = LANGS_WITHOUT_SEP.contains(locale.getLanguage()) ? "" : "-"; return stem.getDisplayName(locale) + sep + branch.getDisplayName(locale); }
class class_name[name] begin[{] method[getDisplayName, return_type[type[String]], modifier[public], parameter[locale]] begin[{] local_variable[type[Stem], stem] local_variable[type[Branch], branch] local_variable[type[String], sep] return[binary_operation[binary_operation[call[stem.getDisplayName, parameter[member[.locale]]], +, member[.sep]], +, call[branch.getDisplayName, parameter[member[.locale]]]]] end[}] END[}]
Keyword[public] identifier[String] identifier[getDisplayName] operator[SEP] identifier[Locale] identifier[locale] operator[SEP] { identifier[Stem] identifier[stem] operator[=] Keyword[this] operator[SEP] identifier[getStem] operator[SEP] operator[SEP] operator[SEP] identifier[Branch] identifier[branch] operator[=] Keyword[this] operator[SEP] identifier[getBranch] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[sep] operator[=] identifier[LANGS_WITHOUT_SEP] operator[SEP] identifier[contains] operator[SEP] identifier[locale] operator[SEP] identifier[getLanguage] operator[SEP] operator[SEP] operator[SEP] operator[?] literal[String] operator[:] literal[String] operator[SEP] Keyword[return] identifier[stem] operator[SEP] identifier[getDisplayName] operator[SEP] identifier[locale] operator[SEP] operator[+] identifier[sep] operator[+] identifier[branch] operator[SEP] identifier[getDisplayName] operator[SEP] identifier[locale] operator[SEP] operator[SEP] }
public String getMessage () { String message = super.getMessage(); if (message == null && exception != null) { return exception.getMessage(); } else { return message; } }
class class_name[name] begin[{] method[getMessage, return_type[type[String]], modifier[public], parameter[]] begin[{] local_variable[type[String], message] if[binary_operation[binary_operation[member[.message], ==, literal[null]], &&, binary_operation[member[.exception], !=, literal[null]]]] begin[{] return[call[exception.getMessage, parameter[]]] else begin[{] return[member[.message]] end[}] end[}] END[}]
Keyword[public] identifier[String] identifier[getMessage] operator[SEP] operator[SEP] { identifier[String] identifier[message] operator[=] Keyword[super] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[message] operator[==] Other[null] operator[&&] identifier[exception] operator[!=] Other[null] operator[SEP] { Keyword[return] identifier[exception] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { Keyword[return] identifier[message] operator[SEP] } }
@SuppressWarnings({"rawtypes", "unchecked"}) private static Object mergeObj(Object[] objs) { List list = new ArrayList(); for (Object obj : objs) { if (list.contains(obj)) { continue; } list.add(obj); } return list; }
class class_name[name] begin[{] method[mergeObj, return_type[type[Object]], modifier[private static], parameter[objs]] begin[{] local_variable[type[List], list] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=obj, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=contains, postfix_operators=[], prefix_operators=[], qualifier=list, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ContinueStatement(goto=None, label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=obj, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=list, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=objs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=obj)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))), label=None) return[member[.list]] end[}] END[}]
annotation[@] identifier[SuppressWarnings] operator[SEP] { literal[String] , literal[String] } operator[SEP] Keyword[private] Keyword[static] identifier[Object] identifier[mergeObj] operator[SEP] identifier[Object] operator[SEP] operator[SEP] identifier[objs] operator[SEP] { identifier[List] identifier[list] operator[=] Keyword[new] identifier[ArrayList] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Object] identifier[obj] operator[:] identifier[objs] operator[SEP] { Keyword[if] operator[SEP] identifier[list] operator[SEP] identifier[contains] operator[SEP] identifier[obj] operator[SEP] operator[SEP] { Keyword[continue] operator[SEP] } identifier[list] operator[SEP] identifier[add] operator[SEP] identifier[obj] operator[SEP] operator[SEP] } Keyword[return] identifier[list] operator[SEP] }
@Override public void resetFixedValues() { fixedValues.clear(); for (DataSet ds : getCurrentDataSets().values()) { ds.resetFixedValues(); } }
class class_name[name] begin[{] method[resetFixedValues, return_type[void], modifier[public], parameter[]] begin[{] call[fixedValues.clear, parameter[]] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=resetFixedValues, postfix_operators=[], prefix_operators=[], qualifier=ds, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getCurrentDataSets, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[], member=values, 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=ds)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=DataSet, sub_type=None))), label=None) end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[resetFixedValues] operator[SEP] operator[SEP] { identifier[fixedValues] operator[SEP] identifier[clear] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[DataSet] identifier[ds] operator[:] identifier[getCurrentDataSets] operator[SEP] operator[SEP] operator[SEP] identifier[values] operator[SEP] operator[SEP] operator[SEP] { identifier[ds] operator[SEP] identifier[resetFixedValues] operator[SEP] operator[SEP] operator[SEP] } }
public static RAExpression joinOn(RAExpression re1, RAExpression re2, java.util.function.Function<ImmutableMap<QualifiedAttributeID, Term>, ImmutableList<Function>> getAtomOnExpression, TermFactory termFactory) throws IllegalJoinException { RAExpressionAttributes attributes = RAExpressionAttributes.crossJoin(re1.attributes, re2.attributes); return new RAExpression(union(re1.dataAtoms, re2.dataAtoms), union(re1.filterAtoms, re2.filterAtoms, getAtomOnExpression.apply(attributes.getAttributes())), attributes, termFactory); }
class class_name[name] begin[{] method[joinOn, return_type[type[RAExpression]], modifier[public static], parameter[re1, re2, getAtomOnExpression, termFactory]] begin[{] local_variable[type[RAExpressionAttributes], attributes] return[ClassCreator(arguments=[MethodInvocation(arguments=[MemberReference(member=dataAtoms, postfix_operators=[], prefix_operators=[], qualifier=re1, selectors=[]), MemberReference(member=dataAtoms, postfix_operators=[], prefix_operators=[], qualifier=re2, selectors=[])], member=union, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), MethodInvocation(arguments=[MemberReference(member=filterAtoms, postfix_operators=[], prefix_operators=[], qualifier=re1, selectors=[]), MemberReference(member=filterAtoms, postfix_operators=[], prefix_operators=[], qualifier=re2, selectors=[]), MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getAttributes, postfix_operators=[], prefix_operators=[], qualifier=attributes, selectors=[], type_arguments=None)], member=apply, postfix_operators=[], prefix_operators=[], qualifier=getAtomOnExpression, selectors=[], type_arguments=None)], member=union, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), MemberReference(member=attributes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=termFactory, 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=RAExpression, sub_type=None))] end[}] END[}]
Keyword[public] Keyword[static] identifier[RAExpression] identifier[joinOn] operator[SEP] identifier[RAExpression] identifier[re1] , identifier[RAExpression] identifier[re2] , identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[function] operator[SEP] identifier[Function] operator[<] identifier[ImmutableMap] operator[<] identifier[QualifiedAttributeID] , identifier[Term] operator[>] , identifier[ImmutableList] operator[<] identifier[Function] operator[>] operator[>] identifier[getAtomOnExpression] , identifier[TermFactory] identifier[termFactory] operator[SEP] Keyword[throws] identifier[IllegalJoinException] { identifier[RAExpressionAttributes] identifier[attributes] operator[=] identifier[RAExpressionAttributes] operator[SEP] identifier[crossJoin] operator[SEP] identifier[re1] operator[SEP] identifier[attributes] , identifier[re2] operator[SEP] identifier[attributes] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[RAExpression] operator[SEP] identifier[union] operator[SEP] identifier[re1] operator[SEP] identifier[dataAtoms] , identifier[re2] operator[SEP] identifier[dataAtoms] operator[SEP] , identifier[union] operator[SEP] identifier[re1] operator[SEP] identifier[filterAtoms] , identifier[re2] operator[SEP] identifier[filterAtoms] , identifier[getAtomOnExpression] operator[SEP] identifier[apply] operator[SEP] identifier[attributes] operator[SEP] identifier[getAttributes] operator[SEP] operator[SEP] operator[SEP] operator[SEP] , identifier[attributes] , identifier[termFactory] operator[SEP] operator[SEP] }
@Override public boolean eIsSet(int featureID) { switch (featureID) { case AfplibPackage.SBI__INCRMENT: return INCRMENT_EDEFAULT == null ? incrment != null : !INCRMENT_EDEFAULT.equals(incrment); } return super.eIsSet(featureID); }
class class_name[name] begin[{] method[eIsSet, return_type[type[boolean]], modifier[public], parameter[featureID]] begin[{] SwitchStatement(cases=[SwitchStatementCase(case=[MemberReference(member=SBI__INCRMENT, postfix_operators=[], prefix_operators=[], qualifier=AfplibPackage, selectors=[])], statements=[ReturnStatement(expression=TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=INCRMENT_EDEFAULT, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), if_false=MethodInvocation(arguments=[MemberReference(member=incrment, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equals, postfix_operators=[], prefix_operators=['!'], qualifier=INCRMENT_EDEFAULT, selectors=[], type_arguments=None), if_true=BinaryOperation(operandl=MemberReference(member=incrment, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=)), label=None)])], expression=MemberReference(member=featureID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None) return[SuperMethodInvocation(arguments=[MemberReference(member=featureID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=eIsSet, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None)] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[boolean] identifier[eIsSet] operator[SEP] Keyword[int] identifier[featureID] operator[SEP] { Keyword[switch] operator[SEP] identifier[featureID] operator[SEP] { Keyword[case] identifier[AfplibPackage] operator[SEP] identifier[SBI__INCRMENT] operator[:] Keyword[return] identifier[INCRMENT_EDEFAULT] operator[==] Other[null] operator[?] identifier[incrment] operator[!=] Other[null] operator[:] operator[!] identifier[INCRMENT_EDEFAULT] operator[SEP] identifier[equals] operator[SEP] identifier[incrment] operator[SEP] operator[SEP] } Keyword[return] Keyword[super] operator[SEP] identifier[eIsSet] operator[SEP] identifier[featureID] operator[SEP] operator[SEP] }
public void setMinDateLastModified(String minDateLastModified) { if ((CmsStringUtil.isNotEmptyOrWhitespaceOnly(minDateLastModified)) && (!minDateLastModified.equals("0"))) { m_searchParams.setMinDateLastModified(Long.parseLong(minDateLastModified)); } else { m_searchParams.setMinDateLastModified(Long.MIN_VALUE); } }
class class_name[name] begin[{] method[setMinDateLastModified, return_type[void], modifier[public], parameter[minDateLastModified]] begin[{] if[binary_operation[call[CmsStringUtil.isNotEmptyOrWhitespaceOnly, parameter[member[.minDateLastModified]]], &&, call[minDateLastModified.equals, parameter[literal["0"]]]]] begin[{] call[m_searchParams.setMinDateLastModified, parameter[call[Long.parseLong, parameter[member[.minDateLastModified]]]]] else begin[{] call[m_searchParams.setMinDateLastModified, parameter[member[Long.MIN_VALUE]]] end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[setMinDateLastModified] operator[SEP] identifier[String] identifier[minDateLastModified] operator[SEP] { Keyword[if] operator[SEP] operator[SEP] identifier[CmsStringUtil] operator[SEP] identifier[isNotEmptyOrWhitespaceOnly] operator[SEP] identifier[minDateLastModified] operator[SEP] operator[SEP] operator[&&] operator[SEP] operator[!] identifier[minDateLastModified] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] { identifier[m_searchParams] operator[SEP] identifier[setMinDateLastModified] operator[SEP] identifier[Long] operator[SEP] identifier[parseLong] operator[SEP] identifier[minDateLastModified] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[m_searchParams] operator[SEP] identifier[setMinDateLastModified] operator[SEP] identifier[Long] operator[SEP] identifier[MIN_VALUE] operator[SEP] operator[SEP] } }
@SuppressWarnings("NullAway") protected final @NonNull <T> T copyOf(@Nullable T object) { if (object == null) { return null; } T copy = copier.copy(object, cacheManager.getClassLoader()); return requireNonNull(copy); }
class class_name[name] begin[{] method[copyOf, return_type[type[T]], modifier[final protected], parameter[object]] begin[{] if[binary_operation[member[.object], ==, literal[null]]] begin[{] return[literal[null]] else begin[{] None end[}] local_variable[type[T], copy] return[call[.requireNonNull, parameter[member[.copy]]]] end[}] END[}]
annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] Keyword[protected] Keyword[final] annotation[@] identifier[NonNull] operator[<] identifier[T] operator[>] identifier[T] identifier[copyOf] operator[SEP] annotation[@] identifier[Nullable] identifier[T] identifier[object] operator[SEP] { Keyword[if] operator[SEP] identifier[object] operator[==] Other[null] operator[SEP] { Keyword[return] Other[null] operator[SEP] } identifier[T] identifier[copy] operator[=] identifier[copier] operator[SEP] identifier[copy] operator[SEP] identifier[object] , identifier[cacheManager] operator[SEP] identifier[getClassLoader] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[requireNonNull] operator[SEP] identifier[copy] operator[SEP] operator[SEP] }
@SuppressWarnings("rawtypes") public static final SerIterator grid( final Grid<?> grid, final Class<?> declaredType, final Class<?> valueType, final List<Class<?>> valueTypeTypes) { return new SerIterator() { private final Iterator it = grid.cells().iterator(); private Grid.Cell current; @Override public String metaTypeName() { return "Grid"; } @Override public boolean metaTypeRequired() { return Grid.class.isAssignableFrom(declaredType) == false; } @Override public SerCategory category() { return SerCategory.GRID; } @Override public int dimensionSize(int dimension) { return (dimension == 0 ? grid.rowCount() : grid.columnCount()); } @Override public int size() { return grid.size(); } @Override public boolean hasNext() { return it.hasNext(); } @Override public void next() { current = (Grid.Cell) it.next(); } @Override public Class<?> keyType() { return Integer.class; } @Override public Object key() { return current.getRow(); } @Override public Class<?> columnType() { return Integer.class; } @Override public Object column() { return current.getColumn(); } @Override public Class<?> valueType() { return valueType; } @Override public Object value() { return current.getValue(); } @Override public Object value(int row, int column) { return grid.get(row, column); } @Override public List<Class<?>> valueTypeTypes() { return valueTypeTypes; } }; }
class class_name[name] begin[{] method[grid, return_type[type[SerIterator]], modifier[final public static], parameter[grid, declaredType, valueType, valueTypeTypes]] begin[{] return[ClassCreator(arguments=[], body=[FieldDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=cells, postfix_operators=[], prefix_operators=[], qualifier=grid, selectors=[MethodInvocation(arguments=[], member=iterator, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=it)], documentation=None, modifiers={'final', 'private'}, type=ReferenceType(arguments=None, dimensions=[], name=Iterator, sub_type=None)), FieldDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=None, name=current)], documentation=None, modifiers={'private'}, type=ReferenceType(arguments=None, dimensions=[], name=Grid, sub_type=ReferenceType(arguments=None, dimensions=None, name=Cell, sub_type=None))), MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Grid"), label=None)], documentation=None, modifiers={'public'}, name=metaTypeName, parameters=[], return_type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None), throws=None, type_parameters=None), MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[ReturnStatement(expression=BinaryOperation(operandl=ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[MemberReference(member=declaredType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isAssignableFrom, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=Grid, sub_type=None)), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), operator===), label=None)], documentation=None, modifiers={'public'}, name=metaTypeRequired, parameters=[], return_type=BasicType(dimensions=[], name=boolean), throws=None, type_parameters=None), MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[ReturnStatement(expression=MemberReference(member=GRID, postfix_operators=[], prefix_operators=[], qualifier=SerCategory, selectors=[]), label=None)], documentation=None, modifiers={'public'}, name=category, parameters=[], return_type=ReferenceType(arguments=None, dimensions=[], name=SerCategory, sub_type=None), throws=None, type_parameters=None), MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[ReturnStatement(expression=TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=dimension, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator===), if_false=MethodInvocation(arguments=[], member=columnCount, postfix_operators=[], prefix_operators=[], qualifier=grid, selectors=[], type_arguments=None), if_true=MethodInvocation(arguments=[], member=rowCount, postfix_operators=[], prefix_operators=[], qualifier=grid, selectors=[], type_arguments=None)), label=None)], documentation=None, modifiers={'public'}, name=dimensionSize, parameters=[FormalParameter(annotations=[], modifiers=set(), name=dimension, type=BasicType(dimensions=[], name=int), varargs=False)], return_type=BasicType(dimensions=[], name=int), throws=None, type_parameters=None), MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[ReturnStatement(expression=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=grid, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=size, parameters=[], return_type=BasicType(dimensions=[], name=int), throws=None, type_parameters=None), MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[ReturnStatement(expression=MethodInvocation(arguments=[], member=hasNext, postfix_operators=[], prefix_operators=[], qualifier=it, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=hasNext, parameters=[], return_type=BasicType(dimensions=[], name=boolean), throws=None, type_parameters=None), MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=current, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Cast(expression=MethodInvocation(arguments=[], member=next, postfix_operators=[], prefix_operators=[], qualifier=it, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=Grid, sub_type=ReferenceType(arguments=None, dimensions=None, name=Cell, sub_type=None)))), label=None)], documentation=None, modifiers={'public'}, name=next, parameters=[], return_type=None, throws=None, type_parameters=None), MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[ReturnStatement(expression=ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Integer, sub_type=None)), label=None)], documentation=None, modifiers={'public'}, name=keyType, parameters=[], return_type=ReferenceType(arguments=[TypeArgument(pattern_type=?, type=None)], dimensions=[], name=Class, sub_type=None), throws=None, type_parameters=None), MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[ReturnStatement(expression=MethodInvocation(arguments=[], member=getRow, postfix_operators=[], prefix_operators=[], qualifier=current, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=key, parameters=[], return_type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None), throws=None, type_parameters=None), MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[ReturnStatement(expression=ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Integer, sub_type=None)), label=None)], documentation=None, modifiers={'public'}, name=columnType, parameters=[], return_type=ReferenceType(arguments=[TypeArgument(pattern_type=?, type=None)], dimensions=[], name=Class, sub_type=None), throws=None, type_parameters=None), MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[ReturnStatement(expression=MethodInvocation(arguments=[], member=getColumn, postfix_operators=[], prefix_operators=[], qualifier=current, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=column, parameters=[], return_type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None), throws=None, type_parameters=None), MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[ReturnStatement(expression=MemberReference(member=valueType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], documentation=None, modifiers={'public'}, name=valueType, parameters=[], return_type=ReferenceType(arguments=[TypeArgument(pattern_type=?, type=None)], dimensions=[], name=Class, sub_type=None), throws=None, type_parameters=None), MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[ReturnStatement(expression=MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=current, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=value, parameters=[], return_type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None), throws=None, type_parameters=None), MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=row, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=column, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=grid, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=value, parameters=[FormalParameter(annotations=[], modifiers=set(), name=row, type=BasicType(dimensions=[], name=int), varargs=False), FormalParameter(annotations=[], modifiers=set(), name=column, type=BasicType(dimensions=[], name=int), varargs=False)], return_type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None), throws=None, type_parameters=None), MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[ReturnStatement(expression=MemberReference(member=valueTypeTypes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], documentation=None, modifiers={'public'}, name=valueTypeTypes, parameters=[], return_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=[TypeArgument(pattern_type=?, type=None)], dimensions=[], name=Class, sub_type=None))], dimensions=[], name=List, sub_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=SerIterator, sub_type=None))] end[}] END[}]
annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] Keyword[public] Keyword[static] Keyword[final] identifier[SerIterator] identifier[grid] operator[SEP] Keyword[final] identifier[Grid] operator[<] operator[?] operator[>] identifier[grid] , Keyword[final] identifier[Class] operator[<] operator[?] operator[>] identifier[declaredType] , Keyword[final] identifier[Class] operator[<] operator[?] operator[>] identifier[valueType] , Keyword[final] identifier[List] operator[<] identifier[Class] operator[<] operator[?] operator[>] operator[>] identifier[valueTypeTypes] operator[SEP] { Keyword[return] Keyword[new] identifier[SerIterator] operator[SEP] operator[SEP] { Keyword[private] Keyword[final] identifier[Iterator] identifier[it] operator[=] identifier[grid] operator[SEP] identifier[cells] operator[SEP] operator[SEP] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] Keyword[private] identifier[Grid] operator[SEP] identifier[Cell] identifier[current] operator[SEP] annotation[@] identifier[Override] Keyword[public] identifier[String] identifier[metaTypeName] operator[SEP] operator[SEP] { Keyword[return] literal[String] operator[SEP] } annotation[@] identifier[Override] Keyword[public] Keyword[boolean] identifier[metaTypeRequired] operator[SEP] operator[SEP] { Keyword[return] identifier[Grid] operator[SEP] Keyword[class] operator[SEP] identifier[isAssignableFrom] operator[SEP] identifier[declaredType] operator[SEP] operator[==] literal[boolean] operator[SEP] } annotation[@] identifier[Override] Keyword[public] identifier[SerCategory] identifier[category] operator[SEP] operator[SEP] { Keyword[return] identifier[SerCategory] operator[SEP] identifier[GRID] operator[SEP] } annotation[@] identifier[Override] Keyword[public] Keyword[int] identifier[dimensionSize] operator[SEP] Keyword[int] identifier[dimension] operator[SEP] { Keyword[return] operator[SEP] identifier[dimension] operator[==] Other[0] operator[?] identifier[grid] operator[SEP] identifier[rowCount] operator[SEP] operator[SEP] operator[:] identifier[grid] operator[SEP] identifier[columnCount] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } annotation[@] identifier[Override] Keyword[public] Keyword[int] identifier[size] operator[SEP] operator[SEP] { Keyword[return] identifier[grid] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] } annotation[@] identifier[Override] Keyword[public] Keyword[boolean] identifier[hasNext] operator[SEP] operator[SEP] { Keyword[return] identifier[it] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] } annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[next] operator[SEP] operator[SEP] { identifier[current] operator[=] operator[SEP] identifier[Grid] operator[SEP] identifier[Cell] operator[SEP] identifier[it] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] } annotation[@] identifier[Override] Keyword[public] identifier[Class] operator[<] operator[?] operator[>] identifier[keyType] operator[SEP] operator[SEP] { Keyword[return] identifier[Integer] operator[SEP] Keyword[class] operator[SEP] } annotation[@] identifier[Override] Keyword[public] identifier[Object] identifier[key] operator[SEP] operator[SEP] { Keyword[return] identifier[current] operator[SEP] identifier[getRow] operator[SEP] operator[SEP] operator[SEP] } annotation[@] identifier[Override] Keyword[public] identifier[Class] operator[<] operator[?] operator[>] identifier[columnType] operator[SEP] operator[SEP] { Keyword[return] identifier[Integer] operator[SEP] Keyword[class] operator[SEP] } annotation[@] identifier[Override] Keyword[public] identifier[Object] identifier[column] operator[SEP] operator[SEP] { Keyword[return] identifier[current] operator[SEP] identifier[getColumn] operator[SEP] operator[SEP] operator[SEP] } annotation[@] identifier[Override] Keyword[public] identifier[Class] operator[<] operator[?] operator[>] identifier[valueType] operator[SEP] operator[SEP] { Keyword[return] identifier[valueType] operator[SEP] } annotation[@] identifier[Override] Keyword[public] identifier[Object] identifier[value] operator[SEP] operator[SEP] { Keyword[return] identifier[current] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] } annotation[@] identifier[Override] Keyword[public] identifier[Object] identifier[value] operator[SEP] Keyword[int] identifier[row] , Keyword[int] identifier[column] operator[SEP] { Keyword[return] identifier[grid] operator[SEP] identifier[get] operator[SEP] identifier[row] , identifier[column] operator[SEP] operator[SEP] } annotation[@] identifier[Override] Keyword[public] identifier[List] operator[<] identifier[Class] operator[<] operator[?] operator[>] operator[>] identifier[valueTypeTypes] operator[SEP] operator[SEP] { Keyword[return] identifier[valueTypeTypes] operator[SEP] } } operator[SEP] }
static Map<String, Object> digitsPayload(final Object i, final Object f) { if (i == null || f == null) { return null; } Map<String, Object> payload = new LinkedHashMap<>(); payload.put("integer", i); payload.put("fraction", f); payload.put("message", MSG_PREFIX + VALIDATORS.get(Digits.class)); return payload; }
class class_name[name] begin[{] method[digitsPayload, return_type[type[Map]], modifier[static], parameter[i, f]] begin[{] if[binary_operation[binary_operation[member[.i], ==, literal[null]], ||, binary_operation[member[.f], ==, literal[null]]]] begin[{] return[literal[null]] else begin[{] None end[}] local_variable[type[Map], payload] call[payload.put, parameter[literal["integer"], member[.i]]] call[payload.put, parameter[literal["fraction"], member[.f]]] call[payload.put, parameter[literal["message"], binary_operation[member[.MSG_PREFIX], +, call[VALIDATORS.get, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Digits, sub_type=None))]]]]] return[member[.payload]] end[}] END[}]
Keyword[static] identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] identifier[digitsPayload] operator[SEP] Keyword[final] identifier[Object] identifier[i] , Keyword[final] identifier[Object] identifier[f] operator[SEP] { Keyword[if] operator[SEP] identifier[i] operator[==] Other[null] operator[||] identifier[f] operator[==] Other[null] operator[SEP] { Keyword[return] Other[null] operator[SEP] } identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] identifier[payload] operator[=] Keyword[new] identifier[LinkedHashMap] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[payload] operator[SEP] identifier[put] operator[SEP] literal[String] , identifier[i] operator[SEP] operator[SEP] identifier[payload] operator[SEP] identifier[put] operator[SEP] literal[String] , identifier[f] operator[SEP] operator[SEP] identifier[payload] operator[SEP] identifier[put] operator[SEP] literal[String] , identifier[MSG_PREFIX] operator[+] identifier[VALIDATORS] operator[SEP] identifier[get] operator[SEP] identifier[Digits] operator[SEP] Keyword[class] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[payload] operator[SEP] }
public String randomLowerMaxLength(int minLength, int maxLength) { int range = maxLength - minLength; int randomLength = 0; if (range > 0) { randomLength = random(range); } return randomLower(minLength + randomLength); }
class class_name[name] begin[{] method[randomLowerMaxLength, return_type[type[String]], modifier[public], parameter[minLength, maxLength]] begin[{] local_variable[type[int], range] local_variable[type[int], randomLength] if[binary_operation[member[.range], >, literal[0]]] begin[{] assign[member[.randomLength], call[.random, parameter[member[.range]]]] else begin[{] None end[}] return[call[.randomLower, parameter[binary_operation[member[.minLength], +, member[.randomLength]]]]] end[}] END[}]
Keyword[public] identifier[String] identifier[randomLowerMaxLength] operator[SEP] Keyword[int] identifier[minLength] , Keyword[int] identifier[maxLength] operator[SEP] { Keyword[int] identifier[range] operator[=] identifier[maxLength] operator[-] identifier[minLength] operator[SEP] Keyword[int] identifier[randomLength] operator[=] Other[0] operator[SEP] Keyword[if] operator[SEP] identifier[range] operator[>] Other[0] operator[SEP] { identifier[randomLength] operator[=] identifier[random] operator[SEP] identifier[range] operator[SEP] operator[SEP] } Keyword[return] identifier[randomLower] operator[SEP] identifier[minLength] operator[+] identifier[randomLength] operator[SEP] operator[SEP] }
public static double roundHalfUp(double d, int scale) { return BigDecimal.valueOf(d).setScale(scale, RoundingMode.HALF_UP).doubleValue(); }
class class_name[name] begin[{] method[roundHalfUp, return_type[type[double]], modifier[public static], parameter[d, scale]] begin[{] return[call[BigDecimal.valueOf, parameter[member[.d]]]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[double] identifier[roundHalfUp] operator[SEP] Keyword[double] identifier[d] , Keyword[int] identifier[scale] operator[SEP] { Keyword[return] identifier[BigDecimal] operator[SEP] identifier[valueOf] operator[SEP] identifier[d] operator[SEP] operator[SEP] identifier[setScale] operator[SEP] identifier[scale] , identifier[RoundingMode] operator[SEP] identifier[HALF_UP] operator[SEP] operator[SEP] identifier[doubleValue] operator[SEP] operator[SEP] operator[SEP] }
public void setTarget(String target) throws IllegalArgumentException { int major, minor; if (target == null || "1.0".equals(target) || "1.1".equals(target)) { major = 45; minor = 3; if (target == null) { target = "1.0"; } } else if ("1.2".equals(target)) { major = 46; minor = 0; } else if ("1.3".equals(target)) { major = 47; minor = 0; } else if ("1.4".equals(target)) { major = 48; minor = 0; } else if ("1.5".equals(target)) { major = 49; minor = 0; } else if ("1.6".equals(target)) { major = 50; minor = 0; } else if ("1.7".equals(target)) { major = 51; minor = 0; } else { throw new IllegalArgumentException ("Unsupported target version: " + target); } mVersion = (minor << 16) | (major & 0xffff); mTarget = target.intern(); }
class class_name[name] begin[{] method[setTarget, return_type[void], modifier[public], parameter[target]] begin[{] local_variable[type[int], major] if[binary_operation[binary_operation[binary_operation[member[.target], ==, literal[null]], ||, literal["1.0"]], ||, literal["1.1"]]] begin[{] assign[member[.major], literal[45]] assign[member[.minor], literal[3]] if[binary_operation[member[.target], ==, literal[null]]] begin[{] assign[member[.target], literal["1.0"]] else begin[{] None end[}] else begin[{] if[literal["1.2"]] begin[{] assign[member[.major], literal[46]] assign[member[.minor], literal[0]] else begin[{] if[literal["1.3"]] begin[{] assign[member[.major], literal[47]] assign[member[.minor], literal[0]] else begin[{] if[literal["1.4"]] begin[{] assign[member[.major], literal[48]] assign[member[.minor], literal[0]] else begin[{] if[literal["1.5"]] begin[{] assign[member[.major], literal[49]] assign[member[.minor], literal[0]] else begin[{] if[literal["1.6"]] begin[{] assign[member[.major], literal[50]] assign[member[.minor], literal[0]] else begin[{] if[literal["1.7"]] begin[{] assign[member[.major], literal[51]] assign[member[.minor], literal[0]] else begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unsupported target version: "), operandr=MemberReference(member=target, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None) end[}] end[}] end[}] end[}] end[}] end[}] end[}] assign[member[.mVersion], binary_operation[binary_operation[member[.minor], <<, literal[16]], |, binary_operation[member[.major], &, literal[0xffff]]]] assign[member[.mTarget], call[target.intern, parameter[]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[setTarget] operator[SEP] identifier[String] identifier[target] operator[SEP] Keyword[throws] identifier[IllegalArgumentException] { Keyword[int] identifier[major] , identifier[minor] operator[SEP] Keyword[if] operator[SEP] identifier[target] operator[==] Other[null] operator[||] literal[String] operator[SEP] identifier[equals] operator[SEP] identifier[target] operator[SEP] operator[||] literal[String] operator[SEP] identifier[equals] operator[SEP] identifier[target] operator[SEP] operator[SEP] { identifier[major] operator[=] Other[45] operator[SEP] identifier[minor] operator[=] Other[3] operator[SEP] Keyword[if] operator[SEP] identifier[target] operator[==] Other[null] operator[SEP] { identifier[target] operator[=] literal[String] operator[SEP] } } Keyword[else] Keyword[if] operator[SEP] literal[String] operator[SEP] identifier[equals] operator[SEP] identifier[target] operator[SEP] operator[SEP] { identifier[major] operator[=] Other[46] operator[SEP] identifier[minor] operator[=] Other[0] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] literal[String] operator[SEP] identifier[equals] operator[SEP] identifier[target] operator[SEP] operator[SEP] { identifier[major] operator[=] Other[47] operator[SEP] identifier[minor] operator[=] Other[0] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] literal[String] operator[SEP] identifier[equals] operator[SEP] identifier[target] operator[SEP] operator[SEP] { identifier[major] operator[=] Other[48] operator[SEP] identifier[minor] operator[=] Other[0] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] literal[String] operator[SEP] identifier[equals] operator[SEP] identifier[target] operator[SEP] operator[SEP] { identifier[major] operator[=] Other[49] operator[SEP] identifier[minor] operator[=] Other[0] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] literal[String] operator[SEP] identifier[equals] operator[SEP] identifier[target] operator[SEP] operator[SEP] { identifier[major] operator[=] Other[50] operator[SEP] identifier[minor] operator[=] Other[0] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] literal[String] operator[SEP] identifier[equals] operator[SEP] identifier[target] operator[SEP] operator[SEP] { identifier[major] operator[=] Other[51] operator[SEP] identifier[minor] operator[=] Other[0] operator[SEP] } Keyword[else] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[+] identifier[target] operator[SEP] operator[SEP] } identifier[mVersion] operator[=] operator[SEP] identifier[minor] operator[<<] Other[16] operator[SEP] operator[|] operator[SEP] identifier[major] operator[&] literal[Integer] operator[SEP] operator[SEP] identifier[mTarget] operator[=] identifier[target] operator[SEP] identifier[intern] operator[SEP] operator[SEP] operator[SEP] }
public List<Map.Entry<K, Float>> nearest(Vector vector, int size) { MaxHeap<Map.Entry<K, Float>> maxHeap = new MaxHeap<Map.Entry<K, Float>>(size, new Comparator<Map.Entry<K, Float>>() { @Override public int compare(Map.Entry<K, Float> o1, Map.Entry<K, Float> o2) { return o1.getValue().compareTo(o2.getValue()); } }); for (Map.Entry<K, Vector> entry : storage.entrySet()) { maxHeap.add(new AbstractMap.SimpleEntry<K, Float>(entry.getKey(), entry.getValue().cosineForUnitVector(vector))); } return maxHeap.toList(); }
class class_name[name] begin[{] method[nearest, return_type[type[List]], modifier[public], parameter[vector, size]] begin[{] local_variable[type[MaxHeap], maxHeap] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[ClassCreator(arguments=[MethodInvocation(arguments=[], member=getKey, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[MethodInvocation(arguments=[MemberReference(member=vector, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=cosineForUnitVector, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=AbstractMap, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=K, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Float, sub_type=None))], dimensions=None, name=SimpleEntry, sub_type=None)))], member=add, postfix_operators=[], prefix_operators=[], qualifier=maxHeap, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=entrySet, postfix_operators=[], prefix_operators=[], qualifier=storage, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=entry)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Map, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=K, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Vector, sub_type=None))], dimensions=None, name=Entry, sub_type=None)))), label=None) return[call[maxHeap.toList, parameter[]]] end[}] END[}]
Keyword[public] identifier[List] operator[<] identifier[Map] operator[SEP] identifier[Entry] operator[<] identifier[K] , identifier[Float] operator[>] operator[>] identifier[nearest] operator[SEP] identifier[Vector] identifier[vector] , Keyword[int] identifier[size] operator[SEP] { identifier[MaxHeap] operator[<] identifier[Map] operator[SEP] identifier[Entry] operator[<] identifier[K] , identifier[Float] operator[>] operator[>] identifier[maxHeap] operator[=] Keyword[new] identifier[MaxHeap] operator[<] identifier[Map] operator[SEP] identifier[Entry] operator[<] identifier[K] , identifier[Float] operator[>] operator[>] operator[SEP] identifier[size] , Keyword[new] identifier[Comparator] operator[<] identifier[Map] operator[SEP] identifier[Entry] operator[<] identifier[K] , identifier[Float] operator[>] operator[>] operator[SEP] operator[SEP] { annotation[@] identifier[Override] Keyword[public] Keyword[int] identifier[compare] operator[SEP] identifier[Map] operator[SEP] identifier[Entry] operator[<] identifier[K] , identifier[Float] operator[>] identifier[o1] , identifier[Map] operator[SEP] identifier[Entry] operator[<] identifier[K] , identifier[Float] operator[>] identifier[o2] operator[SEP] { Keyword[return] identifier[o1] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] identifier[compareTo] operator[SEP] identifier[o2] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Map] operator[SEP] identifier[Entry] operator[<] identifier[K] , identifier[Vector] operator[>] identifier[entry] operator[:] identifier[storage] operator[SEP] identifier[entrySet] operator[SEP] operator[SEP] operator[SEP] { identifier[maxHeap] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[AbstractMap] operator[SEP] identifier[SimpleEntry] operator[<] identifier[K] , identifier[Float] operator[>] operator[SEP] identifier[entry] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] , identifier[entry] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] identifier[cosineForUnitVector] operator[SEP] identifier[vector] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[maxHeap] operator[SEP] identifier[toList] operator[SEP] operator[SEP] operator[SEP] }
public static JavaRDD<List<List<Writable>>> zeroMeanUnitVarianceSequence(Schema schema, JavaRDD<List<List<Writable>>> sequence) { return zeroMeanUnitVarianceSequence(schema, sequence, null); }
class class_name[name] begin[{] method[zeroMeanUnitVarianceSequence, return_type[type[JavaRDD]], modifier[public static], parameter[schema, sequence]] begin[{] return[call[.zeroMeanUnitVarianceSequence, parameter[member[.schema], member[.sequence], literal[null]]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[JavaRDD] operator[<] identifier[List] operator[<] identifier[List] operator[<] identifier[Writable] operator[>] operator[>] operator[>] identifier[zeroMeanUnitVarianceSequence] operator[SEP] identifier[Schema] identifier[schema] , identifier[JavaRDD] operator[<] identifier[List] operator[<] identifier[List] operator[<] identifier[Writable] operator[>] operator[>] operator[>] identifier[sequence] operator[SEP] { Keyword[return] identifier[zeroMeanUnitVarianceSequence] operator[SEP] identifier[schema] , identifier[sequence] , Other[null] operator[SEP] operator[SEP] }
private DescribeVpcsResponseType describeVpcs() { DescribeVpcsResponseType ret = new DescribeVpcsResponseType(); ret.setRequestId(UUID.randomUUID().toString()); VpcSetType vpcSet = new VpcSetType(); for (Iterator<MockVpc> mockVpc = mockVpcController.describeVpcs().iterator(); mockVpc .hasNext();) { MockVpc item = mockVpc.next(); VpcType vpcType = new VpcType(); if (!DEFAULT_MOCK_PLACEMENT.getAvailabilityZone().equals(currentRegion)) { vpcType.setVpcId(currentRegion + "_" + item.getVpcId()); } else { vpcType.setVpcId(item.getVpcId()); } vpcType.setState(item.getState()); vpcType.setCidrBlock(item.getCidrBlock()); vpcType.setIsDefault(item.getIsDefault()); vpcSet.getItem().add(vpcType); } ret.setVpcSet(vpcSet); return ret; }
class class_name[name] begin[{] method[describeVpcs, return_type[type[DescribeVpcsResponseType]], modifier[private], parameter[]] begin[{] local_variable[type[DescribeVpcsResponseType], ret] call[ret.setRequestId, parameter[call[UUID.randomUUID, parameter[]]]] local_variable[type[VpcSetType], vpcSet] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=next, postfix_operators=[], prefix_operators=[], qualifier=mockVpc, selectors=[], type_arguments=None), name=item)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=MockVpc, sub_type=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=VpcType, sub_type=None)), name=vpcType)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=VpcType, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[], member=getAvailabilityZone, postfix_operators=[], prefix_operators=['!'], qualifier=DEFAULT_MOCK_PLACEMENT, selectors=[MethodInvocation(arguments=[MemberReference(member=currentRegion, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getVpcId, postfix_operators=[], prefix_operators=[], qualifier=item, selectors=[], type_arguments=None)], member=setVpcId, postfix_operators=[], prefix_operators=[], qualifier=vpcType, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=currentRegion, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="_"), operator=+), operandr=MethodInvocation(arguments=[], member=getVpcId, postfix_operators=[], prefix_operators=[], qualifier=item, selectors=[], type_arguments=None), operator=+)], member=setVpcId, postfix_operators=[], prefix_operators=[], qualifier=vpcType, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getState, postfix_operators=[], prefix_operators=[], qualifier=item, selectors=[], type_arguments=None)], member=setState, postfix_operators=[], prefix_operators=[], qualifier=vpcType, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getCidrBlock, postfix_operators=[], prefix_operators=[], qualifier=item, selectors=[], type_arguments=None)], member=setCidrBlock, postfix_operators=[], prefix_operators=[], qualifier=vpcType, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getIsDefault, postfix_operators=[], prefix_operators=[], qualifier=item, selectors=[], type_arguments=None)], member=setIsDefault, postfix_operators=[], prefix_operators=[], qualifier=vpcType, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=getItem, postfix_operators=[], prefix_operators=[], qualifier=vpcSet, selectors=[MethodInvocation(arguments=[MemberReference(member=vpcType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)]), control=ForControl(condition=MethodInvocation(arguments=[], member=hasNext, postfix_operators=[], prefix_operators=[], qualifier=mockVpc, selectors=[], type_arguments=None), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=MethodInvocation(arguments=[], member=describeVpcs, postfix_operators=[], prefix_operators=[], qualifier=mockVpcController, selectors=[MethodInvocation(arguments=[], member=iterator, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=mockVpc)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=MockVpc, sub_type=None))], dimensions=[], name=Iterator, sub_type=None)), update=None), label=None) call[ret.setVpcSet, parameter[member[.vpcSet]]] return[member[.ret]] end[}] END[}]
Keyword[private] identifier[DescribeVpcsResponseType] identifier[describeVpcs] operator[SEP] operator[SEP] { identifier[DescribeVpcsResponseType] identifier[ret] operator[=] Keyword[new] identifier[DescribeVpcsResponseType] operator[SEP] operator[SEP] operator[SEP] identifier[ret] operator[SEP] identifier[setRequestId] operator[SEP] identifier[UUID] operator[SEP] identifier[randomUUID] operator[SEP] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[VpcSetType] identifier[vpcSet] operator[=] Keyword[new] identifier[VpcSetType] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Iterator] operator[<] identifier[MockVpc] operator[>] identifier[mockVpc] operator[=] identifier[mockVpcController] operator[SEP] identifier[describeVpcs] operator[SEP] operator[SEP] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] identifier[mockVpc] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { identifier[MockVpc] identifier[item] operator[=] identifier[mockVpc] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] identifier[VpcType] identifier[vpcType] operator[=] Keyword[new] identifier[VpcType] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[DEFAULT_MOCK_PLACEMENT] operator[SEP] identifier[getAvailabilityZone] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[currentRegion] operator[SEP] operator[SEP] { identifier[vpcType] operator[SEP] identifier[setVpcId] operator[SEP] identifier[currentRegion] operator[+] literal[String] operator[+] identifier[item] operator[SEP] identifier[getVpcId] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[vpcType] operator[SEP] identifier[setVpcId] operator[SEP] identifier[item] operator[SEP] identifier[getVpcId] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[vpcType] operator[SEP] identifier[setState] operator[SEP] identifier[item] operator[SEP] identifier[getState] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[vpcType] operator[SEP] identifier[setCidrBlock] operator[SEP] identifier[item] operator[SEP] identifier[getCidrBlock] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[vpcType] operator[SEP] identifier[setIsDefault] operator[SEP] identifier[item] operator[SEP] identifier[getIsDefault] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[vpcSet] operator[SEP] identifier[getItem] operator[SEP] operator[SEP] operator[SEP] identifier[add] operator[SEP] identifier[vpcType] operator[SEP] operator[SEP] } identifier[ret] operator[SEP] identifier[setVpcSet] operator[SEP] identifier[vpcSet] operator[SEP] operator[SEP] Keyword[return] identifier[ret] operator[SEP] }
public void writeVarLong(final long value) throws IOException { final int bitLength = new Bits(value).bitLength; int type = Arrays.binarySearch(varLongDepths, bitLength); if (type < 0) { type = -type - 1; } this.write(new Bits(type, 2)); this.write(new Bits(value, varLongDepths[type])); }
class class_name[name] begin[{] method[writeVarLong, return_type[void], modifier[public], parameter[value]] begin[{] local_variable[type[int], bitLength] local_variable[type[int], type] if[binary_operation[member[.type], <, literal[0]]] begin[{] assign[member[.type], binary_operation[member[.type], -, literal[1]]] else begin[{] None end[}] THIS[call[None.write, parameter[ClassCreator(arguments=[MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Bits, sub_type=None))]]] THIS[call[None.write, parameter[ClassCreator(arguments=[MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=varLongDepths, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=type, 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=Bits, sub_type=None))]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[writeVarLong] operator[SEP] Keyword[final] Keyword[long] identifier[value] operator[SEP] Keyword[throws] identifier[IOException] { Keyword[final] Keyword[int] identifier[bitLength] operator[=] Keyword[new] identifier[Bits] operator[SEP] identifier[value] operator[SEP] operator[SEP] identifier[bitLength] operator[SEP] Keyword[int] identifier[type] operator[=] identifier[Arrays] operator[SEP] identifier[binarySearch] operator[SEP] identifier[varLongDepths] , identifier[bitLength] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[type] operator[<] Other[0] operator[SEP] { identifier[type] operator[=] operator[-] identifier[type] operator[-] Other[1] operator[SEP] } Keyword[this] operator[SEP] identifier[write] operator[SEP] Keyword[new] identifier[Bits] operator[SEP] identifier[type] , Other[2] operator[SEP] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[write] operator[SEP] Keyword[new] identifier[Bits] operator[SEP] identifier[value] , identifier[varLongDepths] operator[SEP] identifier[type] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
private boolean setPrototypeNoCheck(ObjectType prototype, Node propertyNode) { ObjectType oldPrototype = prototypeSlot == null ? null : (ObjectType) prototypeSlot.getType(); boolean replacedPrototype = oldPrototype != null; this.prototypeSlot = new Property("prototype", prototype, true, propertyNode == null ? source : propertyNode); prototype.setOwnerFunction(this); if (oldPrototype != null) { // Disassociating the old prototype makes this easier to debug-- // we don't have to worry about two prototypes running around. oldPrototype.setOwnerFunction(null); } if (isConstructor() || isInterface()) { FunctionType superClass = getSuperClassConstructor(); if (superClass != null) { superClass.addSubType(this); wasAddedToExtendedConstructorSubtypes = true; } if (isInterface()) { for (ObjectType interfaceType : getExtendedInterfaces()) { if (interfaceType.getConstructor() != null) { interfaceType.getConstructor().addSubType(this); } } } } if (replacedPrototype) { clearCachedValues(); } return true; }
class class_name[name] begin[{] method[setPrototypeNoCheck, return_type[type[boolean]], modifier[private], parameter[prototype, propertyNode]] begin[{] local_variable[type[ObjectType], oldPrototype] local_variable[type[boolean], replacedPrototype] assign[THIS[member[None.prototypeSlot]], ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="prototype"), MemberReference(member=prototype, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true), TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=propertyNode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), if_false=MemberReference(member=propertyNode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_true=MemberReference(member=source, 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=Property, sub_type=None))] call[prototype.setOwnerFunction, parameter[THIS[]]] if[binary_operation[member[.oldPrototype], !=, literal[null]]] begin[{] call[oldPrototype.setOwnerFunction, parameter[literal[null]]] else begin[{] None end[}] if[binary_operation[call[.isConstructor, parameter[]], ||, call[.isInterface, parameter[]]]] begin[{] local_variable[type[FunctionType], superClass] if[binary_operation[member[.superClass], !=, literal[null]]] begin[{] call[superClass.addSubType, parameter[THIS[]]] assign[member[.wasAddedToExtendedConstructorSubtypes], literal[true]] else begin[{] None end[}] if[call[.isInterface, parameter[]]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getConstructor, postfix_operators=[], prefix_operators=[], qualifier=interfaceType, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=getConstructor, postfix_operators=[], prefix_operators=[], qualifier=interfaceType, selectors=[MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[])], member=addSubType, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getExtendedInterfaces, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=interfaceType)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ObjectType, sub_type=None))), label=None) else begin[{] None end[}] else begin[{] None end[}] if[member[.replacedPrototype]] begin[{] call[.clearCachedValues, parameter[]] else begin[{] None end[}] return[literal[true]] end[}] END[}]
Keyword[private] Keyword[boolean] identifier[setPrototypeNoCheck] operator[SEP] identifier[ObjectType] identifier[prototype] , identifier[Node] identifier[propertyNode] operator[SEP] { identifier[ObjectType] identifier[oldPrototype] operator[=] identifier[prototypeSlot] operator[==] Other[null] operator[?] Other[null] operator[:] operator[SEP] identifier[ObjectType] operator[SEP] identifier[prototypeSlot] operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[SEP] Keyword[boolean] identifier[replacedPrototype] operator[=] identifier[oldPrototype] operator[!=] Other[null] operator[SEP] Keyword[this] operator[SEP] identifier[prototypeSlot] operator[=] Keyword[new] identifier[Property] operator[SEP] literal[String] , identifier[prototype] , literal[boolean] , identifier[propertyNode] operator[==] Other[null] operator[?] identifier[source] operator[:] identifier[propertyNode] operator[SEP] operator[SEP] identifier[prototype] operator[SEP] identifier[setOwnerFunction] operator[SEP] Keyword[this] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[oldPrototype] operator[!=] Other[null] operator[SEP] { identifier[oldPrototype] operator[SEP] identifier[setOwnerFunction] operator[SEP] Other[null] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[isConstructor] operator[SEP] operator[SEP] operator[||] identifier[isInterface] operator[SEP] operator[SEP] operator[SEP] { identifier[FunctionType] identifier[superClass] operator[=] identifier[getSuperClassConstructor] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[superClass] operator[!=] Other[null] operator[SEP] { identifier[superClass] operator[SEP] identifier[addSubType] operator[SEP] Keyword[this] operator[SEP] operator[SEP] identifier[wasAddedToExtendedConstructorSubtypes] operator[=] literal[boolean] operator[SEP] } Keyword[if] operator[SEP] identifier[isInterface] operator[SEP] operator[SEP] operator[SEP] { Keyword[for] operator[SEP] identifier[ObjectType] identifier[interfaceType] operator[:] identifier[getExtendedInterfaces] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[interfaceType] operator[SEP] identifier[getConstructor] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] { identifier[interfaceType] operator[SEP] identifier[getConstructor] operator[SEP] operator[SEP] operator[SEP] identifier[addSubType] operator[SEP] Keyword[this] operator[SEP] operator[SEP] } } } } Keyword[if] operator[SEP] identifier[replacedPrototype] operator[SEP] { identifier[clearCachedValues] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] literal[boolean] operator[SEP] }
public static BoundingBox getProjectedBoundingBox(String authority, Long code, int x, int y, int zoom) { BoundingBox boundingBox = getWebMercatorBoundingBox(x, y, zoom); if (code != null) { ProjectionTransform transform = webMercator.getTransformation( authority, code); boundingBox = boundingBox.transform(transform); } return boundingBox; }
class class_name[name] begin[{] method[getProjectedBoundingBox, return_type[type[BoundingBox]], modifier[public static], parameter[authority, code, x, y, zoom]] begin[{] local_variable[type[BoundingBox], boundingBox] if[binary_operation[member[.code], !=, literal[null]]] begin[{] local_variable[type[ProjectionTransform], transform] assign[member[.boundingBox], call[boundingBox.transform, parameter[member[.transform]]]] else begin[{] None end[}] return[member[.boundingBox]] end[}] END[}]
Keyword[public] Keyword[static] identifier[BoundingBox] identifier[getProjectedBoundingBox] operator[SEP] identifier[String] identifier[authority] , identifier[Long] identifier[code] , Keyword[int] identifier[x] , Keyword[int] identifier[y] , Keyword[int] identifier[zoom] operator[SEP] { identifier[BoundingBox] identifier[boundingBox] operator[=] identifier[getWebMercatorBoundingBox] operator[SEP] identifier[x] , identifier[y] , identifier[zoom] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[code] operator[!=] Other[null] operator[SEP] { identifier[ProjectionTransform] identifier[transform] operator[=] identifier[webMercator] operator[SEP] identifier[getTransformation] operator[SEP] identifier[authority] , identifier[code] operator[SEP] operator[SEP] identifier[boundingBox] operator[=] identifier[boundingBox] operator[SEP] identifier[transform] operator[SEP] identifier[transform] operator[SEP] operator[SEP] } Keyword[return] identifier[boundingBox] operator[SEP] }
public Matrix4d translationRotateScale(double tx, double ty, double tz, double qx, double qy, double qz, double qw, double sx, double sy, double sz) { double dqx = qx + qx, dqy = qy + qy, dqz = qz + qz; double q00 = dqx * qx; double q11 = dqy * qy; double q22 = dqz * qz; double q01 = dqx * qy; double q02 = dqx * qz; double q03 = dqx * qw; double q12 = dqy * qz; double q13 = dqy * qw; double q23 = dqz * qw; m00 = sx - (q11 + q22) * sx; m01 = (q01 + q23) * sx; m02 = (q02 - q13) * sx; m03 = 0.0; m10 = (q01 - q23) * sy; m11 = sy - (q22 + q00) * sy; m12 = (q12 + q03) * sy; m13 = 0.0; m20 = (q02 + q13) * sz; m21 = (q12 - q03) * sz; m22 = sz - (q11 + q00) * sz; m23 = 0.0; m30 = tx; m31 = ty; m32 = tz; m33 = 1.0; boolean one = Math.abs(sx) == 1.0 && Math.abs(sy) == 1.0 && Math.abs(sz) == 1.0; properties = PROPERTY_AFFINE | (one ? PROPERTY_ORTHONORMAL : 0); return this; }
class class_name[name] begin[{] method[translationRotateScale, return_type[type[Matrix4d]], modifier[public], parameter[tx, ty, tz, qx, qy, qz, qw, sx, sy, sz]] begin[{] local_variable[type[double], dqx] local_variable[type[double], q00] local_variable[type[double], q11] local_variable[type[double], q22] local_variable[type[double], q01] local_variable[type[double], q02] local_variable[type[double], q03] local_variable[type[double], q12] local_variable[type[double], q13] local_variable[type[double], q23] assign[member[.m00], binary_operation[member[.sx], -, binary_operation[binary_operation[member[.q11], +, member[.q22]], *, member[.sx]]]] assign[member[.m01], binary_operation[binary_operation[member[.q01], +, member[.q23]], *, member[.sx]]] assign[member[.m02], binary_operation[binary_operation[member[.q02], -, member[.q13]], *, member[.sx]]] assign[member[.m03], literal[0.0]] assign[member[.m10], binary_operation[binary_operation[member[.q01], -, member[.q23]], *, member[.sy]]] assign[member[.m11], binary_operation[member[.sy], -, binary_operation[binary_operation[member[.q22], +, member[.q00]], *, member[.sy]]]] assign[member[.m12], binary_operation[binary_operation[member[.q12], +, member[.q03]], *, member[.sy]]] assign[member[.m13], literal[0.0]] assign[member[.m20], binary_operation[binary_operation[member[.q02], +, member[.q13]], *, member[.sz]]] assign[member[.m21], binary_operation[binary_operation[member[.q12], -, member[.q03]], *, member[.sz]]] assign[member[.m22], binary_operation[member[.sz], -, binary_operation[binary_operation[member[.q11], +, member[.q00]], *, member[.sz]]]] assign[member[.m23], literal[0.0]] assign[member[.m30], member[.tx]] assign[member[.m31], member[.ty]] assign[member[.m32], member[.tz]] assign[member[.m33], literal[1.0]] local_variable[type[boolean], one] assign[member[.properties], binary_operation[member[.PROPERTY_AFFINE], |, TernaryExpression(condition=MemberReference(member=one, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_false=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), if_true=MemberReference(member=PROPERTY_ORTHONORMAL, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]] return[THIS[]] end[}] END[}]
Keyword[public] identifier[Matrix4d] identifier[translationRotateScale] operator[SEP] Keyword[double] identifier[tx] , Keyword[double] identifier[ty] , Keyword[double] identifier[tz] , Keyword[double] identifier[qx] , Keyword[double] identifier[qy] , Keyword[double] identifier[qz] , Keyword[double] identifier[qw] , Keyword[double] identifier[sx] , Keyword[double] identifier[sy] , Keyword[double] identifier[sz] operator[SEP] { Keyword[double] identifier[dqx] operator[=] identifier[qx] operator[+] identifier[qx] , identifier[dqy] operator[=] identifier[qy] operator[+] identifier[qy] , identifier[dqz] operator[=] identifier[qz] operator[+] identifier[qz] operator[SEP] Keyword[double] identifier[q00] operator[=] identifier[dqx] operator[*] identifier[qx] operator[SEP] Keyword[double] identifier[q11] operator[=] identifier[dqy] operator[*] identifier[qy] operator[SEP] Keyword[double] identifier[q22] operator[=] identifier[dqz] operator[*] identifier[qz] operator[SEP] Keyword[double] identifier[q01] operator[=] identifier[dqx] operator[*] identifier[qy] operator[SEP] Keyword[double] identifier[q02] operator[=] identifier[dqx] operator[*] identifier[qz] operator[SEP] Keyword[double] identifier[q03] operator[=] identifier[dqx] operator[*] identifier[qw] operator[SEP] Keyword[double] identifier[q12] operator[=] identifier[dqy] operator[*] identifier[qz] operator[SEP] Keyword[double] identifier[q13] operator[=] identifier[dqy] operator[*] identifier[qw] operator[SEP] Keyword[double] identifier[q23] operator[=] identifier[dqz] operator[*] identifier[qw] operator[SEP] identifier[m00] operator[=] identifier[sx] operator[-] operator[SEP] identifier[q11] operator[+] identifier[q22] operator[SEP] operator[*] identifier[sx] operator[SEP] identifier[m01] operator[=] operator[SEP] identifier[q01] operator[+] identifier[q23] operator[SEP] operator[*] identifier[sx] operator[SEP] identifier[m02] operator[=] operator[SEP] identifier[q02] operator[-] identifier[q13] operator[SEP] operator[*] identifier[sx] operator[SEP] identifier[m03] operator[=] literal[Float] operator[SEP] identifier[m10] operator[=] operator[SEP] identifier[q01] operator[-] identifier[q23] operator[SEP] operator[*] identifier[sy] operator[SEP] identifier[m11] operator[=] identifier[sy] operator[-] operator[SEP] identifier[q22] operator[+] identifier[q00] operator[SEP] operator[*] identifier[sy] operator[SEP] identifier[m12] operator[=] operator[SEP] identifier[q12] operator[+] identifier[q03] operator[SEP] operator[*] identifier[sy] operator[SEP] identifier[m13] operator[=] literal[Float] operator[SEP] identifier[m20] operator[=] operator[SEP] identifier[q02] operator[+] identifier[q13] operator[SEP] operator[*] identifier[sz] operator[SEP] identifier[m21] operator[=] operator[SEP] identifier[q12] operator[-] identifier[q03] operator[SEP] operator[*] identifier[sz] operator[SEP] identifier[m22] operator[=] identifier[sz] operator[-] operator[SEP] identifier[q11] operator[+] identifier[q00] operator[SEP] operator[*] identifier[sz] operator[SEP] identifier[m23] operator[=] literal[Float] operator[SEP] identifier[m30] operator[=] identifier[tx] operator[SEP] identifier[m31] operator[=] identifier[ty] operator[SEP] identifier[m32] operator[=] identifier[tz] operator[SEP] identifier[m33] operator[=] literal[Float] operator[SEP] Keyword[boolean] identifier[one] operator[=] identifier[Math] operator[SEP] identifier[abs] operator[SEP] identifier[sx] operator[SEP] operator[==] literal[Float] operator[&&] identifier[Math] operator[SEP] identifier[abs] operator[SEP] identifier[sy] operator[SEP] operator[==] literal[Float] operator[&&] identifier[Math] operator[SEP] identifier[abs] operator[SEP] identifier[sz] operator[SEP] operator[==] literal[Float] operator[SEP] identifier[properties] operator[=] identifier[PROPERTY_AFFINE] operator[|] operator[SEP] identifier[one] operator[?] identifier[PROPERTY_ORTHONORMAL] operator[:] Other[0] operator[SEP] operator[SEP] Keyword[return] Keyword[this] operator[SEP] }
public void debug( @Nullable final String event, @Nullable final String message, @Nullable final String[] dataKeys, @Nullable final Object... dataValues) { final Throwable throwable = extractThrowable(dataKeys, dataValues); log(LogLevel.DEBUG, event, message, dataKeys, chompArray(dataValues, throwable == null ? 0 : 1), throwable); }
class class_name[name] begin[{] method[debug, return_type[void], modifier[public], parameter[event, message, dataKeys, dataValues]] begin[{] local_variable[type[Throwable], throwable] call[.log, parameter[member[LogLevel.DEBUG], member[.event], member[.message], member[.dataKeys], call[.chompArray, parameter[member[.dataValues], TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=throwable, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), if_false=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))]], member[.throwable]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[debug] operator[SEP] annotation[@] identifier[Nullable] Keyword[final] identifier[String] identifier[event] , annotation[@] identifier[Nullable] Keyword[final] identifier[String] identifier[message] , annotation[@] identifier[Nullable] Keyword[final] identifier[String] operator[SEP] operator[SEP] identifier[dataKeys] , annotation[@] identifier[Nullable] Keyword[final] identifier[Object] operator[...] identifier[dataValues] operator[SEP] { Keyword[final] identifier[Throwable] identifier[throwable] operator[=] identifier[extractThrowable] operator[SEP] identifier[dataKeys] , identifier[dataValues] operator[SEP] operator[SEP] identifier[log] operator[SEP] identifier[LogLevel] operator[SEP] identifier[DEBUG] , identifier[event] , identifier[message] , identifier[dataKeys] , identifier[chompArray] operator[SEP] identifier[dataValues] , identifier[throwable] operator[==] Other[null] operator[?] Other[0] operator[:] Other[1] operator[SEP] , identifier[throwable] operator[SEP] operator[SEP] }
private static String encode(final CharSequence text, final char[][] buff, final int bufflen) { int len; if ((text == null) || ((len = text.length()) == 0)) { return StringPool.EMPTY; } StringBuilder buffer = new StringBuilder(len + (len >> 2)); for (int i = 0; i < len; i++) { char c = text.charAt(i); if (c < bufflen) { buffer.append(buff[c]); } else { buffer.append(c); } } return buffer.toString(); }
class class_name[name] begin[{] method[encode, return_type[type[String]], modifier[private static], parameter[text, buff, bufflen]] begin[{] local_variable[type[int], len] if[binary_operation[binary_operation[member[.text], ==, literal[null]], ||, binary_operation[assign[member[.len], call[text.length, parameter[]]], ==, literal[0]]]] begin[{] return[member[StringPool.EMPTY]] else begin[{] None end[}] local_variable[type[StringBuilder], buffer] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=charAt, postfix_operators=[], prefix_operators=[], qualifier=text, selectors=[], type_arguments=None), name=c)], modifiers=set(), type=BasicType(dimensions=[], name=char)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=bufflen, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=append, postfix_operators=[], prefix_operators=[], qualifier=buffer, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=buff, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])], member=append, postfix_operators=[], prefix_operators=[], qualifier=buffer, selectors=[], type_arguments=None), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=len, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) return[call[buffer.toString, parameter[]]] end[}] END[}]
Keyword[private] Keyword[static] identifier[String] identifier[encode] operator[SEP] Keyword[final] identifier[CharSequence] identifier[text] , Keyword[final] Keyword[char] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[buff] , Keyword[final] Keyword[int] identifier[bufflen] operator[SEP] { Keyword[int] identifier[len] operator[SEP] Keyword[if] operator[SEP] operator[SEP] identifier[text] operator[==] Other[null] operator[SEP] operator[||] operator[SEP] operator[SEP] identifier[len] operator[=] identifier[text] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] operator[==] Other[0] operator[SEP] operator[SEP] { Keyword[return] identifier[StringPool] operator[SEP] identifier[EMPTY] operator[SEP] } identifier[StringBuilder] identifier[buffer] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] identifier[len] operator[+] operator[SEP] identifier[len] operator[>] operator[>] Other[2] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[len] operator[SEP] identifier[i] operator[++] operator[SEP] { Keyword[char] identifier[c] operator[=] identifier[text] operator[SEP] identifier[charAt] operator[SEP] identifier[i] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[c] operator[<] identifier[bufflen] operator[SEP] { identifier[buffer] operator[SEP] identifier[append] operator[SEP] identifier[buff] operator[SEP] identifier[c] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[buffer] operator[SEP] identifier[append] operator[SEP] identifier[c] operator[SEP] operator[SEP] } } Keyword[return] identifier[buffer] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] }
private Message unfragment(Message msg, FragHeader hdr) { Address sender=msg.getSrc(); FragmentationTable frag_table=fragment_list.get(sender); if(frag_table == null) { frag_table=new FragmentationTable(sender); try { fragment_list.add(sender, frag_table); } catch(IllegalArgumentException x) { // the entry has already been added, probably in parallel from another thread frag_table=fragment_list.get(sender); } } num_received_frags++; byte[] buf=frag_table.add(hdr.id, hdr.frag_id, hdr.num_frags, msg.getBuffer()); if(buf == null) return null; try { DataInput in=new ByteArrayDataInputStream(buf); Message assembled_msg=new Message(false); assembled_msg.readFrom(in); assembled_msg.setSrc(sender); // needed ? YES, because fragments have a null src !! if(log.isTraceEnabled()) log.trace("assembled_msg is " + assembled_msg); num_received_msgs++; return assembled_msg; } catch(Exception e) { log.error(Util.getMessage("FailedUnfragmentingAMessage"), e); return null; } }
class class_name[name] begin[{] method[unfragment, return_type[type[Message]], modifier[private], parameter[msg, hdr]] begin[{] local_variable[type[Address], sender] local_variable[type[FragmentationTable], frag_table] if[binary_operation[member[.frag_table], ==, literal[null]]] begin[{] assign[member[.frag_table], ClassCreator(arguments=[MemberReference(member=sender, 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=FragmentationTable, sub_type=None))] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=sender, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=frag_table, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=fragment_list, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=frag_table, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=sender, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=fragment_list, selectors=[], type_arguments=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=x, types=['IllegalArgumentException']))], finally_block=None, label=None, resources=None) else begin[{] None end[}] member[.num_received_frags] local_variable[type[byte], buf] if[binary_operation[member[.buf], ==, literal[null]]] begin[{] return[literal[null]] else begin[{] None end[}] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MemberReference(member=buf, 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=ByteArrayDataInputStream, sub_type=None)), name=in)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=DataInput, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[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=Message, sub_type=None)), name=assembled_msg)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Message, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=in, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=readFrom, postfix_operators=[], prefix_operators=[], qualifier=assembled_msg, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=sender, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setSrc, postfix_operators=[], prefix_operators=[], qualifier=assembled_msg, selectors=[], type_arguments=None), label=None), IfStatement(condition=MethodInvocation(arguments=[], member=isTraceEnabled, postfix_operators=[], prefix_operators=[], qualifier=log, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="assembled_msg is "), operandr=MemberReference(member=assembled_msg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=trace, postfix_operators=[], prefix_operators=[], qualifier=log, selectors=[], type_arguments=None), label=None)), StatementExpression(expression=MemberReference(member=num_received_msgs, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]), label=None), ReturnStatement(expression=MemberReference(member=assembled_msg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="FailedUnfragmentingAMessage")], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=Util, selectors=[], type_arguments=None), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=log, selectors=[], type_arguments=None), label=None), 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[private] identifier[Message] identifier[unfragment] operator[SEP] identifier[Message] identifier[msg] , identifier[FragHeader] identifier[hdr] operator[SEP] { identifier[Address] identifier[sender] operator[=] identifier[msg] operator[SEP] identifier[getSrc] operator[SEP] operator[SEP] operator[SEP] identifier[FragmentationTable] identifier[frag_table] operator[=] identifier[fragment_list] operator[SEP] identifier[get] operator[SEP] identifier[sender] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[frag_table] operator[==] Other[null] operator[SEP] { identifier[frag_table] operator[=] Keyword[new] identifier[FragmentationTable] operator[SEP] identifier[sender] operator[SEP] operator[SEP] Keyword[try] { identifier[fragment_list] operator[SEP] identifier[add] operator[SEP] identifier[sender] , identifier[frag_table] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[IllegalArgumentException] identifier[x] operator[SEP] { identifier[frag_table] operator[=] identifier[fragment_list] operator[SEP] identifier[get] operator[SEP] identifier[sender] operator[SEP] operator[SEP] } } identifier[num_received_frags] operator[++] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[buf] operator[=] identifier[frag_table] operator[SEP] identifier[add] operator[SEP] identifier[hdr] operator[SEP] identifier[id] , identifier[hdr] operator[SEP] identifier[frag_id] , identifier[hdr] operator[SEP] identifier[num_frags] , identifier[msg] operator[SEP] identifier[getBuffer] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[buf] operator[==] Other[null] operator[SEP] Keyword[return] Other[null] operator[SEP] Keyword[try] { identifier[DataInput] identifier[in] operator[=] Keyword[new] identifier[ByteArrayDataInputStream] operator[SEP] identifier[buf] operator[SEP] operator[SEP] identifier[Message] identifier[assembled_msg] operator[=] Keyword[new] identifier[Message] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[assembled_msg] operator[SEP] identifier[readFrom] operator[SEP] identifier[in] operator[SEP] operator[SEP] identifier[assembled_msg] operator[SEP] identifier[setSrc] operator[SEP] identifier[sender] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[log] operator[SEP] identifier[isTraceEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[log] operator[SEP] identifier[trace] operator[SEP] literal[String] operator[+] identifier[assembled_msg] operator[SEP] operator[SEP] identifier[num_received_msgs] operator[++] operator[SEP] Keyword[return] identifier[assembled_msg] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { identifier[log] operator[SEP] identifier[error] operator[SEP] identifier[Util] operator[SEP] identifier[getMessage] operator[SEP] literal[String] operator[SEP] , identifier[e] operator[SEP] operator[SEP] Keyword[return] Other[null] operator[SEP] } }
public static <T> byte[] toByteArray(T message, Schema<T> schema) { return toByteArray(message, schema, DEFAULT_OUTPUT_FACTORY); }
class class_name[name] begin[{] method[toByteArray, return_type[type[byte]], modifier[public static], parameter[message, schema]] begin[{] return[call[.toByteArray, parameter[member[.message], member[.schema], member[.DEFAULT_OUTPUT_FACTORY]]]] end[}] END[}]
Keyword[public] Keyword[static] operator[<] identifier[T] operator[>] Keyword[byte] operator[SEP] operator[SEP] identifier[toByteArray] operator[SEP] identifier[T] identifier[message] , identifier[Schema] operator[<] identifier[T] operator[>] identifier[schema] operator[SEP] { Keyword[return] identifier[toByteArray] operator[SEP] identifier[message] , identifier[schema] , identifier[DEFAULT_OUTPUT_FACTORY] operator[SEP] operator[SEP] }
public FileStatus[] list( final String hostName, final Path path, final boolean fullListing, final boolean prefixBased, final Boolean isDirectory, final boolean flatListing, final PathFilter filter) throws IOException { LOG.debug("List container: raw path parent {} container {} hostname {}", path.toString(), container, hostName); final Container cObj = mJossAccount.getAccount().getContainer(container); String obj; if (path.toString().equals(container) || publicContainer) { obj = ""; } else if (path.toString().startsWith(container + "/")) { obj = path.toString().substring(container.length() + 1); } else if (path.toString().startsWith(hostName)) { obj = path.toString().substring(hostName.length()); } else { obj = path.toString(); } LOG.debug("List container for {} container {}", obj, container); ArrayList<FileStatus> tmpResult = new ArrayList<FileStatus>(); StoredObject previousElement = null; boolean moreData = true; String marker = null; FileStatus fs = null; while (moreData) { Collection<StoredObject> res = cObj.list(obj, marker, pageListSize); moreData = (res.size() == pageListSize); if (marker == null && (res == null || res.isEmpty() || res.size() == 0)) { FileStatus[] emptyRes = {}; LOG.debug("List {} in container {} is empty", obj, container); return emptyRes; } for (StoredObject tmp : res) { marker = tmp.getAsObject().getName(); if (previousElement == null) { // first entry setCorrectSize(tmp, cObj); previousElement = tmp.getAsObject(); continue; } String unifiedObjectName = extractUnifiedObjectName(tmp.getName()); LOG.trace("{} Matching {}", unifiedObjectName, obj); if (!prefixBased && !obj.equals("") && !path.toString().endsWith("/") && !unifiedObjectName.equals(obj) && !unifiedObjectName.startsWith(obj + "/")) { // JOSS returns all objects that start with the prefix of obj. // These may include other unrelated objects. LOG.trace("{} does not match {}. Skipped", unifiedObjectName, obj); continue; } else if (isDirectory && !unifiedObjectName.equals(obj) && !unifiedObjectName.startsWith(obj + "/")) { LOG.trace("directory {}. {} does not match {}. Skipped", isDirectory, unifiedObjectName, obj); continue; } LOG.trace("Unified name: {}, path {}", unifiedObjectName, tmp.getName()); if (!unifiedObjectName.equals(tmp.getName()) && isSparkOrigin(unifiedObjectName) && !fullListing) { LOG.trace("{} created by Spark", unifiedObjectName); if (!isJobSuccessful(unifiedObjectName)) { LOG.trace("{} created by failed Spark job. Skipped", unifiedObjectName); if (fModeAutomaticDelete) { delete(hostName, new Path(tmp.getName()), true); } continue; } else { // if we here - data created by spark and job completed successfully // however there be might parts of failed tasks that were not aborted // we need to make sure there are no failed attempts if (nameWithoutTaskID(tmp.getName()) .equals(nameWithoutTaskID(previousElement.getName()))) { // found failed that was not aborted. LOG.trace("Colision identified between {} and {}", previousElement.getName(), tmp.getName()); setCorrectSize(tmp, cObj); if (previousElement.getContentLength() < tmp.getContentLength()) { LOG.trace("New candidate is {}. Removed {}", tmp.getName(), previousElement.getName()); previousElement = tmp.getAsObject(); } continue; } } } fs = null; if (previousElement.getContentLength() > 0 || fullListing) { fs = createFileStatus(previousElement, cObj, hostName, path); objectCache.put(getObjName(hostName, fs.getPath()), fs.getLen(), fs.getModificationTime()); tmpResult.add(fs); } previousElement = tmp.getAsObject(); } } if (previousElement != null && (previousElement.getContentLength() > 0 || fullListing)) { LOG.trace("Adding {} to the list", previousElement.getPath()); fs = createFileStatus(previousElement, cObj, hostName, path); if (filter == null) { objectCache.put(getObjName(hostName, fs.getPath()), fs.getLen(), fs.getModificationTime()); tmpResult.add(fs); } else if (filter != null && filter.accept(fs.getPath())) { objectCache.put(getObjName(hostName, fs.getPath()), fs.getLen(), fs.getModificationTime()); tmpResult.add(fs); } else { LOG.trace("{} rejected by path filter during list", fs.getPath()); } } LOG.debug("Listing of {} completed with {} results", path.toString(), tmpResult.size()); return tmpResult.toArray(new FileStatus[tmpResult.size()]); }
class class_name[name] begin[{] method[list, return_type[type[FileStatus]], modifier[public], parameter[hostName, path, fullListing, prefixBased, isDirectory, flatListing, filter]] begin[{] call[LOG.debug, parameter[literal["List container: raw path parent {} container {} hostname {}"], call[path.toString, parameter[]], member[.container], member[.hostName]]] local_variable[type[Container], cObj] local_variable[type[String], obj] if[binary_operation[call[path.toString, parameter[]], ||, member[.publicContainer]]] begin[{] assign[member[.obj], literal[""]] else begin[{] if[call[path.toString, parameter[]]] begin[{] assign[member[.obj], call[path.toString, parameter[]]] else begin[{] if[call[path.toString, parameter[]]] begin[{] assign[member[.obj], call[path.toString, parameter[]]] else begin[{] assign[member[.obj], call[path.toString, parameter[]]] end[}] end[}] end[}] call[LOG.debug, parameter[literal["List container for {} container {}"], member[.obj], member[.container]]] local_variable[type[ArrayList], tmpResult] local_variable[type[StoredObject], previousElement] local_variable[type[boolean], moreData] local_variable[type[String], marker] local_variable[type[FileStatus], fs] while[member[.moreData]] begin[{] local_variable[type[Collection], res] assign[member[.moreData], binary_operation[call[res.size, parameter[]], ==, member[.pageListSize]]] if[binary_operation[binary_operation[member[.marker], ==, literal[null]], &&, binary_operation[binary_operation[binary_operation[member[.res], ==, literal[null]], ||, call[res.isEmpty, parameter[]]], ||, binary_operation[call[res.size, parameter[]], ==, literal[0]]]]] begin[{] local_variable[type[FileStatus], emptyRes] call[LOG.debug, parameter[literal["List {} in container {} is empty"], member[.obj], member[.container]]] return[member[.emptyRes]] else begin[{] None end[}] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=marker, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=getAsObject, postfix_operators=[], prefix_operators=[], qualifier=tmp, selectors=[MethodInvocation(arguments=[], member=getName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=previousElement, 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=tmp, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=cObj, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setCorrectSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=previousElement, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=getAsObject, postfix_operators=[], prefix_operators=[], qualifier=tmp, selectors=[], type_arguments=None)), label=None), ContinueStatement(goto=None, label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=tmp, selectors=[], type_arguments=None)], member=extractUnifiedObjectName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=unifiedObjectName)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="{} Matching {}"), MemberReference(member=unifiedObjectName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=obj, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=trace, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), label=None), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=prefixBased, postfix_operators=[], prefix_operators=['!'], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="")], member=equals, postfix_operators=[], prefix_operators=['!'], qualifier=obj, selectors=[], type_arguments=None), operator=&&), operandr=MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=['!'], qualifier=path, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="/")], member=endsWith, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operator=&&), operandr=MethodInvocation(arguments=[MemberReference(member=obj, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equals, postfix_operators=[], prefix_operators=['!'], qualifier=unifiedObjectName, selectors=[], type_arguments=None), operator=&&), operandr=MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=obj, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="/"), operator=+)], member=startsWith, postfix_operators=[], prefix_operators=['!'], qualifier=unifiedObjectName, selectors=[], type_arguments=None), operator=&&), else_statement=IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=isDirectory, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[MemberReference(member=obj, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equals, postfix_operators=[], prefix_operators=['!'], qualifier=unifiedObjectName, selectors=[], type_arguments=None), operator=&&), operandr=MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=obj, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="/"), operator=+)], member=startsWith, postfix_operators=[], prefix_operators=['!'], qualifier=unifiedObjectName, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="directory {}. {} does not match {}. Skipped"), MemberReference(member=isDirectory, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=unifiedObjectName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=obj, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=trace, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), label=None), ContinueStatement(goto=None, label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="{} does not match {}. Skipped"), MemberReference(member=unifiedObjectName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=obj, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=trace, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), label=None), ContinueStatement(goto=None, label=None)])), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unified name: {}, path {}"), MemberReference(member=unifiedObjectName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=tmp, selectors=[], type_arguments=None)], member=trace, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), label=None), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=tmp, selectors=[], type_arguments=None)], member=equals, postfix_operators=[], prefix_operators=['!'], qualifier=unifiedObjectName, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[MemberReference(member=unifiedObjectName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isSparkOrigin, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), operator=&&), operandr=MemberReference(member=fullListing, postfix_operators=[], prefix_operators=['!'], qualifier=, selectors=[]), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="{} created by Spark"), MemberReference(member=unifiedObjectName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=trace, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), label=None), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=unifiedObjectName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isJobSuccessful, postfix_operators=[], prefix_operators=['!'], qualifier=, selectors=[], type_arguments=None), else_statement=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=tmp, selectors=[], type_arguments=None)], member=nameWithoutTaskID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=previousElement, selectors=[], type_arguments=None)], member=nameWithoutTaskID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Colision identified between {} and {}"), MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=previousElement, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=tmp, selectors=[], type_arguments=None)], member=trace, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=tmp, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=cObj, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setCorrectSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getContentLength, postfix_operators=[], prefix_operators=[], qualifier=previousElement, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[], member=getContentLength, postfix_operators=[], prefix_operators=[], qualifier=tmp, selectors=[], type_arguments=None), operator=<), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="New candidate is {}. Removed {}"), MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=tmp, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=previousElement, selectors=[], type_arguments=None)], member=trace, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=previousElement, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=getAsObject, postfix_operators=[], prefix_operators=[], qualifier=tmp, selectors=[], type_arguments=None)), label=None)])), ContinueStatement(goto=None, label=None)]))]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="{} created by failed Spark job. Skipped"), MemberReference(member=unifiedObjectName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=trace, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), label=None), IfStatement(condition=MemberReference(member=fModeAutomaticDelete, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=hostName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), ClassCreator(arguments=[MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=tmp, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Path, sub_type=None)), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], member=delete, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)])), ContinueStatement(goto=None, label=None)]))])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=fs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)), label=None), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getContentLength, postfix_operators=[], prefix_operators=[], qualifier=previousElement, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>), operandr=MemberReference(member=fullListing, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=||), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=fs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=previousElement, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=cObj, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=hostName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=path, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=createFileStatus, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=hostName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getPath, postfix_operators=[], prefix_operators=[], qualifier=fs, selectors=[], type_arguments=None)], member=getObjName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getLen, postfix_operators=[], prefix_operators=[], qualifier=fs, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getModificationTime, postfix_operators=[], prefix_operators=[], qualifier=fs, selectors=[], type_arguments=None)], member=put, postfix_operators=[], prefix_operators=[], qualifier=objectCache, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=fs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=tmpResult, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=previousElement, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=getAsObject, postfix_operators=[], prefix_operators=[], qualifier=tmp, selectors=[], type_arguments=None)), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=res, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=tmp)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=StoredObject, sub_type=None))), label=None) end[}] if[binary_operation[binary_operation[member[.previousElement], !=, literal[null]], &&, binary_operation[binary_operation[call[previousElement.getContentLength, parameter[]], >, literal[0]], ||, member[.fullListing]]]] begin[{] call[LOG.trace, parameter[literal["Adding {} to the list"], call[previousElement.getPath, parameter[]]]] assign[member[.fs], call[.createFileStatus, parameter[member[.previousElement], member[.cObj], member[.hostName], member[.path]]]] if[binary_operation[member[.filter], ==, literal[null]]] begin[{] call[objectCache.put, parameter[call[.getObjName, parameter[member[.hostName], call[fs.getPath, parameter[]]]], call[fs.getLen, parameter[]], call[fs.getModificationTime, parameter[]]]] call[tmpResult.add, parameter[member[.fs]]] else begin[{] if[binary_operation[binary_operation[member[.filter], !=, literal[null]], &&, call[filter.accept, parameter[call[fs.getPath, parameter[]]]]]] begin[{] call[objectCache.put, parameter[call[.getObjName, parameter[member[.hostName], call[fs.getPath, parameter[]]]], call[fs.getLen, parameter[]], call[fs.getModificationTime, parameter[]]]] call[tmpResult.add, parameter[member[.fs]]] else begin[{] call[LOG.trace, parameter[literal["{} rejected by path filter during list"], call[fs.getPath, parameter[]]]] end[}] end[}] else begin[{] None end[}] call[LOG.debug, parameter[literal["Listing of {} completed with {} results"], call[path.toString, parameter[]], call[tmpResult.size, parameter[]]]] return[call[tmpResult.toArray, parameter[ArrayCreator(dimensions=[MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=tmpResult, selectors=[], type_arguments=None)], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=FileStatus, sub_type=None))]]] end[}] END[}]
Keyword[public] identifier[FileStatus] operator[SEP] operator[SEP] identifier[list] operator[SEP] Keyword[final] identifier[String] identifier[hostName] , Keyword[final] identifier[Path] identifier[path] , Keyword[final] Keyword[boolean] identifier[fullListing] , Keyword[final] Keyword[boolean] identifier[prefixBased] , Keyword[final] identifier[Boolean] identifier[isDirectory] , Keyword[final] Keyword[boolean] identifier[flatListing] , Keyword[final] identifier[PathFilter] identifier[filter] operator[SEP] Keyword[throws] identifier[IOException] { identifier[LOG] operator[SEP] identifier[debug] operator[SEP] literal[String] , identifier[path] operator[SEP] identifier[toString] operator[SEP] operator[SEP] , identifier[container] , identifier[hostName] operator[SEP] operator[SEP] Keyword[final] identifier[Container] identifier[cObj] operator[=] identifier[mJossAccount] operator[SEP] identifier[getAccount] operator[SEP] operator[SEP] operator[SEP] identifier[getContainer] operator[SEP] identifier[container] operator[SEP] operator[SEP] identifier[String] identifier[obj] operator[SEP] Keyword[if] operator[SEP] identifier[path] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[container] operator[SEP] operator[||] identifier[publicContainer] operator[SEP] { identifier[obj] operator[=] literal[String] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[path] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] identifier[startsWith] operator[SEP] identifier[container] operator[+] literal[String] operator[SEP] operator[SEP] { identifier[obj] operator[=] identifier[path] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] identifier[substring] operator[SEP] identifier[container] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[+] Other[1] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[path] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] identifier[startsWith] operator[SEP] identifier[hostName] operator[SEP] operator[SEP] { identifier[obj] operator[=] identifier[path] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] identifier[substring] operator[SEP] identifier[hostName] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[obj] operator[=] identifier[path] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] } identifier[LOG] operator[SEP] identifier[debug] operator[SEP] literal[String] , identifier[obj] , identifier[container] operator[SEP] operator[SEP] identifier[ArrayList] operator[<] identifier[FileStatus] operator[>] identifier[tmpResult] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[FileStatus] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[StoredObject] identifier[previousElement] operator[=] Other[null] operator[SEP] Keyword[boolean] identifier[moreData] operator[=] literal[boolean] operator[SEP] identifier[String] identifier[marker] operator[=] Other[null] operator[SEP] identifier[FileStatus] identifier[fs] operator[=] Other[null] operator[SEP] Keyword[while] operator[SEP] identifier[moreData] operator[SEP] { identifier[Collection] operator[<] identifier[StoredObject] operator[>] identifier[res] operator[=] identifier[cObj] operator[SEP] identifier[list] operator[SEP] identifier[obj] , identifier[marker] , identifier[pageListSize] operator[SEP] operator[SEP] identifier[moreData] operator[=] operator[SEP] identifier[res] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[==] identifier[pageListSize] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[marker] operator[==] Other[null] operator[&&] operator[SEP] identifier[res] operator[==] Other[null] operator[||] identifier[res] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[||] identifier[res] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[==] Other[0] operator[SEP] operator[SEP] { identifier[FileStatus] operator[SEP] operator[SEP] identifier[emptyRes] operator[=] { } operator[SEP] identifier[LOG] operator[SEP] identifier[debug] operator[SEP] literal[String] , identifier[obj] , identifier[container] operator[SEP] operator[SEP] Keyword[return] identifier[emptyRes] operator[SEP] } Keyword[for] operator[SEP] identifier[StoredObject] identifier[tmp] operator[:] identifier[res] operator[SEP] { identifier[marker] operator[=] identifier[tmp] operator[SEP] identifier[getAsObject] operator[SEP] operator[SEP] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[previousElement] operator[==] Other[null] operator[SEP] { identifier[setCorrectSize] operator[SEP] identifier[tmp] , identifier[cObj] operator[SEP] operator[SEP] identifier[previousElement] operator[=] identifier[tmp] operator[SEP] identifier[getAsObject] operator[SEP] operator[SEP] operator[SEP] Keyword[continue] operator[SEP] } identifier[String] identifier[unifiedObjectName] operator[=] identifier[extractUnifiedObjectName] operator[SEP] identifier[tmp] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[LOG] operator[SEP] identifier[trace] operator[SEP] literal[String] , identifier[unifiedObjectName] , identifier[obj] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[prefixBased] operator[&&] operator[!] identifier[obj] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[&&] operator[!] identifier[path] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] identifier[endsWith] operator[SEP] literal[String] operator[SEP] operator[&&] operator[!] identifier[unifiedObjectName] operator[SEP] identifier[equals] operator[SEP] identifier[obj] operator[SEP] operator[&&] operator[!] identifier[unifiedObjectName] operator[SEP] identifier[startsWith] operator[SEP] identifier[obj] operator[+] literal[String] operator[SEP] operator[SEP] { identifier[LOG] operator[SEP] identifier[trace] operator[SEP] literal[String] , identifier[unifiedObjectName] , identifier[obj] operator[SEP] operator[SEP] Keyword[continue] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[isDirectory] operator[&&] operator[!] identifier[unifiedObjectName] operator[SEP] identifier[equals] operator[SEP] identifier[obj] operator[SEP] operator[&&] operator[!] identifier[unifiedObjectName] operator[SEP] identifier[startsWith] operator[SEP] identifier[obj] operator[+] literal[String] operator[SEP] operator[SEP] { identifier[LOG] operator[SEP] identifier[trace] operator[SEP] literal[String] , identifier[isDirectory] , identifier[unifiedObjectName] , identifier[obj] operator[SEP] operator[SEP] Keyword[continue] operator[SEP] } identifier[LOG] operator[SEP] identifier[trace] operator[SEP] literal[String] , identifier[unifiedObjectName] , identifier[tmp] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[unifiedObjectName] operator[SEP] identifier[equals] operator[SEP] identifier[tmp] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[&&] identifier[isSparkOrigin] operator[SEP] identifier[unifiedObjectName] operator[SEP] operator[&&] operator[!] identifier[fullListing] operator[SEP] { identifier[LOG] operator[SEP] identifier[trace] operator[SEP] literal[String] , identifier[unifiedObjectName] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[isJobSuccessful] operator[SEP] identifier[unifiedObjectName] operator[SEP] operator[SEP] { identifier[LOG] operator[SEP] identifier[trace] operator[SEP] literal[String] , identifier[unifiedObjectName] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[fModeAutomaticDelete] operator[SEP] { identifier[delete] operator[SEP] identifier[hostName] , Keyword[new] identifier[Path] operator[SEP] identifier[tmp] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] , literal[boolean] operator[SEP] operator[SEP] } Keyword[continue] operator[SEP] } Keyword[else] { Keyword[if] operator[SEP] identifier[nameWithoutTaskID] operator[SEP] identifier[tmp] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[nameWithoutTaskID] operator[SEP] identifier[previousElement] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { identifier[LOG] operator[SEP] identifier[trace] operator[SEP] literal[String] , identifier[previousElement] operator[SEP] identifier[getName] operator[SEP] operator[SEP] , identifier[tmp] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[setCorrectSize] operator[SEP] identifier[tmp] , identifier[cObj] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[previousElement] operator[SEP] identifier[getContentLength] operator[SEP] operator[SEP] operator[<] identifier[tmp] operator[SEP] identifier[getContentLength] operator[SEP] operator[SEP] operator[SEP] { identifier[LOG] operator[SEP] identifier[trace] operator[SEP] literal[String] , identifier[tmp] operator[SEP] identifier[getName] operator[SEP] operator[SEP] , identifier[previousElement] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[previousElement] operator[=] identifier[tmp] operator[SEP] identifier[getAsObject] operator[SEP] operator[SEP] operator[SEP] } Keyword[continue] operator[SEP] } } } identifier[fs] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[previousElement] operator[SEP] identifier[getContentLength] operator[SEP] operator[SEP] operator[>] Other[0] operator[||] identifier[fullListing] operator[SEP] { identifier[fs] operator[=] identifier[createFileStatus] operator[SEP] identifier[previousElement] , identifier[cObj] , identifier[hostName] , identifier[path] operator[SEP] operator[SEP] identifier[objectCache] operator[SEP] identifier[put] operator[SEP] identifier[getObjName] operator[SEP] identifier[hostName] , identifier[fs] operator[SEP] identifier[getPath] operator[SEP] operator[SEP] operator[SEP] , identifier[fs] operator[SEP] identifier[getLen] operator[SEP] operator[SEP] , identifier[fs] operator[SEP] identifier[getModificationTime] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[tmpResult] operator[SEP] identifier[add] operator[SEP] identifier[fs] operator[SEP] operator[SEP] } identifier[previousElement] operator[=] identifier[tmp] operator[SEP] identifier[getAsObject] operator[SEP] operator[SEP] operator[SEP] } } Keyword[if] operator[SEP] identifier[previousElement] operator[!=] Other[null] operator[&&] operator[SEP] identifier[previousElement] operator[SEP] identifier[getContentLength] operator[SEP] operator[SEP] operator[>] Other[0] operator[||] identifier[fullListing] operator[SEP] operator[SEP] { identifier[LOG] operator[SEP] identifier[trace] operator[SEP] literal[String] , identifier[previousElement] operator[SEP] identifier[getPath] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[fs] operator[=] identifier[createFileStatus] operator[SEP] identifier[previousElement] , identifier[cObj] , identifier[hostName] , identifier[path] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[filter] operator[==] Other[null] operator[SEP] { identifier[objectCache] operator[SEP] identifier[put] operator[SEP] identifier[getObjName] operator[SEP] identifier[hostName] , identifier[fs] operator[SEP] identifier[getPath] operator[SEP] operator[SEP] operator[SEP] , identifier[fs] operator[SEP] identifier[getLen] operator[SEP] operator[SEP] , identifier[fs] operator[SEP] identifier[getModificationTime] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[tmpResult] operator[SEP] identifier[add] operator[SEP] identifier[fs] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[filter] operator[!=] Other[null] operator[&&] identifier[filter] operator[SEP] identifier[accept] operator[SEP] identifier[fs] operator[SEP] identifier[getPath] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { identifier[objectCache] operator[SEP] identifier[put] operator[SEP] identifier[getObjName] operator[SEP] identifier[hostName] , identifier[fs] operator[SEP] identifier[getPath] operator[SEP] operator[SEP] operator[SEP] , identifier[fs] operator[SEP] identifier[getLen] operator[SEP] operator[SEP] , identifier[fs] operator[SEP] identifier[getModificationTime] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[tmpResult] operator[SEP] identifier[add] operator[SEP] identifier[fs] operator[SEP] operator[SEP] } Keyword[else] { identifier[LOG] operator[SEP] identifier[trace] operator[SEP] literal[String] , identifier[fs] operator[SEP] identifier[getPath] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } identifier[LOG] operator[SEP] identifier[debug] operator[SEP] literal[String] , identifier[path] operator[SEP] identifier[toString] operator[SEP] operator[SEP] , identifier[tmpResult] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[tmpResult] operator[SEP] identifier[toArray] operator[SEP] Keyword[new] identifier[FileStatus] operator[SEP] identifier[tmpResult] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
private void increaseCapacity() { Object[] oldheap; // no handling of boundary conditions. // In the highly unlikely event of a rollover, // in theory, an exception will be thrown (negative array index in // array allocation?) oldheap = heap; // as per java collections, v.s. JDK 1.1 java util. heap = new Object[3 * heap.length / 2 + 1]; System.arraycopy(oldheap, 0, heap, 0, count); }
class class_name[name] begin[{] method[increaseCapacity, return_type[void], modifier[private], parameter[]] begin[{] local_variable[type[Object], oldheap] assign[member[.oldheap], member[.heap]] assign[member[.heap], ArrayCreator(dimensions=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=3), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=heap, selectors=[]), operator=*), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), operator=/), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+)], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Object, sub_type=None))] call[System.arraycopy, parameter[member[.oldheap], literal[0], member[.heap], literal[0], member[.count]]] end[}] END[}]
Keyword[private] Keyword[void] identifier[increaseCapacity] operator[SEP] operator[SEP] { identifier[Object] operator[SEP] operator[SEP] identifier[oldheap] operator[SEP] identifier[oldheap] operator[=] identifier[heap] operator[SEP] identifier[heap] operator[=] Keyword[new] identifier[Object] operator[SEP] Other[3] operator[*] identifier[heap] operator[SEP] identifier[length] operator[/] Other[2] operator[+] Other[1] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[arraycopy] operator[SEP] identifier[oldheap] , Other[0] , identifier[heap] , Other[0] , identifier[count] operator[SEP] operator[SEP] }
private void onLossPacket(Packet p) { if (p.respHeader == null) { p.respHeader = new ResponseHeader(-1, -1, ErrorCode.OK); } switch (getStatus()) { case AUTH_FAILED: p.respHeader.setErr(ErrorCode.AUTHENT_FAILED); break; case CLOSED: p.respHeader.setErr(ErrorCode.CLIENT_CLOSED); break; default: p.respHeader.setErr(ErrorCode.CONNECTION_LOSS); } finishPacket(p); }
class class_name[name] begin[{] method[onLossPacket, return_type[void], modifier[private], parameter[p]] begin[{] if[binary_operation[member[p.respHeader], ==, literal[null]]] begin[{] assign[member[p.respHeader], ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=1), Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=1), MemberReference(member=OK, postfix_operators=[], prefix_operators=[], qualifier=ErrorCode, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ResponseHeader, sub_type=None))] else begin[{] None end[}] SwitchStatement(cases=[SwitchStatementCase(case=['AUTH_FAILED'], statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=AUTHENT_FAILED, postfix_operators=[], prefix_operators=[], qualifier=ErrorCode, selectors=[])], member=setErr, postfix_operators=[], prefix_operators=[], qualifier=p.respHeader, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=['CLOSED'], statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=CLIENT_CLOSED, postfix_operators=[], prefix_operators=[], qualifier=ErrorCode, selectors=[])], member=setErr, postfix_operators=[], prefix_operators=[], qualifier=p.respHeader, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[], statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=CONNECTION_LOSS, postfix_operators=[], prefix_operators=[], qualifier=ErrorCode, selectors=[])], member=setErr, postfix_operators=[], prefix_operators=[], qualifier=p.respHeader, selectors=[], type_arguments=None), label=None)])], expression=MethodInvocation(arguments=[], member=getStatus, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None) call[.finishPacket, parameter[member[.p]]] end[}] END[}]
Keyword[private] Keyword[void] identifier[onLossPacket] operator[SEP] identifier[Packet] identifier[p] operator[SEP] { Keyword[if] operator[SEP] identifier[p] operator[SEP] identifier[respHeader] operator[==] Other[null] operator[SEP] { identifier[p] operator[SEP] identifier[respHeader] operator[=] Keyword[new] identifier[ResponseHeader] operator[SEP] operator[-] Other[1] , operator[-] Other[1] , identifier[ErrorCode] operator[SEP] identifier[OK] operator[SEP] operator[SEP] } Keyword[switch] operator[SEP] identifier[getStatus] operator[SEP] operator[SEP] operator[SEP] { Keyword[case] identifier[AUTH_FAILED] operator[:] identifier[p] operator[SEP] identifier[respHeader] operator[SEP] identifier[setErr] operator[SEP] identifier[ErrorCode] operator[SEP] identifier[AUTHENT_FAILED] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[CLOSED] operator[:] identifier[p] operator[SEP] identifier[respHeader] operator[SEP] identifier[setErr] operator[SEP] identifier[ErrorCode] operator[SEP] identifier[CLIENT_CLOSED] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[default] operator[:] identifier[p] operator[SEP] identifier[respHeader] operator[SEP] identifier[setErr] operator[SEP] identifier[ErrorCode] operator[SEP] identifier[CONNECTION_LOSS] operator[SEP] operator[SEP] } identifier[finishPacket] operator[SEP] identifier[p] operator[SEP] operator[SEP] }
public SecretKey toAes() { if (k == null) { return null; } SecretKey secretKey = new SecretKeySpec(k, "AES"); return secretKey; }
class class_name[name] begin[{] method[toAes, return_type[type[SecretKey]], modifier[public], parameter[]] begin[{] if[binary_operation[member[.k], ==, literal[null]]] begin[{] return[literal[null]] else begin[{] None end[}] local_variable[type[SecretKey], secretKey] return[member[.secretKey]] end[}] END[}]
Keyword[public] identifier[SecretKey] identifier[toAes] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[k] operator[==] Other[null] operator[SEP] { Keyword[return] Other[null] operator[SEP] } identifier[SecretKey] identifier[secretKey] operator[=] Keyword[new] identifier[SecretKeySpec] operator[SEP] identifier[k] , literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[secretKey] operator[SEP] }