code
stringlengths
63
466k
code_sememe
stringlengths
141
3.79M
token_type
stringlengths
274
1.23M
public static void fillCounting(int[] array , int offset, int length ) { for (int i = 0; i < length; i++) { array[i+offset] = i; } }
class class_name[name] begin[{] method[fillCounting, return_type[void], modifier[public static], parameter[array, offset, length]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=array, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=offset, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+))]), type==, value=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[fillCounting] operator[SEP] Keyword[int] operator[SEP] operator[SEP] identifier[array] , Keyword[int] identifier[offset] , Keyword[int] identifier[length] operator[SEP] { Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[array] operator[SEP] identifier[i] operator[+] identifier[offset] operator[SEP] operator[=] identifier[i] operator[SEP] } }
public Collection<DataSegment> getLazyAllSegments() { return CollectionUtils.createLazyCollectionFromStream( () -> dataSources.values().stream().flatMap(dataSource -> dataSource.getSegments().stream()), totalSegments ); }
class class_name[name] begin[{] method[getLazyAllSegments, return_type[type[Collection]], modifier[public], parameter[]] begin[{] return[call[CollectionUtils.createLazyCollectionFromStream, parameter[LambdaExpression(body=MethodInvocation(arguments=[], member=values, postfix_operators=[], prefix_operators=[], qualifier=dataSources, selectors=[MethodInvocation(arguments=[], member=stream, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[LambdaExpression(body=MethodInvocation(arguments=[], member=getSegments, postfix_operators=[], prefix_operators=[], qualifier=dataSource, selectors=[MethodInvocation(arguments=[], member=stream, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), parameters=[MemberReference(member=dataSource, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])])], member=flatMap, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), parameters=[]), member[.totalSegments]]]] end[}] END[}]
Keyword[public] identifier[Collection] operator[<] identifier[DataSegment] operator[>] identifier[getLazyAllSegments] operator[SEP] operator[SEP] { Keyword[return] identifier[CollectionUtils] operator[SEP] identifier[createLazyCollectionFromStream] operator[SEP] operator[SEP] operator[SEP] operator[->] identifier[dataSources] operator[SEP] identifier[values] operator[SEP] operator[SEP] operator[SEP] identifier[stream] operator[SEP] operator[SEP] operator[SEP] identifier[flatMap] operator[SEP] identifier[dataSource] operator[->] identifier[dataSource] operator[SEP] identifier[getSegments] operator[SEP] operator[SEP] operator[SEP] identifier[stream] operator[SEP] operator[SEP] operator[SEP] , identifier[totalSegments] operator[SEP] operator[SEP] }
private static void checkServerRunning(final DeviceImportInfo importInfo, final String toBeImported) throws DevFailed { XLOGGER.entry(); Device_5 devIDL5 = null; Device_4 devIDL4 = null; Device_3 devIDL3 = null; Device_2 devIDL2 = null; Device devIDL1 = null; try { // try IDL5 try { devIDL5 = narrowIDL5(importInfo); } catch (final BAD_PARAM e) { // try IDL4 try { devIDL4 = narrowIDL4(importInfo); } catch (final BAD_PARAM e4) { // maybe another IDL is currently running // try IDL3 try { devIDL3 = narrowIDL3(importInfo); } catch (final BAD_PARAM e1) { // maybe another IDL is currently running // try IDL2 try { devIDL2 = narrowIDL2(importInfo); } catch (final BAD_PARAM e2) { // maybe another IDL is currently running // try IDL1 try { devIDL1 = narrowIDL1(importInfo); } catch (final BAD_PARAM e3) { // may not occur, unknown CORBA server throw DevFailedUtils.newDevFailed(e); } } } } } if (devIDL5 == null && devIDL4 == null && devIDL3 == null && devIDL2 == null && devIDL1 == null) { LOGGER.debug("out, device is not running"); } else { checkDeviceName(toBeImported, devIDL5, devIDL4, devIDL3, devIDL2, devIDL1); } } catch (final org.omg.CORBA.TIMEOUT e) { // Receive a Timeout exception ---> It is not running !!!! LOGGER.debug("out on TIMEOUT"); } catch (final BAD_OPERATION e) { // System.err.println("Can't pack/unpack data sent to/from database in/to Any object"); throw DevFailedUtils.newDevFailed(e); } catch (final TRANSIENT e) { LOGGER.debug("out on TRANSIENT, device is not running"); } catch (final OBJECT_NOT_EXIST e) { LOGGER.debug("out on OBJECT_NOT_EXIST, device is not running"); } catch (final COMM_FAILURE e) { LOGGER.debug("out on COMM_FAILURE,, device is not running"); } catch (final BAD_INV_ORDER e) { LOGGER.debug("out on BAD_INV_ORDER,, device is not running"); } XLOGGER.exit(); }
class class_name[name] begin[{] method[checkServerRunning, return_type[void], modifier[private static], parameter[importInfo, toBeImported]] begin[{] call[XLOGGER.entry, parameter[]] local_variable[type[Device_5], devIDL5] local_variable[type[Device_4], devIDL4] local_variable[type[Device_3], devIDL3] local_variable[type[Device_2], devIDL2] local_variable[type[Device], devIDL1] TryStatement(block=[TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=devIDL5, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=importInfo, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=narrowIDL5, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None)], catches=[CatchClause(block=[TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=devIDL4, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=importInfo, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=narrowIDL4, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None)], catches=[CatchClause(block=[TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=devIDL3, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=importInfo, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=narrowIDL3, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None)], catches=[CatchClause(block=[TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=devIDL2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=importInfo, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=narrowIDL2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None)], catches=[CatchClause(block=[TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=devIDL1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=importInfo, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=narrowIDL1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=MethodInvocation(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=newDevFailed, postfix_operators=[], prefix_operators=[], qualifier=DevFailedUtils, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e3, types=['BAD_PARAM']))], finally_block=None, label=None, resources=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e2, types=['BAD_PARAM']))], finally_block=None, label=None, resources=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e1, types=['BAD_PARAM']))], finally_block=None, label=None, resources=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e4, types=['BAD_PARAM']))], finally_block=None, label=None, resources=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['BAD_PARAM']))], finally_block=None, label=None, resources=None), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=devIDL5, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), operandr=BinaryOperation(operandl=MemberReference(member=devIDL4, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), operator=&&), operandr=BinaryOperation(operandl=MemberReference(member=devIDL3, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), operator=&&), operandr=BinaryOperation(operandl=MemberReference(member=devIDL2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), operator=&&), operandr=BinaryOperation(operandl=MemberReference(member=devIDL1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), operator=&&), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=toBeImported, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=devIDL5, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=devIDL4, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=devIDL3, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=devIDL2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=devIDL1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=checkDeviceName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="out, device is not running")], member=debug, postfix_operators=[], prefix_operators=[], qualifier=LOGGER, selectors=[], type_arguments=None), label=None)]))], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="out on TIMEOUT")], member=debug, postfix_operators=[], prefix_operators=[], qualifier=LOGGER, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['org.omg.CORBA.TIMEOUT'])), CatchClause(block=[ThrowStatement(expression=MethodInvocation(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=newDevFailed, postfix_operators=[], prefix_operators=[], qualifier=DevFailedUtils, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['BAD_OPERATION'])), CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="out on TRANSIENT, device is not running")], member=debug, postfix_operators=[], prefix_operators=[], qualifier=LOGGER, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['TRANSIENT'])), CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="out on OBJECT_NOT_EXIST, device is not running")], member=debug, postfix_operators=[], prefix_operators=[], qualifier=LOGGER, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['OBJECT_NOT_EXIST'])), CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="out on COMM_FAILURE,, device is not running")], member=debug, postfix_operators=[], prefix_operators=[], qualifier=LOGGER, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['COMM_FAILURE'])), CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="out on BAD_INV_ORDER,, device is not running")], member=debug, postfix_operators=[], prefix_operators=[], qualifier=LOGGER, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['BAD_INV_ORDER']))], finally_block=None, label=None, resources=None) call[XLOGGER.exit, parameter[]] end[}] END[}]
Keyword[private] Keyword[static] Keyword[void] identifier[checkServerRunning] operator[SEP] Keyword[final] identifier[DeviceImportInfo] identifier[importInfo] , Keyword[final] identifier[String] identifier[toBeImported] operator[SEP] Keyword[throws] identifier[DevFailed] { identifier[XLOGGER] operator[SEP] identifier[entry] operator[SEP] operator[SEP] operator[SEP] identifier[Device_5] identifier[devIDL5] operator[=] Other[null] operator[SEP] identifier[Device_4] identifier[devIDL4] operator[=] Other[null] operator[SEP] identifier[Device_3] identifier[devIDL3] operator[=] Other[null] operator[SEP] identifier[Device_2] identifier[devIDL2] operator[=] Other[null] operator[SEP] identifier[Device] identifier[devIDL1] operator[=] Other[null] operator[SEP] Keyword[try] { Keyword[try] { identifier[devIDL5] operator[=] identifier[narrowIDL5] operator[SEP] identifier[importInfo] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] Keyword[final] identifier[BAD_PARAM] identifier[e] operator[SEP] { Keyword[try] { identifier[devIDL4] operator[=] identifier[narrowIDL4] operator[SEP] identifier[importInfo] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] Keyword[final] identifier[BAD_PARAM] identifier[e4] operator[SEP] { Keyword[try] { identifier[devIDL3] operator[=] identifier[narrowIDL3] operator[SEP] identifier[importInfo] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] Keyword[final] identifier[BAD_PARAM] identifier[e1] operator[SEP] { Keyword[try] { identifier[devIDL2] operator[=] identifier[narrowIDL2] operator[SEP] identifier[importInfo] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] Keyword[final] identifier[BAD_PARAM] identifier[e2] operator[SEP] { Keyword[try] { identifier[devIDL1] operator[=] identifier[narrowIDL1] operator[SEP] identifier[importInfo] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] Keyword[final] identifier[BAD_PARAM] identifier[e3] operator[SEP] { Keyword[throw] identifier[DevFailedUtils] operator[SEP] identifier[newDevFailed] operator[SEP] identifier[e] operator[SEP] operator[SEP] } } } } } Keyword[if] operator[SEP] identifier[devIDL5] operator[==] Other[null] operator[&&] identifier[devIDL4] operator[==] Other[null] operator[&&] identifier[devIDL3] operator[==] Other[null] operator[&&] identifier[devIDL2] operator[==] Other[null] operator[&&] identifier[devIDL1] operator[==] Other[null] operator[SEP] { identifier[LOGGER] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[else] { identifier[checkDeviceName] operator[SEP] identifier[toBeImported] , identifier[devIDL5] , identifier[devIDL4] , identifier[devIDL3] , identifier[devIDL2] , identifier[devIDL1] operator[SEP] operator[SEP] } } Keyword[catch] operator[SEP] Keyword[final] identifier[org] operator[SEP] identifier[omg] operator[SEP] identifier[CORBA] operator[SEP] identifier[TIMEOUT] identifier[e] operator[SEP] { identifier[LOGGER] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] Keyword[final] identifier[BAD_OPERATION] identifier[e] operator[SEP] { Keyword[throw] identifier[DevFailedUtils] operator[SEP] identifier[newDevFailed] operator[SEP] identifier[e] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] Keyword[final] identifier[TRANSIENT] identifier[e] operator[SEP] { identifier[LOGGER] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] Keyword[final] identifier[OBJECT_NOT_EXIST] identifier[e] operator[SEP] { identifier[LOGGER] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] Keyword[final] identifier[COMM_FAILURE] identifier[e] operator[SEP] { identifier[LOGGER] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] Keyword[final] identifier[BAD_INV_ORDER] identifier[e] operator[SEP] { identifier[LOGGER] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[SEP] operator[SEP] } identifier[XLOGGER] operator[SEP] identifier[exit] operator[SEP] operator[SEP] operator[SEP] }
public Matrix3f lookAlong(float dirX, float dirY, float dirZ, float upX, float upY, float upZ) { return lookAlong(dirX, dirY, dirZ, upX, upY, upZ, this); }
class class_name[name] begin[{] method[lookAlong, return_type[type[Matrix3f]], modifier[public], parameter[dirX, dirY, dirZ, upX, upY, upZ]] begin[{] return[call[.lookAlong, parameter[member[.dirX], member[.dirY], member[.dirZ], member[.upX], member[.upY], member[.upZ], THIS[]]]] end[}] END[}]
Keyword[public] identifier[Matrix3f] identifier[lookAlong] operator[SEP] Keyword[float] identifier[dirX] , Keyword[float] identifier[dirY] , Keyword[float] identifier[dirZ] , Keyword[float] identifier[upX] , Keyword[float] identifier[upY] , Keyword[float] identifier[upZ] operator[SEP] { Keyword[return] identifier[lookAlong] operator[SEP] identifier[dirX] , identifier[dirY] , identifier[dirZ] , identifier[upX] , identifier[upY] , identifier[upZ] , Keyword[this] operator[SEP] operator[SEP] }
@SuppressWarnings("unchecked") protected final MODEL_ID tryConvertId(Object id) { try { return (MODEL_ID) getModelBeanDescriptor().convertId(id); } catch (Exception e) { throw new UnprocessableEntityException(Messages.get("info.query.id.unprocessable.entity"), e); } }
class class_name[name] begin[{] method[tryConvertId, return_type[type[MODEL_ID]], modifier[final protected], parameter[id]] begin[{] TryStatement(block=[ReturnStatement(expression=Cast(expression=MethodInvocation(arguments=[], member=getModelBeanDescriptor, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[MemberReference(member=id, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=convertId, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=MODEL_ID, sub_type=None)), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="info.query.id.unprocessable.entity")], member=get, postfix_operators=[], prefix_operators=[], qualifier=Messages, selectors=[], type_arguments=None), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=UnprocessableEntityException, 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[}]
annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] Keyword[protected] Keyword[final] identifier[MODEL_ID] identifier[tryConvertId] operator[SEP] identifier[Object] identifier[id] operator[SEP] { Keyword[try] { Keyword[return] operator[SEP] identifier[MODEL_ID] operator[SEP] identifier[getModelBeanDescriptor] operator[SEP] operator[SEP] operator[SEP] identifier[convertId] operator[SEP] identifier[id] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[UnprocessableEntityException] operator[SEP] identifier[Messages] operator[SEP] identifier[get] operator[SEP] literal[String] operator[SEP] , identifier[e] operator[SEP] operator[SEP] } }
@SuppressWarnings("unchecked") public <T extends BaseWrapper<T>> T create(final Object entity, boolean isRevision) { if (entity == null) { return null; } // Create the key final DBWrapperKey key = new DBWrapperKey(entity); // Check to see if a wrapper has already been cached for the key final BaseWrapper cachedWrapper = wrapperCache.get(key); if (cachedWrapper != null) { return (T) cachedWrapper; } final DBBaseWrapper wrapper; if (entity instanceof ApplicationConfig) { // SERVER SETTINGS wrapper = new DBServerSettingsWrapper(getProviderFactory(), (ApplicationConfig) entity); } else if (entity instanceof EntitiesConfig) { // SERVER ENTITIES wrapper = new DBServerEntitiesWrapper(getProviderFactory(), (EntitiesConfig) entity); } else if (entity instanceof UndefinedEntity) { // UNDEFINED ENTITY wrapper = new DBServerUndefinedEntityWrapper(getProviderFactory(), (UndefinedEntity) entity); } else if (entity instanceof UndefinedSetting) { // UNDEFINED SETTING wrapper = new DBServerUndefinedSettingWrapper(getProviderFactory(), (UndefinedSetting) entity); } else if (entity instanceof Locale) { // Locale wrapper = new DBLocaleWrapper(getProviderFactory(), (Locale) entity); } else if (entity instanceof TranslationServer) { // Translation server throw new UnsupportedOperationException("A return class needs to be specified for TranslationServer entities."); } else if (entity instanceof Topic) { // TOPIC wrapper = new DBTopicWrapper(getProviderFactory(), (Topic) entity, isRevision); } else if (entity instanceof TopicSourceUrl) { // TOPIC SOURCE URL wrapper = new DBTopicSourceURLWrapper(getProviderFactory(), (TopicSourceUrl) entity, isRevision); } else if (entity instanceof TranslatedTopicData) { // TRANSLATED TOPIC wrapper = new DBTranslatedTopicDataWrapper(getProviderFactory(), (TranslatedTopicData) entity, isRevision); } else if (entity instanceof TranslatedTopicString) { // TRANSLATED TOPIC STRING wrapper = new DBTranslatedTopicStringWrapper(getProviderFactory(), (TranslatedTopicString) entity, isRevision); } else if (entity instanceof Tag) { // TAG wrapper = new DBTagWrapper(getProviderFactory(), (Tag) entity, isRevision); } else if (entity instanceof TagToCategory) { throw new UnsupportedOperationException("A return class needs to be specified for TagToCategory entities."); } else if (entity instanceof Category) { // CATEGORY wrapper = new DBCategoryWrapper(getProviderFactory(), (Category) entity, isRevision); } else if (entity instanceof PropertyTag) { // PROPERTY TAGS wrapper = new DBPropertyTagWrapper(getProviderFactory(), (PropertyTag) entity, isRevision); } else if (entity instanceof TopicToPropertyTag) { wrapper = new DBTopicToPropertyTagWrapper(getProviderFactory(), (TopicToPropertyTag) entity, isRevision); } else if (entity instanceof TagToPropertyTag) { wrapper = new DBTagToPropertyTagWrapper(getProviderFactory(), (TagToPropertyTag) entity, isRevision); } else if (entity instanceof ContentSpecToPropertyTag) { wrapper = new DBContentSpecToPropertyTagWrapper(getProviderFactory(), (ContentSpecToPropertyTag) entity, isRevision); } else if (entity instanceof PropertyTagToPropertyTagCategory) { wrapper = new DBPropertyTagToPropertyTagCategoryWrapper(getProviderFactory(), (PropertyTagToPropertyTagCategory) entity, isRevision); } else if (entity instanceof BlobConstants) { // BLOB CONSTANT wrapper = new DBBlobConstantWrapper(getProviderFactory(), (BlobConstants) entity, isRevision); } else if (entity instanceof StringConstants) { // STRING CONSTANT wrapper = new DBStringConstantWrapper(getProviderFactory(), (StringConstants) entity, isRevision); } else if (entity instanceof File) { // FILE wrapper = new DBFileWrapper(getProviderFactory(), (File) entity, isRevision); } else if (entity instanceof LanguageFile) { // LANGUAGE FILE wrapper = new DBLanguageFileWrapper(getProviderFactory(), (LanguageFile) entity, isRevision); } else if (entity instanceof ImageFile) { // IMAGE wrapper = new DBImageWrapper(getProviderFactory(), (ImageFile) entity, isRevision); } else if (entity instanceof LanguageImage) { // LANGUAGE IMAGE wrapper = new DBLanguageImageWrapper(getProviderFactory(), (LanguageImage) entity, isRevision); } else if (entity instanceof User) { // USER wrapper = new DBUserWrapper(getProviderFactory(), (User) entity, isRevision); } else if (entity instanceof ContentSpec) { // CONTENT SPEC throw new UnsupportedOperationException("A return class needs to be specified for ContentSpec entities."); } else if (entity instanceof CSNode) { // CONTENT SPEC NODE wrapper = new DBCSNodeWrapper(getProviderFactory(), (CSNode) entity, isRevision); } else if (entity instanceof CSNodeToCSNode) { wrapper = new DBCSRelatedNodeWrapper(getProviderFactory(), (CSNodeToCSNode) entity, isRevision); } else if (entity instanceof CSInfoNode) { // CONTENT SPEC INFO NODE wrapper = new DBCSInfoNodeWrapper(getProviderFactory(), (CSInfoNode) entity, isRevision); } else if (entity instanceof TranslatedCSNode) { // CONTENT SPEC TRANSLATED NODE wrapper = new DBTranslatedCSNodeWrapper(getProviderFactory(), (TranslatedCSNode) entity, isRevision); } else if (entity instanceof TranslatedCSNodeString) { // CONTENT SPEC TRANSLATED NODE STRING wrapper = new DBTranslatedCSNodeStringWrapper(getProviderFactory(), (TranslatedCSNodeString) entity, isRevision); } else if (entity instanceof CSTranslationDetail) { // CONTENT SPEC TRANSLATION DETAIL wrapper = new DBCSTranslationDetailWrapper(getProviderFactory(), (CSTranslationDetail) entity); } else { throw new IllegalArgumentException("Failed to create a Wrapper instance as there is no wrapper available for the Entity."); } // Add the wrapper to the cache wrapperCache.put(key, wrapper); return (T) wrapper; }
class class_name[name] begin[{] method[create, return_type[type[T]], modifier[public], parameter[entity, isRevision]] begin[{] if[binary_operation[member[.entity], ==, literal[null]]] begin[{] return[literal[null]] else begin[{] None end[}] local_variable[type[DBWrapperKey], key] local_variable[type[BaseWrapper], cachedWrapper] if[binary_operation[member[.cachedWrapper], !=, literal[null]]] begin[{] return[Cast(expression=MemberReference(member=cachedWrapper, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None))] else begin[{] None end[}] local_variable[type[DBBaseWrapper], wrapper] if[binary_operation[member[.entity], instanceof, type[ApplicationConfig]]] begin[{] assign[member[.wrapper], ClassCreator(arguments=[MethodInvocation(arguments=[], member=getProviderFactory, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), Cast(expression=MemberReference(member=entity, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=ApplicationConfig, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=DBServerSettingsWrapper, sub_type=None))] else begin[{] if[binary_operation[member[.entity], instanceof, type[EntitiesConfig]]] begin[{] assign[member[.wrapper], ClassCreator(arguments=[MethodInvocation(arguments=[], member=getProviderFactory, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), Cast(expression=MemberReference(member=entity, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=EntitiesConfig, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=DBServerEntitiesWrapper, sub_type=None))] else begin[{] if[binary_operation[member[.entity], instanceof, type[UndefinedEntity]]] begin[{] assign[member[.wrapper], ClassCreator(arguments=[MethodInvocation(arguments=[], member=getProviderFactory, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), Cast(expression=MemberReference(member=entity, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=UndefinedEntity, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=DBServerUndefinedEntityWrapper, sub_type=None))] else begin[{] if[binary_operation[member[.entity], instanceof, type[UndefinedSetting]]] begin[{] assign[member[.wrapper], ClassCreator(arguments=[MethodInvocation(arguments=[], member=getProviderFactory, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), Cast(expression=MemberReference(member=entity, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=UndefinedSetting, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=DBServerUndefinedSettingWrapper, sub_type=None))] else begin[{] if[binary_operation[member[.entity], instanceof, type[Locale]]] begin[{] assign[member[.wrapper], ClassCreator(arguments=[MethodInvocation(arguments=[], member=getProviderFactory, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), Cast(expression=MemberReference(member=entity, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Locale, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=DBLocaleWrapper, sub_type=None))] else begin[{] if[binary_operation[member[.entity], instanceof, type[TranslationServer]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="A return class needs to be specified for TranslationServer entities.")], 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) else begin[{] if[binary_operation[member[.entity], instanceof, type[Topic]]] begin[{] assign[member[.wrapper], ClassCreator(arguments=[MethodInvocation(arguments=[], member=getProviderFactory, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), Cast(expression=MemberReference(member=entity, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Topic, sub_type=None)), MemberReference(member=isRevision, 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=DBTopicWrapper, sub_type=None))] else begin[{] if[binary_operation[member[.entity], instanceof, type[TopicSourceUrl]]] begin[{] assign[member[.wrapper], ClassCreator(arguments=[MethodInvocation(arguments=[], member=getProviderFactory, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), Cast(expression=MemberReference(member=entity, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=TopicSourceUrl, sub_type=None)), MemberReference(member=isRevision, 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=DBTopicSourceURLWrapper, sub_type=None))] else begin[{] if[binary_operation[member[.entity], instanceof, type[TranslatedTopicData]]] begin[{] assign[member[.wrapper], ClassCreator(arguments=[MethodInvocation(arguments=[], member=getProviderFactory, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), Cast(expression=MemberReference(member=entity, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=TranslatedTopicData, sub_type=None)), MemberReference(member=isRevision, 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=DBTranslatedTopicDataWrapper, sub_type=None))] else begin[{] if[binary_operation[member[.entity], instanceof, type[TranslatedTopicString]]] begin[{] assign[member[.wrapper], ClassCreator(arguments=[MethodInvocation(arguments=[], member=getProviderFactory, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), Cast(expression=MemberReference(member=entity, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=TranslatedTopicString, sub_type=None)), MemberReference(member=isRevision, 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=DBTranslatedTopicStringWrapper, sub_type=None))] else begin[{] if[binary_operation[member[.entity], instanceof, type[Tag]]] begin[{] assign[member[.wrapper], ClassCreator(arguments=[MethodInvocation(arguments=[], member=getProviderFactory, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), Cast(expression=MemberReference(member=entity, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Tag, sub_type=None)), MemberReference(member=isRevision, 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=DBTagWrapper, sub_type=None))] else begin[{] if[binary_operation[member[.entity], instanceof, type[TagToCategory]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="A return class needs to be specified for TagToCategory entities.")], 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) else begin[{] if[binary_operation[member[.entity], instanceof, type[Category]]] begin[{] assign[member[.wrapper], ClassCreator(arguments=[MethodInvocation(arguments=[], member=getProviderFactory, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), Cast(expression=MemberReference(member=entity, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Category, sub_type=None)), MemberReference(member=isRevision, 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=DBCategoryWrapper, sub_type=None))] else begin[{] if[binary_operation[member[.entity], instanceof, type[PropertyTag]]] begin[{] assign[member[.wrapper], ClassCreator(arguments=[MethodInvocation(arguments=[], member=getProviderFactory, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), Cast(expression=MemberReference(member=entity, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=PropertyTag, sub_type=None)), MemberReference(member=isRevision, 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=DBPropertyTagWrapper, sub_type=None))] else begin[{] if[binary_operation[member[.entity], instanceof, type[TopicToPropertyTag]]] begin[{] assign[member[.wrapper], ClassCreator(arguments=[MethodInvocation(arguments=[], member=getProviderFactory, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), Cast(expression=MemberReference(member=entity, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=TopicToPropertyTag, sub_type=None)), MemberReference(member=isRevision, 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=DBTopicToPropertyTagWrapper, sub_type=None))] else begin[{] if[binary_operation[member[.entity], instanceof, type[TagToPropertyTag]]] begin[{] assign[member[.wrapper], ClassCreator(arguments=[MethodInvocation(arguments=[], member=getProviderFactory, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), Cast(expression=MemberReference(member=entity, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=TagToPropertyTag, sub_type=None)), MemberReference(member=isRevision, 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=DBTagToPropertyTagWrapper, sub_type=None))] else begin[{] if[binary_operation[member[.entity], instanceof, type[ContentSpecToPropertyTag]]] begin[{] assign[member[.wrapper], ClassCreator(arguments=[MethodInvocation(arguments=[], member=getProviderFactory, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), Cast(expression=MemberReference(member=entity, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=ContentSpecToPropertyTag, sub_type=None)), MemberReference(member=isRevision, 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=DBContentSpecToPropertyTagWrapper, sub_type=None))] else begin[{] if[binary_operation[member[.entity], instanceof, type[PropertyTagToPropertyTagCategory]]] begin[{] assign[member[.wrapper], ClassCreator(arguments=[MethodInvocation(arguments=[], member=getProviderFactory, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), Cast(expression=MemberReference(member=entity, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=PropertyTagToPropertyTagCategory, sub_type=None)), MemberReference(member=isRevision, 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=DBPropertyTagToPropertyTagCategoryWrapper, sub_type=None))] else begin[{] if[binary_operation[member[.entity], instanceof, type[BlobConstants]]] begin[{] assign[member[.wrapper], ClassCreator(arguments=[MethodInvocation(arguments=[], member=getProviderFactory, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), Cast(expression=MemberReference(member=entity, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=BlobConstants, sub_type=None)), MemberReference(member=isRevision, 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=DBBlobConstantWrapper, sub_type=None))] else begin[{] if[binary_operation[member[.entity], instanceof, type[StringConstants]]] begin[{] assign[member[.wrapper], ClassCreator(arguments=[MethodInvocation(arguments=[], member=getProviderFactory, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), Cast(expression=MemberReference(member=entity, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=StringConstants, sub_type=None)), MemberReference(member=isRevision, 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=DBStringConstantWrapper, sub_type=None))] else begin[{] if[binary_operation[member[.entity], instanceof, type[File]]] begin[{] assign[member[.wrapper], ClassCreator(arguments=[MethodInvocation(arguments=[], member=getProviderFactory, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), Cast(expression=MemberReference(member=entity, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=File, sub_type=None)), MemberReference(member=isRevision, 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=DBFileWrapper, sub_type=None))] else begin[{] if[binary_operation[member[.entity], instanceof, type[LanguageFile]]] begin[{] assign[member[.wrapper], ClassCreator(arguments=[MethodInvocation(arguments=[], member=getProviderFactory, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), Cast(expression=MemberReference(member=entity, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=LanguageFile, sub_type=None)), MemberReference(member=isRevision, 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=DBLanguageFileWrapper, sub_type=None))] else begin[{] if[binary_operation[member[.entity], instanceof, type[ImageFile]]] begin[{] assign[member[.wrapper], ClassCreator(arguments=[MethodInvocation(arguments=[], member=getProviderFactory, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), Cast(expression=MemberReference(member=entity, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=ImageFile, sub_type=None)), MemberReference(member=isRevision, 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=DBImageWrapper, sub_type=None))] else begin[{] if[binary_operation[member[.entity], instanceof, type[LanguageImage]]] begin[{] assign[member[.wrapper], ClassCreator(arguments=[MethodInvocation(arguments=[], member=getProviderFactory, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), Cast(expression=MemberReference(member=entity, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=LanguageImage, sub_type=None)), MemberReference(member=isRevision, 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=DBLanguageImageWrapper, sub_type=None))] else begin[{] if[binary_operation[member[.entity], instanceof, type[User]]] begin[{] assign[member[.wrapper], ClassCreator(arguments=[MethodInvocation(arguments=[], member=getProviderFactory, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), Cast(expression=MemberReference(member=entity, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=User, sub_type=None)), MemberReference(member=isRevision, 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=DBUserWrapper, sub_type=None))] else begin[{] if[binary_operation[member[.entity], instanceof, type[ContentSpec]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="A return class needs to be specified for ContentSpec entities.")], 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) else begin[{] if[binary_operation[member[.entity], instanceof, type[CSNode]]] begin[{] assign[member[.wrapper], ClassCreator(arguments=[MethodInvocation(arguments=[], member=getProviderFactory, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), Cast(expression=MemberReference(member=entity, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=CSNode, sub_type=None)), MemberReference(member=isRevision, 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=DBCSNodeWrapper, sub_type=None))] else begin[{] if[binary_operation[member[.entity], instanceof, type[CSNodeToCSNode]]] begin[{] assign[member[.wrapper], ClassCreator(arguments=[MethodInvocation(arguments=[], member=getProviderFactory, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), Cast(expression=MemberReference(member=entity, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=CSNodeToCSNode, sub_type=None)), MemberReference(member=isRevision, 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=DBCSRelatedNodeWrapper, sub_type=None))] else begin[{] if[binary_operation[member[.entity], instanceof, type[CSInfoNode]]] begin[{] assign[member[.wrapper], ClassCreator(arguments=[MethodInvocation(arguments=[], member=getProviderFactory, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), Cast(expression=MemberReference(member=entity, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=CSInfoNode, sub_type=None)), MemberReference(member=isRevision, 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=DBCSInfoNodeWrapper, sub_type=None))] else begin[{] if[binary_operation[member[.entity], instanceof, type[TranslatedCSNode]]] begin[{] assign[member[.wrapper], ClassCreator(arguments=[MethodInvocation(arguments=[], member=getProviderFactory, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), Cast(expression=MemberReference(member=entity, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=TranslatedCSNode, sub_type=None)), MemberReference(member=isRevision, 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=DBTranslatedCSNodeWrapper, sub_type=None))] else begin[{] if[binary_operation[member[.entity], instanceof, type[TranslatedCSNodeString]]] begin[{] assign[member[.wrapper], ClassCreator(arguments=[MethodInvocation(arguments=[], member=getProviderFactory, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), Cast(expression=MemberReference(member=entity, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=TranslatedCSNodeString, sub_type=None)), MemberReference(member=isRevision, 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=DBTranslatedCSNodeStringWrapper, sub_type=None))] else begin[{] if[binary_operation[member[.entity], instanceof, type[CSTranslationDetail]]] begin[{] assign[member[.wrapper], ClassCreator(arguments=[MethodInvocation(arguments=[], member=getProviderFactory, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), Cast(expression=MemberReference(member=entity, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=CSTranslationDetail, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=DBCSTranslationDetailWrapper, sub_type=None))] else begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Failed to create a Wrapper instance as there is no wrapper available for the Entity.")], 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[}] end[}] end[}] end[}] end[}] end[}] end[}] end[}] end[}] end[}] end[}] end[}] end[}] end[}] end[}] end[}] end[}] end[}] end[}] end[}] end[}] end[}] end[}] end[}] end[}] end[}] call[wrapperCache.put, parameter[member[.key], member[.wrapper]]] return[Cast(expression=MemberReference(member=wrapper, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None))] end[}] END[}]
annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] Keyword[public] operator[<] identifier[T] Keyword[extends] identifier[BaseWrapper] operator[<] identifier[T] operator[>] operator[>] identifier[T] identifier[create] operator[SEP] Keyword[final] identifier[Object] identifier[entity] , Keyword[boolean] identifier[isRevision] operator[SEP] { Keyword[if] operator[SEP] identifier[entity] operator[==] Other[null] operator[SEP] { Keyword[return] Other[null] operator[SEP] } Keyword[final] identifier[DBWrapperKey] identifier[key] operator[=] Keyword[new] identifier[DBWrapperKey] operator[SEP] identifier[entity] operator[SEP] operator[SEP] Keyword[final] identifier[BaseWrapper] identifier[cachedWrapper] operator[=] identifier[wrapperCache] operator[SEP] identifier[get] operator[SEP] identifier[key] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[cachedWrapper] operator[!=] Other[null] operator[SEP] { Keyword[return] operator[SEP] identifier[T] operator[SEP] identifier[cachedWrapper] operator[SEP] } Keyword[final] identifier[DBBaseWrapper] identifier[wrapper] operator[SEP] Keyword[if] operator[SEP] identifier[entity] Keyword[instanceof] identifier[ApplicationConfig] operator[SEP] { identifier[wrapper] operator[=] Keyword[new] identifier[DBServerSettingsWrapper] operator[SEP] identifier[getProviderFactory] operator[SEP] operator[SEP] , operator[SEP] identifier[ApplicationConfig] operator[SEP] identifier[entity] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[entity] Keyword[instanceof] identifier[EntitiesConfig] operator[SEP] { identifier[wrapper] operator[=] Keyword[new] identifier[DBServerEntitiesWrapper] operator[SEP] identifier[getProviderFactory] operator[SEP] operator[SEP] , operator[SEP] identifier[EntitiesConfig] operator[SEP] identifier[entity] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[entity] Keyword[instanceof] identifier[UndefinedEntity] operator[SEP] { identifier[wrapper] operator[=] Keyword[new] identifier[DBServerUndefinedEntityWrapper] operator[SEP] identifier[getProviderFactory] operator[SEP] operator[SEP] , operator[SEP] identifier[UndefinedEntity] operator[SEP] identifier[entity] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[entity] Keyword[instanceof] identifier[UndefinedSetting] operator[SEP] { identifier[wrapper] operator[=] Keyword[new] identifier[DBServerUndefinedSettingWrapper] operator[SEP] identifier[getProviderFactory] operator[SEP] operator[SEP] , operator[SEP] identifier[UndefinedSetting] operator[SEP] identifier[entity] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[entity] Keyword[instanceof] identifier[Locale] operator[SEP] { identifier[wrapper] operator[=] Keyword[new] identifier[DBLocaleWrapper] operator[SEP] identifier[getProviderFactory] operator[SEP] operator[SEP] , operator[SEP] identifier[Locale] operator[SEP] identifier[entity] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[entity] Keyword[instanceof] identifier[TranslationServer] operator[SEP] { Keyword[throw] Keyword[new] identifier[UnsupportedOperationException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[entity] Keyword[instanceof] identifier[Topic] operator[SEP] { identifier[wrapper] operator[=] Keyword[new] identifier[DBTopicWrapper] operator[SEP] identifier[getProviderFactory] operator[SEP] operator[SEP] , operator[SEP] identifier[Topic] operator[SEP] identifier[entity] , identifier[isRevision] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[entity] Keyword[instanceof] identifier[TopicSourceUrl] operator[SEP] { identifier[wrapper] operator[=] Keyword[new] identifier[DBTopicSourceURLWrapper] operator[SEP] identifier[getProviderFactory] operator[SEP] operator[SEP] , operator[SEP] identifier[TopicSourceUrl] operator[SEP] identifier[entity] , identifier[isRevision] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[entity] Keyword[instanceof] identifier[TranslatedTopicData] operator[SEP] { identifier[wrapper] operator[=] Keyword[new] identifier[DBTranslatedTopicDataWrapper] operator[SEP] identifier[getProviderFactory] operator[SEP] operator[SEP] , operator[SEP] identifier[TranslatedTopicData] operator[SEP] identifier[entity] , identifier[isRevision] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[entity] Keyword[instanceof] identifier[TranslatedTopicString] operator[SEP] { identifier[wrapper] operator[=] Keyword[new] identifier[DBTranslatedTopicStringWrapper] operator[SEP] identifier[getProviderFactory] operator[SEP] operator[SEP] , operator[SEP] identifier[TranslatedTopicString] operator[SEP] identifier[entity] , identifier[isRevision] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[entity] Keyword[instanceof] identifier[Tag] operator[SEP] { identifier[wrapper] operator[=] Keyword[new] identifier[DBTagWrapper] operator[SEP] identifier[getProviderFactory] operator[SEP] operator[SEP] , operator[SEP] identifier[Tag] operator[SEP] identifier[entity] , identifier[isRevision] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[entity] Keyword[instanceof] identifier[TagToCategory] operator[SEP] { Keyword[throw] Keyword[new] identifier[UnsupportedOperationException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[entity] Keyword[instanceof] identifier[Category] operator[SEP] { identifier[wrapper] operator[=] Keyword[new] identifier[DBCategoryWrapper] operator[SEP] identifier[getProviderFactory] operator[SEP] operator[SEP] , operator[SEP] identifier[Category] operator[SEP] identifier[entity] , identifier[isRevision] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[entity] Keyword[instanceof] identifier[PropertyTag] operator[SEP] { identifier[wrapper] operator[=] Keyword[new] identifier[DBPropertyTagWrapper] operator[SEP] identifier[getProviderFactory] operator[SEP] operator[SEP] , operator[SEP] identifier[PropertyTag] operator[SEP] identifier[entity] , identifier[isRevision] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[entity] Keyword[instanceof] identifier[TopicToPropertyTag] operator[SEP] { identifier[wrapper] operator[=] Keyword[new] identifier[DBTopicToPropertyTagWrapper] operator[SEP] identifier[getProviderFactory] operator[SEP] operator[SEP] , operator[SEP] identifier[TopicToPropertyTag] operator[SEP] identifier[entity] , identifier[isRevision] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[entity] Keyword[instanceof] identifier[TagToPropertyTag] operator[SEP] { identifier[wrapper] operator[=] Keyword[new] identifier[DBTagToPropertyTagWrapper] operator[SEP] identifier[getProviderFactory] operator[SEP] operator[SEP] , operator[SEP] identifier[TagToPropertyTag] operator[SEP] identifier[entity] , identifier[isRevision] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[entity] Keyword[instanceof] identifier[ContentSpecToPropertyTag] operator[SEP] { identifier[wrapper] operator[=] Keyword[new] identifier[DBContentSpecToPropertyTagWrapper] operator[SEP] identifier[getProviderFactory] operator[SEP] operator[SEP] , operator[SEP] identifier[ContentSpecToPropertyTag] operator[SEP] identifier[entity] , identifier[isRevision] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[entity] Keyword[instanceof] identifier[PropertyTagToPropertyTagCategory] operator[SEP] { identifier[wrapper] operator[=] Keyword[new] identifier[DBPropertyTagToPropertyTagCategoryWrapper] operator[SEP] identifier[getProviderFactory] operator[SEP] operator[SEP] , operator[SEP] identifier[PropertyTagToPropertyTagCategory] operator[SEP] identifier[entity] , identifier[isRevision] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[entity] Keyword[instanceof] identifier[BlobConstants] operator[SEP] { identifier[wrapper] operator[=] Keyword[new] identifier[DBBlobConstantWrapper] operator[SEP] identifier[getProviderFactory] operator[SEP] operator[SEP] , operator[SEP] identifier[BlobConstants] operator[SEP] identifier[entity] , identifier[isRevision] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[entity] Keyword[instanceof] identifier[StringConstants] operator[SEP] { identifier[wrapper] operator[=] Keyword[new] identifier[DBStringConstantWrapper] operator[SEP] identifier[getProviderFactory] operator[SEP] operator[SEP] , operator[SEP] identifier[StringConstants] operator[SEP] identifier[entity] , identifier[isRevision] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[entity] Keyword[instanceof] identifier[File] operator[SEP] { identifier[wrapper] operator[=] Keyword[new] identifier[DBFileWrapper] operator[SEP] identifier[getProviderFactory] operator[SEP] operator[SEP] , operator[SEP] identifier[File] operator[SEP] identifier[entity] , identifier[isRevision] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[entity] Keyword[instanceof] identifier[LanguageFile] operator[SEP] { identifier[wrapper] operator[=] Keyword[new] identifier[DBLanguageFileWrapper] operator[SEP] identifier[getProviderFactory] operator[SEP] operator[SEP] , operator[SEP] identifier[LanguageFile] operator[SEP] identifier[entity] , identifier[isRevision] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[entity] Keyword[instanceof] identifier[ImageFile] operator[SEP] { identifier[wrapper] operator[=] Keyword[new] identifier[DBImageWrapper] operator[SEP] identifier[getProviderFactory] operator[SEP] operator[SEP] , operator[SEP] identifier[ImageFile] operator[SEP] identifier[entity] , identifier[isRevision] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[entity] Keyword[instanceof] identifier[LanguageImage] operator[SEP] { identifier[wrapper] operator[=] Keyword[new] identifier[DBLanguageImageWrapper] operator[SEP] identifier[getProviderFactory] operator[SEP] operator[SEP] , operator[SEP] identifier[LanguageImage] operator[SEP] identifier[entity] , identifier[isRevision] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[entity] Keyword[instanceof] identifier[User] operator[SEP] { identifier[wrapper] operator[=] Keyword[new] identifier[DBUserWrapper] operator[SEP] identifier[getProviderFactory] operator[SEP] operator[SEP] , operator[SEP] identifier[User] operator[SEP] identifier[entity] , identifier[isRevision] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[entity] Keyword[instanceof] identifier[ContentSpec] operator[SEP] { Keyword[throw] Keyword[new] identifier[UnsupportedOperationException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[entity] Keyword[instanceof] identifier[CSNode] operator[SEP] { identifier[wrapper] operator[=] Keyword[new] identifier[DBCSNodeWrapper] operator[SEP] identifier[getProviderFactory] operator[SEP] operator[SEP] , operator[SEP] identifier[CSNode] operator[SEP] identifier[entity] , identifier[isRevision] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[entity] Keyword[instanceof] identifier[CSNodeToCSNode] operator[SEP] { identifier[wrapper] operator[=] Keyword[new] identifier[DBCSRelatedNodeWrapper] operator[SEP] identifier[getProviderFactory] operator[SEP] operator[SEP] , operator[SEP] identifier[CSNodeToCSNode] operator[SEP] identifier[entity] , identifier[isRevision] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[entity] Keyword[instanceof] identifier[CSInfoNode] operator[SEP] { identifier[wrapper] operator[=] Keyword[new] identifier[DBCSInfoNodeWrapper] operator[SEP] identifier[getProviderFactory] operator[SEP] operator[SEP] , operator[SEP] identifier[CSInfoNode] operator[SEP] identifier[entity] , identifier[isRevision] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[entity] Keyword[instanceof] identifier[TranslatedCSNode] operator[SEP] { identifier[wrapper] operator[=] Keyword[new] identifier[DBTranslatedCSNodeWrapper] operator[SEP] identifier[getProviderFactory] operator[SEP] operator[SEP] , operator[SEP] identifier[TranslatedCSNode] operator[SEP] identifier[entity] , identifier[isRevision] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[entity] Keyword[instanceof] identifier[TranslatedCSNodeString] operator[SEP] { identifier[wrapper] operator[=] Keyword[new] identifier[DBTranslatedCSNodeStringWrapper] operator[SEP] identifier[getProviderFactory] operator[SEP] operator[SEP] , operator[SEP] identifier[TranslatedCSNodeString] operator[SEP] identifier[entity] , identifier[isRevision] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[entity] Keyword[instanceof] identifier[CSTranslationDetail] operator[SEP] { identifier[wrapper] operator[=] Keyword[new] identifier[DBCSTranslationDetailWrapper] operator[SEP] identifier[getProviderFactory] operator[SEP] operator[SEP] , operator[SEP] identifier[CSTranslationDetail] operator[SEP] identifier[entity] operator[SEP] operator[SEP] } Keyword[else] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] } identifier[wrapperCache] operator[SEP] identifier[put] operator[SEP] identifier[key] , identifier[wrapper] operator[SEP] operator[SEP] Keyword[return] operator[SEP] identifier[T] operator[SEP] identifier[wrapper] operator[SEP] }
public void setTags(String tags) { if (GitTaskUtils.isNullOrBlankString(tags)) { throw new BuildException("Invalid tag names provided."); } this.tags = tags.split(","); }
class class_name[name] begin[{] method[setTags, return_type[void], modifier[public], parameter[tags]] begin[{] if[call[GitTaskUtils.isNullOrBlankString, parameter[member[.tags]]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Invalid tag names provided.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=BuildException, sub_type=None)), label=None) else begin[{] None end[}] assign[THIS[member[None.tags]], call[tags.split, parameter[literal[","]]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[setTags] operator[SEP] identifier[String] identifier[tags] operator[SEP] { Keyword[if] operator[SEP] identifier[GitTaskUtils] operator[SEP] identifier[isNullOrBlankString] operator[SEP] identifier[tags] operator[SEP] operator[SEP] { Keyword[throw] Keyword[new] identifier[BuildException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[this] operator[SEP] identifier[tags] operator[=] identifier[tags] operator[SEP] identifier[split] operator[SEP] literal[String] operator[SEP] operator[SEP] }
public final int getInt32(final int pos) { final int position = origin + pos; if (pos + 3 >= limit || pos < 0) throw new IllegalArgumentException("limit excceed: " + (pos < 0 ? pos : (pos + 3))); byte[] buf = buffer; return (0xff & buf[position]) | ((0xff & buf[position + 1]) << 8) | ((0xff & buf[position + 2]) << 16) | ((buf[position + 3]) << 24); }
class class_name[name] begin[{] method[getInt32, return_type[type[int]], modifier[final public], parameter[pos]] begin[{] local_variable[type[int], position] if[binary_operation[binary_operation[binary_operation[member[.pos], +, literal[3]], >=, member[.limit]], ||, binary_operation[member[.pos], <, literal[0]]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="limit excceed: "), operandr=TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=pos, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=<), if_false=BinaryOperation(operandl=MemberReference(member=pos, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=3), operator=+), if_true=MemberReference(member=pos, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None) else begin[{] None end[}] local_variable[type[byte], buf] return[binary_operation[binary_operation[binary_operation[binary_operation[literal[0xff], &, member[.buf]], |, binary_operation[binary_operation[literal[0xff], &, member[.buf]], <<, literal[8]]], |, binary_operation[binary_operation[literal[0xff], &, member[.buf]], <<, literal[16]]], |, binary_operation[member[.buf], <<, literal[24]]]] end[}] END[}]
Keyword[public] Keyword[final] Keyword[int] identifier[getInt32] operator[SEP] Keyword[final] Keyword[int] identifier[pos] operator[SEP] { Keyword[final] Keyword[int] identifier[position] operator[=] identifier[origin] operator[+] identifier[pos] operator[SEP] Keyword[if] operator[SEP] identifier[pos] operator[+] Other[3] operator[>=] identifier[limit] operator[||] identifier[pos] operator[<] Other[0] operator[SEP] Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[+] operator[SEP] identifier[pos] operator[<] Other[0] operator[?] identifier[pos] operator[:] operator[SEP] identifier[pos] operator[+] Other[3] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[buf] operator[=] identifier[buffer] operator[SEP] Keyword[return] operator[SEP] literal[Integer] operator[&] identifier[buf] operator[SEP] identifier[position] operator[SEP] operator[SEP] operator[|] operator[SEP] operator[SEP] literal[Integer] operator[&] identifier[buf] operator[SEP] identifier[position] operator[+] Other[1] operator[SEP] operator[SEP] operator[<<] Other[8] operator[SEP] operator[|] operator[SEP] operator[SEP] literal[Integer] operator[&] identifier[buf] operator[SEP] identifier[position] operator[+] Other[2] operator[SEP] operator[SEP] operator[<<] Other[16] operator[SEP] operator[|] operator[SEP] operator[SEP] identifier[buf] operator[SEP] identifier[position] operator[+] Other[3] operator[SEP] operator[SEP] operator[<<] Other[24] operator[SEP] operator[SEP] }
public TaskResult add(String key, ArrayList<CharSequence> value) { mBundle.putCharSequenceArrayList(key, value); return this; }
class class_name[name] begin[{] method[add, return_type[type[TaskResult]], modifier[public], parameter[key, value]] begin[{] call[mBundle.putCharSequenceArrayList, parameter[member[.key], member[.value]]] return[THIS[]] end[}] END[}]
Keyword[public] identifier[TaskResult] identifier[add] operator[SEP] identifier[String] identifier[key] , identifier[ArrayList] operator[<] identifier[CharSequence] operator[>] identifier[value] operator[SEP] { identifier[mBundle] operator[SEP] identifier[putCharSequenceArrayList] operator[SEP] identifier[key] , identifier[value] operator[SEP] operator[SEP] Keyword[return] Keyword[this] operator[SEP] }
public void apply(IntFloatVector other, LambdaBinOpFloat lambda, boolean skipZeros) { if (other instanceof IntFloatSortedVector) { applyToSorted((IntFloatSortedVector)other, lambda, false); } else if (other instanceof IntFloatHashVector) { other = new IntFloatSortedVector((IntFloatHashVector) other); applyToSorted((IntFloatSortedVector) other, lambda, false); } else if (other instanceof IntFloatDenseVector) { other = new IntFloatSortedVector((IntFloatDenseVector) other); applyToSorted((IntFloatSortedVector) other, lambda, false); } else { // TODO: we could just add a generic constructor. throw new IllegalStateException("Unhandled vector type: " + other.getClass()); } }
class class_name[name] begin[{] method[apply, return_type[void], modifier[public], parameter[other, lambda, skipZeros]] begin[{] if[binary_operation[member[.other], instanceof, type[IntFloatSortedVector]]] begin[{] call[.applyToSorted, parameter[Cast(expression=MemberReference(member=other, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=IntFloatSortedVector, sub_type=None)), member[.lambda], literal[false]]] else begin[{] if[binary_operation[member[.other], instanceof, type[IntFloatHashVector]]] begin[{] assign[member[.other], ClassCreator(arguments=[Cast(expression=MemberReference(member=other, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=IntFloatHashVector, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IntFloatSortedVector, sub_type=None))] call[.applyToSorted, parameter[Cast(expression=MemberReference(member=other, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=IntFloatSortedVector, sub_type=None)), member[.lambda], literal[false]]] else begin[{] if[binary_operation[member[.other], instanceof, type[IntFloatDenseVector]]] begin[{] assign[member[.other], ClassCreator(arguments=[Cast(expression=MemberReference(member=other, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=IntFloatDenseVector, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IntFloatSortedVector, sub_type=None))] call[.applyToSorted, parameter[Cast(expression=MemberReference(member=other, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=IntFloatSortedVector, sub_type=None)), member[.lambda], literal[false]]] else begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unhandled vector type: "), operandr=MethodInvocation(arguments=[], member=getClass, postfix_operators=[], prefix_operators=[], qualifier=other, selectors=[], type_arguments=None), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalStateException, sub_type=None)), label=None) end[}] end[}] end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[apply] operator[SEP] identifier[IntFloatVector] identifier[other] , identifier[LambdaBinOpFloat] identifier[lambda] , Keyword[boolean] identifier[skipZeros] operator[SEP] { Keyword[if] operator[SEP] identifier[other] Keyword[instanceof] identifier[IntFloatSortedVector] operator[SEP] { identifier[applyToSorted] operator[SEP] operator[SEP] identifier[IntFloatSortedVector] operator[SEP] identifier[other] , identifier[lambda] , literal[boolean] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[other] Keyword[instanceof] identifier[IntFloatHashVector] operator[SEP] { identifier[other] operator[=] Keyword[new] identifier[IntFloatSortedVector] operator[SEP] operator[SEP] identifier[IntFloatHashVector] operator[SEP] identifier[other] operator[SEP] operator[SEP] identifier[applyToSorted] operator[SEP] operator[SEP] identifier[IntFloatSortedVector] operator[SEP] identifier[other] , identifier[lambda] , literal[boolean] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[other] Keyword[instanceof] identifier[IntFloatDenseVector] operator[SEP] { identifier[other] operator[=] Keyword[new] identifier[IntFloatSortedVector] operator[SEP] operator[SEP] identifier[IntFloatDenseVector] operator[SEP] identifier[other] operator[SEP] operator[SEP] identifier[applyToSorted] operator[SEP] operator[SEP] identifier[IntFloatSortedVector] operator[SEP] identifier[other] , identifier[lambda] , literal[boolean] operator[SEP] operator[SEP] } Keyword[else] { Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] literal[String] operator[+] identifier[other] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } }
public String getCaCertLocations() { String location; location = System.getProperty("X509_CERT_DIR"); if (location != null) { return location; } location = getProperty("cacert"); if (location != null) { return location; } return ConfigUtil.discoverCertDirLocation(); }
class class_name[name] begin[{] method[getCaCertLocations, return_type[type[String]], modifier[public], parameter[]] begin[{] local_variable[type[String], location] assign[member[.location], call[System.getProperty, parameter[literal["X509_CERT_DIR"]]]] if[binary_operation[member[.location], !=, literal[null]]] begin[{] return[member[.location]] else begin[{] None end[}] assign[member[.location], call[.getProperty, parameter[literal["cacert"]]]] if[binary_operation[member[.location], !=, literal[null]]] begin[{] return[member[.location]] else begin[{] None end[}] return[call[ConfigUtil.discoverCertDirLocation, parameter[]]] end[}] END[}]
Keyword[public] identifier[String] identifier[getCaCertLocations] operator[SEP] operator[SEP] { identifier[String] identifier[location] operator[SEP] identifier[location] operator[=] identifier[System] operator[SEP] identifier[getProperty] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[location] operator[!=] Other[null] operator[SEP] { Keyword[return] identifier[location] operator[SEP] } identifier[location] operator[=] identifier[getProperty] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[location] operator[!=] Other[null] operator[SEP] { Keyword[return] identifier[location] operator[SEP] } Keyword[return] identifier[ConfigUtil] operator[SEP] identifier[discoverCertDirLocation] operator[SEP] operator[SEP] operator[SEP] }
public List<V> get(K key){ return (List<V>)map.get(key); }
class class_name[name] begin[{] method[get, return_type[type[List]], modifier[public], parameter[key]] begin[{] return[Cast(expression=MethodInvocation(arguments=[MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=map, selectors=[], type_arguments=None), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=V, sub_type=None))], dimensions=[], name=List, sub_type=None))] end[}] END[}]
Keyword[public] identifier[List] operator[<] identifier[V] operator[>] identifier[get] operator[SEP] identifier[K] identifier[key] operator[SEP] { Keyword[return] operator[SEP] identifier[List] operator[<] identifier[V] operator[>] operator[SEP] identifier[map] operator[SEP] identifier[get] operator[SEP] identifier[key] operator[SEP] operator[SEP] }
public CreateCollectionRequestBuilder<T,ID> create(List<T> items) { return new CreateCollectionRequestBuilder<T,ID>(version,type,entityName,items); }
class class_name[name] begin[{] method[create, return_type[type[CreateCollectionRequestBuilder]], modifier[public], parameter[items]] begin[{] return[ClassCreator(arguments=[MemberReference(member=version, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=entityName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=items, 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=T, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=ID, sub_type=None))], dimensions=None, name=CreateCollectionRequestBuilder, sub_type=None))] end[}] END[}]
Keyword[public] identifier[CreateCollectionRequestBuilder] operator[<] identifier[T] , identifier[ID] operator[>] identifier[create] operator[SEP] identifier[List] operator[<] identifier[T] operator[>] identifier[items] operator[SEP] { Keyword[return] Keyword[new] identifier[CreateCollectionRequestBuilder] operator[<] identifier[T] , identifier[ID] operator[>] operator[SEP] identifier[version] , identifier[type] , identifier[entityName] , identifier[items] operator[SEP] operator[SEP] }
public static UUID nameUUIDFromString(String name, UUID namespace, String encoding) { byte[] nameAsBytes = name.getBytes(); byte[] concat = new byte[UUID_BYTE_LENGTH + nameAsBytes.length]; System.arraycopy(namespace.getRawBytes(), 0, concat, 0, UUID_BYTE_LENGTH); System.arraycopy(nameAsBytes, 0, concat, UUID_BYTE_LENGTH, nameAsBytes.length); byte[] raw = null; if(encoding.equals(UUID.MD5_ENCODING)) { raw = DigestUtils.md5(concat); } else if(encoding.equals(UUID.SHA1_ENCODING)) { byte[] shaDigest = DigestUtils.sha(concat); // Truncate digest to 16 bytes (SHA-1 returns a 20-byte digest) raw = new byte[16]; System.arraycopy(shaDigest, 0, raw, 0, 16); } else { throw new RuntimeException("Unsupported encoding " + encoding); } //Set version (version 3 and version 5 are identical on a bit-level, //thus we only need ever set one of them raw[TIME_HI_AND_VERSION_BYTE_6] &= 0x0F; raw[TIME_HI_AND_VERSION_BYTE_6] |= (UUID.VERSION_THREE << 4); //Set variant raw[CLOCK_SEQ_HI_AND_RESERVED_BYTE_8] &= 0x3F; //0011 1111 raw[CLOCK_SEQ_HI_AND_RESERVED_BYTE_8] |= 0x80; //1000 0000 return new UUID(raw); }
class class_name[name] begin[{] method[nameUUIDFromString, return_type[type[UUID]], modifier[public static], parameter[name, namespace, encoding]] begin[{] local_variable[type[byte], nameAsBytes] local_variable[type[byte], concat] call[System.arraycopy, parameter[call[namespace.getRawBytes, parameter[]], literal[0], member[.concat], literal[0], member[.UUID_BYTE_LENGTH]]] call[System.arraycopy, parameter[member[.nameAsBytes], literal[0], member[.concat], member[.UUID_BYTE_LENGTH], member[nameAsBytes.length]]] local_variable[type[byte], raw] if[call[encoding.equals, parameter[member[UUID.MD5_ENCODING]]]] begin[{] assign[member[.raw], call[DigestUtils.md5, parameter[member[.concat]]]] else begin[{] if[call[encoding.equals, parameter[member[UUID.SHA1_ENCODING]]]] begin[{] local_variable[type[byte], shaDigest] assign[member[.raw], ArrayCreator(dimensions=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=16)], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=None, name=byte))] call[System.arraycopy, parameter[member[.shaDigest], literal[0], member[.raw], literal[0], literal[16]]] else begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unsupported encoding "), operandr=MemberReference(member=encoding, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=RuntimeException, sub_type=None)), label=None) end[}] end[}] assign[member[.raw], literal[0x0F]] assign[member[.raw], binary_operation[member[UUID.VERSION_THREE], <<, literal[4]]] assign[member[.raw], literal[0x3F]] assign[member[.raw], literal[0x80]] return[ClassCreator(arguments=[MemberReference(member=raw, 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=UUID, sub_type=None))] end[}] END[}]
Keyword[public] Keyword[static] identifier[UUID] identifier[nameUUIDFromString] operator[SEP] identifier[String] identifier[name] , identifier[UUID] identifier[namespace] , identifier[String] identifier[encoding] operator[SEP] { Keyword[byte] operator[SEP] operator[SEP] identifier[nameAsBytes] operator[=] identifier[name] operator[SEP] identifier[getBytes] operator[SEP] operator[SEP] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[concat] operator[=] Keyword[new] Keyword[byte] operator[SEP] identifier[UUID_BYTE_LENGTH] operator[+] identifier[nameAsBytes] operator[SEP] identifier[length] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[arraycopy] operator[SEP] identifier[namespace] operator[SEP] identifier[getRawBytes] operator[SEP] operator[SEP] , Other[0] , identifier[concat] , Other[0] , identifier[UUID_BYTE_LENGTH] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[arraycopy] operator[SEP] identifier[nameAsBytes] , Other[0] , identifier[concat] , identifier[UUID_BYTE_LENGTH] , identifier[nameAsBytes] operator[SEP] identifier[length] operator[SEP] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[raw] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[encoding] operator[SEP] identifier[equals] operator[SEP] identifier[UUID] operator[SEP] identifier[MD5_ENCODING] operator[SEP] operator[SEP] { identifier[raw] operator[=] identifier[DigestUtils] operator[SEP] identifier[md5] operator[SEP] identifier[concat] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[encoding] operator[SEP] identifier[equals] operator[SEP] identifier[UUID] operator[SEP] identifier[SHA1_ENCODING] operator[SEP] operator[SEP] { Keyword[byte] operator[SEP] operator[SEP] identifier[shaDigest] operator[=] identifier[DigestUtils] operator[SEP] identifier[sha] operator[SEP] identifier[concat] operator[SEP] operator[SEP] identifier[raw] operator[=] Keyword[new] Keyword[byte] operator[SEP] Other[16] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[arraycopy] operator[SEP] identifier[shaDigest] , Other[0] , identifier[raw] , Other[0] , Other[16] operator[SEP] operator[SEP] } Keyword[else] { Keyword[throw] Keyword[new] identifier[RuntimeException] operator[SEP] literal[String] operator[+] identifier[encoding] operator[SEP] operator[SEP] } identifier[raw] operator[SEP] identifier[TIME_HI_AND_VERSION_BYTE_6] operator[SEP] operator[&=] literal[Integer] operator[SEP] identifier[raw] operator[SEP] identifier[TIME_HI_AND_VERSION_BYTE_6] operator[SEP] operator[|=] operator[SEP] identifier[UUID] operator[SEP] identifier[VERSION_THREE] operator[<<] Other[4] operator[SEP] operator[SEP] identifier[raw] operator[SEP] identifier[CLOCK_SEQ_HI_AND_RESERVED_BYTE_8] operator[SEP] operator[&=] literal[Integer] operator[SEP] identifier[raw] operator[SEP] identifier[CLOCK_SEQ_HI_AND_RESERVED_BYTE_8] operator[SEP] operator[|=] literal[Integer] operator[SEP] Keyword[return] Keyword[new] identifier[UUID] operator[SEP] identifier[raw] operator[SEP] operator[SEP] }
private void resolveBaseDirection(byte[] levels) { if (Bidi.IsDefaultLevel(levels[0])) { byte level = Bidi.getBaseDirection(text); levels[0] = level != Bidi.NEUTRAL ? level : levels[0] == Bidi.LEVEL_DEFAULT_RTL ? Bidi.RTL : Bidi.LTR; } else { levels[0] &= 1; } if (Bidi.IsDefaultLevel(levels[1])) { levels[1] = levels[0]; } else { levels[1] &= 1; } }
class class_name[name] begin[{] method[resolveBaseDirection, return_type[void], modifier[private], parameter[levels]] begin[{] if[call[Bidi.IsDefaultLevel, parameter[member[.levels]]]] begin[{] local_variable[type[byte], level] assign[member[.levels], TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=level, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=NEUTRAL, postfix_operators=[], prefix_operators=[], qualifier=Bidi, selectors=[]), operator=!=), if_false=TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=levels, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))]), operandr=MemberReference(member=LEVEL_DEFAULT_RTL, postfix_operators=[], prefix_operators=[], qualifier=Bidi, selectors=[]), operator===), if_false=MemberReference(member=LTR, postfix_operators=[], prefix_operators=[], qualifier=Bidi, selectors=[]), if_true=MemberReference(member=RTL, postfix_operators=[], prefix_operators=[], qualifier=Bidi, selectors=[])), if_true=MemberReference(member=level, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))] else begin[{] assign[member[.levels], literal[1]] end[}] if[call[Bidi.IsDefaultLevel, parameter[member[.levels]]]] begin[{] assign[member[.levels], member[.levels]] else begin[{] assign[member[.levels], literal[1]] end[}] end[}] END[}]
Keyword[private] Keyword[void] identifier[resolveBaseDirection] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[levels] operator[SEP] { Keyword[if] operator[SEP] identifier[Bidi] operator[SEP] identifier[IsDefaultLevel] operator[SEP] identifier[levels] operator[SEP] Other[0] operator[SEP] operator[SEP] operator[SEP] { Keyword[byte] identifier[level] operator[=] identifier[Bidi] operator[SEP] identifier[getBaseDirection] operator[SEP] identifier[text] operator[SEP] operator[SEP] identifier[levels] operator[SEP] Other[0] operator[SEP] operator[=] identifier[level] operator[!=] identifier[Bidi] operator[SEP] identifier[NEUTRAL] operator[?] identifier[level] operator[:] identifier[levels] operator[SEP] Other[0] operator[SEP] operator[==] identifier[Bidi] operator[SEP] identifier[LEVEL_DEFAULT_RTL] operator[?] identifier[Bidi] operator[SEP] identifier[RTL] operator[:] identifier[Bidi] operator[SEP] identifier[LTR] operator[SEP] } Keyword[else] { identifier[levels] operator[SEP] Other[0] operator[SEP] operator[&=] Other[1] operator[SEP] } Keyword[if] operator[SEP] identifier[Bidi] operator[SEP] identifier[IsDefaultLevel] operator[SEP] identifier[levels] operator[SEP] Other[1] operator[SEP] operator[SEP] operator[SEP] { identifier[levels] operator[SEP] Other[1] operator[SEP] operator[=] identifier[levels] operator[SEP] Other[0] operator[SEP] operator[SEP] } Keyword[else] { identifier[levels] operator[SEP] Other[1] operator[SEP] operator[&=] Other[1] operator[SEP] } }
public Instruction read(int opcode, Input src, int ofs) throws IOException { switch (opcode) { case WIDE: return readWide(src, ofs); case TABLESWITCH: return readTableSwitch(src, ofs); case LOOKUPSWITCH: return readLookupSwitch(src, ofs); default: return readNormal(src, ofs); } }
class class_name[name] begin[{] method[read, return_type[type[Instruction]], modifier[public], parameter[opcode, src, ofs]] begin[{] SwitchStatement(cases=[SwitchStatementCase(case=['WIDE'], statements=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=src, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=ofs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=readWide, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), SwitchStatementCase(case=['TABLESWITCH'], statements=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=src, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=ofs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=readTableSwitch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), SwitchStatementCase(case=['LOOKUPSWITCH'], statements=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=src, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=ofs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=readLookupSwitch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), SwitchStatementCase(case=[], statements=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=src, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=ofs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=readNormal, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)])], expression=MemberReference(member=opcode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None) end[}] END[}]
Keyword[public] identifier[Instruction] identifier[read] operator[SEP] Keyword[int] identifier[opcode] , identifier[Input] identifier[src] , Keyword[int] identifier[ofs] operator[SEP] Keyword[throws] identifier[IOException] { Keyword[switch] operator[SEP] identifier[opcode] operator[SEP] { Keyword[case] identifier[WIDE] operator[:] Keyword[return] identifier[readWide] operator[SEP] identifier[src] , identifier[ofs] operator[SEP] operator[SEP] Keyword[case] identifier[TABLESWITCH] operator[:] Keyword[return] identifier[readTableSwitch] operator[SEP] identifier[src] , identifier[ofs] operator[SEP] operator[SEP] Keyword[case] identifier[LOOKUPSWITCH] operator[:] Keyword[return] identifier[readLookupSwitch] operator[SEP] identifier[src] , identifier[ofs] operator[SEP] operator[SEP] Keyword[default] operator[:] Keyword[return] identifier[readNormal] operator[SEP] identifier[src] , identifier[ofs] operator[SEP] operator[SEP] } }
@Override public float getFloatValue( final String key, final float defaultValue ) { return formatFloatValue( key, getFormattedPropValue( key ), defaultValue ); }
class class_name[name] begin[{] method[getFloatValue, return_type[type[float]], modifier[public], parameter[key, defaultValue]] begin[{] return[call[.formatFloatValue, parameter[member[.key], call[.getFormattedPropValue, parameter[member[.key]]], member[.defaultValue]]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[float] identifier[getFloatValue] operator[SEP] Keyword[final] identifier[String] identifier[key] , Keyword[final] Keyword[float] identifier[defaultValue] operator[SEP] { Keyword[return] identifier[formatFloatValue] operator[SEP] identifier[key] , identifier[getFormattedPropValue] operator[SEP] identifier[key] operator[SEP] , identifier[defaultValue] operator[SEP] operator[SEP] }
public int doAfterBody() throws JspException { if (hasErrors()) { return SKIP_BODY; } // if this is a repeater we need to repeater over the body... if (_repeater) { if (doRepeaterAfterBody()) return EVAL_BODY_AGAIN; } if (bodyContent != null) { String value = bodyContent.getString(); bodyContent.clearBody(); if (value == null) value = ""; _saveBody = value.trim(); } return SKIP_BODY; }
class class_name[name] begin[{] method[doAfterBody, return_type[type[int]], modifier[public], parameter[]] begin[{] if[call[.hasErrors, parameter[]]] begin[{] return[member[.SKIP_BODY]] else begin[{] None end[}] if[member[._repeater]] begin[{] if[call[.doRepeaterAfterBody, parameter[]]] begin[{] return[member[.EVAL_BODY_AGAIN]] else begin[{] None end[}] else begin[{] None end[}] if[binary_operation[member[.bodyContent], !=, literal[null]]] begin[{] local_variable[type[String], value] call[bodyContent.clearBody, parameter[]] if[binary_operation[member[.value], ==, literal[null]]] begin[{] assign[member[.value], literal[""]] else begin[{] None end[}] assign[member[._saveBody], call[value.trim, parameter[]]] else begin[{] None end[}] return[member[.SKIP_BODY]] end[}] END[}]
Keyword[public] Keyword[int] identifier[doAfterBody] operator[SEP] operator[SEP] Keyword[throws] identifier[JspException] { Keyword[if] operator[SEP] identifier[hasErrors] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] identifier[SKIP_BODY] operator[SEP] } Keyword[if] operator[SEP] identifier[_repeater] operator[SEP] { Keyword[if] operator[SEP] identifier[doRepeaterAfterBody] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[EVAL_BODY_AGAIN] operator[SEP] } Keyword[if] operator[SEP] identifier[bodyContent] operator[!=] Other[null] operator[SEP] { identifier[String] identifier[value] operator[=] identifier[bodyContent] operator[SEP] identifier[getString] operator[SEP] operator[SEP] operator[SEP] identifier[bodyContent] operator[SEP] identifier[clearBody] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[value] operator[==] Other[null] operator[SEP] identifier[value] operator[=] literal[String] operator[SEP] identifier[_saveBody] operator[=] identifier[value] operator[SEP] identifier[trim] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[SKIP_BODY] operator[SEP] }
public Map<String, String> toMap() { Map<String, String> map = new HashMap<>(); map.put("message", this.getMessage()); map.put("success", this.getSuccess()); map.put("is_ported", this.getIsPorted()); map.put("provider", this.getProvider()); map.put("type", this.getType()); return map; }
class class_name[name] begin[{] method[toMap, return_type[type[Map]], modifier[public], parameter[]] begin[{] local_variable[type[Map], map] call[map.put, parameter[literal["message"], THIS[call[None.getMessage, parameter[]]]]] call[map.put, parameter[literal["success"], THIS[call[None.getSuccess, parameter[]]]]] call[map.put, parameter[literal["is_ported"], THIS[call[None.getIsPorted, parameter[]]]]] call[map.put, parameter[literal["provider"], THIS[call[None.getProvider, parameter[]]]]] call[map.put, parameter[literal["type"], THIS[call[None.getType, parameter[]]]]] return[member[.map]] end[}] END[}]
Keyword[public] identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[toMap] operator[SEP] operator[SEP] { identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[map] operator[=] Keyword[new] identifier[HashMap] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[map] operator[SEP] identifier[put] operator[SEP] literal[String] , Keyword[this] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[map] operator[SEP] identifier[put] operator[SEP] literal[String] , Keyword[this] operator[SEP] identifier[getSuccess] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[map] operator[SEP] identifier[put] operator[SEP] literal[String] , Keyword[this] operator[SEP] identifier[getIsPorted] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[map] operator[SEP] identifier[put] operator[SEP] literal[String] , Keyword[this] operator[SEP] identifier[getProvider] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[map] operator[SEP] identifier[put] operator[SEP] literal[String] , Keyword[this] operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[map] operator[SEP] }
public String trimLeading(String str) { if (str == null) { return null; } int length = str.length(); for (int i=0; i<length; i++) { if (str.charAt(i) > ' ') { return str.substring(i); } } return ""; }
class class_name[name] begin[{] method[trimLeading, return_type[type[String]], modifier[public], parameter[str]] begin[{] if[binary_operation[member[.str], ==, literal[null]]] begin[{] return[literal[null]] else begin[{] None end[}] local_variable[type[int], length] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=charAt, postfix_operators=[], prefix_operators=[], qualifier=str, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=' '), operator=>), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=substring, postfix_operators=[], prefix_operators=[], qualifier=str, 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=, 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[""]] end[}] END[}]
Keyword[public] identifier[String] identifier[trimLeading] operator[SEP] identifier[String] identifier[str] operator[SEP] { Keyword[if] operator[SEP] identifier[str] operator[==] Other[null] operator[SEP] { Keyword[return] Other[null] operator[SEP] } Keyword[int] identifier[length] operator[=] identifier[str] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] { Keyword[if] operator[SEP] identifier[str] operator[SEP] identifier[charAt] operator[SEP] identifier[i] operator[SEP] operator[>] literal[String] operator[SEP] { Keyword[return] identifier[str] operator[SEP] identifier[substring] operator[SEP] identifier[i] operator[SEP] operator[SEP] } } Keyword[return] literal[String] operator[SEP] }
public static void extract(int format, Resource source, Resource target) throws IOException { if (format == FORMAT_ZIP) extractZip(source, target); else if (format == FORMAT_TAR) extractTar(source, target); else if (format == FORMAT_GZIP) extractGZip(source, target); else if (format == FORMAT_TGZ) extractTGZ(source, target); else throw new IOException("can't extract in given format"); }
class class_name[name] begin[{] method[extract, return_type[void], modifier[public static], parameter[format, source, target]] begin[{] if[binary_operation[member[.format], ==, member[.FORMAT_ZIP]]] begin[{] call[.extractZip, parameter[member[.source], member[.target]]] else begin[{] if[binary_operation[member[.format], ==, member[.FORMAT_TAR]]] begin[{] call[.extractTar, parameter[member[.source], member[.target]]] else begin[{] if[binary_operation[member[.format], ==, member[.FORMAT_GZIP]]] begin[{] call[.extractGZip, parameter[member[.source], member[.target]]] else begin[{] if[binary_operation[member[.format], ==, member[.FORMAT_TGZ]]] begin[{] call[.extractTGZ, parameter[member[.source], member[.target]]] else begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="can't extract in given format")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IOException, sub_type=None)), label=None) end[}] end[}] end[}] end[}] end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[extract] operator[SEP] Keyword[int] identifier[format] , identifier[Resource] identifier[source] , identifier[Resource] identifier[target] operator[SEP] Keyword[throws] identifier[IOException] { Keyword[if] operator[SEP] identifier[format] operator[==] identifier[FORMAT_ZIP] operator[SEP] identifier[extractZip] operator[SEP] identifier[source] , identifier[target] operator[SEP] operator[SEP] Keyword[else] Keyword[if] operator[SEP] identifier[format] operator[==] identifier[FORMAT_TAR] operator[SEP] identifier[extractTar] operator[SEP] identifier[source] , identifier[target] operator[SEP] operator[SEP] Keyword[else] Keyword[if] operator[SEP] identifier[format] operator[==] identifier[FORMAT_GZIP] operator[SEP] identifier[extractGZip] operator[SEP] identifier[source] , identifier[target] operator[SEP] operator[SEP] Keyword[else] Keyword[if] operator[SEP] identifier[format] operator[==] identifier[FORMAT_TGZ] operator[SEP] identifier[extractTGZ] operator[SEP] identifier[source] , identifier[target] operator[SEP] operator[SEP] Keyword[else] Keyword[throw] Keyword[new] identifier[IOException] operator[SEP] literal[String] operator[SEP] operator[SEP] }
public <T extends TermStream> T getTermStream(T reusableTermStream) { reusableTermStream.set(this.getAtomicReaderId(), this.getAtomicDocId()); return reusableTermStream; }
class class_name[name] begin[{] method[getTermStream, return_type[type[T]], modifier[public], parameter[reusableTermStream]] begin[{] call[reusableTermStream.set, parameter[THIS[call[None.getAtomicReaderId, parameter[]]], THIS[call[None.getAtomicDocId, parameter[]]]]] return[member[.reusableTermStream]] end[}] END[}]
Keyword[public] operator[<] identifier[T] Keyword[extends] identifier[TermStream] operator[>] identifier[T] identifier[getTermStream] operator[SEP] identifier[T] identifier[reusableTermStream] operator[SEP] { identifier[reusableTermStream] operator[SEP] identifier[set] operator[SEP] Keyword[this] operator[SEP] identifier[getAtomicReaderId] operator[SEP] operator[SEP] , Keyword[this] operator[SEP] identifier[getAtomicDocId] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[reusableTermStream] operator[SEP] }
static void printMyTimeLine(){ long [] s = TimeLine.snapshot(); System.err.println("===================================<TIMELINE>=============================================="); for(int i = 0; i < TimeLine.length(); ++i) { long lo = TimeLine.l0(s, i),hi = TimeLine.l8(s, i); int port = (int)((lo >> 8) & 0xFFFF); String op = TimeLine.send_recv(s,i) == 0?"SEND":"RECV"; if(!TimeLine.isEmpty(s, i) && (lo & 0xFF) == UDP.udp.exec.ordinal()) System.err.println(TimeLine.ms(s, i) + ": " + op + " " + (((TimeLine.ns(s, i) & 4) != 0)?"TCP":"UDP") + TimeLine.inet(s, i) + ":" + port + " | " + UDP.printx16(lo, hi)); } System.err.println("==========================================================================================="); }
class class_name[name] begin[{] method[printMyTimeLine, return_type[void], modifier[static], parameter[]] begin[{] local_variable[type[long], s] call[System.err.println, parameter[literal["===================================<TIMELINE>=============================================="]]] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=s, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=l0, postfix_operators=[], prefix_operators=[], qualifier=TimeLine, selectors=[], type_arguments=None), name=lo), VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=s, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=l8, postfix_operators=[], prefix_operators=[], qualifier=TimeLine, selectors=[], type_arguments=None), name=hi)], modifiers=set(), type=BasicType(dimensions=[], name=long)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=lo, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=8), operator=>>), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0xFFFF), operator=&), type=BasicType(dimensions=[], name=int)), name=port)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=TernaryExpression(condition=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=s, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=send_recv, postfix_operators=[], prefix_operators=[], qualifier=TimeLine, 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="RECV"), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="SEND")), name=op)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=s, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isEmpty, postfix_operators=[], prefix_operators=['!'], qualifier=TimeLine, selectors=[], type_arguments=None), operandr=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=lo, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0xFF), operator=&), operandr=MethodInvocation(arguments=[], member=ordinal, postfix_operators=[], prefix_operators=[], qualifier=UDP.udp.exec, selectors=[], type_arguments=None), operator===), operator=&&), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=s, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=ms, postfix_operators=[], prefix_operators=[], qualifier=TimeLine, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=": "), operator=+), operandr=MemberReference(member=op, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" "), operator=+), operandr=TernaryExpression(condition=BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=s, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=ns, postfix_operators=[], prefix_operators=[], qualifier=TimeLine, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=4), operator=&), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=!=), if_false=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="UDP"), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="TCP")), operator=+), operandr=MethodInvocation(arguments=[MemberReference(member=s, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=inet, postfix_operators=[], prefix_operators=[], qualifier=TimeLine, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=":"), operator=+), operandr=MemberReference(member=port, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" | "), operator=+), operandr=MethodInvocation(arguments=[MemberReference(member=lo, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=hi, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=printx16, postfix_operators=[], prefix_operators=[], qualifier=UDP, selectors=[], type_arguments=None), operator=+)], member=println, postfix_operators=[], prefix_operators=[], qualifier=System.err, selectors=[], type_arguments=None), label=None))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=TimeLine, selectors=[], type_arguments=None), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=[], prefix_operators=['++'], qualifier=, selectors=[])]), label=None) call[System.err.println, parameter[literal["==========================================================================================="]]] end[}] END[}]
Keyword[static] Keyword[void] identifier[printMyTimeLine] operator[SEP] operator[SEP] { Keyword[long] operator[SEP] operator[SEP] identifier[s] operator[=] identifier[TimeLine] operator[SEP] identifier[snapshot] operator[SEP] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[err] operator[SEP] identifier[println] 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[TimeLine] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] operator[++] identifier[i] operator[SEP] { Keyword[long] identifier[lo] operator[=] identifier[TimeLine] operator[SEP] identifier[l0] operator[SEP] identifier[s] , identifier[i] operator[SEP] , identifier[hi] operator[=] identifier[TimeLine] operator[SEP] identifier[l8] operator[SEP] identifier[s] , identifier[i] operator[SEP] operator[SEP] Keyword[int] identifier[port] operator[=] operator[SEP] Keyword[int] operator[SEP] operator[SEP] operator[SEP] identifier[lo] operator[>] operator[>] Other[8] operator[SEP] operator[&] literal[Integer] operator[SEP] operator[SEP] identifier[String] identifier[op] operator[=] identifier[TimeLine] operator[SEP] identifier[send_recv] operator[SEP] identifier[s] , identifier[i] operator[SEP] operator[==] Other[0] operator[?] literal[String] operator[:] literal[String] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[TimeLine] operator[SEP] identifier[isEmpty] operator[SEP] identifier[s] , identifier[i] operator[SEP] operator[&&] operator[SEP] identifier[lo] operator[&] literal[Integer] operator[SEP] operator[==] identifier[UDP] operator[SEP] identifier[udp] operator[SEP] identifier[exec] operator[SEP] identifier[ordinal] operator[SEP] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[err] operator[SEP] identifier[println] operator[SEP] identifier[TimeLine] operator[SEP] identifier[ms] operator[SEP] identifier[s] , identifier[i] operator[SEP] operator[+] literal[String] operator[+] identifier[op] operator[+] literal[String] operator[+] operator[SEP] operator[SEP] operator[SEP] identifier[TimeLine] operator[SEP] identifier[ns] operator[SEP] identifier[s] , identifier[i] operator[SEP] operator[&] Other[4] operator[SEP] operator[!=] Other[0] operator[SEP] operator[?] literal[String] operator[:] literal[String] operator[SEP] operator[+] identifier[TimeLine] operator[SEP] identifier[inet] operator[SEP] identifier[s] , identifier[i] operator[SEP] operator[+] literal[String] operator[+] identifier[port] operator[+] literal[String] operator[+] identifier[UDP] operator[SEP] identifier[printx16] operator[SEP] identifier[lo] , identifier[hi] operator[SEP] operator[SEP] operator[SEP] } identifier[System] operator[SEP] identifier[err] operator[SEP] identifier[println] operator[SEP] literal[String] operator[SEP] operator[SEP] }
private ByteBuffer convertValueByFunction(Tree functionCall, CfDef columnFamily, ByteBuffer columnName) { return convertValueByFunction(functionCall, columnFamily, columnName, false); }
class class_name[name] begin[{] method[convertValueByFunction, return_type[type[ByteBuffer]], modifier[private], parameter[functionCall, columnFamily, columnName]] begin[{] return[call[.convertValueByFunction, parameter[member[.functionCall], member[.columnFamily], member[.columnName], literal[false]]]] end[}] END[}]
Keyword[private] identifier[ByteBuffer] identifier[convertValueByFunction] operator[SEP] identifier[Tree] identifier[functionCall] , identifier[CfDef] identifier[columnFamily] , identifier[ByteBuffer] identifier[columnName] operator[SEP] { Keyword[return] identifier[convertValueByFunction] operator[SEP] identifier[functionCall] , identifier[columnFamily] , identifier[columnName] , literal[boolean] operator[SEP] operator[SEP] }
private Path gotLeftTopArrowPath() { Path path = new Path(); int diameter = cSize * 2; // 左上角圆角起点 path.moveTo(aWidth, cSize); RectF rectF = new RectF(aWidth, 0, aWidth + diameter, diameter); path.arcTo(rectF, 180, 90); // 右上角圆角起点 path.lineTo(mWidth - cSize, 0); rectF = new RectF(mWidth - diameter, 0, mWidth, diameter); path.arcTo(rectF, -90, 90); // 右下角圆角起点 path.lineTo(mWidth, mHeight - cSize); rectF = new RectF(mWidth - diameter, mHeight - diameter, mWidth, mHeight); path.arcTo(rectF, 0, 90); // 左下角圆角起点 path.lineTo(aWidth + cSize, mHeight); rectF = new RectF(aWidth, mHeight - diameter, aWidth + diameter, mHeight); path.arcTo(rectF, 90, 90); // 箭头起点 path.lineTo(aWidth, aMargin + aHeight); // 箭头顶点 path.lineTo(0, aMargin + aHeight / 2); // 箭头结束点 path.lineTo(aWidth, aMargin); path.close(); return path; }
class class_name[name] begin[{] method[gotLeftTopArrowPath, return_type[type[Path]], modifier[private], parameter[]] begin[{] local_variable[type[Path], path] local_variable[type[int], diameter] call[path.moveTo, parameter[member[.aWidth], member[.cSize]]] local_variable[type[RectF], rectF] call[path.arcTo, parameter[member[.rectF], literal[180], literal[90]]] call[path.lineTo, parameter[binary_operation[member[.mWidth], -, member[.cSize]], literal[0]]] assign[member[.rectF], ClassCreator(arguments=[BinaryOperation(operandl=MemberReference(member=mWidth, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=diameter, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=-), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), MemberReference(member=mWidth, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=diameter, 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=RectF, sub_type=None))] call[path.arcTo, parameter[member[.rectF], literal[90], literal[90]]] call[path.lineTo, parameter[member[.mWidth], binary_operation[member[.mHeight], -, member[.cSize]]]] assign[member[.rectF], ClassCreator(arguments=[BinaryOperation(operandl=MemberReference(member=mWidth, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=diameter, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=-), BinaryOperation(operandl=MemberReference(member=mHeight, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=diameter, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=-), MemberReference(member=mWidth, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=mHeight, 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=RectF, sub_type=None))] call[path.arcTo, parameter[member[.rectF], literal[0], literal[90]]] call[path.lineTo, parameter[binary_operation[member[.aWidth], +, member[.cSize]], member[.mHeight]]] assign[member[.rectF], ClassCreator(arguments=[MemberReference(member=aWidth, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=MemberReference(member=mHeight, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=diameter, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=-), BinaryOperation(operandl=MemberReference(member=aWidth, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=diameter, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), MemberReference(member=mHeight, 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=RectF, sub_type=None))] call[path.arcTo, parameter[member[.rectF], literal[90], literal[90]]] call[path.lineTo, parameter[member[.aWidth], binary_operation[member[.aMargin], +, member[.aHeight]]]] call[path.lineTo, parameter[literal[0], binary_operation[member[.aMargin], +, binary_operation[member[.aHeight], /, literal[2]]]]] call[path.lineTo, parameter[member[.aWidth], member[.aMargin]]] call[path.close, parameter[]] return[member[.path]] end[}] END[}]
Keyword[private] identifier[Path] identifier[gotLeftTopArrowPath] operator[SEP] operator[SEP] { identifier[Path] identifier[path] operator[=] Keyword[new] identifier[Path] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[diameter] operator[=] identifier[cSize] operator[*] Other[2] operator[SEP] identifier[path] operator[SEP] identifier[moveTo] operator[SEP] identifier[aWidth] , identifier[cSize] operator[SEP] operator[SEP] identifier[RectF] identifier[rectF] operator[=] Keyword[new] identifier[RectF] operator[SEP] identifier[aWidth] , Other[0] , identifier[aWidth] operator[+] identifier[diameter] , identifier[diameter] operator[SEP] operator[SEP] identifier[path] operator[SEP] identifier[arcTo] operator[SEP] identifier[rectF] , Other[180] , Other[90] operator[SEP] operator[SEP] identifier[path] operator[SEP] identifier[lineTo] operator[SEP] identifier[mWidth] operator[-] identifier[cSize] , Other[0] operator[SEP] operator[SEP] identifier[rectF] operator[=] Keyword[new] identifier[RectF] operator[SEP] identifier[mWidth] operator[-] identifier[diameter] , Other[0] , identifier[mWidth] , identifier[diameter] operator[SEP] operator[SEP] identifier[path] operator[SEP] identifier[arcTo] operator[SEP] identifier[rectF] , operator[-] Other[90] , Other[90] operator[SEP] operator[SEP] identifier[path] operator[SEP] identifier[lineTo] operator[SEP] identifier[mWidth] , identifier[mHeight] operator[-] identifier[cSize] operator[SEP] operator[SEP] identifier[rectF] operator[=] Keyword[new] identifier[RectF] operator[SEP] identifier[mWidth] operator[-] identifier[diameter] , identifier[mHeight] operator[-] identifier[diameter] , identifier[mWidth] , identifier[mHeight] operator[SEP] operator[SEP] identifier[path] operator[SEP] identifier[arcTo] operator[SEP] identifier[rectF] , Other[0] , Other[90] operator[SEP] operator[SEP] identifier[path] operator[SEP] identifier[lineTo] operator[SEP] identifier[aWidth] operator[+] identifier[cSize] , identifier[mHeight] operator[SEP] operator[SEP] identifier[rectF] operator[=] Keyword[new] identifier[RectF] operator[SEP] identifier[aWidth] , identifier[mHeight] operator[-] identifier[diameter] , identifier[aWidth] operator[+] identifier[diameter] , identifier[mHeight] operator[SEP] operator[SEP] identifier[path] operator[SEP] identifier[arcTo] operator[SEP] identifier[rectF] , Other[90] , Other[90] operator[SEP] operator[SEP] identifier[path] operator[SEP] identifier[lineTo] operator[SEP] identifier[aWidth] , identifier[aMargin] operator[+] identifier[aHeight] operator[SEP] operator[SEP] identifier[path] operator[SEP] identifier[lineTo] operator[SEP] Other[0] , identifier[aMargin] operator[+] identifier[aHeight] operator[/] Other[2] operator[SEP] operator[SEP] identifier[path] operator[SEP] identifier[lineTo] operator[SEP] identifier[aWidth] , identifier[aMargin] operator[SEP] operator[SEP] identifier[path] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[path] operator[SEP] }
@Override public int compareTo(LocalTime other) { int cmp = Integer.compare(hour, other.hour); if (cmp == 0) { cmp = Integer.compare(minute, other.minute); if (cmp == 0) { cmp = Integer.compare(second, other.second); if (cmp == 0) { cmp = Integer.compare(nano, other.nano); } } } return cmp; }
class class_name[name] begin[{] method[compareTo, return_type[type[int]], modifier[public], parameter[other]] begin[{] local_variable[type[int], cmp] if[binary_operation[member[.cmp], ==, literal[0]]] begin[{] assign[member[.cmp], call[Integer.compare, parameter[member[.minute], member[other.minute]]]] if[binary_operation[member[.cmp], ==, literal[0]]] begin[{] assign[member[.cmp], call[Integer.compare, parameter[member[.second], member[other.second]]]] if[binary_operation[member[.cmp], ==, literal[0]]] begin[{] assign[member[.cmp], call[Integer.compare, parameter[member[.nano], member[other.nano]]]] else begin[{] None end[}] else begin[{] None end[}] else begin[{] None end[}] return[member[.cmp]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[int] identifier[compareTo] operator[SEP] identifier[LocalTime] identifier[other] operator[SEP] { Keyword[int] identifier[cmp] operator[=] identifier[Integer] operator[SEP] identifier[compare] operator[SEP] identifier[hour] , identifier[other] operator[SEP] identifier[hour] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[cmp] operator[==] Other[0] operator[SEP] { identifier[cmp] operator[=] identifier[Integer] operator[SEP] identifier[compare] operator[SEP] identifier[minute] , identifier[other] operator[SEP] identifier[minute] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[cmp] operator[==] Other[0] operator[SEP] { identifier[cmp] operator[=] identifier[Integer] operator[SEP] identifier[compare] operator[SEP] identifier[second] , identifier[other] operator[SEP] identifier[second] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[cmp] operator[==] Other[0] operator[SEP] { identifier[cmp] operator[=] identifier[Integer] operator[SEP] identifier[compare] operator[SEP] identifier[nano] , identifier[other] operator[SEP] identifier[nano] operator[SEP] operator[SEP] } } } Keyword[return] identifier[cmp] operator[SEP] }
@XmlElementDecl(namespace = "urn:oasis:names:tc:ciq:xsdschema:xAL:2.0", name = "AddressDetails") public JAXBElement<AddressDetails> createAddressDetails(AddressDetails value) { return new JAXBElement<AddressDetails>(_AddressDetails_QNAME, AddressDetails.class, null, value); }
class class_name[name] begin[{] method[createAddressDetails, return_type[type[JAXBElement]], modifier[public], parameter[value]] begin[{] return[ClassCreator(arguments=[MemberReference(member=_AddressDetails_QNAME, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=AddressDetails, sub_type=None)), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=AddressDetails, 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] operator[SEP] Keyword[public] identifier[JAXBElement] operator[<] identifier[AddressDetails] operator[>] identifier[createAddressDetails] operator[SEP] identifier[AddressDetails] identifier[value] operator[SEP] { Keyword[return] Keyword[new] identifier[JAXBElement] operator[<] identifier[AddressDetails] operator[>] operator[SEP] identifier[_AddressDetails_QNAME] , identifier[AddressDetails] operator[SEP] Keyword[class] , Other[null] , identifier[value] operator[SEP] operator[SEP] }
@Override GroupCmdReplyList command_inout_reply_i(final int rid, final int tmo, final boolean fwd) throws DevFailed { final Integer rid_obj = new Integer(rid); final GroupCmdReplyList rl = new GroupCmdReplyList(); final AsynchRequest ar = arp.get(rid_obj); if (ar == null) { final DevError[] errors = new DevError[1]; errors[0] = new DevError(); errors[0].severity = ErrSeverity.ERR; errors[0].reason = "API_BadAsynPollId"; errors[0].desc = "Invalid asynch. request identifier specified"; errors[0].origin = "GroupDeviceElement.command_inout_reply"; final DevFailed e = new DevFailed(errors); rl.add(new GroupCmdReply(get_name(), "unknown", e)); return rl; } if (ar.req_id == -1) { for (final String element : ar.obj_name) { rl.add(new GroupCmdReply(get_name(), element, ar.exception)); } arp.remove(rid_obj); return rl; } try { final DeviceData dd = proxy.command_inout_reply(ar.req_id, tmo); for (final String element : ar.obj_name) { rl.add(new GroupCmdReply(get_name(), element, dd)); } } catch (final AsynReplyNotArrived na) { final DevError[] errors = new DevError[1]; errors[0] = new DevError(); errors[0].severity = ErrSeverity.ERR; errors[0].reason = "API_AsynReplyNotArrived"; errors[0].desc = "No reply for asynch request"; errors[0].origin = "GroupDeviceElement.command_inout_reply"; final DevFailed e = new DevFailed(errors); for (final String element : ar.obj_name) { rl.add(new GroupCmdReply(get_name(), element, e)); } } catch (final DevFailed df) { for (final String element : ar.obj_name) { rl.add(new GroupCmdReply(get_name(), element, df)); } } catch (final Exception ex) { final DevError[] errors = new DevError[1]; errors[0] = new DevError(); errors[0].severity = ErrSeverity.ERR; errors[0].reason = "unknown exception caught"; errors[0].desc = "unknown error"; errors[0].origin = "GroupDeviceElemnt.command_inout"; final DevFailed e = new DevFailed(errors); for (final String element : ar.obj_name) { rl.add(new GroupCmdReply(get_name(), element, e)); } } arp.remove(rid_obj); return rl; }
class class_name[name] begin[{] method[command_inout_reply_i, return_type[type[GroupCmdReplyList]], modifier[default], parameter[rid, tmo, fwd]] begin[{] local_variable[type[Integer], rid_obj] local_variable[type[GroupCmdReplyList], rl] local_variable[type[AsynchRequest], ar] if[binary_operation[member[.ar], ==, literal[null]]] begin[{] local_variable[type[DevError], errors] assign[member[.errors], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=DevError, sub_type=None))] assign[member[.errors], member[ErrSeverity.ERR]] assign[member[.errors], literal["API_BadAsynPollId"]] assign[member[.errors], literal["Invalid asynch. request identifier specified"]] assign[member[.errors], literal["GroupDeviceElement.command_inout_reply"]] local_variable[type[DevFailed], e] call[rl.add, parameter[ClassCreator(arguments=[MethodInvocation(arguments=[], member=get_name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="unknown"), 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=GroupCmdReply, sub_type=None))]] return[member[.rl]] else begin[{] None end[}] if[binary_operation[member[ar.req_id], ==, literal[1]]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[ClassCreator(arguments=[MethodInvocation(arguments=[], member=get_name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), MemberReference(member=element, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=exception, postfix_operators=[], prefix_operators=[], qualifier=ar, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=GroupCmdReply, sub_type=None))], member=add, postfix_operators=[], prefix_operators=[], qualifier=rl, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=obj_name, postfix_operators=[], prefix_operators=[], qualifier=ar, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=element)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None) call[arp.remove, parameter[member[.rid_obj]]] return[member[.rl]] else begin[{] None end[}] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=req_id, postfix_operators=[], prefix_operators=[], qualifier=ar, selectors=[]), MemberReference(member=tmo, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=command_inout_reply, postfix_operators=[], prefix_operators=[], qualifier=proxy, selectors=[], type_arguments=None), name=dd)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=DeviceData, sub_type=None)), ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[ClassCreator(arguments=[MethodInvocation(arguments=[], member=get_name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), MemberReference(member=element, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=dd, 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=GroupCmdReply, sub_type=None))], member=add, postfix_operators=[], prefix_operators=[], qualifier=rl, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=obj_name, postfix_operators=[], prefix_operators=[], qualifier=ar, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=element)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None)], catches=[CatchClause(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ArrayCreator(dimensions=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=DevError, sub_type=None)), name=errors)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[None], name=DevError, sub_type=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=errors, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))]), type==, value=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=DevError, sub_type=None))), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=errors, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)), MemberReference(member=severity, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), type==, value=MemberReference(member=ERR, postfix_operators=[], prefix_operators=[], qualifier=ErrSeverity, selectors=[])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=errors, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)), MemberReference(member=reason, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="API_AsynReplyNotArrived")), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=errors, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)), MemberReference(member=desc, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="No reply for asynch request")), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=errors, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)), MemberReference(member=origin, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="GroupDeviceElement.command_inout_reply")), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MemberReference(member=errors, 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=DevFailed, sub_type=None)), name=e)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=DevFailed, sub_type=None)), ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[ClassCreator(arguments=[MethodInvocation(arguments=[], member=get_name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), MemberReference(member=element, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), 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=GroupCmdReply, sub_type=None))], member=add, postfix_operators=[], prefix_operators=[], qualifier=rl, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=obj_name, postfix_operators=[], prefix_operators=[], qualifier=ar, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=element)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=na, types=['AsynReplyNotArrived'])), CatchClause(block=[ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[ClassCreator(arguments=[MethodInvocation(arguments=[], member=get_name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), MemberReference(member=element, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=df, 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=GroupCmdReply, sub_type=None))], member=add, postfix_operators=[], prefix_operators=[], qualifier=rl, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=obj_name, postfix_operators=[], prefix_operators=[], qualifier=ar, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=element)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=df, types=['DevFailed'])), CatchClause(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ArrayCreator(dimensions=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=DevError, sub_type=None)), name=errors)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[None], name=DevError, sub_type=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=errors, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))]), type==, value=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=DevError, sub_type=None))), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=errors, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)), MemberReference(member=severity, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), type==, value=MemberReference(member=ERR, postfix_operators=[], prefix_operators=[], qualifier=ErrSeverity, selectors=[])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=errors, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)), MemberReference(member=reason, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="unknown exception caught")), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=errors, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)), MemberReference(member=desc, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="unknown error")), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=errors, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)), MemberReference(member=origin, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="GroupDeviceElemnt.command_inout")), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MemberReference(member=errors, 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=DevFailed, sub_type=None)), name=e)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=DevFailed, sub_type=None)), ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[ClassCreator(arguments=[MethodInvocation(arguments=[], member=get_name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), MemberReference(member=element, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), 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=GroupCmdReply, sub_type=None))], member=add, postfix_operators=[], prefix_operators=[], qualifier=rl, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=obj_name, postfix_operators=[], prefix_operators=[], qualifier=ar, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=element)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ex, types=['Exception']))], finally_block=None, label=None, resources=None) call[arp.remove, parameter[member[.rid_obj]]] return[member[.rl]] end[}] END[}]
annotation[@] identifier[Override] identifier[GroupCmdReplyList] identifier[command_inout_reply_i] operator[SEP] Keyword[final] Keyword[int] identifier[rid] , Keyword[final] Keyword[int] identifier[tmo] , Keyword[final] Keyword[boolean] identifier[fwd] operator[SEP] Keyword[throws] identifier[DevFailed] { Keyword[final] identifier[Integer] identifier[rid_obj] operator[=] Keyword[new] identifier[Integer] operator[SEP] identifier[rid] operator[SEP] operator[SEP] Keyword[final] identifier[GroupCmdReplyList] identifier[rl] operator[=] Keyword[new] identifier[GroupCmdReplyList] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[AsynchRequest] identifier[ar] operator[=] identifier[arp] operator[SEP] identifier[get] operator[SEP] identifier[rid_obj] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[ar] operator[==] Other[null] operator[SEP] { Keyword[final] identifier[DevError] operator[SEP] operator[SEP] identifier[errors] operator[=] Keyword[new] identifier[DevError] operator[SEP] Other[1] operator[SEP] operator[SEP] identifier[errors] operator[SEP] Other[0] operator[SEP] operator[=] Keyword[new] identifier[DevError] operator[SEP] operator[SEP] operator[SEP] identifier[errors] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[severity] operator[=] identifier[ErrSeverity] operator[SEP] identifier[ERR] operator[SEP] identifier[errors] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[reason] operator[=] literal[String] operator[SEP] identifier[errors] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[desc] operator[=] literal[String] operator[SEP] identifier[errors] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[origin] operator[=] literal[String] operator[SEP] Keyword[final] identifier[DevFailed] identifier[e] operator[=] Keyword[new] identifier[DevFailed] operator[SEP] identifier[errors] operator[SEP] operator[SEP] identifier[rl] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[GroupCmdReply] operator[SEP] identifier[get_name] operator[SEP] operator[SEP] , literal[String] , identifier[e] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[rl] operator[SEP] } Keyword[if] operator[SEP] identifier[ar] operator[SEP] identifier[req_id] operator[==] operator[-] Other[1] operator[SEP] { Keyword[for] operator[SEP] Keyword[final] identifier[String] identifier[element] operator[:] identifier[ar] operator[SEP] identifier[obj_name] operator[SEP] { identifier[rl] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[GroupCmdReply] operator[SEP] identifier[get_name] operator[SEP] operator[SEP] , identifier[element] , identifier[ar] operator[SEP] identifier[exception] operator[SEP] operator[SEP] operator[SEP] } identifier[arp] operator[SEP] identifier[remove] operator[SEP] identifier[rid_obj] operator[SEP] operator[SEP] Keyword[return] identifier[rl] operator[SEP] } Keyword[try] { Keyword[final] identifier[DeviceData] identifier[dd] operator[=] identifier[proxy] operator[SEP] identifier[command_inout_reply] operator[SEP] identifier[ar] operator[SEP] identifier[req_id] , identifier[tmo] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[final] identifier[String] identifier[element] operator[:] identifier[ar] operator[SEP] identifier[obj_name] operator[SEP] { identifier[rl] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[GroupCmdReply] operator[SEP] identifier[get_name] operator[SEP] operator[SEP] , identifier[element] , identifier[dd] operator[SEP] operator[SEP] operator[SEP] } } Keyword[catch] operator[SEP] Keyword[final] identifier[AsynReplyNotArrived] identifier[na] operator[SEP] { Keyword[final] identifier[DevError] operator[SEP] operator[SEP] identifier[errors] operator[=] Keyword[new] identifier[DevError] operator[SEP] Other[1] operator[SEP] operator[SEP] identifier[errors] operator[SEP] Other[0] operator[SEP] operator[=] Keyword[new] identifier[DevError] operator[SEP] operator[SEP] operator[SEP] identifier[errors] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[severity] operator[=] identifier[ErrSeverity] operator[SEP] identifier[ERR] operator[SEP] identifier[errors] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[reason] operator[=] literal[String] operator[SEP] identifier[errors] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[desc] operator[=] literal[String] operator[SEP] identifier[errors] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[origin] operator[=] literal[String] operator[SEP] Keyword[final] identifier[DevFailed] identifier[e] operator[=] Keyword[new] identifier[DevFailed] operator[SEP] identifier[errors] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[final] identifier[String] identifier[element] operator[:] identifier[ar] operator[SEP] identifier[obj_name] operator[SEP] { identifier[rl] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[GroupCmdReply] operator[SEP] identifier[get_name] operator[SEP] operator[SEP] , identifier[element] , identifier[e] operator[SEP] operator[SEP] operator[SEP] } } Keyword[catch] operator[SEP] Keyword[final] identifier[DevFailed] identifier[df] operator[SEP] { Keyword[for] operator[SEP] Keyword[final] identifier[String] identifier[element] operator[:] identifier[ar] operator[SEP] identifier[obj_name] operator[SEP] { identifier[rl] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[GroupCmdReply] operator[SEP] identifier[get_name] operator[SEP] operator[SEP] , identifier[element] , identifier[df] operator[SEP] operator[SEP] operator[SEP] } } Keyword[catch] operator[SEP] Keyword[final] identifier[Exception] identifier[ex] operator[SEP] { Keyword[final] identifier[DevError] operator[SEP] operator[SEP] identifier[errors] operator[=] Keyword[new] identifier[DevError] operator[SEP] Other[1] operator[SEP] operator[SEP] identifier[errors] operator[SEP] Other[0] operator[SEP] operator[=] Keyword[new] identifier[DevError] operator[SEP] operator[SEP] operator[SEP] identifier[errors] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[severity] operator[=] identifier[ErrSeverity] operator[SEP] identifier[ERR] operator[SEP] identifier[errors] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[reason] operator[=] literal[String] operator[SEP] identifier[errors] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[desc] operator[=] literal[String] operator[SEP] identifier[errors] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[origin] operator[=] literal[String] operator[SEP] Keyword[final] identifier[DevFailed] identifier[e] operator[=] Keyword[new] identifier[DevFailed] operator[SEP] identifier[errors] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[final] identifier[String] identifier[element] operator[:] identifier[ar] operator[SEP] identifier[obj_name] operator[SEP] { identifier[rl] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[GroupCmdReply] operator[SEP] identifier[get_name] operator[SEP] operator[SEP] , identifier[element] , identifier[e] operator[SEP] operator[SEP] operator[SEP] } } identifier[arp] operator[SEP] identifier[remove] operator[SEP] identifier[rid_obj] operator[SEP] operator[SEP] Keyword[return] identifier[rl] operator[SEP] }
public static Object copy(Object source) { try { ByteArrayOutputStream baos = new ByteArrayOutputStream(); ObjectOutputStream oos = new ObjectOutputStream(baos); oos.writeObject(source); ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray()); ObjectInputStream ois = new ObjectInputStream(bais); Object deepCopy = ois.readObject(); return deepCopy; } catch (Exception e) { throw new JKException(e); } }
class class_name[name] begin[{] method[copy, return_type[type[Object]], modifier[public static], parameter[source]] begin[{] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ByteArrayOutputStream, sub_type=None)), name=baos)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ByteArrayOutputStream, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MemberReference(member=baos, 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=ObjectOutputStream, sub_type=None)), name=oos)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ObjectOutputStream, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=source, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=writeObject, postfix_operators=[], prefix_operators=[], qualifier=oos, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MethodInvocation(arguments=[], member=toByteArray, postfix_operators=[], prefix_operators=[], qualifier=baos, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ByteArrayInputStream, sub_type=None)), name=bais)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ByteArrayInputStream, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MemberReference(member=bais, 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=ObjectInputStream, sub_type=None)), name=ois)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ObjectInputStream, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=readObject, postfix_operators=[], prefix_operators=[], qualifier=ois, selectors=[], type_arguments=None), name=deepCopy)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None)), ReturnStatement(expression=MemberReference(member=deepCopy, 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=JKException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[public] Keyword[static] identifier[Object] identifier[copy] operator[SEP] identifier[Object] identifier[source] operator[SEP] { Keyword[try] { identifier[ByteArrayOutputStream] identifier[baos] operator[=] Keyword[new] identifier[ByteArrayOutputStream] operator[SEP] operator[SEP] operator[SEP] identifier[ObjectOutputStream] identifier[oos] operator[=] Keyword[new] identifier[ObjectOutputStream] operator[SEP] identifier[baos] operator[SEP] operator[SEP] identifier[oos] operator[SEP] identifier[writeObject] operator[SEP] identifier[source] operator[SEP] operator[SEP] identifier[ByteArrayInputStream] identifier[bais] operator[=] Keyword[new] identifier[ByteArrayInputStream] operator[SEP] identifier[baos] operator[SEP] identifier[toByteArray] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[ObjectInputStream] identifier[ois] operator[=] Keyword[new] identifier[ObjectInputStream] operator[SEP] identifier[bais] operator[SEP] operator[SEP] identifier[Object] identifier[deepCopy] operator[=] identifier[ois] operator[SEP] identifier[readObject] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[deepCopy] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[JKException] operator[SEP] identifier[e] operator[SEP] operator[SEP] } }
public static void saveImage(Image image, String filename, String imgFileFormat){ File f = new File(filename); if(!f.isDirectory()){ saveImage(image, f, imgFileFormat); } else { throw new ImageSaverException(new IOException(String.format("provided file name denotes a directory. %s", filename))); } }
class class_name[name] begin[{] method[saveImage, return_type[void], modifier[public static], parameter[image, filename, imgFileFormat]] begin[{] local_variable[type[File], f] if[call[f.isDirectory, parameter[]]] begin[{] call[.saveImage, parameter[member[.image], member[.f], member[.imgFileFormat]]] else begin[{] ThrowStatement(expression=ClassCreator(arguments=[ClassCreator(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="provided file name denotes a directory. %s"), MemberReference(member=filename, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=format, postfix_operators=[], prefix_operators=[], qualifier=String, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IOException, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ImageSaverException, sub_type=None)), label=None) end[}] end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[saveImage] operator[SEP] identifier[Image] identifier[image] , identifier[String] identifier[filename] , identifier[String] identifier[imgFileFormat] operator[SEP] { identifier[File] identifier[f] operator[=] Keyword[new] identifier[File] operator[SEP] identifier[filename] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[f] operator[SEP] identifier[isDirectory] operator[SEP] operator[SEP] operator[SEP] { identifier[saveImage] operator[SEP] identifier[image] , identifier[f] , identifier[imgFileFormat] operator[SEP] operator[SEP] } Keyword[else] { Keyword[throw] Keyword[new] identifier[ImageSaverException] operator[SEP] Keyword[new] identifier[IOException] operator[SEP] identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[filename] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } }
@XmlElementDecl(namespace = "http://xmlns.jcp.org/xml/ns/javaee", name = "job") public JAXBElement<JSLJob> createJob(JSLJob value) { return new JAXBElement<JSLJob>(_Job_QNAME, JSLJob.class, null, value); }
class class_name[name] begin[{] method[createJob, return_type[type[JAXBElement]], modifier[public], parameter[value]] begin[{] return[ClassCreator(arguments=[MemberReference(member=_Job_QNAME, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=JSLJob, sub_type=None)), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=JSLJob, 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] operator[SEP] Keyword[public] identifier[JAXBElement] operator[<] identifier[JSLJob] operator[>] identifier[createJob] operator[SEP] identifier[JSLJob] identifier[value] operator[SEP] { Keyword[return] Keyword[new] identifier[JAXBElement] operator[<] identifier[JSLJob] operator[>] operator[SEP] identifier[_Job_QNAME] , identifier[JSLJob] operator[SEP] Keyword[class] , Other[null] , identifier[value] operator[SEP] operator[SEP] }
public void mergeMapSection(int line, int column, String mapSectionContents) throws SourceMapParseException { setStartingPosition(line, column); SourceMapConsumerV3 section = new SourceMapConsumerV3(); section.parse(mapSectionContents); section.visitMappings(new ConsumerEntryVisitor()); }
class class_name[name] begin[{] method[mergeMapSection, return_type[void], modifier[public], parameter[line, column, mapSectionContents]] begin[{] call[.setStartingPosition, parameter[member[.line], member[.column]]] local_variable[type[SourceMapConsumerV3], section] call[section.parse, parameter[member[.mapSectionContents]]] call[section.visitMappings, parameter[ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ConsumerEntryVisitor, sub_type=None))]] end[}] END[}]
Keyword[public] Keyword[void] identifier[mergeMapSection] operator[SEP] Keyword[int] identifier[line] , Keyword[int] identifier[column] , identifier[String] identifier[mapSectionContents] operator[SEP] Keyword[throws] identifier[SourceMapParseException] { identifier[setStartingPosition] operator[SEP] identifier[line] , identifier[column] operator[SEP] operator[SEP] identifier[SourceMapConsumerV3] identifier[section] operator[=] Keyword[new] identifier[SourceMapConsumerV3] operator[SEP] operator[SEP] operator[SEP] identifier[section] operator[SEP] identifier[parse] operator[SEP] identifier[mapSectionContents] operator[SEP] operator[SEP] identifier[section] operator[SEP] identifier[visitMappings] operator[SEP] Keyword[new] identifier[ConsumerEntryVisitor] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
public static BlankFragment newInstance() { BlankFragment fragment = new BlankFragment(); Bundle args = new Bundle(); fragment.setArguments(args); return fragment; }
class class_name[name] begin[{] method[newInstance, return_type[type[BlankFragment]], modifier[public static], parameter[]] begin[{] local_variable[type[BlankFragment], fragment] local_variable[type[Bundle], args] call[fragment.setArguments, parameter[member[.args]]] return[member[.fragment]] end[}] END[}]
Keyword[public] Keyword[static] identifier[BlankFragment] identifier[newInstance] operator[SEP] operator[SEP] { identifier[BlankFragment] identifier[fragment] operator[=] Keyword[new] identifier[BlankFragment] operator[SEP] operator[SEP] operator[SEP] identifier[Bundle] identifier[args] operator[=] Keyword[new] identifier[Bundle] operator[SEP] operator[SEP] operator[SEP] identifier[fragment] operator[SEP] identifier[setArguments] operator[SEP] identifier[args] operator[SEP] operator[SEP] Keyword[return] identifier[fragment] operator[SEP] }
public String getSchema() { getEntityType(); return this.entityType != null && !StringUtils.isBlank(((AbstractManagedType) this.entityType).getSchemaName()) ? ((AbstractManagedType) this.entityType) .getSchemaName() : schema; }
class class_name[name] begin[{] method[getSchema, return_type[type[String]], modifier[public], parameter[]] begin[{] call[.getEntityType, parameter[]] return[TernaryExpression(condition=BinaryOperation(operandl=BinaryOperation(operandl=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=entityType, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operandr=MethodInvocation(arguments=[Cast(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=entityType, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), type=ReferenceType(arguments=None, dimensions=[], name=AbstractManagedType, sub_type=None))], member=isBlank, postfix_operators=[], prefix_operators=['!'], qualifier=StringUtils, selectors=[], type_arguments=None), operator=&&), if_false=MemberReference(member=schema, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_true=Cast(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=entityType, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), type=ReferenceType(arguments=None, dimensions=[], name=AbstractManagedType, sub_type=None)))] end[}] END[}]
Keyword[public] identifier[String] identifier[getSchema] operator[SEP] operator[SEP] { identifier[getEntityType] operator[SEP] operator[SEP] operator[SEP] Keyword[return] Keyword[this] operator[SEP] identifier[entityType] operator[!=] Other[null] operator[&&] operator[!] identifier[StringUtils] operator[SEP] identifier[isBlank] operator[SEP] operator[SEP] operator[SEP] identifier[AbstractManagedType] operator[SEP] Keyword[this] operator[SEP] identifier[entityType] operator[SEP] operator[SEP] identifier[getSchemaName] operator[SEP] operator[SEP] operator[SEP] operator[?] operator[SEP] operator[SEP] identifier[AbstractManagedType] operator[SEP] Keyword[this] operator[SEP] identifier[entityType] operator[SEP] operator[SEP] identifier[getSchemaName] operator[SEP] operator[SEP] operator[:] identifier[schema] operator[SEP] }
public void trace(String format, Object... args) { if (!logger.isTraceEnabled()) return; if (instanceofLAL) { String formattedMessage = MessageFormatter.arrayFormat(format, args).getMessage(); ((LocationAwareLogger) logger).log(null, fqcn, LocationAwareLogger.TRACE_INT, formattedMessage, args, null); } else { logger.trace(format, args); } }
class class_name[name] begin[{] method[trace, return_type[void], modifier[public], parameter[format, args]] begin[{] if[call[logger.isTraceEnabled, parameter[]]] begin[{] return[None] else begin[{] None end[}] if[member[.instanceofLAL]] begin[{] local_variable[type[String], formattedMessage] Cast(expression=MemberReference(member=logger, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=LocationAwareLogger, sub_type=None)) else begin[{] call[logger.trace, parameter[member[.format], member[.args]]] end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[trace] operator[SEP] identifier[String] identifier[format] , identifier[Object] operator[...] identifier[args] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[logger] operator[SEP] identifier[isTraceEnabled] operator[SEP] operator[SEP] operator[SEP] Keyword[return] operator[SEP] Keyword[if] operator[SEP] identifier[instanceofLAL] operator[SEP] { identifier[String] identifier[formattedMessage] operator[=] identifier[MessageFormatter] operator[SEP] identifier[arrayFormat] operator[SEP] identifier[format] , identifier[args] operator[SEP] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[LocationAwareLogger] operator[SEP] identifier[logger] operator[SEP] operator[SEP] identifier[log] operator[SEP] Other[null] , identifier[fqcn] , identifier[LocationAwareLogger] operator[SEP] identifier[TRACE_INT] , identifier[formattedMessage] , identifier[args] , Other[null] operator[SEP] operator[SEP] } Keyword[else] { identifier[logger] operator[SEP] identifier[trace] operator[SEP] identifier[format] , identifier[args] operator[SEP] operator[SEP] } }
@NonNull @Override public ListenerToken addChangeListener(@NonNull QueryChangeListener listener) { if (listener == null) { throw new IllegalArgumentException("listener cannot be null."); } return addChangeListener(null, listener); }
class class_name[name] begin[{] method[addChangeListener, return_type[type[ListenerToken]], modifier[public], parameter[listener]] begin[{] if[binary_operation[member[.listener], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="listener cannot be null.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None) else begin[{] None end[}] return[call[.addChangeListener, parameter[literal[null], member[.listener]]]] end[}] END[}]
annotation[@] identifier[NonNull] annotation[@] identifier[Override] Keyword[public] identifier[ListenerToken] identifier[addChangeListener] operator[SEP] annotation[@] identifier[NonNull] identifier[QueryChangeListener] identifier[listener] operator[SEP] { Keyword[if] operator[SEP] identifier[listener] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[return] identifier[addChangeListener] operator[SEP] Other[null] , identifier[listener] operator[SEP] operator[SEP] }
public static Collection<String> getUnstaticClassFieldNameCollection(Class<?> clazz) { if (clazz == null) { throw new NullPointerException("传入的clazz为空对象!"); } Field[] fields = clazz.getDeclaredFields(); int length = fields.length; Collection<String> fieldNames = new ArrayList<String>(); for (int i = 0; i < length; i++) { Field field = fields[i]; if (!Modifier.isStatic(field.getModifiers())) { fieldNames.add(field.getName()); } } return fieldNames; }
class class_name[name] begin[{] method[getUnstaticClassFieldNameCollection, return_type[type[Collection]], modifier[public static], parameter[clazz]] begin[{] if[binary_operation[member[.clazz], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="传入的clazz为空对象!")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=NullPointerException, sub_type=None)), label=None) else begin[{] None end[}] local_variable[type[Field], fields] local_variable[type[int], length] local_variable[type[Collection], fieldNames] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=fields, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), name=field)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Field, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getModifiers, postfix_operators=[], prefix_operators=[], qualifier=field, selectors=[], type_arguments=None)], member=isStatic, postfix_operators=[], prefix_operators=['!'], qualifier=Modifier, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=field, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=fieldNames, 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=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) return[member[.fieldNames]] end[}] END[}]
Keyword[public] Keyword[static] identifier[Collection] operator[<] identifier[String] operator[>] identifier[getUnstaticClassFieldNameCollection] operator[SEP] identifier[Class] operator[<] operator[?] operator[>] identifier[clazz] operator[SEP] { Keyword[if] operator[SEP] identifier[clazz] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[NullPointerException] operator[SEP] literal[String] operator[SEP] operator[SEP] } identifier[Field] operator[SEP] operator[SEP] identifier[fields] operator[=] identifier[clazz] operator[SEP] identifier[getDeclaredFields] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[length] operator[=] identifier[fields] operator[SEP] identifier[length] operator[SEP] identifier[Collection] operator[<] identifier[String] operator[>] identifier[fieldNames] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[String] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[Field] identifier[field] operator[=] identifier[fields] operator[SEP] identifier[i] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[Modifier] operator[SEP] identifier[isStatic] operator[SEP] identifier[field] operator[SEP] identifier[getModifiers] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { identifier[fieldNames] operator[SEP] identifier[add] operator[SEP] identifier[field] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } Keyword[return] identifier[fieldNames] operator[SEP] }
public boolean areParamsValid() { if (queryType == QueryType.COUNT) { if (eventCollection == null || eventCollection.isEmpty()) { return false; } } if (queryType == QueryType.COUNT_UNIQUE || queryType == QueryType.MINIMUM || queryType == QueryType.MAXIMUM || queryType == QueryType.AVERAGE || queryType == QueryType.MEDIAN || queryType == QueryType.PERCENTILE || queryType == QueryType.SUM || queryType == QueryType.SELECT_UNIQUE || queryType == QueryType.STANDARD_DEVIATION) { if (eventCollection == null || eventCollection.isEmpty() || targetProperty == null || targetProperty.isEmpty()) { return false; } } if (queryType == QueryType.PERCENTILE) { return percentile != null; } return true; }
class class_name[name] begin[{] method[areParamsValid, return_type[type[boolean]], modifier[public], parameter[]] begin[{] if[binary_operation[member[.queryType], ==, member[QueryType.COUNT]]] begin[{] if[binary_operation[binary_operation[member[.eventCollection], ==, literal[null]], ||, call[eventCollection.isEmpty, parameter[]]]] begin[{] return[literal[false]] else begin[{] None end[}] else begin[{] None end[}] if[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[member[.queryType], ==, member[QueryType.COUNT_UNIQUE]], ||, binary_operation[member[.queryType], ==, member[QueryType.MINIMUM]]], ||, binary_operation[member[.queryType], ==, member[QueryType.MAXIMUM]]], ||, binary_operation[member[.queryType], ==, member[QueryType.AVERAGE]]], ||, binary_operation[member[.queryType], ==, member[QueryType.MEDIAN]]], ||, binary_operation[member[.queryType], ==, member[QueryType.PERCENTILE]]], ||, binary_operation[member[.queryType], ==, member[QueryType.SUM]]], ||, binary_operation[member[.queryType], ==, member[QueryType.SELECT_UNIQUE]]], ||, binary_operation[member[.queryType], ==, member[QueryType.STANDARD_DEVIATION]]]] begin[{] if[binary_operation[binary_operation[binary_operation[binary_operation[member[.eventCollection], ==, literal[null]], ||, call[eventCollection.isEmpty, parameter[]]], ||, binary_operation[member[.targetProperty], ==, literal[null]]], ||, call[targetProperty.isEmpty, parameter[]]]] begin[{] return[literal[false]] else begin[{] None end[}] else begin[{] None end[}] if[binary_operation[member[.queryType], ==, member[QueryType.PERCENTILE]]] begin[{] return[binary_operation[member[.percentile], !=, literal[null]]] else begin[{] None end[}] return[literal[true]] end[}] END[}]
Keyword[public] Keyword[boolean] identifier[areParamsValid] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[queryType] operator[==] identifier[QueryType] operator[SEP] identifier[COUNT] operator[SEP] { Keyword[if] operator[SEP] identifier[eventCollection] operator[==] Other[null] operator[||] identifier[eventCollection] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } } Keyword[if] operator[SEP] identifier[queryType] operator[==] identifier[QueryType] operator[SEP] identifier[COUNT_UNIQUE] operator[||] identifier[queryType] operator[==] identifier[QueryType] operator[SEP] identifier[MINIMUM] operator[||] identifier[queryType] operator[==] identifier[QueryType] operator[SEP] identifier[MAXIMUM] operator[||] identifier[queryType] operator[==] identifier[QueryType] operator[SEP] identifier[AVERAGE] operator[||] identifier[queryType] operator[==] identifier[QueryType] operator[SEP] identifier[MEDIAN] operator[||] identifier[queryType] operator[==] identifier[QueryType] operator[SEP] identifier[PERCENTILE] operator[||] identifier[queryType] operator[==] identifier[QueryType] operator[SEP] identifier[SUM] operator[||] identifier[queryType] operator[==] identifier[QueryType] operator[SEP] identifier[SELECT_UNIQUE] operator[||] identifier[queryType] operator[==] identifier[QueryType] operator[SEP] identifier[STANDARD_DEVIATION] operator[SEP] { Keyword[if] operator[SEP] identifier[eventCollection] operator[==] Other[null] operator[||] identifier[eventCollection] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[||] identifier[targetProperty] operator[==] Other[null] operator[||] identifier[targetProperty] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } } Keyword[if] operator[SEP] identifier[queryType] operator[==] identifier[QueryType] operator[SEP] identifier[PERCENTILE] operator[SEP] { Keyword[return] identifier[percentile] operator[!=] Other[null] operator[SEP] } Keyword[return] literal[boolean] operator[SEP] }
protected WriteableLogRecord getWriteableLogRecord(int recordLength) throws InternalLogException { if (tc.isEntryEnabled()) Tr.entry(tc, "getWriteableLogRecord", new Object[] { this, recordLength }); WriteableLogRecord writeableLogRecord = null; boolean keyPointRequired = false; synchronized (this) { if (_activeFile.freeBytes() < (recordLength + WriteableLogRecord.HEADER_SIZE)) { // There is insufficient space in the active file to accomodate a record // of the requested size. We must perform a keypoint operation instead. // We can't perform this directly as we are synchronized under this object // so make a note of this fact here instead. This causes a keypoint to // occur outside this sync block below. keyPointRequired = true; } else { try { writeableLogRecord = _activeFile.getWriteableLogRecord(recordLength, _recordSequenceNumber++); } catch (InternalLogException exc) { FFDCFilter.processException(exc, "com.ibm.ws.recoverylog.spi.LogHandle.getWriteableLogRecord", "1112", this); if (tc.isEntryEnabled()) Tr.exit(tc, "getWriteableLogRecord", exc); throw exc; } } } if (keyPointRequired) { // There is insufficient space in the active file to accomodate a record // of the requested size. We must perform a keypoint operation instead. try { _recoveryLog.keypoint(); } catch (LogClosedException exc) { FFDCFilter.processException(exc, "com.ibm.ws.recoverylog.spi.LogHandle.getWriteableLogRecord", "1129", this); if (tc.isEntryEnabled()) Tr.exit(tc, "getWriteableLogRecord", "InternalLogException"); throw new InternalLogException(exc); } catch (InternalLogException exc) { FFDCFilter.processException(exc, "com.ibm.ws.recoverylog.spi.LogHandle.getWriteableLogRecord", "1135", this); if (tc.isEntryEnabled()) Tr.exit(tc, "getWriteableLogRecord", exc); throw exc; } catch (LogIncompatibleException exc) { FFDCFilter.processException(exc, "com.ibm.ws.recoverylog.spi.LogHandle.getWriteableLogRecord", "1204", this); if (tc.isEntryEnabled()) Tr.exit(tc, "getWriteableLogRecord", exc); throw new InternalLogException(exc); } // Return null to the caller. This indicates that the recovery log now contains // a persistent record of all active data and the write operation is no longer // required. writeableLogRecord = null; } if (tc.isEntryEnabled()) Tr.exit(tc, "getWriteableLogRecord", writeableLogRecord); return writeableLogRecord; }
class class_name[name] begin[{] method[getWriteableLogRecord, return_type[type[WriteableLogRecord]], modifier[protected], parameter[recordLength]] begin[{] if[call[tc.isEntryEnabled, parameter[]]] begin[{] call[Tr.entry, parameter[member[.tc], literal["getWriteableLogRecord"], ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), MemberReference(member=recordLength, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Object, sub_type=None))]] else begin[{] None end[}] local_variable[type[WriteableLogRecord], writeableLogRecord] local_variable[type[boolean], keyPointRequired] SYNCHRONIZED[THIS[]] BEGIN[{] if[binary_operation[call[_activeFile.freeBytes, parameter[]], <, binary_operation[member[.recordLength], +, member[WriteableLogRecord.HEADER_SIZE]]]] begin[{] assign[member[.keyPointRequired], literal[true]] else begin[{] TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=writeableLogRecord, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=recordLength, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=_recordSequenceNumber, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])], member=getWriteableLogRecord, postfix_operators=[], prefix_operators=[], qualifier=_activeFile, selectors=[], type_arguments=None)), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=exc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="com.ibm.ws.recoverylog.spi.LogHandle.getWriteableLogRecord"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="1112"), This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[])], member=processException, postfix_operators=[], prefix_operators=[], qualifier=FFDCFilter, selectors=[], type_arguments=None), label=None), IfStatement(condition=MethodInvocation(arguments=[], member=isEntryEnabled, postfix_operators=[], prefix_operators=[], qualifier=tc, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=tc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="getWriteableLogRecord"), MemberReference(member=exc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=exit, postfix_operators=[], prefix_operators=[], qualifier=Tr, selectors=[], type_arguments=None), label=None)), ThrowStatement(expression=MemberReference(member=exc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=exc, types=['InternalLogException']))], finally_block=None, label=None, resources=None) end[}] END[}] if[member[.keyPointRequired]] begin[{] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=keypoint, postfix_operators=[], prefix_operators=[], qualifier=_recoveryLog, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=exc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="com.ibm.ws.recoverylog.spi.LogHandle.getWriteableLogRecord"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="1129"), This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[])], member=processException, postfix_operators=[], prefix_operators=[], qualifier=FFDCFilter, selectors=[], type_arguments=None), label=None), IfStatement(condition=MethodInvocation(arguments=[], member=isEntryEnabled, postfix_operators=[], prefix_operators=[], qualifier=tc, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=tc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="getWriteableLogRecord"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="InternalLogException")], member=exit, postfix_operators=[], prefix_operators=[], qualifier=Tr, selectors=[], type_arguments=None), label=None)), ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=exc, 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=InternalLogException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=exc, types=['LogClosedException'])), CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=exc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="com.ibm.ws.recoverylog.spi.LogHandle.getWriteableLogRecord"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="1135"), This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[])], member=processException, postfix_operators=[], prefix_operators=[], qualifier=FFDCFilter, selectors=[], type_arguments=None), label=None), IfStatement(condition=MethodInvocation(arguments=[], member=isEntryEnabled, postfix_operators=[], prefix_operators=[], qualifier=tc, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=tc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="getWriteableLogRecord"), MemberReference(member=exc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=exit, postfix_operators=[], prefix_operators=[], qualifier=Tr, selectors=[], type_arguments=None), label=None)), ThrowStatement(expression=MemberReference(member=exc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=exc, types=['InternalLogException'])), CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=exc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="com.ibm.ws.recoverylog.spi.LogHandle.getWriteableLogRecord"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="1204"), This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[])], member=processException, postfix_operators=[], prefix_operators=[], qualifier=FFDCFilter, selectors=[], type_arguments=None), label=None), IfStatement(condition=MethodInvocation(arguments=[], member=isEntryEnabled, postfix_operators=[], prefix_operators=[], qualifier=tc, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=tc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="getWriteableLogRecord"), MemberReference(member=exc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=exit, postfix_operators=[], prefix_operators=[], qualifier=Tr, selectors=[], type_arguments=None), label=None)), ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=exc, 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=InternalLogException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=exc, types=['LogIncompatibleException']))], finally_block=None, label=None, resources=None) assign[member[.writeableLogRecord], literal[null]] else begin[{] None end[}] if[call[tc.isEntryEnabled, parameter[]]] begin[{] call[Tr.exit, parameter[member[.tc], literal["getWriteableLogRecord"], member[.writeableLogRecord]]] else begin[{] None end[}] return[member[.writeableLogRecord]] end[}] END[}]
Keyword[protected] identifier[WriteableLogRecord] identifier[getWriteableLogRecord] operator[SEP] Keyword[int] identifier[recordLength] operator[SEP] Keyword[throws] identifier[InternalLogException] { Keyword[if] operator[SEP] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[Tr] operator[SEP] identifier[entry] operator[SEP] identifier[tc] , literal[String] , Keyword[new] identifier[Object] operator[SEP] operator[SEP] { Keyword[this] , identifier[recordLength] } operator[SEP] operator[SEP] identifier[WriteableLogRecord] identifier[writeableLogRecord] operator[=] Other[null] operator[SEP] Keyword[boolean] identifier[keyPointRequired] operator[=] literal[boolean] operator[SEP] Keyword[synchronized] operator[SEP] Keyword[this] operator[SEP] { Keyword[if] operator[SEP] identifier[_activeFile] operator[SEP] identifier[freeBytes] operator[SEP] operator[SEP] operator[<] operator[SEP] identifier[recordLength] operator[+] identifier[WriteableLogRecord] operator[SEP] identifier[HEADER_SIZE] operator[SEP] operator[SEP] { identifier[keyPointRequired] operator[=] literal[boolean] operator[SEP] } Keyword[else] { Keyword[try] { identifier[writeableLogRecord] operator[=] identifier[_activeFile] operator[SEP] identifier[getWriteableLogRecord] operator[SEP] identifier[recordLength] , identifier[_recordSequenceNumber] operator[++] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[InternalLogException] identifier[exc] operator[SEP] { identifier[FFDCFilter] operator[SEP] identifier[processException] operator[SEP] identifier[exc] , literal[String] , literal[String] , Keyword[this] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[Tr] operator[SEP] identifier[exit] operator[SEP] identifier[tc] , literal[String] , identifier[exc] operator[SEP] operator[SEP] Keyword[throw] identifier[exc] operator[SEP] } } } Keyword[if] operator[SEP] identifier[keyPointRequired] operator[SEP] { Keyword[try] { identifier[_recoveryLog] operator[SEP] identifier[keypoint] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[LogClosedException] identifier[exc] operator[SEP] { identifier[FFDCFilter] operator[SEP] identifier[processException] operator[SEP] identifier[exc] , literal[String] , literal[String] , Keyword[this] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[Tr] operator[SEP] identifier[exit] operator[SEP] identifier[tc] , literal[String] , literal[String] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[InternalLogException] operator[SEP] identifier[exc] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[InternalLogException] identifier[exc] operator[SEP] { identifier[FFDCFilter] operator[SEP] identifier[processException] operator[SEP] identifier[exc] , literal[String] , literal[String] , Keyword[this] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[Tr] operator[SEP] identifier[exit] operator[SEP] identifier[tc] , literal[String] , identifier[exc] operator[SEP] operator[SEP] Keyword[throw] identifier[exc] operator[SEP] } Keyword[catch] operator[SEP] identifier[LogIncompatibleException] identifier[exc] operator[SEP] { identifier[FFDCFilter] operator[SEP] identifier[processException] operator[SEP] identifier[exc] , literal[String] , literal[String] , Keyword[this] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[Tr] operator[SEP] identifier[exit] operator[SEP] identifier[tc] , literal[String] , identifier[exc] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[InternalLogException] operator[SEP] identifier[exc] operator[SEP] operator[SEP] } identifier[writeableLogRecord] operator[=] Other[null] operator[SEP] } Keyword[if] operator[SEP] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[Tr] operator[SEP] identifier[exit] operator[SEP] identifier[tc] , literal[String] , identifier[writeableLogRecord] operator[SEP] operator[SEP] Keyword[return] identifier[writeableLogRecord] operator[SEP] }
protected void attemptToSplit(LeafNode node, Node parent, int parentIndex) { // Initialize the split criterion SplitCriterion splitCriterion = (SplitCriterion) getPreparedClassOption(splitCriterionOption); // Using this criterion, find the best split per attribute and rank the results AttributeSplitSuggestion[] bestSplitSuggestions = node.getBestSplitSuggestions(splitCriterion); List<AttributeSplitSuggestion> acceptedSplits = new LinkedList<AttributeSplitSuggestion>(); Arrays.sort(bestSplitSuggestions); // Declare a variable to determine the number of splits to be performed int numSplits = 0; // If only one split was returned, use it (this generally shouldn't happen) if (bestSplitSuggestions.length == 1) { numSplits = 1; acceptedSplits.add(bestSplitSuggestions[0]); } else if (bestSplitSuggestions.length > 1) { // Otherwise, consider which of the splits proposed may be worth trying // Determine the Hoeffding bound value, used to select how many instances should be used to make a test decision // to feel reasonably confident that the test chosen by this sample is the same as what would be chosen using infinite examples double hoeffdingBound = computeHoeffdingBound(1, splitConfidenceOption.getValue(), node.examplesSeen); // Determine the top two ranked splitting suggestions AttributeSplitSuggestion bestSuggestion = bestSplitSuggestions[bestSplitSuggestions.length - 1]; AttributeSplitSuggestion secondBestSuggestion = bestSplitSuggestions[bestSplitSuggestions.length - 2]; // If the upper bound of the sample mean for the ratio of SDR(best suggestion) to SDR(second best suggestion), // as determined using the Hoeffding bound, is less than 1, then the true mean is also less than 1, and thus at this // particular moment of observation the bestSuggestion is indeed the best split option with confidence 1-delta, and // splitting should occur. // Alternatively, if two or more splits are very similar or identical in terms of their splits, then a threshold limit // (default 0.05) is applied to the Hoeffding bound; if the Hoeffding bound is smaller than this limit then the two // competing attributes are equally good, and the split will be made on the one with the higher SDR value. if (secondBestSuggestion.merit / bestSuggestion.merit < 1 - hoeffdingBound) { numSplits = 1; acceptedSplits.add(bestSuggestion); } else if (numTrees < maxTreesOption.getValue() && node.getLevel() <= maxOptionLevelOption.getValue()) { for (AttributeSplitSuggestion suggestion : bestSplitSuggestions) { if (suggestion.merit / bestSuggestion.merit >= 1 - hoeffdingBound) { numSplits++; acceptedSplits.add(suggestion); } } } else if (hoeffdingBound < tieThresholdOption.getValue()) { numSplits = 1; acceptedSplits.add(bestSplitSuggestions[0]); } else { // If the splitting criterion was not met, initiate pruning of the E-BST structures in each attribute observer for (int i = 0; i < node.attributeObservers.size(); i++) { AttributeClassObserver obs = node.attributeObservers.get(i); if (obs != null) { ((FIMTDDNumericAttributeClassObserver) obs).removeBadSplits(splitCriterion, secondBestSuggestion.merit / bestSuggestion.merit, bestSuggestion.merit, hoeffdingBound); } } } } // If the splitting criterion was met, split the current node using the chosen attribute test, and // make two new branches leading to (empty) leaves if (numSplits > 0) { double optionFactor = numSplits * Math.pow(optionDecayFactorOption.getValue(), (double) node.getLevel()); if (numSplits == 1 || optionFactor < 2.0 || maxTreesOption.getValue() - numTrees <= 1) { AttributeSplitSuggestion splitDecision = acceptedSplits.get(0); SplitNode newSplit = newSplitNode(splitDecision.splitTest); for (int i = 0; i < splitDecision.numSplits(); i++) { LeafNode newChild = newLeafNode(); newChild.setParent(newSplit); newSplit.setChild(i, newChild); } leafNodeCount--; innerNodeCount++; leafNodeCount += splitDecision.numSplits(); if (parent == null) { treeRoot = newSplit; } else { parent.setChild(parent.getChildIndex(node), newSplit); newSplit.setParent(parent); } } else { OptionNode optionNode = newOptionNode(); leafNodeCount--; int j = 0; for (AttributeSplitSuggestion splitDecision : acceptedSplits) { if (j > optionFactor || maxTreesOption.getValue() - numTrees <= 0) { break; } SplitNode newSplit = newSplitNode(splitDecision.splitTest); for (int i = 0; i < splitDecision.numSplits(); i++) { LeafNode newChild = newLeafNode(); newChild.setParent(newSplit); newSplit.setChild(i, newChild); } leafNodeCount += splitDecision.numSplits(); innerNodeCount++; numTrees++; newSplit.setParent(optionNode); optionNode.setChild(j, newSplit); j++; } innerNodeCount++; optionNodeCount++; if (parent == null) { treeRoot = optionNode; } else { parent.setChild(parent.getChildIndex(node), optionNode); optionNode.setParent(parent); } optionNode.resetFF(); } } }
class class_name[name] begin[{] method[attemptToSplit, return_type[void], modifier[protected], parameter[node, parent, parentIndex]] begin[{] local_variable[type[SplitCriterion], splitCriterion] local_variable[type[AttributeSplitSuggestion], bestSplitSuggestions] local_variable[type[List], acceptedSplits] call[Arrays.sort, parameter[member[.bestSplitSuggestions]]] local_variable[type[int], numSplits] if[binary_operation[member[bestSplitSuggestions.length], ==, literal[1]]] begin[{] assign[member[.numSplits], literal[1]] call[acceptedSplits.add, parameter[member[.bestSplitSuggestions]]] else begin[{] if[binary_operation[member[bestSplitSuggestions.length], >, literal[1]]] begin[{] local_variable[type[double], hoeffdingBound] local_variable[type[AttributeSplitSuggestion], bestSuggestion] local_variable[type[AttributeSplitSuggestion], secondBestSuggestion] if[binary_operation[binary_operation[member[secondBestSuggestion.merit], /, member[bestSuggestion.merit]], <, binary_operation[literal[1], -, member[.hoeffdingBound]]]] begin[{] assign[member[.numSplits], literal[1]] call[acceptedSplits.add, parameter[member[.bestSuggestion]]] else begin[{] if[binary_operation[binary_operation[member[.numTrees], <, call[maxTreesOption.getValue, parameter[]]], &&, binary_operation[call[node.getLevel, parameter[]], <=, call[maxOptionLevelOption.getValue, parameter[]]]]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=merit, postfix_operators=[], prefix_operators=[], qualifier=suggestion, selectors=[]), operandr=MemberReference(member=merit, postfix_operators=[], prefix_operators=[], qualifier=bestSuggestion, selectors=[]), operator=/), operandr=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operandr=MemberReference(member=hoeffdingBound, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=-), operator=>=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MemberReference(member=numSplits, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=suggestion, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=acceptedSplits, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=bestSplitSuggestions, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=suggestion)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=AttributeSplitSuggestion, sub_type=None))), label=None) else begin[{] if[binary_operation[member[.hoeffdingBound], <, call[tieThresholdOption.getValue, parameter[]]]] begin[{] assign[member[.numSplits], literal[1]] call[acceptedSplits.add, parameter[member[.bestSplitSuggestions]]] else begin[{] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=node.attributeObservers, selectors=[], type_arguments=None), name=obs)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=AttributeClassObserver, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=obs, 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=Cast(expression=MemberReference(member=obs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=FIMTDDNumericAttributeClassObserver, sub_type=None)), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=node.attributeObservers, selectors=[], type_arguments=None), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) end[}] end[}] end[}] else begin[{] None end[}] end[}] if[binary_operation[member[.numSplits], >, literal[0]]] begin[{] local_variable[type[double], optionFactor] if[binary_operation[binary_operation[binary_operation[member[.numSplits], ==, literal[1]], ||, binary_operation[member[.optionFactor], <, literal[2.0]]], ||, binary_operation[binary_operation[call[maxTreesOption.getValue, parameter[]], -, member[.numTrees]], <=, literal[1]]]] begin[{] local_variable[type[AttributeSplitSuggestion], splitDecision] local_variable[type[SplitNode], newSplit] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=newLeafNode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=newChild)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=LeafNode, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=newSplit, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setParent, postfix_operators=[], prefix_operators=[], qualifier=newChild, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=newChild, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setChild, postfix_operators=[], prefix_operators=[], qualifier=newSplit, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=numSplits, postfix_operators=[], prefix_operators=[], qualifier=splitDecision, selectors=[], type_arguments=None), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) member[.leafNodeCount] member[.innerNodeCount] assign[member[.leafNodeCount], call[splitDecision.numSplits, parameter[]]] if[binary_operation[member[.parent], ==, literal[null]]] begin[{] assign[member[.treeRoot], member[.newSplit]] else begin[{] call[parent.setChild, parameter[call[parent.getChildIndex, parameter[member[.node]]], member[.newSplit]]] call[newSplit.setParent, parameter[member[.parent]]] end[}] else begin[{] local_variable[type[OptionNode], optionNode] member[.leafNodeCount] local_variable[type[int], j] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=optionFactor, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=>), operandr=BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=maxTreesOption, selectors=[], type_arguments=None), operandr=MemberReference(member=numTrees, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=-), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=<=), operator=||), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[BreakStatement(goto=None, label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=splitTest, postfix_operators=[], prefix_operators=[], qualifier=splitDecision, selectors=[])], member=newSplitNode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=newSplit)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=SplitNode, sub_type=None)), ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=newLeafNode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=newChild)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=LeafNode, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=newSplit, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setParent, postfix_operators=[], prefix_operators=[], qualifier=newChild, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=newChild, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setChild, postfix_operators=[], prefix_operators=[], qualifier=newSplit, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=numSplits, postfix_operators=[], prefix_operators=[], qualifier=splitDecision, selectors=[], type_arguments=None), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=leafNodeCount, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=MethodInvocation(arguments=[], member=numSplits, postfix_operators=[], prefix_operators=[], qualifier=splitDecision, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=MemberReference(member=innerNodeCount, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]), label=None), StatementExpression(expression=MemberReference(member=numTrees, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=optionNode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setParent, postfix_operators=[], prefix_operators=[], qualifier=newSplit, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=newSplit, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setChild, postfix_operators=[], prefix_operators=[], qualifier=optionNode, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MemberReference(member=j, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=acceptedSplits, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=splitDecision)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=AttributeSplitSuggestion, sub_type=None))), label=None) member[.innerNodeCount] member[.optionNodeCount] if[binary_operation[member[.parent], ==, literal[null]]] begin[{] assign[member[.treeRoot], member[.optionNode]] else begin[{] call[parent.setChild, parameter[call[parent.getChildIndex, parameter[member[.node]]], member[.optionNode]]] call[optionNode.setParent, parameter[member[.parent]]] end[}] call[optionNode.resetFF, parameter[]] end[}] else begin[{] None end[}] end[}] END[}]
Keyword[protected] Keyword[void] identifier[attemptToSplit] operator[SEP] identifier[LeafNode] identifier[node] , identifier[Node] identifier[parent] , Keyword[int] identifier[parentIndex] operator[SEP] { identifier[SplitCriterion] identifier[splitCriterion] operator[=] operator[SEP] identifier[SplitCriterion] operator[SEP] identifier[getPreparedClassOption] operator[SEP] identifier[splitCriterionOption] operator[SEP] operator[SEP] identifier[AttributeSplitSuggestion] operator[SEP] operator[SEP] identifier[bestSplitSuggestions] operator[=] identifier[node] operator[SEP] identifier[getBestSplitSuggestions] operator[SEP] identifier[splitCriterion] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[AttributeSplitSuggestion] operator[>] identifier[acceptedSplits] operator[=] Keyword[new] identifier[LinkedList] operator[<] identifier[AttributeSplitSuggestion] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[Arrays] operator[SEP] identifier[sort] operator[SEP] identifier[bestSplitSuggestions] operator[SEP] operator[SEP] Keyword[int] identifier[numSplits] operator[=] Other[0] operator[SEP] Keyword[if] operator[SEP] identifier[bestSplitSuggestions] operator[SEP] identifier[length] operator[==] Other[1] operator[SEP] { identifier[numSplits] operator[=] Other[1] operator[SEP] identifier[acceptedSplits] operator[SEP] identifier[add] operator[SEP] identifier[bestSplitSuggestions] operator[SEP] Other[0] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[bestSplitSuggestions] operator[SEP] identifier[length] operator[>] Other[1] operator[SEP] { Keyword[double] identifier[hoeffdingBound] operator[=] identifier[computeHoeffdingBound] operator[SEP] Other[1] , identifier[splitConfidenceOption] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] , identifier[node] operator[SEP] identifier[examplesSeen] operator[SEP] operator[SEP] identifier[AttributeSplitSuggestion] identifier[bestSuggestion] operator[=] identifier[bestSplitSuggestions] operator[SEP] identifier[bestSplitSuggestions] operator[SEP] identifier[length] operator[-] Other[1] operator[SEP] operator[SEP] identifier[AttributeSplitSuggestion] identifier[secondBestSuggestion] operator[=] identifier[bestSplitSuggestions] operator[SEP] identifier[bestSplitSuggestions] operator[SEP] identifier[length] operator[-] Other[2] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[secondBestSuggestion] operator[SEP] identifier[merit] operator[/] identifier[bestSuggestion] operator[SEP] identifier[merit] operator[<] Other[1] operator[-] identifier[hoeffdingBound] operator[SEP] { identifier[numSplits] operator[=] Other[1] operator[SEP] identifier[acceptedSplits] operator[SEP] identifier[add] operator[SEP] identifier[bestSuggestion] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[numTrees] operator[<] identifier[maxTreesOption] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[&&] identifier[node] operator[SEP] identifier[getLevel] operator[SEP] operator[SEP] operator[<=] identifier[maxOptionLevelOption] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] { Keyword[for] operator[SEP] identifier[AttributeSplitSuggestion] identifier[suggestion] operator[:] identifier[bestSplitSuggestions] operator[SEP] { Keyword[if] operator[SEP] identifier[suggestion] operator[SEP] identifier[merit] operator[/] identifier[bestSuggestion] operator[SEP] identifier[merit] operator[>=] Other[1] operator[-] identifier[hoeffdingBound] operator[SEP] { identifier[numSplits] operator[++] operator[SEP] identifier[acceptedSplits] operator[SEP] identifier[add] operator[SEP] identifier[suggestion] operator[SEP] operator[SEP] } } } Keyword[else] Keyword[if] operator[SEP] identifier[hoeffdingBound] operator[<] identifier[tieThresholdOption] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] { identifier[numSplits] operator[=] Other[1] operator[SEP] identifier[acceptedSplits] operator[SEP] identifier[add] operator[SEP] identifier[bestSplitSuggestions] operator[SEP] Other[0] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[node] operator[SEP] identifier[attributeObservers] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[AttributeClassObserver] identifier[obs] operator[=] identifier[node] operator[SEP] identifier[attributeObservers] operator[SEP] identifier[get] operator[SEP] identifier[i] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[obs] operator[!=] Other[null] operator[SEP] { operator[SEP] operator[SEP] identifier[FIMTDDNumericAttributeClassObserver] operator[SEP] identifier[obs] operator[SEP] operator[SEP] identifier[removeBadSplits] operator[SEP] identifier[splitCriterion] , identifier[secondBestSuggestion] operator[SEP] identifier[merit] operator[/] identifier[bestSuggestion] operator[SEP] identifier[merit] , identifier[bestSuggestion] operator[SEP] identifier[merit] , identifier[hoeffdingBound] operator[SEP] operator[SEP] } } } } Keyword[if] operator[SEP] identifier[numSplits] operator[>] Other[0] operator[SEP] { Keyword[double] identifier[optionFactor] operator[=] identifier[numSplits] operator[*] identifier[Math] operator[SEP] identifier[pow] operator[SEP] identifier[optionDecayFactorOption] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] , operator[SEP] Keyword[double] operator[SEP] identifier[node] operator[SEP] identifier[getLevel] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[numSplits] operator[==] Other[1] operator[||] identifier[optionFactor] operator[<] literal[Float] operator[||] identifier[maxTreesOption] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[-] identifier[numTrees] operator[<=] Other[1] operator[SEP] { identifier[AttributeSplitSuggestion] identifier[splitDecision] operator[=] identifier[acceptedSplits] operator[SEP] identifier[get] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[SplitNode] identifier[newSplit] operator[=] identifier[newSplitNode] operator[SEP] identifier[splitDecision] operator[SEP] identifier[splitTest] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[splitDecision] operator[SEP] identifier[numSplits] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[LeafNode] identifier[newChild] operator[=] identifier[newLeafNode] operator[SEP] operator[SEP] operator[SEP] identifier[newChild] operator[SEP] identifier[setParent] operator[SEP] identifier[newSplit] operator[SEP] operator[SEP] identifier[newSplit] operator[SEP] identifier[setChild] operator[SEP] identifier[i] , identifier[newChild] operator[SEP] operator[SEP] } identifier[leafNodeCount] operator[--] operator[SEP] identifier[innerNodeCount] operator[++] operator[SEP] identifier[leafNodeCount] operator[+=] identifier[splitDecision] operator[SEP] identifier[numSplits] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[parent] operator[==] Other[null] operator[SEP] { identifier[treeRoot] operator[=] identifier[newSplit] operator[SEP] } Keyword[else] { identifier[parent] operator[SEP] identifier[setChild] operator[SEP] identifier[parent] operator[SEP] identifier[getChildIndex] operator[SEP] identifier[node] operator[SEP] , identifier[newSplit] operator[SEP] operator[SEP] identifier[newSplit] operator[SEP] identifier[setParent] operator[SEP] identifier[parent] operator[SEP] operator[SEP] } } Keyword[else] { identifier[OptionNode] identifier[optionNode] operator[=] identifier[newOptionNode] operator[SEP] operator[SEP] operator[SEP] identifier[leafNodeCount] operator[--] operator[SEP] Keyword[int] identifier[j] operator[=] Other[0] operator[SEP] Keyword[for] operator[SEP] identifier[AttributeSplitSuggestion] identifier[splitDecision] operator[:] identifier[acceptedSplits] operator[SEP] { Keyword[if] operator[SEP] identifier[j] operator[>] identifier[optionFactor] operator[||] identifier[maxTreesOption] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[-] identifier[numTrees] operator[<=] Other[0] operator[SEP] { Keyword[break] operator[SEP] } identifier[SplitNode] identifier[newSplit] operator[=] identifier[newSplitNode] operator[SEP] identifier[splitDecision] operator[SEP] identifier[splitTest] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[splitDecision] operator[SEP] identifier[numSplits] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[LeafNode] identifier[newChild] operator[=] identifier[newLeafNode] operator[SEP] operator[SEP] operator[SEP] identifier[newChild] operator[SEP] identifier[setParent] operator[SEP] identifier[newSplit] operator[SEP] operator[SEP] identifier[newSplit] operator[SEP] identifier[setChild] operator[SEP] identifier[i] , identifier[newChild] operator[SEP] operator[SEP] } identifier[leafNodeCount] operator[+=] identifier[splitDecision] operator[SEP] identifier[numSplits] operator[SEP] operator[SEP] operator[SEP] identifier[innerNodeCount] operator[++] operator[SEP] identifier[numTrees] operator[++] operator[SEP] identifier[newSplit] operator[SEP] identifier[setParent] operator[SEP] identifier[optionNode] operator[SEP] operator[SEP] identifier[optionNode] operator[SEP] identifier[setChild] operator[SEP] identifier[j] , identifier[newSplit] operator[SEP] operator[SEP] identifier[j] operator[++] operator[SEP] } identifier[innerNodeCount] operator[++] operator[SEP] identifier[optionNodeCount] operator[++] operator[SEP] Keyword[if] operator[SEP] identifier[parent] operator[==] Other[null] operator[SEP] { identifier[treeRoot] operator[=] identifier[optionNode] operator[SEP] } Keyword[else] { identifier[parent] operator[SEP] identifier[setChild] operator[SEP] identifier[parent] operator[SEP] identifier[getChildIndex] operator[SEP] identifier[node] operator[SEP] , identifier[optionNode] operator[SEP] operator[SEP] identifier[optionNode] operator[SEP] identifier[setParent] operator[SEP] identifier[parent] operator[SEP] operator[SEP] } identifier[optionNode] operator[SEP] identifier[resetFF] operator[SEP] operator[SEP] operator[SEP] } } }
static StructTypeInfo getSchemaTypeInfo(Configuration conf) { String schemaTypeInfo = conf.get(SCHEMA_TYPE_INFO); if (schemaTypeInfo != null && !schemaTypeInfo.isEmpty()) { LOG.debug("Got schema typeInfo from conf: {}", schemaTypeInfo); return (StructTypeInfo) TypeInfoUtils.getTypeInfoFromTypeString(conf.get(SCHEMA_TYPE_INFO)); } return null; }
class class_name[name] begin[{] method[getSchemaTypeInfo, return_type[type[StructTypeInfo]], modifier[static], parameter[conf]] begin[{] local_variable[type[String], schemaTypeInfo] if[binary_operation[binary_operation[member[.schemaTypeInfo], !=, literal[null]], &&, call[schemaTypeInfo.isEmpty, parameter[]]]] begin[{] call[LOG.debug, parameter[literal["Got schema typeInfo from conf: {}"], member[.schemaTypeInfo]]] return[Cast(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=SCHEMA_TYPE_INFO, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=conf, selectors=[], type_arguments=None)], member=getTypeInfoFromTypeString, postfix_operators=[], prefix_operators=[], qualifier=TypeInfoUtils, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=StructTypeInfo, sub_type=None))] else begin[{] None end[}] return[literal[null]] end[}] END[}]
Keyword[static] identifier[StructTypeInfo] identifier[getSchemaTypeInfo] operator[SEP] identifier[Configuration] identifier[conf] operator[SEP] { identifier[String] identifier[schemaTypeInfo] operator[=] identifier[conf] operator[SEP] identifier[get] operator[SEP] identifier[SCHEMA_TYPE_INFO] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[schemaTypeInfo] operator[!=] Other[null] operator[&&] operator[!] identifier[schemaTypeInfo] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { identifier[LOG] operator[SEP] identifier[debug] operator[SEP] literal[String] , identifier[schemaTypeInfo] operator[SEP] operator[SEP] Keyword[return] operator[SEP] identifier[StructTypeInfo] operator[SEP] identifier[TypeInfoUtils] operator[SEP] identifier[getTypeInfoFromTypeString] operator[SEP] identifier[conf] operator[SEP] identifier[get] operator[SEP] identifier[SCHEMA_TYPE_INFO] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] Other[null] operator[SEP] }
private String[] getComments(Map<String, Object> map, EnumNode node) { // 1. 模板引擎解析 try { StringWriter stringWriter = new StringWriter(); Template template = templates.get(node); if (template != null){ template.process(map, stringWriter); String comment = stringWriter.toString(); stringWriter.close(); // 需要先清理字符串 return comment.replaceFirst("^[\\s\\t\\r\\n]*", "").replaceFirst("[\\s\\t\\r\\n]*$", "").split("\n"); } } catch (Exception e) { logger.error("freemarker 解析失败!", e); } return null; }
class class_name[name] begin[{] method[getComments, return_type[type[String]], modifier[private], parameter[map, node]] begin[{] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=StringWriter, sub_type=None)), name=stringWriter)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=StringWriter, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=node, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=templates, selectors=[], type_arguments=None), name=template)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Template, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=template, 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=map, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=stringWriter, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=process, postfix_operators=[], prefix_operators=[], qualifier=template, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=stringWriter, selectors=[], type_arguments=None), name=comment)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[], member=close, postfix_operators=[], prefix_operators=[], qualifier=stringWriter, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="^[\\s\\t\\r\\n]*"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="")], member=replaceFirst, postfix_operators=[], prefix_operators=[], qualifier=comment, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="[\\s\\t\\r\\n]*$"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="")], member=replaceFirst, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\n")], member=split, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)]))], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="freemarker 解析失败!"), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None) return[literal[null]] end[}] END[}]
Keyword[private] identifier[String] operator[SEP] operator[SEP] identifier[getComments] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] identifier[map] , identifier[EnumNode] identifier[node] operator[SEP] { Keyword[try] { identifier[StringWriter] identifier[stringWriter] operator[=] Keyword[new] identifier[StringWriter] operator[SEP] operator[SEP] operator[SEP] identifier[Template] identifier[template] operator[=] identifier[templates] operator[SEP] identifier[get] operator[SEP] identifier[node] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[template] operator[!=] Other[null] operator[SEP] { identifier[template] operator[SEP] identifier[process] operator[SEP] identifier[map] , identifier[stringWriter] operator[SEP] operator[SEP] identifier[String] identifier[comment] operator[=] identifier[stringWriter] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] identifier[stringWriter] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[comment] operator[SEP] identifier[replaceFirst] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[replaceFirst] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[split] operator[SEP] literal[String] operator[SEP] operator[SEP] } } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { identifier[logger] operator[SEP] identifier[error] operator[SEP] literal[String] , identifier[e] operator[SEP] operator[SEP] } Keyword[return] Other[null] operator[SEP] }
@Override public void filter(ContainerRequestContext requestContext, ContainerResponseContext responseContext) throws IOException { Object entity = responseContext.getEntity(); if (entity instanceof Download) { Download downloadEntity = (Download) entity; Response.ResponseBuilder builder = null; String _etag = downloadEntity.getEtag(); EntityTag etag = null; if (_etag != null) { etag = new EntityTag(_etag); } Long lm = downloadEntity.getLastModified(); Date lastModified = null; if (lm != null) { lastModified = new Date(lm); } if (etag != null && lastModified != null) { builder = requestContext.getRequest().evaluatePreconditions( lastModified, etag ); } else if (etag != null) { builder = requestContext.getRequest().evaluatePreconditions( etag ); } else if (lastModified != null) { builder = requestContext.getRequest().evaluatePreconditions( lastModified ); } if (builder != null) { responseContext.setEntity(builder.build()); return; } entity = downloadEntity.getEntity(); if (downloadEntity.isAttachment()) { String download = "attachment;"; String fileName = downloadEntity.getFileName(); if (StringUtils.isBlank(fileName) && entity instanceof File) { fileName = ((File) entity).getName(); } if (StringUtils.isNotBlank(fileName)) { String userAgent = Requests.getHeaders().getFirst(HttpHeaders.USER_AGENT); fileName = URLEncoder.encode(fileName, Charsets.UTF_8.name()); if (StringUtils.isBlank(userAgent) || userAgent.contains("MSIE") || userAgent.contains("Android")) fileName = "filename=" + fileName; else fileName = "filename*=UTF-8''" + fileName; download += fileName; } responseContext.getHeaders().putSingle(HttpHeaders.CONTENT_DISPOSITION, download); } if (downloadEntity.getMediaType() != null) { MediaType mediaType = downloadEntity.getMediaType(); responseContext.getHeaders().putSingle(HttpHeaders.CONTENT_TYPE, mediaType); } if (etag != null) { responseContext.getHeaders().putSingle(HttpHeaders.ETAG, etag); } if (lastModified != null) { responseContext.getHeaders().putSingle(HttpHeaders.LAST_MODIFIED, lastModified); } responseContext.setEntity(entity); } }
class class_name[name] begin[{] method[filter, return_type[void], modifier[public], parameter[requestContext, responseContext]] begin[{] local_variable[type[Object], entity] if[binary_operation[member[.entity], instanceof, type[Download]]] begin[{] local_variable[type[Download], downloadEntity] local_variable[type[Response], builder] local_variable[type[String], _etag] local_variable[type[EntityTag], etag] if[binary_operation[member[._etag], !=, literal[null]]] begin[{] assign[member[.etag], ClassCreator(arguments=[MemberReference(member=_etag, 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=EntityTag, sub_type=None))] else begin[{] None end[}] local_variable[type[Long], lm] local_variable[type[Date], lastModified] if[binary_operation[member[.lm], !=, literal[null]]] begin[{] assign[member[.lastModified], ClassCreator(arguments=[MemberReference(member=lm, 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=Date, sub_type=None))] else begin[{] None end[}] if[binary_operation[binary_operation[member[.etag], !=, literal[null]], &&, binary_operation[member[.lastModified], !=, literal[null]]]] begin[{] assign[member[.builder], call[requestContext.getRequest, parameter[]]] else begin[{] if[binary_operation[member[.etag], !=, literal[null]]] begin[{] assign[member[.builder], call[requestContext.getRequest, parameter[]]] else begin[{] if[binary_operation[member[.lastModified], !=, literal[null]]] begin[{] assign[member[.builder], call[requestContext.getRequest, parameter[]]] else begin[{] None end[}] end[}] end[}] if[binary_operation[member[.builder], !=, literal[null]]] begin[{] call[responseContext.setEntity, parameter[call[builder.build, parameter[]]]] return[None] else begin[{] None end[}] assign[member[.entity], call[downloadEntity.getEntity, parameter[]]] if[call[downloadEntity.isAttachment, parameter[]]] begin[{] local_variable[type[String], download] local_variable[type[String], fileName] if[binary_operation[call[StringUtils.isBlank, parameter[member[.fileName]]], &&, binary_operation[member[.entity], instanceof, type[File]]]] begin[{] assign[member[.fileName], Cast(expression=MemberReference(member=entity, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=File, sub_type=None))] else begin[{] None end[}] if[call[StringUtils.isNotBlank, parameter[member[.fileName]]]] begin[{] local_variable[type[String], userAgent] assign[member[.fileName], call[URLEncoder.encode, parameter[member[.fileName], call[Charsets.UTF_8.name, parameter[]]]]] if[binary_operation[binary_operation[call[StringUtils.isBlank, parameter[member[.userAgent]]], ||, call[userAgent.contains, parameter[literal["MSIE"]]]], ||, call[userAgent.contains, parameter[literal["Android"]]]]] begin[{] assign[member[.fileName], binary_operation[literal["filename="], +, member[.fileName]]] else begin[{] assign[member[.fileName], binary_operation[literal["filename*=UTF-8''"], +, member[.fileName]]] end[}] assign[member[.download], member[.fileName]] else begin[{] None end[}] call[responseContext.getHeaders, parameter[]] else begin[{] None end[}] if[binary_operation[call[downloadEntity.getMediaType, parameter[]], !=, literal[null]]] begin[{] local_variable[type[MediaType], mediaType] call[responseContext.getHeaders, parameter[]] else begin[{] None end[}] if[binary_operation[member[.etag], !=, literal[null]]] begin[{] call[responseContext.getHeaders, parameter[]] else begin[{] None end[}] if[binary_operation[member[.lastModified], !=, literal[null]]] begin[{] call[responseContext.getHeaders, parameter[]] else begin[{] None end[}] call[responseContext.setEntity, parameter[member[.entity]]] else begin[{] None end[}] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[filter] operator[SEP] identifier[ContainerRequestContext] identifier[requestContext] , identifier[ContainerResponseContext] identifier[responseContext] operator[SEP] Keyword[throws] identifier[IOException] { identifier[Object] identifier[entity] operator[=] identifier[responseContext] operator[SEP] identifier[getEntity] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[entity] Keyword[instanceof] identifier[Download] operator[SEP] { identifier[Download] identifier[downloadEntity] operator[=] operator[SEP] identifier[Download] operator[SEP] identifier[entity] operator[SEP] identifier[Response] operator[SEP] identifier[ResponseBuilder] identifier[builder] operator[=] Other[null] operator[SEP] identifier[String] identifier[_etag] operator[=] identifier[downloadEntity] operator[SEP] identifier[getEtag] operator[SEP] operator[SEP] operator[SEP] identifier[EntityTag] identifier[etag] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[_etag] operator[!=] Other[null] operator[SEP] { identifier[etag] operator[=] Keyword[new] identifier[EntityTag] operator[SEP] identifier[_etag] operator[SEP] operator[SEP] } identifier[Long] identifier[lm] operator[=] identifier[downloadEntity] operator[SEP] identifier[getLastModified] operator[SEP] operator[SEP] operator[SEP] identifier[Date] identifier[lastModified] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[lm] operator[!=] Other[null] operator[SEP] { identifier[lastModified] operator[=] Keyword[new] identifier[Date] operator[SEP] identifier[lm] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[etag] operator[!=] Other[null] operator[&&] identifier[lastModified] operator[!=] Other[null] operator[SEP] { identifier[builder] operator[=] identifier[requestContext] operator[SEP] identifier[getRequest] operator[SEP] operator[SEP] operator[SEP] identifier[evaluatePreconditions] operator[SEP] identifier[lastModified] , identifier[etag] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[etag] operator[!=] Other[null] operator[SEP] { identifier[builder] operator[=] identifier[requestContext] operator[SEP] identifier[getRequest] operator[SEP] operator[SEP] operator[SEP] identifier[evaluatePreconditions] operator[SEP] identifier[etag] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[lastModified] operator[!=] Other[null] operator[SEP] { identifier[builder] operator[=] identifier[requestContext] operator[SEP] identifier[getRequest] operator[SEP] operator[SEP] operator[SEP] identifier[evaluatePreconditions] operator[SEP] identifier[lastModified] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[builder] operator[!=] Other[null] operator[SEP] { identifier[responseContext] operator[SEP] identifier[setEntity] operator[SEP] identifier[builder] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] operator[SEP] } identifier[entity] operator[=] identifier[downloadEntity] operator[SEP] identifier[getEntity] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[downloadEntity] operator[SEP] identifier[isAttachment] operator[SEP] operator[SEP] operator[SEP] { identifier[String] identifier[download] operator[=] literal[String] operator[SEP] identifier[String] identifier[fileName] operator[=] identifier[downloadEntity] operator[SEP] identifier[getFileName] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[StringUtils] operator[SEP] identifier[isBlank] operator[SEP] identifier[fileName] operator[SEP] operator[&&] identifier[entity] Keyword[instanceof] identifier[File] operator[SEP] { identifier[fileName] operator[=] operator[SEP] operator[SEP] identifier[File] operator[SEP] identifier[entity] operator[SEP] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[StringUtils] operator[SEP] identifier[isNotBlank] operator[SEP] identifier[fileName] operator[SEP] operator[SEP] { identifier[String] identifier[userAgent] operator[=] identifier[Requests] operator[SEP] identifier[getHeaders] operator[SEP] operator[SEP] operator[SEP] identifier[getFirst] operator[SEP] identifier[HttpHeaders] operator[SEP] identifier[USER_AGENT] operator[SEP] operator[SEP] identifier[fileName] operator[=] identifier[URLEncoder] operator[SEP] identifier[encode] operator[SEP] identifier[fileName] , identifier[Charsets] operator[SEP] identifier[UTF_8] operator[SEP] identifier[name] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[StringUtils] operator[SEP] identifier[isBlank] operator[SEP] identifier[userAgent] operator[SEP] operator[||] identifier[userAgent] operator[SEP] identifier[contains] operator[SEP] literal[String] operator[SEP] operator[||] identifier[userAgent] operator[SEP] identifier[contains] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[fileName] operator[=] literal[String] operator[+] identifier[fileName] operator[SEP] Keyword[else] identifier[fileName] operator[=] literal[String] operator[+] identifier[fileName] operator[SEP] identifier[download] operator[+=] identifier[fileName] operator[SEP] } identifier[responseContext] operator[SEP] identifier[getHeaders] operator[SEP] operator[SEP] operator[SEP] identifier[putSingle] operator[SEP] identifier[HttpHeaders] operator[SEP] identifier[CONTENT_DISPOSITION] , identifier[download] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[downloadEntity] operator[SEP] identifier[getMediaType] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] { identifier[MediaType] identifier[mediaType] operator[=] identifier[downloadEntity] operator[SEP] identifier[getMediaType] operator[SEP] operator[SEP] operator[SEP] identifier[responseContext] operator[SEP] identifier[getHeaders] operator[SEP] operator[SEP] operator[SEP] identifier[putSingle] operator[SEP] identifier[HttpHeaders] operator[SEP] identifier[CONTENT_TYPE] , identifier[mediaType] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[etag] operator[!=] Other[null] operator[SEP] { identifier[responseContext] operator[SEP] identifier[getHeaders] operator[SEP] operator[SEP] operator[SEP] identifier[putSingle] operator[SEP] identifier[HttpHeaders] operator[SEP] identifier[ETAG] , identifier[etag] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[lastModified] operator[!=] Other[null] operator[SEP] { identifier[responseContext] operator[SEP] identifier[getHeaders] operator[SEP] operator[SEP] operator[SEP] identifier[putSingle] operator[SEP] identifier[HttpHeaders] operator[SEP] identifier[LAST_MODIFIED] , identifier[lastModified] operator[SEP] operator[SEP] } identifier[responseContext] operator[SEP] identifier[setEntity] operator[SEP] identifier[entity] operator[SEP] operator[SEP] } }
@Override public Timestamp getTimestamp(int columnIndex, Calendar cal) throws SQLException { checkColumnBounds(columnIndex); throw SQLError.noSupport(); }
class class_name[name] begin[{] method[getTimestamp, return_type[type[Timestamp]], modifier[public], parameter[columnIndex, cal]] begin[{] call[.checkColumnBounds, parameter[member[.columnIndex]]] ThrowStatement(expression=MethodInvocation(arguments=[], member=noSupport, postfix_operators=[], prefix_operators=[], qualifier=SQLError, selectors=[], type_arguments=None), label=None) end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[Timestamp] identifier[getTimestamp] operator[SEP] Keyword[int] identifier[columnIndex] , identifier[Calendar] identifier[cal] operator[SEP] Keyword[throws] identifier[SQLException] { identifier[checkColumnBounds] operator[SEP] identifier[columnIndex] operator[SEP] operator[SEP] Keyword[throw] identifier[SQLError] operator[SEP] identifier[noSupport] operator[SEP] operator[SEP] operator[SEP] }
public List<I> findIntersections(ChronoInterval<T> interval) { // trivial case if (interval.isEmpty()) { return Collections.emptyList(); } // make search interval half-open T low = interval.getStart().getTemporal(); T high = interval.getEnd().getTemporal(); if ((low != null) && interval.getStart().isOpen()) { low = this.timeLine.stepForward(low); } if ((high != null) && interval.getEnd().isClosed()) { high = this.timeLine.stepForward(high); } // collect recursively List<I> found = new ArrayList<>(); findIntersections(low, high, this.root, found); return Collections.unmodifiableList(found); }
class class_name[name] begin[{] method[findIntersections, return_type[type[List]], modifier[public], parameter[interval]] begin[{] if[call[interval.isEmpty, parameter[]]] begin[{] return[call[Collections.emptyList, parameter[]]] else begin[{] None end[}] local_variable[type[T], low] local_variable[type[T], high] if[binary_operation[binary_operation[member[.low], !=, literal[null]], &&, call[interval.getStart, parameter[]]]] begin[{] assign[member[.low], THIS[member[None.timeLine]call[None.stepForward, parameter[member[.low]]]]] else begin[{] None end[}] if[binary_operation[binary_operation[member[.high], !=, literal[null]], &&, call[interval.getEnd, parameter[]]]] begin[{] assign[member[.high], THIS[member[None.timeLine]call[None.stepForward, parameter[member[.high]]]]] else begin[{] None end[}] local_variable[type[List], found] call[.findIntersections, parameter[member[.low], member[.high], THIS[member[None.root]], member[.found]]] return[call[Collections.unmodifiableList, parameter[member[.found]]]] end[}] END[}]
Keyword[public] identifier[List] operator[<] identifier[I] operator[>] identifier[findIntersections] operator[SEP] identifier[ChronoInterval] operator[<] identifier[T] operator[>] identifier[interval] operator[SEP] { Keyword[if] operator[SEP] identifier[interval] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] identifier[Collections] operator[SEP] identifier[emptyList] operator[SEP] operator[SEP] operator[SEP] } identifier[T] identifier[low] operator[=] identifier[interval] operator[SEP] identifier[getStart] operator[SEP] operator[SEP] operator[SEP] identifier[getTemporal] operator[SEP] operator[SEP] operator[SEP] identifier[T] identifier[high] operator[=] identifier[interval] operator[SEP] identifier[getEnd] operator[SEP] operator[SEP] operator[SEP] identifier[getTemporal] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[SEP] identifier[low] operator[!=] Other[null] operator[SEP] operator[&&] identifier[interval] operator[SEP] identifier[getStart] operator[SEP] operator[SEP] operator[SEP] identifier[isOpen] operator[SEP] operator[SEP] operator[SEP] { identifier[low] operator[=] Keyword[this] operator[SEP] identifier[timeLine] operator[SEP] identifier[stepForward] operator[SEP] identifier[low] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] operator[SEP] identifier[high] operator[!=] Other[null] operator[SEP] operator[&&] identifier[interval] operator[SEP] identifier[getEnd] operator[SEP] operator[SEP] operator[SEP] identifier[isClosed] operator[SEP] operator[SEP] operator[SEP] { identifier[high] operator[=] Keyword[this] operator[SEP] identifier[timeLine] operator[SEP] identifier[stepForward] operator[SEP] identifier[high] operator[SEP] operator[SEP] } identifier[List] operator[<] identifier[I] operator[>] identifier[found] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[findIntersections] operator[SEP] identifier[low] , identifier[high] , Keyword[this] operator[SEP] identifier[root] , identifier[found] operator[SEP] operator[SEP] Keyword[return] identifier[Collections] operator[SEP] identifier[unmodifiableList] operator[SEP] identifier[found] operator[SEP] operator[SEP] }
public void getBackStoryQuestionInfo(int[] ids, Callback<List<BackStoryQuestion>> callback) throws GuildWars2Exception, NullPointerException { isParamValid(new ParamChecker(ids)); gw2API.getBackStoryQuestionInfo(processIds(ids), GuildWars2.lang.getValue()).enqueue(callback); }
class class_name[name] begin[{] method[getBackStoryQuestionInfo, return_type[void], modifier[public], parameter[ids, callback]] begin[{] call[.isParamValid, parameter[ClassCreator(arguments=[MemberReference(member=ids, 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=ParamChecker, sub_type=None))]] call[gw2API.getBackStoryQuestionInfo, parameter[call[.processIds, parameter[member[.ids]]], call[GuildWars2.lang.getValue, parameter[]]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[getBackStoryQuestionInfo] operator[SEP] Keyword[int] operator[SEP] operator[SEP] identifier[ids] , identifier[Callback] operator[<] identifier[List] operator[<] identifier[BackStoryQuestion] operator[>] operator[>] identifier[callback] operator[SEP] Keyword[throws] identifier[GuildWars2Exception] , identifier[NullPointerException] { identifier[isParamValid] operator[SEP] Keyword[new] identifier[ParamChecker] operator[SEP] identifier[ids] operator[SEP] operator[SEP] operator[SEP] identifier[gw2API] operator[SEP] identifier[getBackStoryQuestionInfo] operator[SEP] identifier[processIds] operator[SEP] identifier[ids] operator[SEP] , identifier[GuildWars2] operator[SEP] identifier[lang] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[enqueue] operator[SEP] identifier[callback] operator[SEP] operator[SEP] }
public void setPFName(String newPFName) { String oldPFName = pfName; pfName = newPFName; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, AfplibPackage.EPF__PF_NAME, oldPFName, pfName)); }
class class_name[name] begin[{] method[setPFName, return_type[void], modifier[public], parameter[newPFName]] begin[{] local_variable[type[String], oldPFName] assign[member[.pfName], member[.newPFName]] if[call[.eNotificationRequired, parameter[]]] begin[{] call[.eNotify, parameter[ClassCreator(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), MemberReference(member=SET, postfix_operators=[], prefix_operators=[], qualifier=Notification, selectors=[]), MemberReference(member=EPF__PF_NAME, postfix_operators=[], prefix_operators=[], qualifier=AfplibPackage, selectors=[]), MemberReference(member=oldPFName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=pfName, 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=ENotificationImpl, sub_type=None))]] else begin[{] None end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[setPFName] operator[SEP] identifier[String] identifier[newPFName] operator[SEP] { identifier[String] identifier[oldPFName] operator[=] identifier[pfName] operator[SEP] identifier[pfName] operator[=] identifier[newPFName] operator[SEP] Keyword[if] operator[SEP] identifier[eNotificationRequired] operator[SEP] operator[SEP] operator[SEP] identifier[eNotify] operator[SEP] Keyword[new] identifier[ENotificationImpl] operator[SEP] Keyword[this] , identifier[Notification] operator[SEP] identifier[SET] , identifier[AfplibPackage] operator[SEP] identifier[EPF__PF_NAME] , identifier[oldPFName] , identifier[pfName] operator[SEP] operator[SEP] operator[SEP] }
public void delete () { IntBuffer idbuf = BufferUtils.createIntBuffer(1); idbuf.put(_id).rewind(); AL10.alDeleteSources(idbuf); _id = 0; _queue.clear(); }
class class_name[name] begin[{] method[delete, return_type[void], modifier[public], parameter[]] begin[{] local_variable[type[IntBuffer], idbuf] call[idbuf.put, parameter[member[._id]]] call[AL10.alDeleteSources, parameter[member[.idbuf]]] assign[member[._id], literal[0]] call[_queue.clear, parameter[]] end[}] END[}]
Keyword[public] Keyword[void] identifier[delete] operator[SEP] operator[SEP] { identifier[IntBuffer] identifier[idbuf] operator[=] identifier[BufferUtils] operator[SEP] identifier[createIntBuffer] operator[SEP] Other[1] operator[SEP] operator[SEP] identifier[idbuf] operator[SEP] identifier[put] operator[SEP] identifier[_id] operator[SEP] operator[SEP] identifier[rewind] operator[SEP] operator[SEP] operator[SEP] identifier[AL10] operator[SEP] identifier[alDeleteSources] operator[SEP] identifier[idbuf] operator[SEP] operator[SEP] identifier[_id] operator[=] Other[0] operator[SEP] identifier[_queue] operator[SEP] identifier[clear] operator[SEP] operator[SEP] operator[SEP] }
public T visitList(List elm, C context) { if (elm.getTypeSpecifier() != null) { visitElement(elm.getTypeSpecifier(), context); } for (Expression element : elm.getElement()) { visitElement(element, context); } return null; }
class class_name[name] begin[{] method[visitList, return_type[type[T]], modifier[public], parameter[elm, context]] begin[{] if[binary_operation[call[elm.getTypeSpecifier, parameter[]], !=, literal[null]]] begin[{] call[.visitElement, parameter[call[elm.getTypeSpecifier, parameter[]], member[.context]]] else begin[{] None end[}] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=element, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=context, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=visitElement, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getElement, postfix_operators=[], prefix_operators=[], qualifier=elm, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=element)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Expression, sub_type=None))), label=None) return[literal[null]] end[}] END[}]
Keyword[public] identifier[T] identifier[visitList] operator[SEP] identifier[List] identifier[elm] , identifier[C] identifier[context] operator[SEP] { Keyword[if] operator[SEP] identifier[elm] operator[SEP] identifier[getTypeSpecifier] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] { identifier[visitElement] operator[SEP] identifier[elm] operator[SEP] identifier[getTypeSpecifier] operator[SEP] operator[SEP] , identifier[context] operator[SEP] operator[SEP] } Keyword[for] operator[SEP] identifier[Expression] identifier[element] operator[:] identifier[elm] operator[SEP] identifier[getElement] operator[SEP] operator[SEP] operator[SEP] { identifier[visitElement] operator[SEP] identifier[element] , identifier[context] operator[SEP] operator[SEP] } Keyword[return] Other[null] operator[SEP] }
public static String httpPost ( final URL url, final String submission, int timeout, final Map<String, String> requestProps) throws IOException, ServiceWaiter.TimeoutException { final ServiceWaiter<String> waiter = new ServiceWaiter<String>( (timeout < 0) ? ServiceWaiter.NO_TIMEOUT : timeout); Thread tt = new Thread() { @Override public void run () { try { HttpURLConnection conn = (HttpURLConnection) url.openConnection(); conn.setDoInput(true); conn.setDoOutput(true); conn.setUseCaches(false); for (Map.Entry<String, String> entry : requestProps.entrySet()) { conn.setRequestProperty(entry.getKey(), entry.getValue()); } DataOutputStream out = new DataOutputStream(conn.getOutputStream()); out.writeBytes(submission); out.flush(); out.close(); BufferedReader reader = new BufferedReader( new InputStreamReader(conn.getInputStream())); StringBuilder buf = new StringBuilder(); for (String s; null != (s = reader.readLine()); ) { buf.append(s); } reader.close(); waiter.postSuccess(buf.toString()); // yay } catch (IOException e) { waiter.postFailure(e); // boo } } }; tt.start(); if (waiter.waitForResponse()) { return waiter.getArgument(); } else { throw (IOException) waiter.getError(); } }
class class_name[name] begin[{] method[httpPost, return_type[type[String]], modifier[public static], parameter[url, submission, timeout, requestProps]] begin[{] local_variable[type[ServiceWaiter], waiter] local_variable[type[Thread], tt] call[tt.start, parameter[]] if[call[waiter.waitForResponse, parameter[]]] begin[{] return[call[waiter.getArgument, parameter[]]] else begin[{] ThrowStatement(expression=Cast(expression=MethodInvocation(arguments=[], member=getError, postfix_operators=[], prefix_operators=[], qualifier=waiter, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=IOException, sub_type=None)), label=None) end[}] end[}] END[}]
Keyword[public] Keyword[static] identifier[String] identifier[httpPost] operator[SEP] Keyword[final] identifier[URL] identifier[url] , Keyword[final] identifier[String] identifier[submission] , Keyword[int] identifier[timeout] , Keyword[final] identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[requestProps] operator[SEP] Keyword[throws] identifier[IOException] , identifier[ServiceWaiter] operator[SEP] identifier[TimeoutException] { Keyword[final] identifier[ServiceWaiter] operator[<] identifier[String] operator[>] identifier[waiter] operator[=] Keyword[new] identifier[ServiceWaiter] operator[<] identifier[String] operator[>] operator[SEP] operator[SEP] identifier[timeout] operator[<] Other[0] operator[SEP] operator[?] identifier[ServiceWaiter] operator[SEP] identifier[NO_TIMEOUT] operator[:] identifier[timeout] operator[SEP] operator[SEP] identifier[Thread] identifier[tt] operator[=] Keyword[new] identifier[Thread] operator[SEP] operator[SEP] { annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[run] operator[SEP] operator[SEP] { Keyword[try] { identifier[HttpURLConnection] identifier[conn] operator[=] operator[SEP] identifier[HttpURLConnection] operator[SEP] identifier[url] operator[SEP] identifier[openConnection] operator[SEP] operator[SEP] operator[SEP] identifier[conn] operator[SEP] identifier[setDoInput] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[conn] operator[SEP] identifier[setDoOutput] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[conn] operator[SEP] identifier[setUseCaches] operator[SEP] literal[boolean] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Map] operator[SEP] identifier[Entry] operator[<] identifier[String] , identifier[String] operator[>] identifier[entry] operator[:] identifier[requestProps] operator[SEP] identifier[entrySet] operator[SEP] operator[SEP] operator[SEP] { identifier[conn] operator[SEP] identifier[setRequestProperty] operator[SEP] identifier[entry] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] , identifier[entry] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[DataOutputStream] identifier[out] operator[=] Keyword[new] identifier[DataOutputStream] operator[SEP] identifier[conn] operator[SEP] identifier[getOutputStream] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[out] operator[SEP] identifier[writeBytes] operator[SEP] identifier[submission] operator[SEP] operator[SEP] identifier[out] operator[SEP] identifier[flush] operator[SEP] operator[SEP] operator[SEP] identifier[out] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP] identifier[BufferedReader] identifier[reader] operator[=] Keyword[new] identifier[BufferedReader] operator[SEP] Keyword[new] identifier[InputStreamReader] operator[SEP] identifier[conn] operator[SEP] identifier[getInputStream] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[StringBuilder] identifier[buf] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[String] identifier[s] operator[SEP] Other[null] operator[!=] operator[SEP] identifier[s] operator[=] identifier[reader] operator[SEP] identifier[readLine] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { identifier[buf] operator[SEP] identifier[append] operator[SEP] identifier[s] operator[SEP] operator[SEP] } identifier[reader] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP] identifier[waiter] operator[SEP] identifier[postSuccess] operator[SEP] identifier[buf] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[IOException] identifier[e] operator[SEP] { identifier[waiter] operator[SEP] identifier[postFailure] operator[SEP] identifier[e] operator[SEP] operator[SEP] } } } operator[SEP] identifier[tt] operator[SEP] identifier[start] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[waiter] operator[SEP] identifier[waitForResponse] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] identifier[waiter] operator[SEP] identifier[getArgument] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { Keyword[throw] operator[SEP] identifier[IOException] operator[SEP] identifier[waiter] operator[SEP] identifier[getError] operator[SEP] operator[SEP] operator[SEP] } }
public Observable<ServiceResponse<FoundFaces>> findFacesWithServiceResponseAsync(Boolean cacheImage) { if (this.client.baseUrl() == null) { throw new IllegalArgumentException("Parameter this.client.baseUrl() is required and cannot be null."); } String parameterizedHost = Joiner.on(", ").join("{baseUrl}", this.client.baseUrl()); return service.findFaces(cacheImage, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<FoundFaces>>>() { @Override public Observable<ServiceResponse<FoundFaces>> call(Response<ResponseBody> response) { try { ServiceResponse<FoundFaces> clientResponse = findFacesDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); } } }); }
class class_name[name] begin[{] method[findFacesWithServiceResponseAsync, return_type[type[Observable]], modifier[public], parameter[cacheImage]] begin[{] if[binary_operation[THIS[member[None.client]call[None.baseUrl, parameter[]]], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Parameter this.client.baseUrl() is required and cannot be null.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None) else begin[{] None end[}] local_variable[type[String], parameterizedHost] return[call[service.findFaces, parameter[member[.cacheImage], THIS[member[None.client]call[None.acceptLanguage, parameter[]]], member[.parameterizedHost], THIS[member[None.client]call[None.userAgent, parameter[]]]]]] end[}] END[}]
Keyword[public] identifier[Observable] operator[<] identifier[ServiceResponse] operator[<] identifier[FoundFaces] operator[>] operator[>] identifier[findFacesWithServiceResponseAsync] operator[SEP] identifier[Boolean] identifier[cacheImage] operator[SEP] { Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[client] operator[SEP] identifier[baseUrl] operator[SEP] operator[SEP] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] } identifier[String] identifier[parameterizedHost] operator[=] identifier[Joiner] operator[SEP] identifier[on] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[join] operator[SEP] literal[String] , Keyword[this] operator[SEP] identifier[client] operator[SEP] identifier[baseUrl] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[service] operator[SEP] identifier[findFaces] operator[SEP] identifier[cacheImage] , Keyword[this] operator[SEP] identifier[client] operator[SEP] identifier[acceptLanguage] operator[SEP] operator[SEP] , identifier[parameterizedHost] , Keyword[this] operator[SEP] identifier[client] operator[SEP] identifier[userAgent] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[flatMap] operator[SEP] Keyword[new] identifier[Func1] operator[<] identifier[Response] operator[<] identifier[ResponseBody] operator[>] , identifier[Observable] operator[<] identifier[ServiceResponse] operator[<] identifier[FoundFaces] operator[>] operator[>] operator[>] operator[SEP] operator[SEP] { annotation[@] identifier[Override] Keyword[public] identifier[Observable] operator[<] identifier[ServiceResponse] operator[<] identifier[FoundFaces] operator[>] operator[>] identifier[call] operator[SEP] identifier[Response] operator[<] identifier[ResponseBody] operator[>] identifier[response] operator[SEP] { Keyword[try] { identifier[ServiceResponse] operator[<] identifier[FoundFaces] operator[>] identifier[clientResponse] operator[=] identifier[findFacesDelegate] operator[SEP] identifier[response] operator[SEP] operator[SEP] Keyword[return] identifier[Observable] operator[SEP] identifier[just] operator[SEP] identifier[clientResponse] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Throwable] identifier[t] operator[SEP] { Keyword[return] identifier[Observable] operator[SEP] identifier[error] operator[SEP] identifier[t] operator[SEP] operator[SEP] } } } operator[SEP] operator[SEP] }
@Override public Set<String> getResourcePaths(final String name) { final String normalizedname = Path.normalizeResourcePath(name); LOG.debug("Searching bundle [" + bundle + "] for resource paths of [" + normalizedname + "]"); final Enumeration<String> entryPaths = bundle .getEntryPaths(normalizedname); if (entryPaths == null || !entryPaths.hasMoreElements()) { return null; } Set<String> foundPaths = new HashSet<>(); while (entryPaths.hasMoreElements()) { foundPaths.add(entryPaths.nextElement()); } return foundPaths; }
class class_name[name] begin[{] method[getResourcePaths, return_type[type[Set]], modifier[public], parameter[name]] begin[{] local_variable[type[String], normalizedname] call[LOG.debug, parameter[binary_operation[binary_operation[binary_operation[binary_operation[literal["Searching bundle ["], +, member[.bundle]], +, literal["] for resource paths of ["]], +, member[.normalizedname]], +, literal["]"]]]] local_variable[type[Enumeration], entryPaths] if[binary_operation[binary_operation[member[.entryPaths], ==, literal[null]], ||, call[entryPaths.hasMoreElements, parameter[]]]] begin[{] return[literal[null]] else begin[{] None end[}] local_variable[type[Set], foundPaths] while[call[entryPaths.hasMoreElements, parameter[]]] begin[{] call[foundPaths.add, parameter[call[entryPaths.nextElement, parameter[]]]] end[}] return[member[.foundPaths]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[Set] operator[<] identifier[String] operator[>] identifier[getResourcePaths] operator[SEP] Keyword[final] identifier[String] identifier[name] operator[SEP] { Keyword[final] identifier[String] identifier[normalizedname] operator[=] identifier[Path] operator[SEP] identifier[normalizeResourcePath] operator[SEP] identifier[name] operator[SEP] operator[SEP] identifier[LOG] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[+] identifier[bundle] operator[+] literal[String] operator[+] identifier[normalizedname] operator[+] literal[String] operator[SEP] operator[SEP] Keyword[final] identifier[Enumeration] operator[<] identifier[String] operator[>] identifier[entryPaths] operator[=] identifier[bundle] operator[SEP] identifier[getEntryPaths] operator[SEP] identifier[normalizedname] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[entryPaths] operator[==] Other[null] operator[||] operator[!] identifier[entryPaths] operator[SEP] identifier[hasMoreElements] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] Other[null] operator[SEP] } identifier[Set] operator[<] identifier[String] operator[>] identifier[foundPaths] operator[=] Keyword[new] identifier[HashSet] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[entryPaths] operator[SEP] identifier[hasMoreElements] operator[SEP] operator[SEP] operator[SEP] { identifier[foundPaths] operator[SEP] identifier[add] operator[SEP] identifier[entryPaths] operator[SEP] identifier[nextElement] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[foundPaths] operator[SEP] }
private void determineFramePal(int index) { if ((inMode != InputMode.VOBSUB && inMode != InputMode.SUPIFO) || configuration.getPaletteMode() != PaletteMode.KEEP_EXISTING) { // get the primary color from the source palette int rgbSrc[] = subtitleStream.getPalette().getRGB( subtitleStream.getPrimaryColorIndex()); // match with primary color from 16 color target palette // note: skip index 0 , primary colors at even positions // special treatment for index 1: white Palette trgPallete = currentDVDPalette; int minDistance = 0xffffff; // init > 0xff*0xff*3 = 0x02fa03 int colIdx = 0; for (int idx = 1; idx < trgPallete.getSize(); idx += 2) { int rgb[] = trgPallete.getRGB(idx); // distance vector (skip sqrt) int rd = rgbSrc[0] - rgb[0]; int gd = rgbSrc[1] - rgb[1]; int bd = rgbSrc[2] - rgb[2]; int distance = rd * rd + gd * gd + bd * bd; // new minimum distance ? if (distance < minDistance) { colIdx = idx; minDistance = distance; if (minDistance == 0) { break; } } // special treatment for index 1 (white) if (idx == 1) { idx--; // -> continue with index = 2 } } // set new frame palette int palFrame[] = new int[4]; palFrame[0] = 0; // black - transparent color palFrame[1] = colIdx; // primary color if (colIdx == 1) { palFrame[2] = colIdx + 2; // special handling: white + dark grey } else { palFrame[2] = colIdx + 1; // darker version of primary color } palFrame[3] = 0; // black - opaque subVobTrg.setAlpha(DEFAULT_ALPHA); subVobTrg.setPal(palFrame); trgPal = SupDvdUtil.decodePalette(subVobTrg, trgPallete); } }
class class_name[name] begin[{] method[determineFramePal, return_type[void], modifier[private], parameter[index]] begin[{] if[binary_operation[binary_operation[binary_operation[member[.inMode], !=, member[InputMode.VOBSUB]], &&, binary_operation[member[.inMode], !=, member[InputMode.SUPIFO]]], ||, binary_operation[call[configuration.getPaletteMode, parameter[]], !=, member[PaletteMode.KEEP_EXISTING]]]] begin[{] local_variable[type[int], rgbSrc] local_variable[type[Palette], trgPallete] local_variable[type[int], minDistance] local_variable[type[int], colIdx] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[None], initializer=MethodInvocation(arguments=[MemberReference(member=idx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getRGB, postfix_operators=[], prefix_operators=[], qualifier=trgPallete, selectors=[], type_arguments=None), name=rgb)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=MemberReference(member=rgbSrc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))]), operandr=MemberReference(member=rgb, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))]), operator=-), name=rd)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=MemberReference(member=rgbSrc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1))]), operandr=MemberReference(member=rgb, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1))]), operator=-), name=gd)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=MemberReference(member=rgbSrc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2))]), operandr=MemberReference(member=rgb, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2))]), operator=-), name=bd)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=rd, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=rd, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=*), operandr=BinaryOperation(operandl=MemberReference(member=gd, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=gd, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=*), operator=+), operandr=BinaryOperation(operandl=MemberReference(member=bd, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=bd, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=*), operator=+), name=distance)], modifiers=set(), type=BasicType(dimensions=[], name=int)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=distance, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=minDistance, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=colIdx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=idx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=minDistance, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=distance, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=minDistance, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[BreakStatement(goto=None, label=None)]))])), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=idx, 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=BlockStatement(label=None, statements=[StatementExpression(expression=MemberReference(member=idx, postfix_operators=['--'], prefix_operators=[], qualifier=, selectors=[]), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=idx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=getSize, postfix_operators=[], prefix_operators=[], qualifier=trgPallete, selectors=[], type_arguments=None), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), name=idx)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[Assignment(expressionl=MemberReference(member=idx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2))]), label=None) local_variable[type[int], palFrame] assign[member[.palFrame], literal[0]] assign[member[.palFrame], member[.colIdx]] if[binary_operation[member[.colIdx], ==, literal[1]]] begin[{] assign[member[.palFrame], binary_operation[member[.colIdx], +, literal[2]]] else begin[{] assign[member[.palFrame], binary_operation[member[.colIdx], +, literal[1]]] end[}] assign[member[.palFrame], literal[0]] call[subVobTrg.setAlpha, parameter[member[.DEFAULT_ALPHA]]] call[subVobTrg.setPal, parameter[member[.palFrame]]] assign[member[.trgPal], call[SupDvdUtil.decodePalette, parameter[member[.subVobTrg], member[.trgPallete]]]] else begin[{] None end[}] end[}] END[}]
Keyword[private] Keyword[void] identifier[determineFramePal] operator[SEP] Keyword[int] identifier[index] operator[SEP] { Keyword[if] operator[SEP] operator[SEP] identifier[inMode] operator[!=] identifier[InputMode] operator[SEP] identifier[VOBSUB] operator[&&] identifier[inMode] operator[!=] identifier[InputMode] operator[SEP] identifier[SUPIFO] operator[SEP] operator[||] identifier[configuration] operator[SEP] identifier[getPaletteMode] operator[SEP] operator[SEP] operator[!=] identifier[PaletteMode] operator[SEP] identifier[KEEP_EXISTING] operator[SEP] { Keyword[int] identifier[rgbSrc] operator[SEP] operator[SEP] operator[=] identifier[subtitleStream] operator[SEP] identifier[getPalette] operator[SEP] operator[SEP] operator[SEP] identifier[getRGB] operator[SEP] identifier[subtitleStream] operator[SEP] identifier[getPrimaryColorIndex] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[Palette] identifier[trgPallete] operator[=] identifier[currentDVDPalette] operator[SEP] Keyword[int] identifier[minDistance] operator[=] literal[Integer] operator[SEP] Keyword[int] identifier[colIdx] operator[=] Other[0] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[idx] operator[=] Other[1] operator[SEP] identifier[idx] operator[<] identifier[trgPallete] operator[SEP] identifier[getSize] operator[SEP] operator[SEP] operator[SEP] identifier[idx] operator[+=] Other[2] operator[SEP] { Keyword[int] identifier[rgb] operator[SEP] operator[SEP] operator[=] identifier[trgPallete] operator[SEP] identifier[getRGB] operator[SEP] identifier[idx] operator[SEP] operator[SEP] Keyword[int] identifier[rd] operator[=] identifier[rgbSrc] operator[SEP] Other[0] operator[SEP] operator[-] identifier[rgb] operator[SEP] Other[0] operator[SEP] operator[SEP] Keyword[int] identifier[gd] operator[=] identifier[rgbSrc] operator[SEP] Other[1] operator[SEP] operator[-] identifier[rgb] operator[SEP] Other[1] operator[SEP] operator[SEP] Keyword[int] identifier[bd] operator[=] identifier[rgbSrc] operator[SEP] Other[2] operator[SEP] operator[-] identifier[rgb] operator[SEP] Other[2] operator[SEP] operator[SEP] Keyword[int] identifier[distance] operator[=] identifier[rd] operator[*] identifier[rd] operator[+] identifier[gd] operator[*] identifier[gd] operator[+] identifier[bd] operator[*] identifier[bd] operator[SEP] Keyword[if] operator[SEP] identifier[distance] operator[<] identifier[minDistance] operator[SEP] { identifier[colIdx] operator[=] identifier[idx] operator[SEP] identifier[minDistance] operator[=] identifier[distance] operator[SEP] Keyword[if] operator[SEP] identifier[minDistance] operator[==] Other[0] operator[SEP] { Keyword[break] operator[SEP] } } Keyword[if] operator[SEP] identifier[idx] operator[==] Other[1] operator[SEP] { identifier[idx] operator[--] operator[SEP] } } Keyword[int] identifier[palFrame] operator[SEP] operator[SEP] operator[=] Keyword[new] Keyword[int] operator[SEP] Other[4] operator[SEP] operator[SEP] identifier[palFrame] operator[SEP] Other[0] operator[SEP] operator[=] Other[0] operator[SEP] identifier[palFrame] operator[SEP] Other[1] operator[SEP] operator[=] identifier[colIdx] operator[SEP] Keyword[if] operator[SEP] identifier[colIdx] operator[==] Other[1] operator[SEP] { identifier[palFrame] operator[SEP] Other[2] operator[SEP] operator[=] identifier[colIdx] operator[+] Other[2] operator[SEP] } Keyword[else] { identifier[palFrame] operator[SEP] Other[2] operator[SEP] operator[=] identifier[colIdx] operator[+] Other[1] operator[SEP] } identifier[palFrame] operator[SEP] Other[3] operator[SEP] operator[=] Other[0] operator[SEP] identifier[subVobTrg] operator[SEP] identifier[setAlpha] operator[SEP] identifier[DEFAULT_ALPHA] operator[SEP] operator[SEP] identifier[subVobTrg] operator[SEP] identifier[setPal] operator[SEP] identifier[palFrame] operator[SEP] operator[SEP] identifier[trgPal] operator[=] identifier[SupDvdUtil] operator[SEP] identifier[decodePalette] operator[SEP] identifier[subVobTrg] , identifier[trgPallete] operator[SEP] operator[SEP] } }
private static long lowMask(String chars) { int n = chars.length(); long m = 0; for (int i = 0; i < n; i++) { char c = chars.charAt(i); if (c < 64) m |= (1L << c); } return m; }
class class_name[name] begin[{] method[lowMask, return_type[type[long]], modifier[private static], parameter[chars]] begin[{] local_variable[type[int], n] local_variable[type[long], m] 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=chars, 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=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=64), operator=<), else_statement=None, label=None, then_statement=StatementExpression(expression=Assignment(expressionl=MemberReference(member=m, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=|=, value=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1L), operandr=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<<)), label=None))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=n, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) return[member[.m]] end[}] END[}]
Keyword[private] Keyword[static] Keyword[long] identifier[lowMask] operator[SEP] identifier[String] identifier[chars] operator[SEP] { Keyword[int] identifier[n] operator[=] identifier[chars] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] Keyword[long] identifier[m] operator[=] Other[0] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[n] operator[SEP] identifier[i] operator[++] operator[SEP] { Keyword[char] identifier[c] operator[=] identifier[chars] operator[SEP] identifier[charAt] operator[SEP] identifier[i] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[c] operator[<] Other[64] operator[SEP] identifier[m] operator[|=] operator[SEP] Other[1L] operator[<<] identifier[c] operator[SEP] operator[SEP] } Keyword[return] identifier[m] operator[SEP] }
public void ecrire(String texte) { //on va chercher le chemin et le nom du fichier et on me tout ca dans un String String adressedufichier = System.getProperty("user.dir") + "\\monfichier.txt"; //on me try si jamais il y a une exception try { //BufferedWriter a besoin d un FileWriter, //les 2 vont ensemble, on donne comme argument le nom du fichier //true signifie qu on ajoute dans le fichier (append), on ne marque pas par dessus FileWriter fw = new FileWriter(adressedufichier, true); // le BufferedWriter output auquel on donne comme argument le FileWriter fw cree juste au dessus BufferedWriter output = new BufferedWriter(fw); //on marque dans le fichier ou plutot dans le BufferedWriter qui sert comme un tampon(stream) output.write(texte); //on peut utiliser plusieurs fois methode write output.flush(); //ensuite flush envoie dans le fichier, ne pas oublier cette methode pour le BufferedWriter output.close(); //et on le ferme } catch(IOException ioe){System.out.println("erreur : " + ioe );} //on "catch" l exception ici si il y en a une, et on l affiche sur la console }
class class_name[name] begin[{] method[ecrire, return_type[void], modifier[public], parameter[texte]] begin[{] local_variable[type[String], adressedufichier] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MemberReference(member=adressedufichier, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=FileWriter, sub_type=None)), name=fw)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=FileWriter, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MemberReference(member=fw, 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=BufferedWriter, sub_type=None)), name=output)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=BufferedWriter, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=texte, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=write, postfix_operators=[], prefix_operators=[], qualifier=output, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=flush, postfix_operators=[], prefix_operators=[], qualifier=output, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=close, postfix_operators=[], prefix_operators=[], qualifier=output, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="erreur : "), operandr=MemberReference(member=ioe, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=println, postfix_operators=[], prefix_operators=[], qualifier=System.out, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ioe, types=['IOException']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[public] Keyword[void] identifier[ecrire] operator[SEP] identifier[String] identifier[texte] operator[SEP] { identifier[String] identifier[adressedufichier] operator[=] identifier[System] operator[SEP] identifier[getProperty] operator[SEP] literal[String] operator[SEP] operator[+] literal[String] operator[SEP] Keyword[try] { identifier[FileWriter] identifier[fw] operator[=] Keyword[new] identifier[FileWriter] operator[SEP] identifier[adressedufichier] , literal[boolean] operator[SEP] operator[SEP] identifier[BufferedWriter] identifier[output] operator[=] Keyword[new] identifier[BufferedWriter] operator[SEP] identifier[fw] operator[SEP] operator[SEP] identifier[output] operator[SEP] identifier[write] operator[SEP] identifier[texte] operator[SEP] operator[SEP] identifier[output] operator[SEP] identifier[flush] operator[SEP] operator[SEP] operator[SEP] identifier[output] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[IOException] identifier[ioe] operator[SEP] { identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[println] operator[SEP] literal[String] operator[+] identifier[ioe] operator[SEP] operator[SEP] } }
public int getGroupLengths(int index, char offsets[], char lengths[]) { char length = 0xffff; byte b = 0, n = 0; int shift; index = index * m_groupsize_; // byte count offsets of group strings int stringoffset = UCharacterUtility.toInt( m_groupinfo_[index + OFFSET_HIGH_OFFSET_], m_groupinfo_[index + OFFSET_LOW_OFFSET_]); offsets[0] = 0; // all 32 lengths must be read to get the offset of the first group // string for (int i = 0; i < LINES_PER_GROUP_; stringoffset ++) { b = m_groupstring_[stringoffset]; shift = 4; while (shift >= 0) { // getting nibble n = (byte)((b >> shift) & 0x0F); if (length == 0xffff && n > SINGLE_NIBBLE_MAX_) { length = (char)((n - 12) << 4); } else { if (length != 0xffff) { lengths[i] = (char)((length | n) + 12); } else { lengths[i] = (char)n; } if (i < LINES_PER_GROUP_) { offsets[i + 1] = (char)(offsets[i] + lengths[i]); } length = 0xffff; i ++; } shift -= 4; } } return stringoffset; }
class class_name[name] begin[{] method[getGroupLengths, return_type[type[int]], modifier[public], parameter[index, offsets, lengths]] begin[{] local_variable[type[char], length] local_variable[type[byte], b] local_variable[type[int], shift] assign[member[.index], binary_operation[member[.index], *, member[.m_groupsize_]]] local_variable[type[int], stringoffset] assign[member[.offsets], literal[0]] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=b, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=m_groupstring_, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=stringoffset, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=shift, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=4)), label=None), WhileStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=n, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Cast(expression=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=b, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=shift, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=>>), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0x0F), operator=&), type=BasicType(dimensions=[], name=byte))), label=None), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0xffff), operator===), operandr=BinaryOperation(operandl=MemberReference(member=n, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=SINGLE_NIBBLE_MAX_, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=>), operator=&&), else_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0xffff), operator=!=), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=lengths, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=Cast(expression=MemberReference(member=n, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=BasicType(dimensions=[], name=char))), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=lengths, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=Cast(expression=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=n, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=|), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=12), operator=+), type=BasicType(dimensions=[], name=char))), label=None)])), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=LINES_PER_GROUP_, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=offsets, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+))]), type==, value=Cast(expression=BinaryOperation(operandl=MemberReference(member=offsets, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operandr=MemberReference(member=lengths, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operator=+), type=BasicType(dimensions=[], name=char))), label=None)])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0xffff)), label=None), StatementExpression(expression=MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Cast(expression=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=n, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=12), operator=-), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=4), operator=<<), type=BasicType(dimensions=[], name=char))), label=None)])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=shift, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=-=, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=4)), label=None)]), condition=BinaryOperation(operandl=MemberReference(member=shift, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>=), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=LINES_PER_GROUP_, 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=stringoffset, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) return[member[.stringoffset]] end[}] END[}]
Keyword[public] Keyword[int] identifier[getGroupLengths] operator[SEP] Keyword[int] identifier[index] , Keyword[char] identifier[offsets] operator[SEP] operator[SEP] , Keyword[char] identifier[lengths] operator[SEP] operator[SEP] operator[SEP] { Keyword[char] identifier[length] operator[=] literal[Integer] operator[SEP] Keyword[byte] identifier[b] operator[=] Other[0] , identifier[n] operator[=] Other[0] operator[SEP] Keyword[int] identifier[shift] operator[SEP] identifier[index] operator[=] identifier[index] operator[*] identifier[m_groupsize_] operator[SEP] Keyword[int] identifier[stringoffset] operator[=] identifier[UCharacterUtility] operator[SEP] identifier[toInt] operator[SEP] identifier[m_groupinfo_] operator[SEP] identifier[index] operator[+] identifier[OFFSET_HIGH_OFFSET_] operator[SEP] , identifier[m_groupinfo_] operator[SEP] identifier[index] operator[+] identifier[OFFSET_LOW_OFFSET_] operator[SEP] operator[SEP] operator[SEP] identifier[offsets] operator[SEP] Other[0] operator[SEP] operator[=] Other[0] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[LINES_PER_GROUP_] operator[SEP] identifier[stringoffset] operator[++] operator[SEP] { identifier[b] operator[=] identifier[m_groupstring_] operator[SEP] identifier[stringoffset] operator[SEP] operator[SEP] identifier[shift] operator[=] Other[4] operator[SEP] Keyword[while] operator[SEP] identifier[shift] operator[>=] Other[0] operator[SEP] { identifier[n] operator[=] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] operator[SEP] identifier[b] operator[>] operator[>] identifier[shift] operator[SEP] operator[&] literal[Integer] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[length] operator[==] literal[Integer] operator[&&] identifier[n] operator[>] identifier[SINGLE_NIBBLE_MAX_] operator[SEP] { identifier[length] operator[=] operator[SEP] Keyword[char] operator[SEP] operator[SEP] operator[SEP] identifier[n] operator[-] Other[12] operator[SEP] operator[<<] Other[4] operator[SEP] operator[SEP] } Keyword[else] { Keyword[if] operator[SEP] identifier[length] operator[!=] literal[Integer] operator[SEP] { identifier[lengths] operator[SEP] identifier[i] operator[SEP] operator[=] operator[SEP] Keyword[char] operator[SEP] operator[SEP] operator[SEP] identifier[length] operator[|] identifier[n] operator[SEP] operator[+] Other[12] operator[SEP] operator[SEP] } Keyword[else] { identifier[lengths] operator[SEP] identifier[i] operator[SEP] operator[=] operator[SEP] Keyword[char] operator[SEP] identifier[n] operator[SEP] } Keyword[if] operator[SEP] identifier[i] operator[<] identifier[LINES_PER_GROUP_] operator[SEP] { identifier[offsets] operator[SEP] identifier[i] operator[+] Other[1] operator[SEP] operator[=] operator[SEP] Keyword[char] operator[SEP] operator[SEP] identifier[offsets] operator[SEP] identifier[i] operator[SEP] operator[+] identifier[lengths] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP] } identifier[length] operator[=] literal[Integer] operator[SEP] identifier[i] operator[++] operator[SEP] } identifier[shift] operator[-=] Other[4] operator[SEP] } } Keyword[return] identifier[stringoffset] operator[SEP] }
public E get(SymbolKey key, L secondaryKey) { // Extract the sequence key from the symbol key. int sequenceKey = ((SymbolKeyImpl) key).sequenceKey; // Check that the field for the secondary key exists, and return null if not. CircularArrayMap<E> field = fieldMap.get(secondaryKey); if (field == null) { return null; } // Look up the value directly by its sequence key. return field.get(sequenceKey); }
class class_name[name] begin[{] method[get, return_type[type[E]], modifier[public], parameter[key, secondaryKey]] begin[{] local_variable[type[int], sequenceKey] local_variable[type[CircularArrayMap], field] if[binary_operation[member[.field], ==, literal[null]]] begin[{] return[literal[null]] else begin[{] None end[}] return[call[field.get, parameter[member[.sequenceKey]]]] end[}] END[}]
Keyword[public] identifier[E] identifier[get] operator[SEP] identifier[SymbolKey] identifier[key] , identifier[L] identifier[secondaryKey] operator[SEP] { Keyword[int] identifier[sequenceKey] operator[=] operator[SEP] operator[SEP] identifier[SymbolKeyImpl] operator[SEP] identifier[key] operator[SEP] operator[SEP] identifier[sequenceKey] operator[SEP] identifier[CircularArrayMap] operator[<] identifier[E] operator[>] identifier[field] operator[=] identifier[fieldMap] operator[SEP] identifier[get] operator[SEP] identifier[secondaryKey] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[field] operator[==] Other[null] operator[SEP] { Keyword[return] Other[null] operator[SEP] } Keyword[return] identifier[field] operator[SEP] identifier[get] operator[SEP] identifier[sequenceKey] operator[SEP] operator[SEP] }
public void updateComponentDataMemberDefaultAccess(String strAccess) throws SecurityException, ApplicationException { checkWriteAccess(); boolean hasAccess = ConfigWebUtil.hasAccess(config, SecurityManager.TYPE_SETTING); if (!hasAccess) throw new SecurityException("no access to update component setting"); Element scope = _getRootElement("component"); if (StringUtil.isEmpty(strAccess)) { scope.setAttribute("data-member-default-access", ""); } else { scope.setAttribute("data-member-default-access", ComponentUtil.toStringAccess(ComponentUtil.toIntAccess(strAccess))); } }
class class_name[name] begin[{] method[updateComponentDataMemberDefaultAccess, return_type[void], modifier[public], parameter[strAccess]] begin[{] call[.checkWriteAccess, parameter[]] local_variable[type[boolean], hasAccess] if[member[.hasAccess]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="no access to update component setting")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SecurityException, sub_type=None)), label=None) else begin[{] None end[}] local_variable[type[Element], scope] if[call[StringUtil.isEmpty, parameter[member[.strAccess]]]] begin[{] call[scope.setAttribute, parameter[literal["data-member-default-access"], literal[""]]] else begin[{] call[scope.setAttribute, parameter[literal["data-member-default-access"], call[ComponentUtil.toStringAccess, parameter[call[ComponentUtil.toIntAccess, parameter[member[.strAccess]]]]]]] end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[updateComponentDataMemberDefaultAccess] operator[SEP] identifier[String] identifier[strAccess] operator[SEP] Keyword[throws] identifier[SecurityException] , identifier[ApplicationException] { identifier[checkWriteAccess] operator[SEP] operator[SEP] operator[SEP] Keyword[boolean] identifier[hasAccess] operator[=] identifier[ConfigWebUtil] operator[SEP] identifier[hasAccess] operator[SEP] identifier[config] , identifier[SecurityManager] operator[SEP] identifier[TYPE_SETTING] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[hasAccess] operator[SEP] Keyword[throw] Keyword[new] identifier[SecurityException] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[Element] identifier[scope] operator[=] identifier[_getRootElement] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[StringUtil] operator[SEP] identifier[isEmpty] operator[SEP] identifier[strAccess] operator[SEP] operator[SEP] { identifier[scope] operator[SEP] identifier[setAttribute] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] } Keyword[else] { identifier[scope] operator[SEP] identifier[setAttribute] operator[SEP] literal[String] , identifier[ComponentUtil] operator[SEP] identifier[toStringAccess] operator[SEP] identifier[ComponentUtil] operator[SEP] identifier[toIntAccess] operator[SEP] identifier[strAccess] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } }
@Override public Object process(InvocableMap.Entry entry) { ReflectionExtractor extractor = new ReflectionExtractor(name, args); if (mutator) { Object value = entry.getValue(); Object result = extractor.extract(value); entry.setValue(value); return result; } else { return entry.extract(extractor); } }
class class_name[name] begin[{] method[process, return_type[type[Object]], modifier[public], parameter[entry]] begin[{] local_variable[type[ReflectionExtractor], extractor] if[member[.mutator]] begin[{] local_variable[type[Object], value] local_variable[type[Object], result] call[entry.setValue, parameter[member[.value]]] return[member[.result]] else begin[{] return[call[entry.extract, parameter[member[.extractor]]]] end[}] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[Object] identifier[process] operator[SEP] identifier[InvocableMap] operator[SEP] identifier[Entry] identifier[entry] operator[SEP] { identifier[ReflectionExtractor] identifier[extractor] operator[=] Keyword[new] identifier[ReflectionExtractor] operator[SEP] identifier[name] , identifier[args] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[mutator] operator[SEP] { identifier[Object] identifier[value] operator[=] identifier[entry] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] identifier[Object] identifier[result] operator[=] identifier[extractor] operator[SEP] identifier[extract] operator[SEP] identifier[value] operator[SEP] operator[SEP] identifier[entry] operator[SEP] identifier[setValue] operator[SEP] identifier[value] operator[SEP] operator[SEP] Keyword[return] identifier[result] operator[SEP] } Keyword[else] { Keyword[return] identifier[entry] operator[SEP] identifier[extract] operator[SEP] identifier[extractor] operator[SEP] operator[SEP] } }
public void addLiteralSchema(String ddlText) throws IOException { File temp = createFileForSchema(ddlText); addSchema(URLEncoder.encode(temp.getAbsolutePath(), "UTF-8")); }
class class_name[name] begin[{] method[addLiteralSchema, return_type[void], modifier[public], parameter[ddlText]] begin[{] local_variable[type[File], temp] call[.addSchema, parameter[call[URLEncoder.encode, parameter[call[temp.getAbsolutePath, parameter[]], literal["UTF-8"]]]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[addLiteralSchema] operator[SEP] identifier[String] identifier[ddlText] operator[SEP] Keyword[throws] identifier[IOException] { identifier[File] identifier[temp] operator[=] identifier[createFileForSchema] operator[SEP] identifier[ddlText] operator[SEP] operator[SEP] identifier[addSchema] operator[SEP] identifier[URLEncoder] operator[SEP] identifier[encode] operator[SEP] identifier[temp] operator[SEP] identifier[getAbsolutePath] operator[SEP] operator[SEP] , literal[String] operator[SEP] operator[SEP] operator[SEP] }
public boolean deleteTableIfExists() { try { deleteTable(); } catch (final ResourceNotFoundException e) { if (LOG.isTraceEnabled()) { LOG.trace("Table does not exist, no need to delete", e); } return false; } return true; }
class class_name[name] begin[{] method[deleteTableIfExists, return_type[type[boolean]], modifier[public], parameter[]] begin[{] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=deleteTable, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[IfStatement(condition=MethodInvocation(arguments=[], member=isTraceEnabled, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Table does not exist, no need to delete"), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=trace, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), label=None)])), ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['ResourceNotFoundException']))], finally_block=None, label=None, resources=None) return[literal[true]] end[}] END[}]
Keyword[public] Keyword[boolean] identifier[deleteTableIfExists] operator[SEP] operator[SEP] { Keyword[try] { identifier[deleteTable] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] Keyword[final] identifier[ResourceNotFoundException] identifier[e] 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] , identifier[e] operator[SEP] operator[SEP] } Keyword[return] literal[boolean] operator[SEP] } Keyword[return] literal[boolean] operator[SEP] }
public String getLine(int pos) { try { if (!findLine(pos)) return null; int lineEnd = lineStart; while (lineEnd < bufLen && buf[lineEnd] != CR && buf[lineEnd] != LF) lineEnd++; if (lineEnd - lineStart == 0) return null; return new String(buf, lineStart, lineEnd - lineStart); } finally { buf = null; } }
class class_name[name] begin[{] method[getLine, return_type[type[String]], modifier[public], parameter[pos]] begin[{] TryStatement(block=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=pos, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=findLine, postfix_operators=[], prefix_operators=['!'], qualifier=, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), label=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=lineStart, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), name=lineEnd)], modifiers=set(), type=BasicType(dimensions=[], name=int)), WhileStatement(body=StatementExpression(expression=MemberReference(member=lineEnd, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]), label=None), condition=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=lineEnd, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=bufLen, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), operandr=BinaryOperation(operandl=MemberReference(member=buf, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=lineEnd, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operandr=MemberReference(member=CR, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=!=), operator=&&), operandr=BinaryOperation(operandl=MemberReference(member=buf, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=lineEnd, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operandr=MemberReference(member=LF, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=!=), operator=&&), label=None), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=lineEnd, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=lineStart, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=-), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator===), else_statement=None, label=None, then_statement=ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), label=None)), ReturnStatement(expression=ClassCreator(arguments=[MemberReference(member=buf, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=lineStart, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=MemberReference(member=lineEnd, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=lineStart, 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=String, sub_type=None)), label=None)], catches=None, finally_block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=buf, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)), label=None)], label=None, resources=None) end[}] END[}]
Keyword[public] identifier[String] identifier[getLine] operator[SEP] Keyword[int] identifier[pos] operator[SEP] { Keyword[try] { Keyword[if] operator[SEP] operator[!] identifier[findLine] operator[SEP] identifier[pos] operator[SEP] operator[SEP] Keyword[return] Other[null] operator[SEP] Keyword[int] identifier[lineEnd] operator[=] identifier[lineStart] operator[SEP] Keyword[while] operator[SEP] identifier[lineEnd] operator[<] identifier[bufLen] operator[&&] identifier[buf] operator[SEP] identifier[lineEnd] operator[SEP] operator[!=] identifier[CR] operator[&&] identifier[buf] operator[SEP] identifier[lineEnd] operator[SEP] operator[!=] identifier[LF] operator[SEP] identifier[lineEnd] operator[++] operator[SEP] Keyword[if] operator[SEP] identifier[lineEnd] operator[-] identifier[lineStart] operator[==] Other[0] operator[SEP] Keyword[return] Other[null] operator[SEP] Keyword[return] Keyword[new] identifier[String] operator[SEP] identifier[buf] , identifier[lineStart] , identifier[lineEnd] operator[-] identifier[lineStart] operator[SEP] operator[SEP] } Keyword[finally] { identifier[buf] operator[=] Other[null] operator[SEP] } }
public java.util.Map<String, String> getExprs() { if (exprs == null) { exprs = new com.amazonaws.internal.SdkInternalMap<String, String>(); } return exprs; }
class class_name[name] begin[{] method[getExprs, return_type[type[java]], modifier[public], parameter[]] begin[{] if[binary_operation[member[.exprs], ==, literal[null]]] begin[{] assign[member[.exprs], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=com, sub_type=ReferenceType(arguments=None, dimensions=None, name=amazonaws, sub_type=ReferenceType(arguments=None, dimensions=None, name=internal, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=None, name=SdkInternalMap, sub_type=None)))))] else begin[{] None end[}] return[member[.exprs]] end[}] END[}]
Keyword[public] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[getExprs] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[exprs] operator[==] Other[null] operator[SEP] { identifier[exprs] operator[=] Keyword[new] identifier[com] operator[SEP] identifier[amazonaws] operator[SEP] identifier[internal] operator[SEP] identifier[SdkInternalMap] operator[<] identifier[String] , identifier[String] operator[>] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[exprs] operator[SEP] }
@Override public String getMessage() { String nl = System.getProperty("line.separator"); StringBuffer sb = new StringBuffer(); sb.append(message); if (index >= 0) { sb.append(" near index "); sb.append(index); } sb.append(nl); sb.append(pattern); if (index >= 0) { sb.append(nl); for (int i = 0; i < index; i++) sb.append(' '); sb.append('^'); } return sb.toString(); }
class class_name[name] begin[{] method[getMessage, return_type[type[String]], modifier[public], parameter[]] begin[{] local_variable[type[String], nl] local_variable[type[StringBuffer], sb] call[sb.append, parameter[member[.message]]] if[binary_operation[member[.index], >=, literal[0]]] begin[{] call[sb.append, parameter[literal[" near index "]]] call[sb.append, parameter[member[.index]]] else begin[{] None end[}] call[sb.append, parameter[member[.nl]]] call[sb.append, parameter[member[.pattern]]] if[binary_operation[member[.index], >=, literal[0]]] begin[{] call[sb.append, parameter[member[.nl]]] ForStatement(body=StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=' ')], member=append, postfix_operators=[], prefix_operators=[], qualifier=sb, selectors=[], type_arguments=None), label=None), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=index, 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) call[sb.append, parameter[literal['^']]] else begin[{] None end[}] return[call[sb.toString, parameter[]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[String] identifier[getMessage] operator[SEP] operator[SEP] { identifier[String] identifier[nl] operator[=] identifier[System] operator[SEP] identifier[getProperty] operator[SEP] literal[String] 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] identifier[message] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[index] operator[>=] Other[0] operator[SEP] { identifier[sb] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[sb] operator[SEP] identifier[append] operator[SEP] identifier[index] operator[SEP] operator[SEP] } identifier[sb] operator[SEP] identifier[append] operator[SEP] identifier[nl] operator[SEP] operator[SEP] identifier[sb] operator[SEP] identifier[append] operator[SEP] identifier[pattern] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[index] operator[>=] Other[0] operator[SEP] { identifier[sb] operator[SEP] identifier[append] operator[SEP] identifier[nl] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[index] operator[SEP] identifier[i] operator[++] 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 void installFixes(Collection<String> fixes, String userId, String password) throws InstallException { fireProgressEvent(InstallProgressEvent.CHECK, 1, Messages.INSTALL_KERNEL_MESSAGES.getLogMessage("STATE_CHECKING")); List<String> fixesToInstall = new ArrayList<String>(fixes.size()); for (String fix : fixes) { fixesToInstall.add(fix); } RepositoryConnectionList loginInfo = getResolveDirector().getRepositoryConnectionList(null, userId, password, this.getClass().getCanonicalName() + ".installFixes"); Resolver resolver = new Resolver(loginInfo); List<IfixResource> ifixResources = resolver.resolveFixResources(fixesToInstall); if (ifixResources.isEmpty()) throw ExceptionUtils.createByKey("ERROR_FAILED_TO_RESOLVE_IFIX", InstallUtils.getFeatureListOutput(fixes)); ArrayList<InstallAsset> installAssets = new ArrayList<InstallAsset>(); int progress = 10; int interval = 40 / ifixResources.size(); for (IfixResource fix : ifixResources) { fireProgressEvent(InstallProgressEvent.DOWNLOAD, progress, "STATE_DOWNLOADING", fix); progress += interval; File d; try { d = InstallUtils.download(this.product.getInstallTempDir(), fix); } catch (InstallException e) { throw e; } catch (Exception e) { throw ExceptionUtils.createByKey(e, "ERROR_FAILED_TO_DOWNLOAD_IFIX", fix.getName(), this.product.getInstallTempDir().getAbsolutePath()); } try { installAssets.add(new FixAsset(fix.getName(), d, true)); } catch (Exception e) { throw ExceptionUtils.createByKey(e, "ERROR_INVALID_IFIX", fix.getName()); } } this.installAssets = new ArrayList<List<InstallAsset>>(1); this.installAssets.add(installAssets); }
class class_name[name] begin[{] method[installFixes, return_type[void], modifier[public], parameter[fixes, userId, password]] begin[{] call[.fireProgressEvent, parameter[member[InstallProgressEvent.CHECK], literal[1], call[Messages.INSTALL_KERNEL_MESSAGES.getLogMessage, parameter[literal["STATE_CHECKING"]]]]] local_variable[type[List], fixesToInstall] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=fix, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=fixesToInstall, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=fixes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=fix)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None) local_variable[type[RepositoryConnectionList], loginInfo] local_variable[type[Resolver], resolver] local_variable[type[List], ifixResources] if[call[ifixResources.isEmpty, parameter[]]] begin[{] ThrowStatement(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="ERROR_FAILED_TO_RESOLVE_IFIX"), MethodInvocation(arguments=[MemberReference(member=fixes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getFeatureListOutput, postfix_operators=[], prefix_operators=[], qualifier=InstallUtils, selectors=[], type_arguments=None)], member=createByKey, postfix_operators=[], prefix_operators=[], qualifier=ExceptionUtils, selectors=[], type_arguments=None), label=None) else begin[{] None end[}] local_variable[type[ArrayList], installAssets] local_variable[type[int], progress] local_variable[type[int], interval] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=DOWNLOAD, postfix_operators=[], prefix_operators=[], qualifier=InstallProgressEvent, selectors=[]), MemberReference(member=progress, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="STATE_DOWNLOADING"), MemberReference(member=fix, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=fireProgressEvent, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=progress, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=MemberReference(member=interval, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=None, name=d)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=File, sub_type=None)), TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=d, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=product, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[], member=getInstallTempDir, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), MemberReference(member=fix, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=download, postfix_operators=[], prefix_operators=[], qualifier=InstallUtils, selectors=[], type_arguments=None)), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['InstallException'])), CatchClause(block=[ThrowStatement(expression=MethodInvocation(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="ERROR_FAILED_TO_DOWNLOAD_IFIX"), MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=fix, selectors=[], type_arguments=None), This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=product, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[], member=getInstallTempDir, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=getAbsolutePath, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)])], member=createByKey, postfix_operators=[], prefix_operators=[], qualifier=ExceptionUtils, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None), TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[ClassCreator(arguments=[MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=fix, selectors=[], type_arguments=None), MemberReference(member=d, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=FixAsset, sub_type=None))], member=add, postfix_operators=[], prefix_operators=[], qualifier=installAssets, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=MethodInvocation(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="ERROR_INVALID_IFIX"), MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=fix, selectors=[], type_arguments=None)], member=createByKey, postfix_operators=[], prefix_operators=[], qualifier=ExceptionUtils, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None)]), control=EnhancedForControl(iterable=MemberReference(member=ifixResources, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=fix)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=IfixResource, sub_type=None))), label=None) assign[THIS[member[None.installAssets]], ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=InstallAsset, sub_type=None))], dimensions=[], name=List, sub_type=None))], dimensions=None, name=ArrayList, sub_type=None))] THIS[member[None.installAssets]call[None.add, parameter[member[.installAssets]]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[installFixes] operator[SEP] identifier[Collection] operator[<] identifier[String] operator[>] identifier[fixes] , identifier[String] identifier[userId] , identifier[String] identifier[password] operator[SEP] Keyword[throws] identifier[InstallException] { identifier[fireProgressEvent] operator[SEP] identifier[InstallProgressEvent] operator[SEP] identifier[CHECK] , Other[1] , identifier[Messages] operator[SEP] identifier[INSTALL_KERNEL_MESSAGES] operator[SEP] identifier[getLogMessage] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[String] operator[>] identifier[fixesToInstall] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[String] operator[>] operator[SEP] identifier[fixes] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[String] identifier[fix] operator[:] identifier[fixes] operator[SEP] { identifier[fixesToInstall] operator[SEP] identifier[add] operator[SEP] identifier[fix] operator[SEP] operator[SEP] } identifier[RepositoryConnectionList] identifier[loginInfo] operator[=] identifier[getResolveDirector] operator[SEP] operator[SEP] operator[SEP] identifier[getRepositoryConnectionList] operator[SEP] Other[null] , identifier[userId] , identifier[password] , Keyword[this] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] identifier[getCanonicalName] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] identifier[Resolver] identifier[resolver] operator[=] Keyword[new] identifier[Resolver] operator[SEP] identifier[loginInfo] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[IfixResource] operator[>] identifier[ifixResources] operator[=] identifier[resolver] operator[SEP] identifier[resolveFixResources] operator[SEP] identifier[fixesToInstall] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[ifixResources] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] Keyword[throw] identifier[ExceptionUtils] operator[SEP] identifier[createByKey] operator[SEP] literal[String] , identifier[InstallUtils] operator[SEP] identifier[getFeatureListOutput] operator[SEP] identifier[fixes] operator[SEP] operator[SEP] operator[SEP] identifier[ArrayList] operator[<] identifier[InstallAsset] operator[>] identifier[installAssets] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[InstallAsset] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[progress] operator[=] Other[10] operator[SEP] Keyword[int] identifier[interval] operator[=] Other[40] operator[/] identifier[ifixResources] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[IfixResource] identifier[fix] operator[:] identifier[ifixResources] operator[SEP] { identifier[fireProgressEvent] operator[SEP] identifier[InstallProgressEvent] operator[SEP] identifier[DOWNLOAD] , identifier[progress] , literal[String] , identifier[fix] operator[SEP] operator[SEP] identifier[progress] operator[+=] identifier[interval] operator[SEP] identifier[File] identifier[d] operator[SEP] Keyword[try] { identifier[d] operator[=] identifier[InstallUtils] operator[SEP] identifier[download] operator[SEP] Keyword[this] operator[SEP] identifier[product] operator[SEP] identifier[getInstallTempDir] operator[SEP] operator[SEP] , identifier[fix] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[InstallException] identifier[e] operator[SEP] { Keyword[throw] identifier[e] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { Keyword[throw] identifier[ExceptionUtils] operator[SEP] identifier[createByKey] operator[SEP] identifier[e] , literal[String] , identifier[fix] operator[SEP] identifier[getName] operator[SEP] operator[SEP] , Keyword[this] operator[SEP] identifier[product] operator[SEP] identifier[getInstallTempDir] operator[SEP] operator[SEP] operator[SEP] identifier[getAbsolutePath] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[try] { identifier[installAssets] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[FixAsset] operator[SEP] identifier[fix] operator[SEP] identifier[getName] operator[SEP] operator[SEP] , identifier[d] , literal[boolean] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { Keyword[throw] identifier[ExceptionUtils] operator[SEP] identifier[createByKey] operator[SEP] identifier[e] , literal[String] , identifier[fix] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } Keyword[this] operator[SEP] identifier[installAssets] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[List] operator[<] identifier[InstallAsset] operator[>] operator[>] operator[SEP] Other[1] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[installAssets] operator[SEP] identifier[add] operator[SEP] identifier[installAssets] operator[SEP] operator[SEP] }
@VisibleForTesting RemoteTaskRunnerWorkItem addPendingTask(final Task task) { log.info("Added pending task %s", task.getId()); final RemoteTaskRunnerWorkItem taskRunnerWorkItem = new RemoteTaskRunnerWorkItem( task.getId(), task.getType(), null, null, task.getDataSource() ); pendingTaskPayloads.put(task.getId(), task); pendingTasks.put(task.getId(), taskRunnerWorkItem); runPendingTasks(); return taskRunnerWorkItem; }
class class_name[name] begin[{] method[addPendingTask, return_type[type[RemoteTaskRunnerWorkItem]], modifier[default], parameter[task]] begin[{] call[log.info, parameter[literal["Added pending task %s"], call[task.getId, parameter[]]]] local_variable[type[RemoteTaskRunnerWorkItem], taskRunnerWorkItem] call[pendingTaskPayloads.put, parameter[call[task.getId, parameter[]], member[.task]]] call[pendingTasks.put, parameter[call[task.getId, parameter[]], member[.taskRunnerWorkItem]]] call[.runPendingTasks, parameter[]] return[member[.taskRunnerWorkItem]] end[}] END[}]
annotation[@] identifier[VisibleForTesting] identifier[RemoteTaskRunnerWorkItem] identifier[addPendingTask] operator[SEP] Keyword[final] identifier[Task] identifier[task] operator[SEP] { identifier[log] operator[SEP] identifier[info] operator[SEP] literal[String] , identifier[task] operator[SEP] identifier[getId] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[RemoteTaskRunnerWorkItem] identifier[taskRunnerWorkItem] operator[=] Keyword[new] identifier[RemoteTaskRunnerWorkItem] operator[SEP] identifier[task] operator[SEP] identifier[getId] operator[SEP] operator[SEP] , identifier[task] operator[SEP] identifier[getType] operator[SEP] operator[SEP] , Other[null] , Other[null] , identifier[task] operator[SEP] identifier[getDataSource] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[pendingTaskPayloads] operator[SEP] identifier[put] operator[SEP] identifier[task] operator[SEP] identifier[getId] operator[SEP] operator[SEP] , identifier[task] operator[SEP] operator[SEP] identifier[pendingTasks] operator[SEP] identifier[put] operator[SEP] identifier[task] operator[SEP] identifier[getId] operator[SEP] operator[SEP] , identifier[taskRunnerWorkItem] operator[SEP] operator[SEP] identifier[runPendingTasks] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[taskRunnerWorkItem] operator[SEP] }
public BufferedImage getAllRecolors (boolean label) { if (_colRepo == null) { return null; } ColorPository.ClassRecord colClass = _colRepo.getClassRecord((String)_classList.getSelectedItem()); int classId = colClass.classId; BufferedImage img = new BufferedImage(_image.getWidth(), _image.getHeight()*colClass.colors.size(), BufferedImage.TYPE_INT_ARGB); Graphics gfx = img.getGraphics(); gfx.setColor(Color.BLACK); int y = 0; Integer[] sortedKeys = colClass.colors.keySet().toArray(new Integer[colClass.colors.size()]); Arrays.sort(sortedKeys); for (int key : sortedKeys) { Colorization coloriz = _colRepo.getColorization(classId, key); BufferedImage subImg = ImageUtil.recolorImage( _image, coloriz.rootColor, coloriz.range, coloriz.offsets); gfx.drawImage(subImg, 0, y, null, null); if (label) { ColorRecord crec = _colRepo.getColorRecord(classId, key); gfx.drawString(crec.name, 2, y + gfx.getFontMetrics().getHeight() + 2); gfx.drawRect(0, y, _image.getWidth() - 1, _image.getHeight()); } y += subImg.getHeight(); } return img; }
class class_name[name] begin[{] method[getAllRecolors, return_type[type[BufferedImage]], modifier[public], parameter[label]] begin[{] if[binary_operation[member[._colRepo], ==, literal[null]]] begin[{] return[literal[null]] else begin[{] None end[}] local_variable[type[ColorPository], colClass] local_variable[type[int], classId] local_variable[type[BufferedImage], img] local_variable[type[Graphics], gfx] call[gfx.setColor, parameter[member[Color.BLACK]]] local_variable[type[int], y] local_variable[type[Integer], sortedKeys] call[Arrays.sort, parameter[member[.sortedKeys]]] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=classId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getColorization, postfix_operators=[], prefix_operators=[], qualifier=_colRepo, selectors=[], type_arguments=None), name=coloriz)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Colorization, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=_image, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=rootColor, postfix_operators=[], prefix_operators=[], qualifier=coloriz, selectors=[]), MemberReference(member=range, postfix_operators=[], prefix_operators=[], qualifier=coloriz, selectors=[]), MemberReference(member=offsets, postfix_operators=[], prefix_operators=[], qualifier=coloriz, selectors=[])], member=recolorImage, postfix_operators=[], prefix_operators=[], qualifier=ImageUtil, selectors=[], type_arguments=None), name=subImg)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=BufferedImage, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=subImg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), MemberReference(member=y, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], member=drawImage, postfix_operators=[], prefix_operators=[], qualifier=gfx, selectors=[], type_arguments=None), label=None), IfStatement(condition=MemberReference(member=label, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=classId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getColorRecord, postfix_operators=[], prefix_operators=[], qualifier=_colRepo, selectors=[], type_arguments=None), name=crec)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ColorRecord, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=crec, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=y, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=getFontMetrics, postfix_operators=[], prefix_operators=[], qualifier=gfx, selectors=[MethodInvocation(arguments=[], member=getHeight, 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=2), operator=+)], member=drawString, postfix_operators=[], prefix_operators=[], qualifier=gfx, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), MemberReference(member=y, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=MethodInvocation(arguments=[], member=getWidth, postfix_operators=[], prefix_operators=[], qualifier=_image, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-), MethodInvocation(arguments=[], member=getHeight, postfix_operators=[], prefix_operators=[], qualifier=_image, selectors=[], type_arguments=None)], member=drawRect, postfix_operators=[], prefix_operators=[], qualifier=gfx, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=y, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=MethodInvocation(arguments=[], member=getHeight, postfix_operators=[], prefix_operators=[], qualifier=subImg, selectors=[], type_arguments=None)), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=sortedKeys, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=key)], modifiers=set(), type=BasicType(dimensions=[], name=int))), label=None) return[member[.img]] end[}] END[}]
Keyword[public] identifier[BufferedImage] identifier[getAllRecolors] operator[SEP] Keyword[boolean] identifier[label] operator[SEP] { Keyword[if] operator[SEP] identifier[_colRepo] operator[==] Other[null] operator[SEP] { Keyword[return] Other[null] operator[SEP] } identifier[ColorPository] operator[SEP] identifier[ClassRecord] identifier[colClass] operator[=] identifier[_colRepo] operator[SEP] identifier[getClassRecord] operator[SEP] operator[SEP] identifier[String] operator[SEP] identifier[_classList] operator[SEP] identifier[getSelectedItem] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[classId] operator[=] identifier[colClass] operator[SEP] identifier[classId] operator[SEP] identifier[BufferedImage] identifier[img] operator[=] Keyword[new] identifier[BufferedImage] operator[SEP] identifier[_image] operator[SEP] identifier[getWidth] operator[SEP] operator[SEP] , identifier[_image] operator[SEP] identifier[getHeight] operator[SEP] operator[SEP] operator[*] identifier[colClass] operator[SEP] identifier[colors] operator[SEP] identifier[size] operator[SEP] operator[SEP] , identifier[BufferedImage] operator[SEP] identifier[TYPE_INT_ARGB] operator[SEP] operator[SEP] identifier[Graphics] identifier[gfx] operator[=] identifier[img] operator[SEP] identifier[getGraphics] operator[SEP] operator[SEP] operator[SEP] identifier[gfx] operator[SEP] identifier[setColor] operator[SEP] identifier[Color] operator[SEP] identifier[BLACK] operator[SEP] operator[SEP] Keyword[int] identifier[y] operator[=] Other[0] operator[SEP] identifier[Integer] operator[SEP] operator[SEP] identifier[sortedKeys] operator[=] identifier[colClass] operator[SEP] identifier[colors] operator[SEP] identifier[keySet] operator[SEP] operator[SEP] operator[SEP] identifier[toArray] operator[SEP] Keyword[new] identifier[Integer] operator[SEP] identifier[colClass] operator[SEP] identifier[colors] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[Arrays] operator[SEP] identifier[sort] operator[SEP] identifier[sortedKeys] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[key] operator[:] identifier[sortedKeys] operator[SEP] { identifier[Colorization] identifier[coloriz] operator[=] identifier[_colRepo] operator[SEP] identifier[getColorization] operator[SEP] identifier[classId] , identifier[key] operator[SEP] operator[SEP] identifier[BufferedImage] identifier[subImg] operator[=] identifier[ImageUtil] operator[SEP] identifier[recolorImage] operator[SEP] identifier[_image] , identifier[coloriz] operator[SEP] identifier[rootColor] , identifier[coloriz] operator[SEP] identifier[range] , identifier[coloriz] operator[SEP] identifier[offsets] operator[SEP] operator[SEP] identifier[gfx] operator[SEP] identifier[drawImage] operator[SEP] identifier[subImg] , Other[0] , identifier[y] , Other[null] , Other[null] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[label] operator[SEP] { identifier[ColorRecord] identifier[crec] operator[=] identifier[_colRepo] operator[SEP] identifier[getColorRecord] operator[SEP] identifier[classId] , identifier[key] operator[SEP] operator[SEP] identifier[gfx] operator[SEP] identifier[drawString] operator[SEP] identifier[crec] operator[SEP] identifier[name] , Other[2] , identifier[y] operator[+] identifier[gfx] operator[SEP] identifier[getFontMetrics] operator[SEP] operator[SEP] operator[SEP] identifier[getHeight] operator[SEP] operator[SEP] operator[+] Other[2] operator[SEP] operator[SEP] identifier[gfx] operator[SEP] identifier[drawRect] operator[SEP] Other[0] , identifier[y] , identifier[_image] operator[SEP] identifier[getWidth] operator[SEP] operator[SEP] operator[-] Other[1] , identifier[_image] operator[SEP] identifier[getHeight] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[y] operator[+=] identifier[subImg] operator[SEP] identifier[getHeight] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[img] operator[SEP] }
protected List<E> createBulkLeafNodes(List<E> objects) { int minEntries = leafMinimum; int maxEntries = leafCapacity; ArrayList<E> result = new ArrayList<>(); List<List<E>> partitions = settings.bulkSplitter.partition(objects, minEntries, maxEntries); for(List<E> partition : partitions) { // create leaf node N leafNode = createNewLeafNode(); // insert data for(E o : partition) { leafNode.addLeafEntry(o); } // write to file writeNode(leafNode); result.add(createNewDirectoryEntry(leafNode)); if(getLogger().isDebugging()) { getLogger().debugFine("Created leaf page " + leafNode.getPageID()); } } if(getLogger().isDebugging()) { getLogger().debugFine("numDataPages = " + result.size()); } return result; }
class class_name[name] begin[{] method[createBulkLeafNodes, return_type[type[List]], modifier[protected], parameter[objects]] begin[{] local_variable[type[int], minEntries] local_variable[type[int], maxEntries] local_variable[type[ArrayList], result] local_variable[type[List], partitions] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=createNewLeafNode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=leafNode)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=N, sub_type=None)), ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=o, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addLeafEntry, postfix_operators=[], prefix_operators=[], qualifier=leafNode, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=partition, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=o)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=E, sub_type=None))), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=leafNode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=writeNode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=leafNode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=createNewDirectoryEntry, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[], type_arguments=None), label=None), IfStatement(condition=MethodInvocation(arguments=[], member=getLogger, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[], member=isDebugging, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=getLogger, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Created leaf page "), operandr=MethodInvocation(arguments=[], member=getPageID, postfix_operators=[], prefix_operators=[], qualifier=leafNode, selectors=[], type_arguments=None), operator=+)], member=debugFine, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=partitions, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=partition)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=E, sub_type=None))], dimensions=[], name=List, sub_type=None))), label=None) if[call[.getLogger, parameter[]]] begin[{] call[.getLogger, parameter[]] else begin[{] None end[}] return[member[.result]] end[}] END[}]
Keyword[protected] identifier[List] operator[<] identifier[E] operator[>] identifier[createBulkLeafNodes] operator[SEP] identifier[List] operator[<] identifier[E] operator[>] identifier[objects] operator[SEP] { Keyword[int] identifier[minEntries] operator[=] identifier[leafMinimum] operator[SEP] Keyword[int] identifier[maxEntries] operator[=] identifier[leafCapacity] operator[SEP] identifier[ArrayList] operator[<] identifier[E] operator[>] identifier[result] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[List] operator[<] identifier[E] operator[>] operator[>] identifier[partitions] operator[=] identifier[settings] operator[SEP] identifier[bulkSplitter] operator[SEP] identifier[partition] operator[SEP] identifier[objects] , identifier[minEntries] , identifier[maxEntries] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[List] operator[<] identifier[E] operator[>] identifier[partition] operator[:] identifier[partitions] operator[SEP] { identifier[N] identifier[leafNode] operator[=] identifier[createNewLeafNode] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[E] identifier[o] operator[:] identifier[partition] operator[SEP] { identifier[leafNode] operator[SEP] identifier[addLeafEntry] operator[SEP] identifier[o] operator[SEP] operator[SEP] } identifier[writeNode] operator[SEP] identifier[leafNode] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[add] operator[SEP] identifier[createNewDirectoryEntry] operator[SEP] identifier[leafNode] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[getLogger] operator[SEP] operator[SEP] operator[SEP] identifier[isDebugging] operator[SEP] operator[SEP] operator[SEP] { identifier[getLogger] operator[SEP] operator[SEP] operator[SEP] identifier[debugFine] operator[SEP] literal[String] operator[+] identifier[leafNode] operator[SEP] identifier[getPageID] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } Keyword[if] operator[SEP] identifier[getLogger] operator[SEP] operator[SEP] operator[SEP] identifier[isDebugging] operator[SEP] operator[SEP] operator[SEP] { identifier[getLogger] operator[SEP] operator[SEP] operator[SEP] identifier[debugFine] operator[SEP] literal[String] operator[+] identifier[result] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[result] operator[SEP] }
protected void onSelectedItemChanged() { if (selectedItem == null) { anchorLabel(); getInputWidget().setText(""); } else { getInputWidget().setText(getItemPrinter().print(selectedItem)); floatLabel(); } if (itemChooserListener != null) itemChooserListener.onSelectionChanged(this, selectedItem); }
class class_name[name] begin[{] method[onSelectedItemChanged, return_type[void], modifier[protected], parameter[]] begin[{] if[binary_operation[member[.selectedItem], ==, literal[null]]] begin[{] call[.anchorLabel, parameter[]] call[.getInputWidget, parameter[]] else begin[{] call[.getInputWidget, parameter[]] call[.floatLabel, parameter[]] end[}] if[binary_operation[member[.itemChooserListener], !=, literal[null]]] begin[{] call[itemChooserListener.onSelectionChanged, parameter[THIS[], member[.selectedItem]]] else begin[{] None end[}] end[}] END[}]
Keyword[protected] Keyword[void] identifier[onSelectedItemChanged] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[selectedItem] operator[==] Other[null] operator[SEP] { identifier[anchorLabel] operator[SEP] operator[SEP] operator[SEP] identifier[getInputWidget] operator[SEP] operator[SEP] operator[SEP] identifier[setText] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[else] { identifier[getInputWidget] operator[SEP] operator[SEP] operator[SEP] identifier[setText] operator[SEP] identifier[getItemPrinter] operator[SEP] operator[SEP] operator[SEP] identifier[print] operator[SEP] identifier[selectedItem] operator[SEP] operator[SEP] operator[SEP] identifier[floatLabel] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[itemChooserListener] operator[!=] Other[null] operator[SEP] identifier[itemChooserListener] operator[SEP] identifier[onSelectionChanged] operator[SEP] Keyword[this] , identifier[selectedItem] operator[SEP] operator[SEP] }
public void flateCompress(int compressionLevel) { if (!Document.compress) return; // check if the flateCompress-method has already been if (compressed) { return; } this.compressionLevel = compressionLevel; if (inputStream != null) { compressed = true; return; } // check if a filter already exists PdfObject filter = PdfReader.getPdfObject(get(PdfName.FILTER)); if (filter != null) { if (filter.isName()) { if (PdfName.FLATEDECODE.equals(filter)) return; } else if (filter.isArray()) { if (((PdfArray) filter).contains(PdfName.FLATEDECODE)) return; } else { throw new RuntimeException("Stream could not be compressed: filter is not a name or array."); } } try { // compress ByteArrayOutputStream stream = new ByteArrayOutputStream(); Deflater deflater = new Deflater(compressionLevel); DeflaterOutputStream zip = new DeflaterOutputStream(stream, deflater); if (streamBytes != null) streamBytes.writeTo(zip); else zip.write(bytes); zip.close(); deflater.end(); // update the object streamBytes = stream; bytes = null; put(PdfName.LENGTH, new PdfNumber(streamBytes.size())); if (filter == null) { put(PdfName.FILTER, PdfName.FLATEDECODE); } else { PdfArray filters = new PdfArray(filter); filters.add(PdfName.FLATEDECODE); put(PdfName.FILTER, filters); } compressed = true; } catch(IOException ioe) { throw new ExceptionConverter(ioe); } }
class class_name[name] begin[{] method[flateCompress, return_type[void], modifier[public], parameter[compressionLevel]] begin[{] if[member[Document.compress]] begin[{] return[None] else begin[{] None end[}] if[member[.compressed]] begin[{] return[None] else begin[{] None end[}] assign[THIS[member[None.compressionLevel]], member[.compressionLevel]] if[binary_operation[member[.inputStream], !=, literal[null]]] begin[{] assign[member[.compressed], literal[true]] return[None] else begin[{] None end[}] local_variable[type[PdfObject], filter] if[binary_operation[member[.filter], !=, literal[null]]] begin[{] if[call[filter.isName, parameter[]]] begin[{] if[call[PdfName.FLATEDECODE.equals, parameter[member[.filter]]]] begin[{] return[None] else begin[{] None end[}] else begin[{] if[call[filter.isArray, parameter[]]] begin[{] if[Cast(expression=MemberReference(member=filter, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=PdfArray, sub_type=None))] begin[{] return[None] else begin[{] None end[}] else begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Stream could not be compressed: filter is not a name or array.")], 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) end[}] end[}] else begin[{] None end[}] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ByteArrayOutputStream, sub_type=None)), name=stream)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ByteArrayOutputStream, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MemberReference(member=compressionLevel, 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=Deflater, sub_type=None)), name=deflater)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Deflater, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MemberReference(member=stream, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=deflater, 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=DeflaterOutputStream, sub_type=None)), name=zip)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=DeflaterOutputStream, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=streamBytes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=bytes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=write, postfix_operators=[], prefix_operators=[], qualifier=zip, selectors=[], type_arguments=None), label=None), label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=zip, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=writeTo, postfix_operators=[], prefix_operators=[], qualifier=streamBytes, selectors=[], type_arguments=None), label=None)), StatementExpression(expression=MethodInvocation(arguments=[], member=close, postfix_operators=[], prefix_operators=[], qualifier=zip, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=end, postfix_operators=[], prefix_operators=[], qualifier=deflater, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=streamBytes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=stream, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=bytes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=LENGTH, postfix_operators=[], prefix_operators=[], qualifier=PdfName, selectors=[]), ClassCreator(arguments=[MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=streamBytes, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=PdfNumber, sub_type=None))], member=put, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=filter, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), else_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MemberReference(member=filter, 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=PdfArray, sub_type=None)), name=filters)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=PdfArray, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=FLATEDECODE, postfix_operators=[], prefix_operators=[], qualifier=PdfName, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=filters, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=FILTER, postfix_operators=[], prefix_operators=[], qualifier=PdfName, selectors=[]), MemberReference(member=filters, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=put, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=FILTER, postfix_operators=[], prefix_operators=[], qualifier=PdfName, selectors=[]), MemberReference(member=FLATEDECODE, postfix_operators=[], prefix_operators=[], qualifier=PdfName, selectors=[])], member=put, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=compressed, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=ioe, 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=ExceptionConverter, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ioe, types=['IOException']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[public] Keyword[void] identifier[flateCompress] operator[SEP] Keyword[int] identifier[compressionLevel] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[Document] operator[SEP] identifier[compress] operator[SEP] Keyword[return] operator[SEP] Keyword[if] operator[SEP] identifier[compressed] operator[SEP] { Keyword[return] operator[SEP] } Keyword[this] operator[SEP] identifier[compressionLevel] operator[=] identifier[compressionLevel] operator[SEP] Keyword[if] operator[SEP] identifier[inputStream] operator[!=] Other[null] operator[SEP] { identifier[compressed] operator[=] literal[boolean] operator[SEP] Keyword[return] operator[SEP] } identifier[PdfObject] identifier[filter] operator[=] identifier[PdfReader] operator[SEP] identifier[getPdfObject] operator[SEP] identifier[get] operator[SEP] identifier[PdfName] operator[SEP] identifier[FILTER] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[filter] operator[!=] Other[null] operator[SEP] { Keyword[if] operator[SEP] identifier[filter] operator[SEP] identifier[isName] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[PdfName] operator[SEP] identifier[FLATEDECODE] operator[SEP] identifier[equals] operator[SEP] identifier[filter] operator[SEP] operator[SEP] Keyword[return] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[filter] operator[SEP] identifier[isArray] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] operator[SEP] operator[SEP] identifier[PdfArray] operator[SEP] identifier[filter] operator[SEP] operator[SEP] identifier[contains] operator[SEP] identifier[PdfName] operator[SEP] identifier[FLATEDECODE] operator[SEP] operator[SEP] Keyword[return] operator[SEP] } Keyword[else] { Keyword[throw] Keyword[new] identifier[RuntimeException] operator[SEP] literal[String] operator[SEP] operator[SEP] } } Keyword[try] { identifier[ByteArrayOutputStream] identifier[stream] operator[=] Keyword[new] identifier[ByteArrayOutputStream] operator[SEP] operator[SEP] operator[SEP] identifier[Deflater] identifier[deflater] operator[=] Keyword[new] identifier[Deflater] operator[SEP] identifier[compressionLevel] operator[SEP] operator[SEP] identifier[DeflaterOutputStream] identifier[zip] operator[=] Keyword[new] identifier[DeflaterOutputStream] operator[SEP] identifier[stream] , identifier[deflater] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[streamBytes] operator[!=] Other[null] operator[SEP] identifier[streamBytes] operator[SEP] identifier[writeTo] operator[SEP] identifier[zip] operator[SEP] operator[SEP] Keyword[else] identifier[zip] operator[SEP] identifier[write] operator[SEP] identifier[bytes] operator[SEP] operator[SEP] identifier[zip] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP] identifier[deflater] operator[SEP] identifier[end] operator[SEP] operator[SEP] operator[SEP] identifier[streamBytes] operator[=] identifier[stream] operator[SEP] identifier[bytes] operator[=] Other[null] operator[SEP] identifier[put] operator[SEP] identifier[PdfName] operator[SEP] identifier[LENGTH] , Keyword[new] identifier[PdfNumber] operator[SEP] identifier[streamBytes] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[filter] operator[==] Other[null] operator[SEP] { identifier[put] operator[SEP] identifier[PdfName] operator[SEP] identifier[FILTER] , identifier[PdfName] operator[SEP] identifier[FLATEDECODE] operator[SEP] operator[SEP] } Keyword[else] { identifier[PdfArray] identifier[filters] operator[=] Keyword[new] identifier[PdfArray] operator[SEP] identifier[filter] operator[SEP] operator[SEP] identifier[filters] operator[SEP] identifier[add] operator[SEP] identifier[PdfName] operator[SEP] identifier[FLATEDECODE] operator[SEP] operator[SEP] identifier[put] operator[SEP] identifier[PdfName] operator[SEP] identifier[FILTER] , identifier[filters] operator[SEP] operator[SEP] } identifier[compressed] operator[=] literal[boolean] operator[SEP] } Keyword[catch] operator[SEP] identifier[IOException] identifier[ioe] operator[SEP] { Keyword[throw] Keyword[new] identifier[ExceptionConverter] operator[SEP] identifier[ioe] operator[SEP] operator[SEP] } }
protected void fireClusterChange(long timestamp, String type, String message) { // if we have no listeners, do nothing... if (listeners != null && !listeners.isEmpty()) { // create the event object to send ClusterEvent event = new ClusterEvent(this, timestamp, type , message); // make a copy of the listener list in case // anyone adds/removes listeners Vector targets; synchronized (this) { targets = (Vector) listeners.clone(); } // walk through the listener list and // call the sunMoved method in each Enumeration e = targets.elements(); while (e.hasMoreElements()) { ClusterEventListener l = (ClusterEventListener) e.nextElement(); l.changeCluster(event); } } }
class class_name[name] begin[{] method[fireClusterChange, return_type[void], modifier[protected], parameter[timestamp, type, message]] begin[{] if[binary_operation[binary_operation[member[.listeners], !=, literal[null]], &&, call[listeners.isEmpty, parameter[]]]] begin[{] local_variable[type[ClusterEvent], event] local_variable[type[Vector], targets] SYNCHRONIZED[THIS[]] BEGIN[{] assign[member[.targets], Cast(expression=MethodInvocation(arguments=[], member=clone, postfix_operators=[], prefix_operators=[], qualifier=listeners, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=Vector, sub_type=None))] END[}] local_variable[type[Enumeration], e] while[call[e.hasMoreElements, parameter[]]] begin[{] local_variable[type[ClusterEventListener], l] call[l.changeCluster, parameter[member[.event]]] end[}] else begin[{] None end[}] end[}] END[}]
Keyword[protected] Keyword[void] identifier[fireClusterChange] operator[SEP] Keyword[long] identifier[timestamp] , identifier[String] identifier[type] , identifier[String] identifier[message] operator[SEP] { Keyword[if] operator[SEP] identifier[listeners] operator[!=] Other[null] operator[&&] operator[!] identifier[listeners] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { identifier[ClusterEvent] identifier[event] operator[=] Keyword[new] identifier[ClusterEvent] operator[SEP] Keyword[this] , identifier[timestamp] , identifier[type] , identifier[message] operator[SEP] operator[SEP] identifier[Vector] identifier[targets] operator[SEP] Keyword[synchronized] operator[SEP] Keyword[this] operator[SEP] { identifier[targets] operator[=] operator[SEP] identifier[Vector] operator[SEP] identifier[listeners] operator[SEP] identifier[clone] operator[SEP] operator[SEP] operator[SEP] } identifier[Enumeration] identifier[e] operator[=] identifier[targets] operator[SEP] identifier[elements] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[e] operator[SEP] identifier[hasMoreElements] operator[SEP] operator[SEP] operator[SEP] { identifier[ClusterEventListener] identifier[l] operator[=] operator[SEP] identifier[ClusterEventListener] operator[SEP] identifier[e] operator[SEP] identifier[nextElement] operator[SEP] operator[SEP] operator[SEP] identifier[l] operator[SEP] identifier[changeCluster] operator[SEP] identifier[event] operator[SEP] operator[SEP] } } }
public void setThreadPoolSize( int threads ) { if( threads <= 0 ) throw new IllegalArgumentException("Number of threads must be greater than 0"); if( verbose ) Log.i(TAG,"setThreadPoolSize("+threads+")"); threadPool.setCorePoolSize(threads); threadPool.setMaximumPoolSize(threads); }
class class_name[name] begin[{] method[setThreadPoolSize, return_type[void], modifier[public], parameter[threads]] begin[{] if[binary_operation[member[.threads], <=, literal[0]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Number of threads must be greater than 0")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None) else begin[{] None end[}] if[member[.verbose]] begin[{] call[Log.i, parameter[member[.TAG], binary_operation[binary_operation[literal["setThreadPoolSize("], +, member[.threads]], +, literal[")"]]]] else begin[{] None end[}] call[threadPool.setCorePoolSize, parameter[member[.threads]]] call[threadPool.setMaximumPoolSize, parameter[member[.threads]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[setThreadPoolSize] operator[SEP] Keyword[int] identifier[threads] operator[SEP] { Keyword[if] operator[SEP] identifier[threads] operator[<=] Other[0] operator[SEP] Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[verbose] operator[SEP] identifier[Log] operator[SEP] identifier[i] operator[SEP] identifier[TAG] , literal[String] operator[+] identifier[threads] operator[+] literal[String] operator[SEP] operator[SEP] identifier[threadPool] operator[SEP] identifier[setCorePoolSize] operator[SEP] identifier[threads] operator[SEP] operator[SEP] identifier[threadPool] operator[SEP] identifier[setMaximumPoolSize] operator[SEP] identifier[threads] operator[SEP] operator[SEP] }
private boolean checkGroupedColumn() { boolean allowEdit = true; if (getTreeTableRow().getTreeItem() != null) { Object rowObject = getTreeTableRow().getTreeItem().getValue(); if (rowObject instanceof RecursiveTreeObject && rowObject.getClass() == RecursiveTreeObject.class) { allowEdit = false; } else { // check grouped columns in the tableview if (getTableColumn() instanceof JFXTreeTableColumn && ((JFXTreeTableColumn) getTableColumn()).isGrouped()) { // make sure that the object is a direct child to a group node if (getTreeTableRow().getTreeItem().getParent() != null && getTreeTableRow().getTreeItem().getParent().getValue().getClass() == RecursiveTreeObject.class) { allowEdit = false; } } } } return allowEdit; }
class class_name[name] begin[{] method[checkGroupedColumn, return_type[type[boolean]], modifier[private], parameter[]] begin[{] local_variable[type[boolean], allowEdit] if[binary_operation[call[.getTreeTableRow, parameter[]], !=, literal[null]]] begin[{] local_variable[type[Object], rowObject] if[binary_operation[binary_operation[member[.rowObject], instanceof, type[RecursiveTreeObject]], &&, binary_operation[call[rowObject.getClass, parameter[]], ==, ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=RecursiveTreeObject, sub_type=None))]]] begin[{] assign[member[.allowEdit], literal[false]] else begin[{] if[binary_operation[binary_operation[call[.getTableColumn, parameter[]], instanceof, type[JFXTreeTableColumn]], &&, Cast(expression=MethodInvocation(arguments=[], member=getTableColumn, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=JFXTreeTableColumn, sub_type=None))]] begin[{] if[binary_operation[binary_operation[call[.getTreeTableRow, parameter[]], !=, literal[null]], &&, binary_operation[call[.getTreeTableRow, parameter[]], ==, ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=RecursiveTreeObject, sub_type=None))]]] begin[{] assign[member[.allowEdit], literal[false]] else begin[{] None end[}] else begin[{] None end[}] end[}] else begin[{] None end[}] return[member[.allowEdit]] end[}] END[}]
Keyword[private] Keyword[boolean] identifier[checkGroupedColumn] operator[SEP] operator[SEP] { Keyword[boolean] identifier[allowEdit] operator[=] literal[boolean] operator[SEP] Keyword[if] operator[SEP] identifier[getTreeTableRow] operator[SEP] operator[SEP] operator[SEP] identifier[getTreeItem] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] { identifier[Object] identifier[rowObject] operator[=] identifier[getTreeTableRow] operator[SEP] operator[SEP] operator[SEP] identifier[getTreeItem] operator[SEP] operator[SEP] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[rowObject] Keyword[instanceof] identifier[RecursiveTreeObject] operator[&&] identifier[rowObject] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[==] identifier[RecursiveTreeObject] operator[SEP] Keyword[class] operator[SEP] { identifier[allowEdit] operator[=] literal[boolean] operator[SEP] } Keyword[else] { Keyword[if] operator[SEP] identifier[getTableColumn] operator[SEP] operator[SEP] Keyword[instanceof] identifier[JFXTreeTableColumn] operator[&&] operator[SEP] operator[SEP] identifier[JFXTreeTableColumn] operator[SEP] identifier[getTableColumn] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[isGrouped] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[getTreeTableRow] operator[SEP] operator[SEP] operator[SEP] identifier[getTreeItem] operator[SEP] operator[SEP] operator[SEP] identifier[getParent] operator[SEP] operator[SEP] operator[!=] Other[null] operator[&&] identifier[getTreeTableRow] operator[SEP] operator[SEP] operator[SEP] identifier[getTreeItem] operator[SEP] operator[SEP] operator[SEP] identifier[getParent] operator[SEP] operator[SEP] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[==] identifier[RecursiveTreeObject] operator[SEP] Keyword[class] operator[SEP] { identifier[allowEdit] operator[=] literal[boolean] operator[SEP] } } } } Keyword[return] identifier[allowEdit] operator[SEP] }
private void addAmbiguousShortDefaultBindingName(String shortBindingName) { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) Tr.debug(tc, "adding AmbiguousEJBReference for short default binding name '" + shortBindingName + "', for EJB " + ivHomeRecord.getJ2EEName()); // Get the list of beans that implement the same interface. d457053.1 ArrayList<J2EEName> beans = null; BindingData bdata = ivServerContextBindingMap.get(shortBindingName); if (bdata != null) { beans = bdata.ivImplicitBeans; } Reference ambiguousReference = AmbiguousEJBRefReferenceFactory. createAmbiguousReference(shortBindingName, beans); ivEjbContextAmbiguousMap.put(shortBindingName, ambiguousReference); }
class class_name[name] begin[{] method[addAmbiguousShortDefaultBindingName, return_type[void], modifier[private], parameter[shortBindingName]] begin[{] if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isDebugEnabled, parameter[]]]] begin[{] call[Tr.debug, parameter[member[.tc], binary_operation[binary_operation[binary_operation[literal["adding AmbiguousEJBReference for short default binding name '"], +, member[.shortBindingName]], +, literal["', for EJB "]], +, call[ivHomeRecord.getJ2EEName, parameter[]]]]] else begin[{] None end[}] local_variable[type[ArrayList], beans] local_variable[type[BindingData], bdata] if[binary_operation[member[.bdata], !=, literal[null]]] begin[{] assign[member[.beans], member[bdata.ivImplicitBeans]] else begin[{] None end[}] local_variable[type[Reference], ambiguousReference] call[ivEjbContextAmbiguousMap.put, parameter[member[.shortBindingName], member[.ambiguousReference]]] end[}] END[}]
Keyword[private] Keyword[void] identifier[addAmbiguousShortDefaultBindingName] operator[SEP] identifier[String] identifier[shortBindingName] operator[SEP] { Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[Tr] operator[SEP] identifier[debug] operator[SEP] identifier[tc] , literal[String] operator[+] identifier[shortBindingName] operator[+] literal[String] operator[+] identifier[ivHomeRecord] operator[SEP] identifier[getJ2EEName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[ArrayList] operator[<] identifier[J2EEName] operator[>] identifier[beans] operator[=] Other[null] operator[SEP] identifier[BindingData] identifier[bdata] operator[=] identifier[ivServerContextBindingMap] operator[SEP] identifier[get] operator[SEP] identifier[shortBindingName] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[bdata] operator[!=] Other[null] operator[SEP] { identifier[beans] operator[=] identifier[bdata] operator[SEP] identifier[ivImplicitBeans] operator[SEP] } identifier[Reference] identifier[ambiguousReference] operator[=] identifier[AmbiguousEJBRefReferenceFactory] operator[SEP] identifier[createAmbiguousReference] operator[SEP] identifier[shortBindingName] , identifier[beans] operator[SEP] operator[SEP] identifier[ivEjbContextAmbiguousMap] operator[SEP] identifier[put] operator[SEP] identifier[shortBindingName] , identifier[ambiguousReference] operator[SEP] operator[SEP] }
public static String verboseClusterDump(final Cluster cluster) { StringBuilder builder = new StringBuilder(); builder.append("CLUSTER XML SUMMARY\n"); Map<Integer, Integer> zoneIdToPartitionCount = Maps.newHashMap(); Map<Integer, Integer> zoneIdToNodeCount = Maps.newHashMap(); for(Zone zone: cluster.getZones()) { zoneIdToPartitionCount.put(zone.getId(), 0); zoneIdToNodeCount.put(zone.getId(), 0); } for(Node node: cluster.getNodes()) { zoneIdToPartitionCount.put(node.getZoneId(), zoneIdToPartitionCount.get(node.getZoneId()) + node.getNumberOfPartitions()); zoneIdToNodeCount.put(node.getZoneId(), zoneIdToNodeCount.get(node.getZoneId()) + 1); } builder.append("\n"); builder.append("Number of partitions per zone:\n"); for(Zone zone: cluster.getZones()) { builder.append("\tZone: " + zone.getId() + " - " + zoneIdToPartitionCount.get(zone.getId()) + "\n"); } builder.append("\n"); builder.append("Number of nodes per zone:\n"); for(Zone zone: cluster.getZones()) { builder.append("\tZone: " + zone.getId() + " - " + zoneIdToNodeCount.get(zone.getId()) + "\n"); } builder.append("\n"); builder.append("Nodes in each zone:\n"); for(Zone zone: cluster.getZones()) { builder.append("\tZone: " + zone.getId() + " - " + cluster.getNodeIdsInZone(zone.getId()) + "\n"); } builder.append("\n"); builder.append("Number of partitions per node:\n"); for(Node node: cluster.getNodes()) { builder.append("\tNode ID: " + node.getId() + " - " + node.getNumberOfPartitions() + " (" + node.getHost() + ")\n"); } builder.append("\n"); if(cluster.getZones().size() > 1) { builder.append("ZONE-PARTITION SUMMARY:\n"); builder.append("\n"); builder.append("Partitions in each zone:\n"); for(Zone zone: cluster.getZones()) { builder.append("\tZone: " + zone.getId() + " - " + compressedListOfPartitionsInZone(cluster, zone.getId()) + "\n"); } builder.append("\n"); builder.append("Contiguous partition run lengths in each zone ('{run length : count}'):\n"); for(Zone zone: cluster.getZones()) { builder.append("\tZone: " + zone.getId() + " - " + getPrettyMapOfContiguousPartitionRunLengths(cluster, zone.getId()) + "\n"); } builder.append("\n"); builder.append("The following nodes have hot partitions:\n"); builder.append(getHotPartitionsDueToContiguity(cluster, 5)); builder.append("\n"); } return builder.toString(); }
class class_name[name] begin[{] method[verboseClusterDump, return_type[type[String]], modifier[public static], parameter[cluster]] begin[{] local_variable[type[StringBuilder], builder] call[builder.append, parameter[literal["CLUSTER XML SUMMARY\n"]]] local_variable[type[Map], zoneIdToPartitionCount] local_variable[type[Map], zoneIdToNodeCount] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getId, postfix_operators=[], prefix_operators=[], qualifier=zone, selectors=[], type_arguments=None), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], member=put, postfix_operators=[], prefix_operators=[], qualifier=zoneIdToPartitionCount, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getId, postfix_operators=[], prefix_operators=[], qualifier=zone, selectors=[], type_arguments=None), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], member=put, postfix_operators=[], prefix_operators=[], qualifier=zoneIdToNodeCount, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getZones, postfix_operators=[], prefix_operators=[], qualifier=cluster, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=zone)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Zone, sub_type=None))), label=None) ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getZoneId, postfix_operators=[], prefix_operators=[], qualifier=node, selectors=[], type_arguments=None), BinaryOperation(operandl=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getZoneId, postfix_operators=[], prefix_operators=[], qualifier=node, selectors=[], type_arguments=None)], member=get, postfix_operators=[], prefix_operators=[], qualifier=zoneIdToPartitionCount, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[], member=getNumberOfPartitions, postfix_operators=[], prefix_operators=[], qualifier=node, selectors=[], type_arguments=None), operator=+)], member=put, postfix_operators=[], prefix_operators=[], qualifier=zoneIdToPartitionCount, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getZoneId, postfix_operators=[], prefix_operators=[], qualifier=node, selectors=[], type_arguments=None), BinaryOperation(operandl=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getZoneId, postfix_operators=[], prefix_operators=[], qualifier=node, selectors=[], type_arguments=None)], member=get, postfix_operators=[], prefix_operators=[], qualifier=zoneIdToNodeCount, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+)], member=put, postfix_operators=[], prefix_operators=[], qualifier=zoneIdToNodeCount, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getNodes, postfix_operators=[], prefix_operators=[], qualifier=cluster, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=node)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Node, sub_type=None))), label=None) call[builder.append, parameter[literal["\n"]]] call[builder.append, parameter[literal["Number of partitions per zone:\n"]]] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\tZone: "), operandr=MethodInvocation(arguments=[], member=getId, postfix_operators=[], prefix_operators=[], qualifier=zone, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" - "), operator=+), operandr=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getId, postfix_operators=[], prefix_operators=[], qualifier=zone, selectors=[], type_arguments=None)], member=get, postfix_operators=[], prefix_operators=[], qualifier=zoneIdToPartitionCount, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\n"), operator=+)], member=append, postfix_operators=[], prefix_operators=[], qualifier=builder, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getZones, postfix_operators=[], prefix_operators=[], qualifier=cluster, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=zone)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Zone, sub_type=None))), label=None) call[builder.append, parameter[literal["\n"]]] call[builder.append, parameter[literal["Number of nodes per zone:\n"]]] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\tZone: "), operandr=MethodInvocation(arguments=[], member=getId, postfix_operators=[], prefix_operators=[], qualifier=zone, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" - "), operator=+), operandr=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getId, postfix_operators=[], prefix_operators=[], qualifier=zone, selectors=[], type_arguments=None)], member=get, postfix_operators=[], prefix_operators=[], qualifier=zoneIdToNodeCount, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\n"), operator=+)], member=append, postfix_operators=[], prefix_operators=[], qualifier=builder, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getZones, postfix_operators=[], prefix_operators=[], qualifier=cluster, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=zone)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Zone, sub_type=None))), label=None) call[builder.append, parameter[literal["\n"]]] call[builder.append, parameter[literal["Nodes in each zone:\n"]]] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\tZone: "), operandr=MethodInvocation(arguments=[], member=getId, postfix_operators=[], prefix_operators=[], qualifier=zone, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" - "), operator=+), operandr=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getId, postfix_operators=[], prefix_operators=[], qualifier=zone, selectors=[], type_arguments=None)], member=getNodeIdsInZone, postfix_operators=[], prefix_operators=[], qualifier=cluster, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\n"), operator=+)], member=append, postfix_operators=[], prefix_operators=[], qualifier=builder, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getZones, postfix_operators=[], prefix_operators=[], qualifier=cluster, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=zone)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Zone, sub_type=None))), label=None) call[builder.append, parameter[literal["\n"]]] call[builder.append, parameter[literal["Number of partitions per node:\n"]]] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\tNode ID: "), operandr=MethodInvocation(arguments=[], member=getId, postfix_operators=[], prefix_operators=[], qualifier=node, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" - "), operator=+), operandr=MethodInvocation(arguments=[], member=getNumberOfPartitions, postfix_operators=[], prefix_operators=[], qualifier=node, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" ("), operator=+), operandr=MethodInvocation(arguments=[], member=getHost, postfix_operators=[], prefix_operators=[], qualifier=node, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=")\n"), operator=+)], member=append, postfix_operators=[], prefix_operators=[], qualifier=builder, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getNodes, postfix_operators=[], prefix_operators=[], qualifier=cluster, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=node)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Node, sub_type=None))), label=None) call[builder.append, parameter[literal["\n"]]] if[binary_operation[call[cluster.getZones, parameter[]], >, literal[1]]] begin[{] call[builder.append, parameter[literal["ZONE-PARTITION SUMMARY:\n"]]] call[builder.append, parameter[literal["\n"]]] call[builder.append, parameter[literal["Partitions in each zone:\n"]]] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\tZone: "), operandr=MethodInvocation(arguments=[], member=getId, postfix_operators=[], prefix_operators=[], qualifier=zone, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" - "), operator=+), operandr=MethodInvocation(arguments=[MemberReference(member=cluster, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getId, postfix_operators=[], prefix_operators=[], qualifier=zone, selectors=[], type_arguments=None)], member=compressedListOfPartitionsInZone, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\n"), operator=+)], member=append, postfix_operators=[], prefix_operators=[], qualifier=builder, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getZones, postfix_operators=[], prefix_operators=[], qualifier=cluster, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=zone)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Zone, sub_type=None))), label=None) call[builder.append, parameter[literal["\n"]]] call[builder.append, parameter[literal["Contiguous partition run lengths in each zone ('{run length : count}'):\n"]]] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\tZone: "), operandr=MethodInvocation(arguments=[], member=getId, postfix_operators=[], prefix_operators=[], qualifier=zone, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" - "), operator=+), operandr=MethodInvocation(arguments=[MemberReference(member=cluster, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getId, postfix_operators=[], prefix_operators=[], qualifier=zone, selectors=[], type_arguments=None)], member=getPrettyMapOfContiguousPartitionRunLengths, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\n"), operator=+)], member=append, postfix_operators=[], prefix_operators=[], qualifier=builder, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getZones, postfix_operators=[], prefix_operators=[], qualifier=cluster, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=zone)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Zone, sub_type=None))), label=None) call[builder.append, parameter[literal["\n"]]] call[builder.append, parameter[literal["The following nodes have hot partitions:\n"]]] call[builder.append, parameter[call[.getHotPartitionsDueToContiguity, parameter[member[.cluster], literal[5]]]]] call[builder.append, parameter[literal["\n"]]] else begin[{] None end[}] return[call[builder.toString, parameter[]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[String] identifier[verboseClusterDump] operator[SEP] Keyword[final] identifier[Cluster] identifier[cluster] operator[SEP] { identifier[StringBuilder] identifier[builder] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[builder] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[Map] operator[<] identifier[Integer] , identifier[Integer] operator[>] identifier[zoneIdToPartitionCount] operator[=] identifier[Maps] operator[SEP] identifier[newHashMap] operator[SEP] operator[SEP] operator[SEP] identifier[Map] operator[<] identifier[Integer] , identifier[Integer] operator[>] identifier[zoneIdToNodeCount] operator[=] identifier[Maps] operator[SEP] identifier[newHashMap] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Zone] identifier[zone] operator[:] identifier[cluster] operator[SEP] identifier[getZones] operator[SEP] operator[SEP] operator[SEP] { identifier[zoneIdToPartitionCount] operator[SEP] identifier[put] operator[SEP] identifier[zone] operator[SEP] identifier[getId] operator[SEP] operator[SEP] , Other[0] operator[SEP] operator[SEP] identifier[zoneIdToNodeCount] operator[SEP] identifier[put] operator[SEP] identifier[zone] operator[SEP] identifier[getId] operator[SEP] operator[SEP] , Other[0] operator[SEP] operator[SEP] } Keyword[for] operator[SEP] identifier[Node] identifier[node] operator[:] identifier[cluster] operator[SEP] identifier[getNodes] operator[SEP] operator[SEP] operator[SEP] { identifier[zoneIdToPartitionCount] operator[SEP] identifier[put] operator[SEP] identifier[node] operator[SEP] identifier[getZoneId] operator[SEP] operator[SEP] , identifier[zoneIdToPartitionCount] operator[SEP] identifier[get] operator[SEP] identifier[node] operator[SEP] identifier[getZoneId] operator[SEP] operator[SEP] operator[SEP] operator[+] identifier[node] operator[SEP] identifier[getNumberOfPartitions] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[zoneIdToNodeCount] operator[SEP] identifier[put] operator[SEP] identifier[node] operator[SEP] identifier[getZoneId] operator[SEP] operator[SEP] , identifier[zoneIdToNodeCount] operator[SEP] identifier[get] operator[SEP] identifier[node] operator[SEP] identifier[getZoneId] operator[SEP] operator[SEP] operator[SEP] operator[+] Other[1] operator[SEP] operator[SEP] } identifier[builder] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[builder] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Zone] identifier[zone] operator[:] identifier[cluster] operator[SEP] identifier[getZones] operator[SEP] operator[SEP] operator[SEP] { identifier[builder] operator[SEP] identifier[append] operator[SEP] literal[String] operator[+] identifier[zone] operator[SEP] identifier[getId] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[zoneIdToPartitionCount] operator[SEP] identifier[get] operator[SEP] identifier[zone] operator[SEP] identifier[getId] operator[SEP] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] } identifier[builder] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[builder] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Zone] identifier[zone] operator[:] identifier[cluster] operator[SEP] identifier[getZones] operator[SEP] operator[SEP] operator[SEP] { identifier[builder] operator[SEP] identifier[append] operator[SEP] literal[String] operator[+] identifier[zone] operator[SEP] identifier[getId] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[zoneIdToNodeCount] operator[SEP] identifier[get] operator[SEP] identifier[zone] operator[SEP] identifier[getId] operator[SEP] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] } identifier[builder] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[builder] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Zone] identifier[zone] operator[:] identifier[cluster] operator[SEP] identifier[getZones] operator[SEP] operator[SEP] operator[SEP] { identifier[builder] operator[SEP] identifier[append] operator[SEP] literal[String] operator[+] identifier[zone] operator[SEP] identifier[getId] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[cluster] operator[SEP] identifier[getNodeIdsInZone] operator[SEP] identifier[zone] operator[SEP] identifier[getId] operator[SEP] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] } identifier[builder] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[builder] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Node] identifier[node] operator[:] identifier[cluster] operator[SEP] identifier[getNodes] operator[SEP] operator[SEP] operator[SEP] { identifier[builder] operator[SEP] identifier[append] operator[SEP] literal[String] operator[+] identifier[node] operator[SEP] identifier[getId] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[node] operator[SEP] identifier[getNumberOfPartitions] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[node] operator[SEP] identifier[getHost] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] } identifier[builder] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[cluster] operator[SEP] identifier[getZones] operator[SEP] operator[SEP] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[>] Other[1] operator[SEP] { identifier[builder] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[builder] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[builder] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Zone] identifier[zone] operator[:] identifier[cluster] operator[SEP] identifier[getZones] operator[SEP] operator[SEP] operator[SEP] { identifier[builder] operator[SEP] identifier[append] operator[SEP] literal[String] operator[+] identifier[zone] operator[SEP] identifier[getId] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[compressedListOfPartitionsInZone] operator[SEP] identifier[cluster] , identifier[zone] operator[SEP] identifier[getId] operator[SEP] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] } identifier[builder] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[builder] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Zone] identifier[zone] operator[:] identifier[cluster] operator[SEP] identifier[getZones] operator[SEP] operator[SEP] operator[SEP] { identifier[builder] operator[SEP] identifier[append] operator[SEP] literal[String] operator[+] identifier[zone] operator[SEP] identifier[getId] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[getPrettyMapOfContiguousPartitionRunLengths] operator[SEP] identifier[cluster] , identifier[zone] operator[SEP] identifier[getId] operator[SEP] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] } identifier[builder] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[builder] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[builder] operator[SEP] identifier[append] operator[SEP] identifier[getHotPartitionsDueToContiguity] operator[SEP] identifier[cluster] , Other[5] operator[SEP] operator[SEP] operator[SEP] identifier[builder] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[return] identifier[builder] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] }
public Observable<ServiceResponse<List<AzureResourceSkuInner>>> listSkusByResourceWithServiceResponseAsync(String resourceGroupName, String clusterName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } if (clusterName == null) { throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); } if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } if (this.client.apiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); } return service.listSkusByResource(resourceGroupName, clusterName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<List<AzureResourceSkuInner>>>>() { @Override public Observable<ServiceResponse<List<AzureResourceSkuInner>>> call(Response<ResponseBody> response) { try { ServiceResponse<PageImpl<AzureResourceSkuInner>> result = listSkusByResourceDelegate(response); List<AzureResourceSkuInner> items = null; if (result.body() != null) { items = result.body().items(); } ServiceResponse<List<AzureResourceSkuInner>> clientResponse = new ServiceResponse<List<AzureResourceSkuInner>>(items, result.response()); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); } } }); }
class class_name[name] begin[{] method[listSkusByResourceWithServiceResponseAsync, return_type[type[Observable]], modifier[public], parameter[resourceGroupName, clusterName]] begin[{] if[binary_operation[member[.resourceGroupName], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Parameter resourceGroupName is required and cannot be null.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None) else begin[{] None end[}] if[binary_operation[member[.clusterName], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Parameter clusterName is required and cannot be null.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None) else begin[{] None end[}] if[binary_operation[THIS[member[None.client]call[None.subscriptionId, parameter[]]], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Parameter this.client.subscriptionId() is required and cannot be null.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None) else begin[{] None end[}] if[binary_operation[THIS[member[None.client]call[None.apiVersion, parameter[]]], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Parameter this.client.apiVersion() is required and cannot be null.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None) else begin[{] None end[}] return[call[service.listSkusByResource, parameter[member[.resourceGroupName], member[.clusterName], THIS[member[None.client]call[None.subscriptionId, parameter[]]], THIS[member[None.client]call[None.apiVersion, parameter[]]], THIS[member[None.client]call[None.acceptLanguage, parameter[]]], THIS[member[None.client]call[None.userAgent, parameter[]]]]]] end[}] END[}]
Keyword[public] identifier[Observable] operator[<] identifier[ServiceResponse] operator[<] identifier[List] operator[<] identifier[AzureResourceSkuInner] operator[>] operator[>] operator[>] identifier[listSkusByResourceWithServiceResponseAsync] operator[SEP] identifier[String] identifier[resourceGroupName] , identifier[String] identifier[clusterName] operator[SEP] { Keyword[if] operator[SEP] identifier[resourceGroupName] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[clusterName] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[client] operator[SEP] identifier[subscriptionId] operator[SEP] operator[SEP] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[client] operator[SEP] identifier[apiVersion] operator[SEP] operator[SEP] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[return] identifier[service] operator[SEP] identifier[listSkusByResource] operator[SEP] identifier[resourceGroupName] , identifier[clusterName] , Keyword[this] operator[SEP] identifier[client] operator[SEP] identifier[subscriptionId] operator[SEP] operator[SEP] , Keyword[this] operator[SEP] identifier[client] operator[SEP] identifier[apiVersion] operator[SEP] operator[SEP] , Keyword[this] operator[SEP] identifier[client] operator[SEP] identifier[acceptLanguage] operator[SEP] operator[SEP] , Keyword[this] operator[SEP] identifier[client] operator[SEP] identifier[userAgent] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[flatMap] operator[SEP] Keyword[new] identifier[Func1] operator[<] identifier[Response] operator[<] identifier[ResponseBody] operator[>] , identifier[Observable] operator[<] identifier[ServiceResponse] operator[<] identifier[List] operator[<] identifier[AzureResourceSkuInner] operator[>] operator[>] operator[>] operator[>] operator[SEP] operator[SEP] { annotation[@] identifier[Override] Keyword[public] identifier[Observable] operator[<] identifier[ServiceResponse] operator[<] identifier[List] operator[<] identifier[AzureResourceSkuInner] operator[>] operator[>] operator[>] identifier[call] operator[SEP] identifier[Response] operator[<] identifier[ResponseBody] operator[>] identifier[response] operator[SEP] { Keyword[try] { identifier[ServiceResponse] operator[<] identifier[PageImpl] operator[<] identifier[AzureResourceSkuInner] operator[>] operator[>] identifier[result] operator[=] identifier[listSkusByResourceDelegate] operator[SEP] identifier[response] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[AzureResourceSkuInner] operator[>] identifier[items] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[result] operator[SEP] identifier[body] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] { identifier[items] operator[=] identifier[result] operator[SEP] identifier[body] operator[SEP] operator[SEP] operator[SEP] identifier[items] operator[SEP] operator[SEP] operator[SEP] } identifier[ServiceResponse] operator[<] identifier[List] operator[<] identifier[AzureResourceSkuInner] operator[>] operator[>] identifier[clientResponse] operator[=] Keyword[new] identifier[ServiceResponse] operator[<] identifier[List] operator[<] identifier[AzureResourceSkuInner] operator[>] operator[>] operator[SEP] identifier[items] , identifier[result] operator[SEP] identifier[response] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[Observable] operator[SEP] identifier[just] operator[SEP] identifier[clientResponse] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Throwable] identifier[t] operator[SEP] { Keyword[return] identifier[Observable] operator[SEP] identifier[error] operator[SEP] identifier[t] operator[SEP] operator[SEP] } } } operator[SEP] operator[SEP] }
public Observable<VaultInner> updateAsync(String resourceGroupName, String vaultName, PatchVault vault) { return updateWithServiceResponseAsync(resourceGroupName, vaultName, vault).map(new Func1<ServiceResponse<VaultInner>, VaultInner>() { @Override public VaultInner call(ServiceResponse<VaultInner> response) { return response.body(); } }); }
class class_name[name] begin[{] method[updateAsync, return_type[type[Observable]], modifier[public], parameter[resourceGroupName, vaultName, vault]] begin[{] return[call[.updateWithServiceResponseAsync, parameter[member[.resourceGroupName], member[.vaultName], member[.vault]]]] end[}] END[}]
Keyword[public] identifier[Observable] operator[<] identifier[VaultInner] operator[>] identifier[updateAsync] operator[SEP] identifier[String] identifier[resourceGroupName] , identifier[String] identifier[vaultName] , identifier[PatchVault] identifier[vault] operator[SEP] { Keyword[return] identifier[updateWithServiceResponseAsync] operator[SEP] identifier[resourceGroupName] , identifier[vaultName] , identifier[vault] operator[SEP] operator[SEP] identifier[map] operator[SEP] Keyword[new] identifier[Func1] operator[<] identifier[ServiceResponse] operator[<] identifier[VaultInner] operator[>] , identifier[VaultInner] operator[>] operator[SEP] operator[SEP] { annotation[@] identifier[Override] Keyword[public] identifier[VaultInner] identifier[call] operator[SEP] identifier[ServiceResponse] operator[<] identifier[VaultInner] operator[>] identifier[response] operator[SEP] { Keyword[return] identifier[response] operator[SEP] identifier[body] operator[SEP] operator[SEP] operator[SEP] } } operator[SEP] operator[SEP] }
private PopupMenu createMenu(View v, String[] menuArray) { PopupMenu popupMenu = new PopupMenu(this, v); Menu menu = popupMenu.getMenu(); for (int i = 0; i < menuArray.length; i++) { String menuText = menuArray[i]; menu.add(0, i, i, menuText); } return popupMenu; }
class class_name[name] begin[{] method[createMenu, return_type[type[PopupMenu]], modifier[private], parameter[v, menuArray]] begin[{] local_variable[type[PopupMenu], popupMenu] local_variable[type[Menu], menu] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=menuArray, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), name=menuText)], 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=0), MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=menuText, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=menu, 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=menuArray, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) return[member[.popupMenu]] end[}] END[}]
Keyword[private] identifier[PopupMenu] identifier[createMenu] operator[SEP] identifier[View] identifier[v] , identifier[String] operator[SEP] operator[SEP] identifier[menuArray] operator[SEP] { identifier[PopupMenu] identifier[popupMenu] operator[=] Keyword[new] identifier[PopupMenu] operator[SEP] Keyword[this] , identifier[v] operator[SEP] operator[SEP] identifier[Menu] identifier[menu] operator[=] identifier[popupMenu] operator[SEP] identifier[getMenu] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[menuArray] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[String] identifier[menuText] operator[=] identifier[menuArray] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[menu] operator[SEP] identifier[add] operator[SEP] Other[0] , identifier[i] , identifier[i] , identifier[menuText] operator[SEP] operator[SEP] } Keyword[return] identifier[popupMenu] operator[SEP] }
@DoesServiceRequest public ResultSegment<ListFileItem> listFilesAndDirectoriesSegmented() throws StorageException { return this.listFilesAndDirectoriesSegmented(null /* prefix */, null /* maxResults */, null /* continuationToken */, null /* options */, null /* opContext */); }
class class_name[name] begin[{] method[listFilesAndDirectoriesSegmented, return_type[type[ResultSegment]], modifier[public], parameter[]] begin[{] return[THIS[call[None.listFilesAndDirectoriesSegmented, parameter[literal[null], literal[null], literal[null], literal[null], literal[null]]]]] end[}] END[}]
annotation[@] identifier[DoesServiceRequest] Keyword[public] identifier[ResultSegment] operator[<] identifier[ListFileItem] operator[>] identifier[listFilesAndDirectoriesSegmented] operator[SEP] operator[SEP] Keyword[throws] identifier[StorageException] { Keyword[return] Keyword[this] operator[SEP] identifier[listFilesAndDirectoriesSegmented] operator[SEP] Other[null] , Other[null] , Other[null] , Other[null] , Other[null] operator[SEP] operator[SEP] }
private AbstractInvocation dequeue() { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "dequeue"); AbstractInvocation invocation; synchronized (barrier) { invocation = queue.remove(0); } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "dequeue", invocation); return invocation; }
class class_name[name] begin[{] method[dequeue, return_type[type[AbstractInvocation]], modifier[private], parameter[]] begin[{] if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{] call[SibTr.entry, parameter[THIS[], member[.tc], literal["dequeue"]]] else begin[{] None end[}] local_variable[type[AbstractInvocation], invocation] SYNCHRONIZED[member[.barrier]] BEGIN[{] assign[member[.invocation], call[queue.remove, parameter[literal[0]]]] END[}] if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{] call[SibTr.exit, parameter[THIS[], member[.tc], literal["dequeue"], member[.invocation]]] else begin[{] None end[}] return[member[.invocation]] end[}] END[}]
Keyword[private] identifier[AbstractInvocation] identifier[dequeue] 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[entry] operator[SEP] Keyword[this] , identifier[tc] , literal[String] operator[SEP] operator[SEP] identifier[AbstractInvocation] identifier[invocation] operator[SEP] Keyword[synchronized] operator[SEP] identifier[barrier] operator[SEP] { identifier[invocation] operator[=] identifier[queue] operator[SEP] identifier[remove] operator[SEP] Other[0] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[exit] operator[SEP] Keyword[this] , identifier[tc] , literal[String] , identifier[invocation] operator[SEP] operator[SEP] Keyword[return] identifier[invocation] operator[SEP] }
public CompromisedCredentialsRiskConfigurationType withEventFilter(String... eventFilter) { if (this.eventFilter == null) { setEventFilter(new java.util.ArrayList<String>(eventFilter.length)); } for (String ele : eventFilter) { this.eventFilter.add(ele); } return this; }
class class_name[name] begin[{] method[withEventFilter, return_type[type[CompromisedCredentialsRiskConfigurationType]], modifier[public], parameter[eventFilter]] begin[{] if[binary_operation[THIS[member[None.eventFilter]], ==, literal[null]]] begin[{] call[.setEventFilter, parameter[ClassCreator(arguments=[MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=eventFilter, 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=String, 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=eventFilter, 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=eventFilter, 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=String, sub_type=None))), label=None) return[THIS[]] end[}] END[}]
Keyword[public] identifier[CompromisedCredentialsRiskConfigurationType] identifier[withEventFilter] operator[SEP] identifier[String] operator[...] identifier[eventFilter] operator[SEP] { Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[eventFilter] operator[==] Other[null] operator[SEP] { identifier[setEventFilter] operator[SEP] Keyword[new] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[ArrayList] operator[<] identifier[String] operator[>] operator[SEP] identifier[eventFilter] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] } Keyword[for] operator[SEP] identifier[String] identifier[ele] operator[:] identifier[eventFilter] operator[SEP] { Keyword[this] operator[SEP] identifier[eventFilter] operator[SEP] identifier[add] operator[SEP] identifier[ele] operator[SEP] operator[SEP] } Keyword[return] Keyword[this] operator[SEP] }
public void configureForSubprocessGobbler(Props props, String logPattern) { if (isAllLogsToConsoleEnabled(props)) { LoggerContext ctx = getRootContext(); ctx.getLogger(ROOT_LOGGER_NAME).addAppender(newConsoleAppender(ctx, "root_console", logPattern)); } }
class class_name[name] begin[{] method[configureForSubprocessGobbler, return_type[void], modifier[public], parameter[props, logPattern]] begin[{] if[call[.isAllLogsToConsoleEnabled, parameter[member[.props]]]] begin[{] local_variable[type[LoggerContext], ctx] call[ctx.getLogger, parameter[member[.ROOT_LOGGER_NAME]]] else begin[{] None end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[configureForSubprocessGobbler] operator[SEP] identifier[Props] identifier[props] , identifier[String] identifier[logPattern] operator[SEP] { Keyword[if] operator[SEP] identifier[isAllLogsToConsoleEnabled] operator[SEP] identifier[props] operator[SEP] operator[SEP] { identifier[LoggerContext] identifier[ctx] operator[=] identifier[getRootContext] operator[SEP] operator[SEP] operator[SEP] identifier[ctx] operator[SEP] identifier[getLogger] operator[SEP] identifier[ROOT_LOGGER_NAME] operator[SEP] operator[SEP] identifier[addAppender] operator[SEP] identifier[newConsoleAppender] operator[SEP] identifier[ctx] , literal[String] , identifier[logPattern] operator[SEP] operator[SEP] operator[SEP] } }
private void getMoreEvents(Calendar day) { // Get more events if the month is changed. if (mEventRects == null) mEventRects = new ArrayList<EventRect>(); if (mWeekViewLoader == null && !isInEditMode()) throw new IllegalStateException("You must provide a MonthChangeListener"); // If a refresh was requested then reset some variables. if (mRefreshEvents) { mEventRects.clear(); mPreviousPeriodEvents = null; mCurrentPeriodEvents = null; mNextPeriodEvents = null; mFetchedPeriod = -1; } if (mWeekViewLoader != null){ int periodToFetch = (int) mWeekViewLoader.toWeekViewPeriodIndex(day); if (!isInEditMode() && (mFetchedPeriod < 0 || mFetchedPeriod != periodToFetch || mRefreshEvents)) { List<? extends WeekViewEvent> previousPeriodEvents = null; List<? extends WeekViewEvent> currentPeriodEvents = null; List<? extends WeekViewEvent> nextPeriodEvents = null; if (mPreviousPeriodEvents != null && mCurrentPeriodEvents != null && mNextPeriodEvents != null){ if (periodToFetch == mFetchedPeriod-1){ currentPeriodEvents = mPreviousPeriodEvents; nextPeriodEvents = mCurrentPeriodEvents; } else if (periodToFetch == mFetchedPeriod){ previousPeriodEvents = mPreviousPeriodEvents; currentPeriodEvents = mCurrentPeriodEvents; nextPeriodEvents = mNextPeriodEvents; } else if (periodToFetch == mFetchedPeriod+1){ previousPeriodEvents = mCurrentPeriodEvents; currentPeriodEvents = mNextPeriodEvents; } } if (currentPeriodEvents == null) currentPeriodEvents = mWeekViewLoader.onLoad(periodToFetch); if (previousPeriodEvents == null) previousPeriodEvents = mWeekViewLoader.onLoad(periodToFetch-1); if (nextPeriodEvents == null) nextPeriodEvents = mWeekViewLoader.onLoad(periodToFetch+1); // Clear events. mEventRects.clear(); sortAndCacheEvents(previousPeriodEvents); sortAndCacheEvents(currentPeriodEvents); sortAndCacheEvents(nextPeriodEvents); calculateHeaderHeight(); mPreviousPeriodEvents = previousPeriodEvents; mCurrentPeriodEvents = currentPeriodEvents; mNextPeriodEvents = nextPeriodEvents; mFetchedPeriod = periodToFetch; } } // Prepare to calculate positions of each events. List<EventRect> tempEvents = mEventRects; mEventRects = new ArrayList<EventRect>(); // Iterate through each day with events to calculate the position of the events. while (tempEvents.size() > 0) { ArrayList<EventRect> eventRects = new ArrayList<>(tempEvents.size()); // Get first event for a day. EventRect eventRect1 = tempEvents.remove(0); eventRects.add(eventRect1); int i = 0; while (i < tempEvents.size()) { // Collect all other events for same day. EventRect eventRect2 = tempEvents.get(i); if (isSameDay(eventRect1.event.getStartTime(), eventRect2.event.getStartTime())) { tempEvents.remove(i); eventRects.add(eventRect2); } else { i++; } } computePositionOfEvents(eventRects); } }
class class_name[name] begin[{] method[getMoreEvents, return_type[void], modifier[private], parameter[day]] begin[{] if[binary_operation[member[.mEventRects], ==, literal[null]]] begin[{] assign[member[.mEventRects], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=EventRect, sub_type=None))], dimensions=None, name=ArrayList, sub_type=None))] else begin[{] None end[}] if[binary_operation[binary_operation[member[.mWeekViewLoader], ==, literal[null]], &&, call[.isInEditMode, parameter[]]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="You must provide a MonthChangeListener")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalStateException, sub_type=None)), label=None) else begin[{] None end[}] if[member[.mRefreshEvents]] begin[{] call[mEventRects.clear, parameter[]] assign[member[.mPreviousPeriodEvents], literal[null]] assign[member[.mCurrentPeriodEvents], literal[null]] assign[member[.mNextPeriodEvents], literal[null]] assign[member[.mFetchedPeriod], literal[1]] else begin[{] None end[}] if[binary_operation[member[.mWeekViewLoader], !=, literal[null]]] begin[{] local_variable[type[int], periodToFetch] if[binary_operation[call[.isInEditMode, parameter[]], &&, binary_operation[binary_operation[binary_operation[member[.mFetchedPeriod], <, literal[0]], ||, binary_operation[member[.mFetchedPeriod], !=, member[.periodToFetch]]], ||, member[.mRefreshEvents]]]] begin[{] local_variable[type[List], previousPeriodEvents] local_variable[type[List], currentPeriodEvents] local_variable[type[List], nextPeriodEvents] if[binary_operation[binary_operation[binary_operation[member[.mPreviousPeriodEvents], !=, literal[null]], &&, binary_operation[member[.mCurrentPeriodEvents], !=, literal[null]]], &&, binary_operation[member[.mNextPeriodEvents], !=, literal[null]]]] begin[{] if[binary_operation[member[.periodToFetch], ==, binary_operation[member[.mFetchedPeriod], -, literal[1]]]] begin[{] assign[member[.currentPeriodEvents], member[.mPreviousPeriodEvents]] assign[member[.nextPeriodEvents], member[.mCurrentPeriodEvents]] else begin[{] if[binary_operation[member[.periodToFetch], ==, member[.mFetchedPeriod]]] begin[{] assign[member[.previousPeriodEvents], member[.mPreviousPeriodEvents]] assign[member[.currentPeriodEvents], member[.mCurrentPeriodEvents]] assign[member[.nextPeriodEvents], member[.mNextPeriodEvents]] else begin[{] if[binary_operation[member[.periodToFetch], ==, binary_operation[member[.mFetchedPeriod], +, literal[1]]]] begin[{] assign[member[.previousPeriodEvents], member[.mCurrentPeriodEvents]] assign[member[.currentPeriodEvents], member[.mNextPeriodEvents]] else begin[{] None end[}] end[}] end[}] else begin[{] None end[}] if[binary_operation[member[.currentPeriodEvents], ==, literal[null]]] begin[{] assign[member[.currentPeriodEvents], call[mWeekViewLoader.onLoad, parameter[member[.periodToFetch]]]] else begin[{] None end[}] if[binary_operation[member[.previousPeriodEvents], ==, literal[null]]] begin[{] assign[member[.previousPeriodEvents], call[mWeekViewLoader.onLoad, parameter[binary_operation[member[.periodToFetch], -, literal[1]]]]] else begin[{] None end[}] if[binary_operation[member[.nextPeriodEvents], ==, literal[null]]] begin[{] assign[member[.nextPeriodEvents], call[mWeekViewLoader.onLoad, parameter[binary_operation[member[.periodToFetch], +, literal[1]]]]] else begin[{] None end[}] call[mEventRects.clear, parameter[]] call[.sortAndCacheEvents, parameter[member[.previousPeriodEvents]]] call[.sortAndCacheEvents, parameter[member[.currentPeriodEvents]]] call[.sortAndCacheEvents, parameter[member[.nextPeriodEvents]]] call[.calculateHeaderHeight, parameter[]] assign[member[.mPreviousPeriodEvents], member[.previousPeriodEvents]] assign[member[.mCurrentPeriodEvents], member[.currentPeriodEvents]] assign[member[.mNextPeriodEvents], member[.nextPeriodEvents]] assign[member[.mFetchedPeriod], member[.periodToFetch]] else begin[{] None end[}] else begin[{] None end[}] local_variable[type[List], tempEvents] assign[member[.mEventRects], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=EventRect, sub_type=None))], dimensions=None, name=ArrayList, sub_type=None))] while[binary_operation[call[tempEvents.size, parameter[]], >, literal[0]]] begin[{] local_variable[type[ArrayList], eventRects] local_variable[type[EventRect], eventRect1] call[eventRects.add, parameter[member[.eventRect1]]] local_variable[type[int], i] while[binary_operation[member[.i], <, call[tempEvents.size, parameter[]]]] begin[{] local_variable[type[EventRect], eventRect2] if[call[.isSameDay, parameter[call[eventRect1.event.getStartTime, parameter[]], call[eventRect2.event.getStartTime, parameter[]]]]] begin[{] call[tempEvents.remove, parameter[member[.i]]] call[eventRects.add, parameter[member[.eventRect2]]] else begin[{] member[.i] end[}] end[}] call[.computePositionOfEvents, parameter[member[.eventRects]]] end[}] end[}] END[}]
Keyword[private] Keyword[void] identifier[getMoreEvents] operator[SEP] identifier[Calendar] identifier[day] operator[SEP] { Keyword[if] operator[SEP] identifier[mEventRects] operator[==] Other[null] operator[SEP] identifier[mEventRects] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[EventRect] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[mWeekViewLoader] operator[==] Other[null] operator[&&] operator[!] identifier[isInEditMode] operator[SEP] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[mRefreshEvents] operator[SEP] { identifier[mEventRects] operator[SEP] identifier[clear] operator[SEP] operator[SEP] operator[SEP] identifier[mPreviousPeriodEvents] operator[=] Other[null] operator[SEP] identifier[mCurrentPeriodEvents] operator[=] Other[null] operator[SEP] identifier[mNextPeriodEvents] operator[=] Other[null] operator[SEP] identifier[mFetchedPeriod] operator[=] operator[-] Other[1] operator[SEP] } Keyword[if] operator[SEP] identifier[mWeekViewLoader] operator[!=] Other[null] operator[SEP] { Keyword[int] identifier[periodToFetch] operator[=] operator[SEP] Keyword[int] operator[SEP] identifier[mWeekViewLoader] operator[SEP] identifier[toWeekViewPeriodIndex] operator[SEP] identifier[day] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[isInEditMode] operator[SEP] operator[SEP] operator[&&] operator[SEP] identifier[mFetchedPeriod] operator[<] Other[0] operator[||] identifier[mFetchedPeriod] operator[!=] identifier[periodToFetch] operator[||] identifier[mRefreshEvents] operator[SEP] operator[SEP] { identifier[List] operator[<] operator[?] Keyword[extends] identifier[WeekViewEvent] operator[>] identifier[previousPeriodEvents] operator[=] Other[null] operator[SEP] identifier[List] operator[<] operator[?] Keyword[extends] identifier[WeekViewEvent] operator[>] identifier[currentPeriodEvents] operator[=] Other[null] operator[SEP] identifier[List] operator[<] operator[?] Keyword[extends] identifier[WeekViewEvent] operator[>] identifier[nextPeriodEvents] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[mPreviousPeriodEvents] operator[!=] Other[null] operator[&&] identifier[mCurrentPeriodEvents] operator[!=] Other[null] operator[&&] identifier[mNextPeriodEvents] operator[!=] Other[null] operator[SEP] { Keyword[if] operator[SEP] identifier[periodToFetch] operator[==] identifier[mFetchedPeriod] operator[-] Other[1] operator[SEP] { identifier[currentPeriodEvents] operator[=] identifier[mPreviousPeriodEvents] operator[SEP] identifier[nextPeriodEvents] operator[=] identifier[mCurrentPeriodEvents] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[periodToFetch] operator[==] identifier[mFetchedPeriod] operator[SEP] { identifier[previousPeriodEvents] operator[=] identifier[mPreviousPeriodEvents] operator[SEP] identifier[currentPeriodEvents] operator[=] identifier[mCurrentPeriodEvents] operator[SEP] identifier[nextPeriodEvents] operator[=] identifier[mNextPeriodEvents] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[periodToFetch] operator[==] identifier[mFetchedPeriod] operator[+] Other[1] operator[SEP] { identifier[previousPeriodEvents] operator[=] identifier[mCurrentPeriodEvents] operator[SEP] identifier[currentPeriodEvents] operator[=] identifier[mNextPeriodEvents] operator[SEP] } } Keyword[if] operator[SEP] identifier[currentPeriodEvents] operator[==] Other[null] operator[SEP] identifier[currentPeriodEvents] operator[=] identifier[mWeekViewLoader] operator[SEP] identifier[onLoad] operator[SEP] identifier[periodToFetch] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[previousPeriodEvents] operator[==] Other[null] operator[SEP] identifier[previousPeriodEvents] operator[=] identifier[mWeekViewLoader] operator[SEP] identifier[onLoad] operator[SEP] identifier[periodToFetch] operator[-] Other[1] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[nextPeriodEvents] operator[==] Other[null] operator[SEP] identifier[nextPeriodEvents] operator[=] identifier[mWeekViewLoader] operator[SEP] identifier[onLoad] operator[SEP] identifier[periodToFetch] operator[+] Other[1] operator[SEP] operator[SEP] identifier[mEventRects] operator[SEP] identifier[clear] operator[SEP] operator[SEP] operator[SEP] identifier[sortAndCacheEvents] operator[SEP] identifier[previousPeriodEvents] operator[SEP] operator[SEP] identifier[sortAndCacheEvents] operator[SEP] identifier[currentPeriodEvents] operator[SEP] operator[SEP] identifier[sortAndCacheEvents] operator[SEP] identifier[nextPeriodEvents] operator[SEP] operator[SEP] identifier[calculateHeaderHeight] operator[SEP] operator[SEP] operator[SEP] identifier[mPreviousPeriodEvents] operator[=] identifier[previousPeriodEvents] operator[SEP] identifier[mCurrentPeriodEvents] operator[=] identifier[currentPeriodEvents] operator[SEP] identifier[mNextPeriodEvents] operator[=] identifier[nextPeriodEvents] operator[SEP] identifier[mFetchedPeriod] operator[=] identifier[periodToFetch] operator[SEP] } } identifier[List] operator[<] identifier[EventRect] operator[>] identifier[tempEvents] operator[=] identifier[mEventRects] operator[SEP] identifier[mEventRects] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[EventRect] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[tempEvents] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] { identifier[ArrayList] operator[<] identifier[EventRect] operator[>] identifier[eventRects] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] identifier[tempEvents] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[EventRect] identifier[eventRect1] operator[=] identifier[tempEvents] operator[SEP] identifier[remove] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[eventRects] operator[SEP] identifier[add] operator[SEP] identifier[eventRect1] operator[SEP] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] Keyword[while] operator[SEP] identifier[i] operator[<] identifier[tempEvents] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] { identifier[EventRect] identifier[eventRect2] operator[=] identifier[tempEvents] operator[SEP] identifier[get] operator[SEP] identifier[i] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[isSameDay] operator[SEP] identifier[eventRect1] operator[SEP] identifier[event] operator[SEP] identifier[getStartTime] operator[SEP] operator[SEP] , identifier[eventRect2] operator[SEP] identifier[event] operator[SEP] identifier[getStartTime] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { identifier[tempEvents] operator[SEP] identifier[remove] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[eventRects] operator[SEP] identifier[add] operator[SEP] identifier[eventRect2] operator[SEP] operator[SEP] } Keyword[else] { identifier[i] operator[++] operator[SEP] } } identifier[computePositionOfEvents] operator[SEP] identifier[eventRects] operator[SEP] operator[SEP] } }
@SuppressWarnings("nullness") private static String attributeValueToString(AttributeValue attributeValue) { return attributeValue.match( returnToString, returnToString, returnToString, returnToString, Functions.<String>returnConstant("")); }
class class_name[name] begin[{] method[attributeValueToString, return_type[type[String]], modifier[private static], parameter[attributeValue]] begin[{] return[call[attributeValue.match, parameter[member[.returnToString], member[.returnToString], member[.returnToString], member[.returnToString], call[.Functions, parameter[literal[""]]]]]] end[}] END[}]
annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] Keyword[private] Keyword[static] identifier[String] identifier[attributeValueToString] operator[SEP] identifier[AttributeValue] identifier[attributeValue] operator[SEP] { Keyword[return] identifier[attributeValue] operator[SEP] identifier[match] operator[SEP] identifier[returnToString] , identifier[returnToString] , identifier[returnToString] , identifier[returnToString] , identifier[Functions] operator[SEP] operator[<] identifier[String] operator[>] identifier[returnConstant] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] }
static public String fqnXMLEscape(String fqn) { // Split the fqn into pieces StringBuilder xml = new StringBuilder(); String segment = null; List<String> segments = Escape.backslashsplit(fqn, '/'); for(int i = 1; i < segments.size() - 1; i++) { // skip leading / segment = segments.get(i); segment = Escape.backslashUnescape(segment); // get to raw name segment = Escape.entityEscape(segment, "\"");// '"' -> &quot; segment = Escape.backslashEscape(segment, "/."); // re-escape xml.append("/"); xml.append(segment); } // Last segment might be structure path, so similar processing, // but worry about '.' segment = segments.get(segments.size() - 1); segments = Escape.backslashsplit(segment, '.'); xml.append("/"); for(int i = 0; i < segments.size(); i++) { segment = segments.get(i); segment = Escape.backslashUnescape(segment); // get to raw name segment = Escape.entityEscape(segment, "\"");// '"' -> &quot; segment = Escape.backslashEscape(segment, "/."); // re-escape if(i > 0) xml.append("."); xml.append(segment); } return xml.toString(); }
class class_name[name] begin[{] method[fqnXMLEscape, return_type[type[String]], modifier[public static], parameter[fqn]] begin[{] local_variable[type[StringBuilder], xml] local_variable[type[String], segment] local_variable[type[List], segments] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=segment, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=segments, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=segment, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=segment, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=backslashUnescape, postfix_operators=[], prefix_operators=[], qualifier=Escape, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=segment, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=segment, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\"")], member=entityEscape, postfix_operators=[], prefix_operators=[], qualifier=Escape, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=segment, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=segment, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="/.")], member=backslashEscape, postfix_operators=[], prefix_operators=[], qualifier=Escape, 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=xml, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=segment, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=append, postfix_operators=[], prefix_operators=[], qualifier=xml, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=segments, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) assign[member[.segment], call[segments.get, parameter[binary_operation[call[segments.size, parameter[]], -, literal[1]]]]] assign[member[.segments], call[Escape.backslashsplit, parameter[member[.segment], literal['.']]]] call[xml.append, parameter[literal["/"]]] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=segment, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=segments, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=segment, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=segment, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=backslashUnescape, postfix_operators=[], prefix_operators=[], qualifier=Escape, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=segment, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=segment, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\"")], member=entityEscape, postfix_operators=[], prefix_operators=[], qualifier=Escape, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=segment, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=segment, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="/.")], member=backslashEscape, postfix_operators=[], prefix_operators=[], qualifier=Escape, selectors=[], type_arguments=None)), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=".")], member=append, postfix_operators=[], prefix_operators=[], qualifier=xml, selectors=[], type_arguments=None), label=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=segment, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=append, postfix_operators=[], prefix_operators=[], qualifier=xml, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=segments, selectors=[], type_arguments=None), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) return[call[xml.toString, parameter[]]] end[}] END[}]
Keyword[static] Keyword[public] identifier[String] identifier[fqnXMLEscape] operator[SEP] identifier[String] identifier[fqn] operator[SEP] { identifier[StringBuilder] identifier[xml] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[segment] operator[=] Other[null] operator[SEP] identifier[List] operator[<] identifier[String] operator[>] identifier[segments] operator[=] identifier[Escape] operator[SEP] identifier[backslashsplit] operator[SEP] identifier[fqn] , literal[String] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[1] operator[SEP] identifier[i] operator[<] identifier[segments] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[-] Other[1] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[segment] operator[=] identifier[segments] operator[SEP] identifier[get] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[segment] operator[=] identifier[Escape] operator[SEP] identifier[backslashUnescape] operator[SEP] identifier[segment] operator[SEP] operator[SEP] identifier[segment] operator[=] identifier[Escape] operator[SEP] identifier[entityEscape] operator[SEP] identifier[segment] , literal[String] operator[SEP] operator[SEP] identifier[segment] operator[=] identifier[Escape] operator[SEP] identifier[backslashEscape] operator[SEP] identifier[segment] , literal[String] operator[SEP] operator[SEP] identifier[xml] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[xml] operator[SEP] identifier[append] operator[SEP] identifier[segment] operator[SEP] operator[SEP] } identifier[segment] operator[=] identifier[segments] operator[SEP] identifier[get] operator[SEP] identifier[segments] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[-] Other[1] operator[SEP] operator[SEP] identifier[segments] operator[=] identifier[Escape] operator[SEP] identifier[backslashsplit] operator[SEP] identifier[segment] , literal[String] operator[SEP] operator[SEP] identifier[xml] operator[SEP] identifier[append] 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[segments] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[segment] operator[=] identifier[segments] operator[SEP] identifier[get] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[segment] operator[=] identifier[Escape] operator[SEP] identifier[backslashUnescape] operator[SEP] identifier[segment] operator[SEP] operator[SEP] identifier[segment] operator[=] identifier[Escape] operator[SEP] identifier[entityEscape] operator[SEP] identifier[segment] , literal[String] operator[SEP] operator[SEP] identifier[segment] operator[=] identifier[Escape] operator[SEP] identifier[backslashEscape] operator[SEP] identifier[segment] , literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[i] operator[>] Other[0] operator[SEP] identifier[xml] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[xml] operator[SEP] identifier[append] operator[SEP] identifier[segment] operator[SEP] operator[SEP] } Keyword[return] identifier[xml] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] }
public String info() { String userCode = get("user.code"); if (Strings.isEmpty(userCode)) { return null; } List<User> users = entityDao.get(User.class, "code", userCode); if (!users.isEmpty()) { User user = users.get(0); put("user", Strings.concat(userCode, "(", user.getName(), ")")); } else { put("user", userCode); } Avatar avatar = avatarBase.getAvatar(userCode); put("avatar", avatar); return forward(); }
class class_name[name] begin[{] method[info, return_type[type[String]], modifier[public], parameter[]] begin[{] local_variable[type[String], userCode] if[call[Strings.isEmpty, parameter[member[.userCode]]]] begin[{] return[literal[null]] else begin[{] None end[}] local_variable[type[List], users] if[call[users.isEmpty, parameter[]]] begin[{] local_variable[type[User], user] call[.put, parameter[literal["user"], call[Strings.concat, parameter[member[.userCode], literal["("], call[user.getName, parameter[]], literal[")"]]]]] else begin[{] call[.put, parameter[literal["user"], member[.userCode]]] end[}] local_variable[type[Avatar], avatar] call[.put, parameter[literal["avatar"], member[.avatar]]] return[call[.forward, parameter[]]] end[}] END[}]
Keyword[public] identifier[String] identifier[info] operator[SEP] operator[SEP] { identifier[String] identifier[userCode] operator[=] identifier[get] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[Strings] operator[SEP] identifier[isEmpty] operator[SEP] identifier[userCode] operator[SEP] operator[SEP] { Keyword[return] Other[null] operator[SEP] } identifier[List] operator[<] identifier[User] operator[>] identifier[users] operator[=] identifier[entityDao] operator[SEP] identifier[get] operator[SEP] identifier[User] operator[SEP] Keyword[class] , literal[String] , identifier[userCode] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[users] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { identifier[User] identifier[user] operator[=] identifier[users] operator[SEP] identifier[get] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[put] operator[SEP] literal[String] , identifier[Strings] operator[SEP] identifier[concat] operator[SEP] identifier[userCode] , literal[String] , identifier[user] operator[SEP] identifier[getName] operator[SEP] operator[SEP] , literal[String] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[put] operator[SEP] literal[String] , identifier[userCode] operator[SEP] operator[SEP] } identifier[Avatar] identifier[avatar] operator[=] identifier[avatarBase] operator[SEP] identifier[getAvatar] operator[SEP] identifier[userCode] operator[SEP] operator[SEP] identifier[put] operator[SEP] literal[String] , identifier[avatar] operator[SEP] operator[SEP] Keyword[return] identifier[forward] operator[SEP] operator[SEP] operator[SEP] }
public static void checkNull(Object o, Object value) { if (o != null) error(String.valueOf(value)); }
class class_name[name] begin[{] method[checkNull, return_type[void], modifier[public static], parameter[o, value]] begin[{] if[binary_operation[member[.o], !=, literal[null]]] begin[{] call[.error, parameter[call[String.valueOf, parameter[member[.value]]]]] else begin[{] None end[}] end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[checkNull] operator[SEP] identifier[Object] identifier[o] , identifier[Object] identifier[value] operator[SEP] { Keyword[if] operator[SEP] identifier[o] operator[!=] Other[null] operator[SEP] identifier[error] operator[SEP] identifier[String] operator[SEP] identifier[valueOf] operator[SEP] identifier[value] operator[SEP] operator[SEP] operator[SEP] }
public static Predicate parse(final String predicate, ClassLoader classLoader) { return PredicateParser.parse(predicate, classLoader); }
class class_name[name] begin[{] method[parse, return_type[type[Predicate]], modifier[public static], parameter[predicate, classLoader]] begin[{] return[call[PredicateParser.parse, parameter[member[.predicate], member[.classLoader]]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[Predicate] identifier[parse] operator[SEP] Keyword[final] identifier[String] identifier[predicate] , identifier[ClassLoader] identifier[classLoader] operator[SEP] { Keyword[return] identifier[PredicateParser] operator[SEP] identifier[parse] operator[SEP] identifier[predicate] , identifier[classLoader] operator[SEP] operator[SEP] }
public static <T> Weighted<T> weighted(T value, double weight) { return new Weighted<>(value, weight); }
class class_name[name] begin[{] method[weighted, return_type[type[Weighted]], modifier[public static], parameter[value, weight]] begin[{] return[ClassCreator(arguments=[MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=weight, 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=Weighted, sub_type=None))] end[}] END[}]
Keyword[public] Keyword[static] operator[<] identifier[T] operator[>] identifier[Weighted] operator[<] identifier[T] operator[>] identifier[weighted] operator[SEP] identifier[T] identifier[value] , Keyword[double] identifier[weight] operator[SEP] { Keyword[return] Keyword[new] identifier[Weighted] operator[<] operator[>] operator[SEP] identifier[value] , identifier[weight] operator[SEP] operator[SEP] }
@SuppressWarnings("unchecked") public void reduce(BytesWritable key, Iterator<BytesWritable> iterator, OutputCollector<Text, Text> output, Reporter reporter) throws IOException { writer.write(key, iterator, reporter); }
class class_name[name] begin[{] method[reduce, return_type[void], modifier[public], parameter[key, iterator, output, reporter]] begin[{] call[writer.write, parameter[member[.key], member[.iterator], member[.reporter]]] end[}] END[}]
annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] Keyword[public] Keyword[void] identifier[reduce] operator[SEP] identifier[BytesWritable] identifier[key] , identifier[Iterator] operator[<] identifier[BytesWritable] operator[>] identifier[iterator] , identifier[OutputCollector] operator[<] identifier[Text] , identifier[Text] operator[>] identifier[output] , identifier[Reporter] identifier[reporter] operator[SEP] Keyword[throws] identifier[IOException] { identifier[writer] operator[SEP] identifier[write] operator[SEP] identifier[key] , identifier[iterator] , identifier[reporter] operator[SEP] operator[SEP] }
public boolean isUserInRole(String role) { for (String assRole : getRoles()) { if (assRole.equalsIgnoreCase(role)) { return true; } } return false; }
class class_name[name] begin[{] method[isUserInRole, return_type[type[boolean]], modifier[public], parameter[role]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=role, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equalsIgnoreCase, postfix_operators=[], prefix_operators=[], qualifier=assRole, selectors=[], type_arguments=None), 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=getRoles, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=assRole)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None) return[literal[false]] end[}] END[}]
Keyword[public] Keyword[boolean] identifier[isUserInRole] operator[SEP] identifier[String] identifier[role] operator[SEP] { Keyword[for] operator[SEP] identifier[String] identifier[assRole] operator[:] identifier[getRoles] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[assRole] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] identifier[role] operator[SEP] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } } Keyword[return] literal[boolean] operator[SEP] }
public EClass getFNNRG2() { if (fnnrg2EClass == null) { fnnrg2EClass = (EClass)EPackage.Registry.INSTANCE.getEPackage(AfplibPackage.eNS_URI).getEClassifiers().get(435); } return fnnrg2EClass; }
class class_name[name] begin[{] method[getFNNRG2, return_type[type[EClass]], modifier[public], parameter[]] begin[{] if[binary_operation[member[.fnnrg2EClass], ==, literal[null]]] begin[{] assign[member[.fnnrg2EClass], Cast(expression=MethodInvocation(arguments=[MemberReference(member=eNS_URI, postfix_operators=[], prefix_operators=[], qualifier=AfplibPackage, selectors=[])], member=getEPackage, postfix_operators=[], prefix_operators=[], qualifier=EPackage.Registry.INSTANCE, selectors=[MethodInvocation(arguments=[], member=getEClassifiers, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=435)], member=get, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=EClass, sub_type=None))] else begin[{] None end[}] return[member[.fnnrg2EClass]] end[}] END[}]
Keyword[public] identifier[EClass] identifier[getFNNRG2] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[fnnrg2EClass] operator[==] Other[null] operator[SEP] { identifier[fnnrg2EClass] operator[=] operator[SEP] identifier[EClass] operator[SEP] identifier[EPackage] operator[SEP] identifier[Registry] operator[SEP] identifier[INSTANCE] operator[SEP] identifier[getEPackage] operator[SEP] identifier[AfplibPackage] operator[SEP] identifier[eNS_URI] operator[SEP] operator[SEP] identifier[getEClassifiers] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] Other[435] operator[SEP] operator[SEP] } Keyword[return] identifier[fnnrg2EClass] operator[SEP] }
@Override public ConstructorWriterImpl getConstructorWriter(ClassWriter classWriter) { return new ConstructorWriterImpl((SubWriterHolderWriter) classWriter, classWriter.getTypeElement()); }
class class_name[name] begin[{] method[getConstructorWriter, return_type[type[ConstructorWriterImpl]], modifier[public], parameter[classWriter]] begin[{] return[ClassCreator(arguments=[Cast(expression=MemberReference(member=classWriter, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=SubWriterHolderWriter, sub_type=None)), MethodInvocation(arguments=[], member=getTypeElement, postfix_operators=[], prefix_operators=[], qualifier=classWriter, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ConstructorWriterImpl, sub_type=None))] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[ConstructorWriterImpl] identifier[getConstructorWriter] operator[SEP] identifier[ClassWriter] identifier[classWriter] operator[SEP] { Keyword[return] Keyword[new] identifier[ConstructorWriterImpl] operator[SEP] operator[SEP] identifier[SubWriterHolderWriter] operator[SEP] identifier[classWriter] , identifier[classWriter] operator[SEP] identifier[getTypeElement] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
public static String getRelativeUri(String fromUri, String toUri) { StringBuffer result = new StringBuffer(); int pos = 0; while (true) { int i = fromUri.indexOf('/', pos); int j = toUri.indexOf('/', pos); if ((i == -1) || (i != j) || !fromUri.regionMatches(pos, toUri, pos, i - pos)) { break; } pos = i + 1; } // count hops up from here to the common ancestor for (int i = fromUri.indexOf('/', pos); i > 0; i = fromUri.indexOf('/', i + 1)) { result.append("../"); } // append path down from common ancestor to there result.append(toUri.substring(pos)); if (result.length() == 0) { // special case: relative link to the parent folder from a file in that folder result.append("./"); } return result.toString(); }
class class_name[name] begin[{] method[getRelativeUri, return_type[type[String]], modifier[public static], parameter[fromUri, toUri]] begin[{] local_variable[type[StringBuffer], result] local_variable[type[int], pos] while[literal[true]] begin[{] local_variable[type[int], i] local_variable[type[int], j] if[binary_operation[binary_operation[binary_operation[member[.i], ==, literal[1]], ||, binary_operation[member[.i], !=, member[.j]]], ||, call[fromUri.regionMatches, parameter[member[.pos], member[.toUri], member[.pos], binary_operation[member[.i], -, member[.pos]]]]]] begin[{] BreakStatement(goto=None, label=None) else begin[{] None end[}] assign[member[.pos], binary_operation[member[.i], +, literal[1]]] end[}] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="../")], member=append, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='/'), MemberReference(member=pos, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=indexOf, postfix_operators=[], prefix_operators=[], qualifier=fromUri, selectors=[], type_arguments=None), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[Assignment(expressionl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='/'), BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+)], member=indexOf, postfix_operators=[], prefix_operators=[], qualifier=fromUri, selectors=[], type_arguments=None))]), label=None) call[result.append, parameter[call[toUri.substring, parameter[member[.pos]]]]] if[binary_operation[call[result.length, parameter[]], ==, literal[0]]] begin[{] call[result.append, parameter[literal["./"]]] else begin[{] None end[}] return[call[result.toString, parameter[]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[String] identifier[getRelativeUri] operator[SEP] identifier[String] identifier[fromUri] , identifier[String] identifier[toUri] operator[SEP] { identifier[StringBuffer] identifier[result] operator[=] Keyword[new] identifier[StringBuffer] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[pos] operator[=] Other[0] operator[SEP] Keyword[while] operator[SEP] literal[boolean] operator[SEP] { Keyword[int] identifier[i] operator[=] identifier[fromUri] operator[SEP] identifier[indexOf] operator[SEP] literal[String] , identifier[pos] operator[SEP] operator[SEP] Keyword[int] identifier[j] operator[=] identifier[toUri] operator[SEP] identifier[indexOf] operator[SEP] literal[String] , identifier[pos] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[SEP] identifier[i] operator[==] operator[-] Other[1] operator[SEP] operator[||] operator[SEP] identifier[i] operator[!=] identifier[j] operator[SEP] operator[||] operator[!] identifier[fromUri] operator[SEP] identifier[regionMatches] operator[SEP] identifier[pos] , identifier[toUri] , identifier[pos] , identifier[i] operator[-] identifier[pos] operator[SEP] operator[SEP] { Keyword[break] operator[SEP] } identifier[pos] operator[=] identifier[i] operator[+] Other[1] operator[SEP] } Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] identifier[fromUri] operator[SEP] identifier[indexOf] operator[SEP] literal[String] , identifier[pos] operator[SEP] operator[SEP] identifier[i] operator[>] Other[0] operator[SEP] identifier[i] operator[=] identifier[fromUri] operator[SEP] identifier[indexOf] operator[SEP] literal[String] , identifier[i] operator[+] Other[1] operator[SEP] operator[SEP] { identifier[result] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] } identifier[result] operator[SEP] identifier[append] operator[SEP] identifier[toUri] operator[SEP] identifier[substring] operator[SEP] identifier[pos] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[result] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[==] Other[0] operator[SEP] { identifier[result] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[return] identifier[result] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] }
public Response request(final Request request) { request.setAuth(username, password); return httpClient.reliableRequest(request); }
class class_name[name] begin[{] method[request, return_type[type[Response]], modifier[public], parameter[request]] begin[{] call[request.setAuth, parameter[member[.username], member[.password]]] return[call[httpClient.reliableRequest, parameter[member[.request]]]] end[}] END[}]
Keyword[public] identifier[Response] identifier[request] operator[SEP] Keyword[final] identifier[Request] identifier[request] operator[SEP] { identifier[request] operator[SEP] identifier[setAuth] operator[SEP] identifier[username] , identifier[password] operator[SEP] operator[SEP] Keyword[return] identifier[httpClient] operator[SEP] identifier[reliableRequest] operator[SEP] identifier[request] operator[SEP] operator[SEP] }
public static boolean canBeDeleted (@Nullable final IUser aUser) { return aUser != null && !aUser.isDeleted () && !aUser.isAdministrator (); }
class class_name[name] begin[{] method[canBeDeleted, return_type[type[boolean]], modifier[public static], parameter[aUser]] begin[{] return[binary_operation[binary_operation[binary_operation[member[.aUser], !=, literal[null]], &&, call[aUser.isDeleted, parameter[]]], &&, call[aUser.isAdministrator, parameter[]]]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[boolean] identifier[canBeDeleted] operator[SEP] annotation[@] identifier[Nullable] Keyword[final] identifier[IUser] identifier[aUser] operator[SEP] { Keyword[return] identifier[aUser] operator[!=] Other[null] operator[&&] operator[!] identifier[aUser] operator[SEP] identifier[isDeleted] operator[SEP] operator[SEP] operator[&&] operator[!] identifier[aUser] operator[SEP] identifier[isAdministrator] operator[SEP] operator[SEP] operator[SEP] }
public static <T> void mergeFrom(Reader r, T message, Schema<T> schema) throws IOException { mergeFrom(r, message, schema, DEFAULT_INPUT_FACTORY); }
class class_name[name] begin[{] method[mergeFrom, return_type[void], modifier[public static], parameter[r, message, schema]] begin[{] call[.mergeFrom, parameter[member[.r], member[.message], member[.schema], member[.DEFAULT_INPUT_FACTORY]]] end[}] END[}]
Keyword[public] Keyword[static] operator[<] identifier[T] operator[>] Keyword[void] identifier[mergeFrom] operator[SEP] identifier[Reader] identifier[r] , identifier[T] identifier[message] , identifier[Schema] operator[<] identifier[T] operator[>] identifier[schema] operator[SEP] Keyword[throws] identifier[IOException] { identifier[mergeFrom] operator[SEP] identifier[r] , identifier[message] , identifier[schema] , identifier[DEFAULT_INPUT_FACTORY] operator[SEP] operator[SEP] }
@Override public DescribeScalingPlansResult describeScalingPlans(DescribeScalingPlansRequest request) { request = beforeClientExecution(request); return executeDescribeScalingPlans(request); }
class class_name[name] begin[{] method[describeScalingPlans, return_type[type[DescribeScalingPlansResult]], modifier[public], parameter[request]] begin[{] assign[member[.request], call[.beforeClientExecution, parameter[member[.request]]]] return[call[.executeDescribeScalingPlans, parameter[member[.request]]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[DescribeScalingPlansResult] identifier[describeScalingPlans] operator[SEP] identifier[DescribeScalingPlansRequest] identifier[request] operator[SEP] { identifier[request] operator[=] identifier[beforeClientExecution] operator[SEP] identifier[request] operator[SEP] operator[SEP] Keyword[return] identifier[executeDescribeScalingPlans] operator[SEP] identifier[request] operator[SEP] operator[SEP] }
@NotNull @Contract(pure = true) @SuppressWarnings("unchecked") public static <T> Optional<T> empty() { return (Optional<T>) EMPTY; }
class class_name[name] begin[{] method[empty, return_type[type[Optional]], modifier[public static], parameter[]] begin[{] return[Cast(expression=MemberReference(member=EMPTY, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None))], dimensions=[], name=Optional, sub_type=None))] end[}] END[}]
annotation[@] identifier[NotNull] annotation[@] identifier[Contract] operator[SEP] identifier[pure] operator[=] literal[boolean] operator[SEP] annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] Keyword[public] Keyword[static] operator[<] identifier[T] operator[>] identifier[Optional] operator[<] identifier[T] operator[>] identifier[empty] operator[SEP] operator[SEP] { Keyword[return] operator[SEP] identifier[Optional] operator[<] identifier[T] operator[>] operator[SEP] identifier[EMPTY] operator[SEP] }
public void pushMessage(IPipe pipe, IMessage message) throws IOException { if (!pullMode) { if (!configsDone) { log.debug("dump early"); return; } } String sessionId = subscriberStream.getConnection().getSessionId(); if (message instanceof RTMPMessage) { IMessageInput msgIn = msgInReference.get(); RTMPMessage rtmpMessage = (RTMPMessage) message; IRTMPEvent body = rtmpMessage.getBody(); if (body instanceof IStreamData) { // the subscriber paused if (subscriberStream.getState() == StreamState.PAUSED) { if (log.isInfoEnabled() && shouldLogPacketDrop()) { log.info("Dropping packet because we are paused. sessionId={} stream={} count={}", sessionId, subscriberStream.getBroadcastStreamPublishName(), droppedPacketsCount); } videoFrameDropper.dropPacket(rtmpMessage); return; } if (body instanceof VideoData && body.getSourceType() == Constants.SOURCE_TYPE_LIVE) { // We only want to drop packets from a live stream. VOD streams we let it buffer. // We don't want a user watching a movie to see a choppy video due to low bandwidth. if (msgIn instanceof IBroadcastScope) { IBroadcastStream stream = (IBroadcastStream) ((IBroadcastScope) msgIn).getClientBroadcastStream(); if (stream != null && stream.getCodecInfo() != null) { IVideoStreamCodec videoCodec = stream.getCodecInfo().getVideoCodec(); // dont try to drop frames if video codec is null if (videoCodec != null && videoCodec.canDropFrames()) { if (!receiveVideo) { videoFrameDropper.dropPacket(rtmpMessage); droppedPacketsCount++; if (log.isInfoEnabled() && shouldLogPacketDrop()) { // client disabled video or the app doesn't have enough bandwidth allowed for this stream log.info("Drop packet. Failed to acquire token or no video. sessionId={} stream={} count={}", sessionId, subscriberStream.getBroadcastStreamPublishName(), droppedPacketsCount); } return; } // Implement some sort of back-pressure on video streams. When the client is on a congested // connection, Red5 cannot send packets fast enough. Mina puts these packets into an // unbounded queue. If we generate video packets fast enough, the queue would get large // which may trigger an OutOfMemory exception. To mitigate this, we check the size of // pending video messages and drop video packets until the queue is below the threshold. // only check for frame dropping if the codec supports it long pendingVideos = pendingVideoMessages(); if (log.isTraceEnabled()) { log.trace("Pending messages sessionId={} pending={} threshold={} sequential={} stream={}, count={}", new Object[] { sessionId, pendingVideos, maxPendingVideoFrames, numSequentialPendingVideoFrames, subscriberStream.getBroadcastStreamPublishName(), droppedPacketsCount }); } if (!videoFrameDropper.canSendPacket(rtmpMessage, pendingVideos)) { // drop frame as it depends on other frames that were dropped before droppedPacketsCount++; if (log.isInfoEnabled() && shouldLogPacketDrop()) { log.info("Frame dropper says to drop packet. sessionId={} stream={} count={}", sessionId, subscriberStream.getBroadcastStreamPublishName(), droppedPacketsCount); } return; } // increment the number of times we had pending video frames sequentially if (pendingVideos > 1) { numSequentialPendingVideoFrames++; } else { // reset number of sequential pending frames if 1 or 0 are pending numSequentialPendingVideoFrames = 0; } if (pendingVideos > maxPendingVideoFrames || numSequentialPendingVideoFrames > maxSequentialPendingVideoFrames) { droppedPacketsCount++; if (log.isInfoEnabled() && shouldLogPacketDrop()) { log.info("Drop packet. Pending above threshold. sessionId={} pending={} threshold={} sequential={} stream={} count={}", new Object[] { sessionId, pendingVideos, maxPendingVideoFrames, numSequentialPendingVideoFrames, subscriberStream.getBroadcastStreamPublishName(), droppedPacketsCount }); } // drop because the client has insufficient bandwidth long now = System.currentTimeMillis(); if (bufferCheckInterval > 0 && now >= nextCheckBufferUnderrun) { // notify client about frame dropping (keyframe) sendInsufficientBandwidthStatus(currentItem.get()); nextCheckBufferUnderrun = now + bufferCheckInterval; } videoFrameDropper.dropPacket(rtmpMessage); return; } // we are ok to send, check if we should send buffered frame if (bufferedInterframeIdx > -1) { IVideoStreamCodec.FrameData fd = videoCodec.getInterframe(bufferedInterframeIdx++); if (fd != null) { VideoData interframe = new VideoData(fd.getFrame()); interframe.setTimestamp(body.getTimestamp()); rtmpMessage = RTMPMessage.build(interframe); } else { // it means that new keyframe was received and we should send current frames instead of buffered bufferedInterframeIdx = -1; } } } } } } else if (body instanceof AudioData) { if (!receiveAudio && sendBlankAudio) { // send blank audio packet to reset player sendBlankAudio = false; body = new AudioData(); if (lastMessageTs > 0) { body.setTimestamp(lastMessageTs); } else { body.setTimestamp(0); } rtmpMessage = RTMPMessage.build(body); } else if (!receiveAudio) { return; } } sendMessage(rtmpMessage); } else { throw new RuntimeException(String.format("Expected IStreamData but got %s (type %s)", body.getClass(), body.getDataType())); } } else if (message instanceof ResetMessage) { sendReset(); } else { msgOutReference.get().pushMessage(message); } }
class class_name[name] begin[{] method[pushMessage, return_type[void], modifier[public], parameter[pipe, message]] begin[{] if[member[.pullMode]] begin[{] if[member[.configsDone]] begin[{] call[log.debug, parameter[literal["dump early"]]] return[None] else begin[{] None end[}] else begin[{] None end[}] local_variable[type[String], sessionId] if[binary_operation[member[.message], instanceof, type[RTMPMessage]]] begin[{] local_variable[type[IMessageInput], msgIn] local_variable[type[RTMPMessage], rtmpMessage] local_variable[type[IRTMPEvent], body] if[binary_operation[member[.body], instanceof, type[IStreamData]]] begin[{] if[binary_operation[call[subscriberStream.getState, parameter[]], ==, member[StreamState.PAUSED]]] begin[{] if[binary_operation[call[log.isInfoEnabled, parameter[]], &&, call[.shouldLogPacketDrop, parameter[]]]] begin[{] call[log.info, parameter[literal["Dropping packet because we are paused. sessionId={} stream={} count={}"], member[.sessionId], call[subscriberStream.getBroadcastStreamPublishName, parameter[]], member[.droppedPacketsCount]]] else begin[{] None end[}] call[videoFrameDropper.dropPacket, parameter[member[.rtmpMessage]]] return[None] else begin[{] None end[}] if[binary_operation[binary_operation[member[.body], instanceof, type[VideoData]], &&, binary_operation[call[body.getSourceType, parameter[]], ==, member[Constants.SOURCE_TYPE_LIVE]]]] begin[{] if[binary_operation[member[.msgIn], instanceof, type[IBroadcastScope]]] begin[{] local_variable[type[IBroadcastStream], stream] if[binary_operation[binary_operation[member[.stream], !=, literal[null]], &&, binary_operation[call[stream.getCodecInfo, parameter[]], !=, literal[null]]]] begin[{] local_variable[type[IVideoStreamCodec], videoCodec] if[binary_operation[binary_operation[member[.videoCodec], !=, literal[null]], &&, call[videoCodec.canDropFrames, parameter[]]]] begin[{] if[member[.receiveVideo]] begin[{] call[videoFrameDropper.dropPacket, parameter[member[.rtmpMessage]]] member[.droppedPacketsCount] if[binary_operation[call[log.isInfoEnabled, parameter[]], &&, call[.shouldLogPacketDrop, parameter[]]]] begin[{] call[log.info, parameter[literal["Drop packet. Failed to acquire token or no video. sessionId={} stream={} count={}"], member[.sessionId], call[subscriberStream.getBroadcastStreamPublishName, parameter[]], member[.droppedPacketsCount]]] else begin[{] None end[}] return[None] else begin[{] None end[}] local_variable[type[long], pendingVideos] if[call[log.isTraceEnabled, parameter[]]] begin[{] call[log.trace, parameter[literal["Pending messages sessionId={} pending={} threshold={} sequential={} stream={}, count={}"], ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MemberReference(member=sessionId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=pendingVideos, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=maxPendingVideoFrames, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=numSequentialPendingVideoFrames, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getBroadcastStreamPublishName, postfix_operators=[], prefix_operators=[], qualifier=subscriberStream, selectors=[], type_arguments=None), MemberReference(member=droppedPacketsCount, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Object, sub_type=None))]] else begin[{] None end[}] if[call[videoFrameDropper.canSendPacket, parameter[member[.rtmpMessage], member[.pendingVideos]]]] begin[{] member[.droppedPacketsCount] if[binary_operation[call[log.isInfoEnabled, parameter[]], &&, call[.shouldLogPacketDrop, parameter[]]]] begin[{] call[log.info, parameter[literal["Frame dropper says to drop packet. sessionId={} stream={} count={}"], member[.sessionId], call[subscriberStream.getBroadcastStreamPublishName, parameter[]], member[.droppedPacketsCount]]] else begin[{] None end[}] return[None] else begin[{] None end[}] if[binary_operation[member[.pendingVideos], >, literal[1]]] begin[{] member[.numSequentialPendingVideoFrames] else begin[{] assign[member[.numSequentialPendingVideoFrames], literal[0]] end[}] if[binary_operation[binary_operation[member[.pendingVideos], >, member[.maxPendingVideoFrames]], ||, binary_operation[member[.numSequentialPendingVideoFrames], >, member[.maxSequentialPendingVideoFrames]]]] begin[{] member[.droppedPacketsCount] if[binary_operation[call[log.isInfoEnabled, parameter[]], &&, call[.shouldLogPacketDrop, parameter[]]]] begin[{] call[log.info, parameter[literal["Drop packet. Pending above threshold. sessionId={} pending={} threshold={} sequential={} stream={} count={}"], ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MemberReference(member=sessionId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=pendingVideos, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=maxPendingVideoFrames, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=numSequentialPendingVideoFrames, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getBroadcastStreamPublishName, postfix_operators=[], prefix_operators=[], qualifier=subscriberStream, selectors=[], type_arguments=None), MemberReference(member=droppedPacketsCount, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Object, sub_type=None))]] else begin[{] None end[}] local_variable[type[long], now] if[binary_operation[binary_operation[member[.bufferCheckInterval], >, literal[0]], &&, binary_operation[member[.now], >=, member[.nextCheckBufferUnderrun]]]] begin[{] call[.sendInsufficientBandwidthStatus, parameter[call[currentItem.get, parameter[]]]] assign[member[.nextCheckBufferUnderrun], binary_operation[member[.now], +, member[.bufferCheckInterval]]] else begin[{] None end[}] call[videoFrameDropper.dropPacket, parameter[member[.rtmpMessage]]] return[None] else begin[{] None end[}] if[binary_operation[member[.bufferedInterframeIdx], >, literal[1]]] begin[{] local_variable[type[IVideoStreamCodec], fd] if[binary_operation[member[.fd], !=, literal[null]]] begin[{] local_variable[type[VideoData], interframe] call[interframe.setTimestamp, parameter[call[body.getTimestamp, parameter[]]]] assign[member[.rtmpMessage], call[RTMPMessage.build, parameter[member[.interframe]]]] else begin[{] assign[member[.bufferedInterframeIdx], literal[1]] end[}] else begin[{] None end[}] else begin[{] None end[}] else begin[{] None end[}] else begin[{] None end[}] else begin[{] if[binary_operation[member[.body], instanceof, type[AudioData]]] begin[{] if[binary_operation[member[.receiveAudio], &&, member[.sendBlankAudio]]] begin[{] assign[member[.sendBlankAudio], literal[false]] assign[member[.body], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=AudioData, sub_type=None))] if[binary_operation[member[.lastMessageTs], >, literal[0]]] begin[{] call[body.setTimestamp, parameter[member[.lastMessageTs]]] else begin[{] call[body.setTimestamp, parameter[literal[0]]] end[}] assign[member[.rtmpMessage], call[RTMPMessage.build, parameter[member[.body]]]] else begin[{] if[member[.receiveAudio]] begin[{] return[None] else begin[{] None end[}] end[}] else begin[{] None end[}] end[}] call[.sendMessage, parameter[member[.rtmpMessage]]] else begin[{] ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Expected IStreamData but got %s (type %s)"), MethodInvocation(arguments=[], member=getClass, postfix_operators=[], prefix_operators=[], qualifier=body, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getDataType, postfix_operators=[], prefix_operators=[], qualifier=body, selectors=[], type_arguments=None)], member=format, postfix_operators=[], prefix_operators=[], qualifier=String, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=RuntimeException, sub_type=None)), label=None) end[}] else begin[{] if[binary_operation[member[.message], instanceof, type[ResetMessage]]] begin[{] call[.sendReset, parameter[]] else begin[{] call[msgOutReference.get, parameter[]] end[}] end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[pushMessage] operator[SEP] identifier[IPipe] identifier[pipe] , identifier[IMessage] identifier[message] operator[SEP] Keyword[throws] identifier[IOException] { Keyword[if] operator[SEP] operator[!] identifier[pullMode] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[configsDone] operator[SEP] { identifier[log] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[return] operator[SEP] } } identifier[String] identifier[sessionId] operator[=] identifier[subscriberStream] operator[SEP] identifier[getConnection] operator[SEP] operator[SEP] operator[SEP] identifier[getSessionId] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[message] Keyword[instanceof] identifier[RTMPMessage] operator[SEP] { identifier[IMessageInput] identifier[msgIn] operator[=] identifier[msgInReference] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[RTMPMessage] identifier[rtmpMessage] operator[=] operator[SEP] identifier[RTMPMessage] operator[SEP] identifier[message] operator[SEP] identifier[IRTMPEvent] identifier[body] operator[=] identifier[rtmpMessage] operator[SEP] identifier[getBody] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[body] Keyword[instanceof] identifier[IStreamData] operator[SEP] { Keyword[if] operator[SEP] identifier[subscriberStream] operator[SEP] identifier[getState] operator[SEP] operator[SEP] operator[==] identifier[StreamState] operator[SEP] identifier[PAUSED] operator[SEP] { Keyword[if] operator[SEP] identifier[log] operator[SEP] identifier[isInfoEnabled] operator[SEP] operator[SEP] operator[&&] identifier[shouldLogPacketDrop] operator[SEP] operator[SEP] operator[SEP] { identifier[log] operator[SEP] identifier[info] operator[SEP] literal[String] , identifier[sessionId] , identifier[subscriberStream] operator[SEP] identifier[getBroadcastStreamPublishName] operator[SEP] operator[SEP] , identifier[droppedPacketsCount] operator[SEP] operator[SEP] } identifier[videoFrameDropper] operator[SEP] identifier[dropPacket] operator[SEP] identifier[rtmpMessage] operator[SEP] operator[SEP] Keyword[return] operator[SEP] } Keyword[if] operator[SEP] identifier[body] Keyword[instanceof] identifier[VideoData] operator[&&] identifier[body] operator[SEP] identifier[getSourceType] operator[SEP] operator[SEP] operator[==] identifier[Constants] operator[SEP] identifier[SOURCE_TYPE_LIVE] operator[SEP] { Keyword[if] operator[SEP] identifier[msgIn] Keyword[instanceof] identifier[IBroadcastScope] operator[SEP] { identifier[IBroadcastStream] identifier[stream] operator[=] operator[SEP] identifier[IBroadcastStream] operator[SEP] operator[SEP] operator[SEP] identifier[IBroadcastScope] operator[SEP] identifier[msgIn] operator[SEP] operator[SEP] identifier[getClientBroadcastStream] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[stream] operator[!=] Other[null] operator[&&] identifier[stream] operator[SEP] identifier[getCodecInfo] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] { identifier[IVideoStreamCodec] identifier[videoCodec] operator[=] identifier[stream] operator[SEP] identifier[getCodecInfo] operator[SEP] operator[SEP] operator[SEP] identifier[getVideoCodec] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[videoCodec] operator[!=] Other[null] operator[&&] identifier[videoCodec] operator[SEP] identifier[canDropFrames] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[receiveVideo] operator[SEP] { identifier[videoFrameDropper] operator[SEP] identifier[dropPacket] operator[SEP] identifier[rtmpMessage] operator[SEP] operator[SEP] identifier[droppedPacketsCount] operator[++] operator[SEP] Keyword[if] operator[SEP] identifier[log] operator[SEP] identifier[isInfoEnabled] operator[SEP] operator[SEP] operator[&&] identifier[shouldLogPacketDrop] operator[SEP] operator[SEP] operator[SEP] { identifier[log] operator[SEP] identifier[info] operator[SEP] literal[String] , identifier[sessionId] , identifier[subscriberStream] operator[SEP] identifier[getBroadcastStreamPublishName] operator[SEP] operator[SEP] , identifier[droppedPacketsCount] operator[SEP] operator[SEP] } Keyword[return] operator[SEP] } Keyword[long] identifier[pendingVideos] operator[=] identifier[pendingVideoMessages] operator[SEP] 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] , Keyword[new] identifier[Object] operator[SEP] operator[SEP] { identifier[sessionId] , identifier[pendingVideos] , identifier[maxPendingVideoFrames] , identifier[numSequentialPendingVideoFrames] , identifier[subscriberStream] operator[SEP] identifier[getBroadcastStreamPublishName] operator[SEP] operator[SEP] , identifier[droppedPacketsCount] } operator[SEP] operator[SEP] } Keyword[if] operator[SEP] operator[!] identifier[videoFrameDropper] operator[SEP] identifier[canSendPacket] operator[SEP] identifier[rtmpMessage] , identifier[pendingVideos] operator[SEP] operator[SEP] { identifier[droppedPacketsCount] operator[++] operator[SEP] Keyword[if] operator[SEP] identifier[log] operator[SEP] identifier[isInfoEnabled] operator[SEP] operator[SEP] operator[&&] identifier[shouldLogPacketDrop] operator[SEP] operator[SEP] operator[SEP] { identifier[log] operator[SEP] identifier[info] operator[SEP] literal[String] , identifier[sessionId] , identifier[subscriberStream] operator[SEP] identifier[getBroadcastStreamPublishName] operator[SEP] operator[SEP] , identifier[droppedPacketsCount] operator[SEP] operator[SEP] } Keyword[return] operator[SEP] } Keyword[if] operator[SEP] identifier[pendingVideos] operator[>] Other[1] operator[SEP] { identifier[numSequentialPendingVideoFrames] operator[++] operator[SEP] } Keyword[else] { identifier[numSequentialPendingVideoFrames] operator[=] Other[0] operator[SEP] } Keyword[if] operator[SEP] identifier[pendingVideos] operator[>] identifier[maxPendingVideoFrames] operator[||] identifier[numSequentialPendingVideoFrames] operator[>] identifier[maxSequentialPendingVideoFrames] operator[SEP] { identifier[droppedPacketsCount] operator[++] operator[SEP] Keyword[if] operator[SEP] identifier[log] operator[SEP] identifier[isInfoEnabled] operator[SEP] operator[SEP] operator[&&] identifier[shouldLogPacketDrop] operator[SEP] operator[SEP] operator[SEP] { identifier[log] operator[SEP] identifier[info] operator[SEP] literal[String] , Keyword[new] identifier[Object] operator[SEP] operator[SEP] { identifier[sessionId] , identifier[pendingVideos] , identifier[maxPendingVideoFrames] , identifier[numSequentialPendingVideoFrames] , identifier[subscriberStream] operator[SEP] identifier[getBroadcastStreamPublishName] operator[SEP] operator[SEP] , identifier[droppedPacketsCount] } operator[SEP] operator[SEP] } Keyword[long] identifier[now] operator[=] identifier[System] operator[SEP] identifier[currentTimeMillis] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[bufferCheckInterval] operator[>] Other[0] operator[&&] identifier[now] operator[>=] identifier[nextCheckBufferUnderrun] operator[SEP] { identifier[sendInsufficientBandwidthStatus] operator[SEP] identifier[currentItem] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[nextCheckBufferUnderrun] operator[=] identifier[now] operator[+] identifier[bufferCheckInterval] operator[SEP] } identifier[videoFrameDropper] operator[SEP] identifier[dropPacket] operator[SEP] identifier[rtmpMessage] operator[SEP] operator[SEP] Keyword[return] operator[SEP] } Keyword[if] operator[SEP] identifier[bufferedInterframeIdx] operator[>] operator[-] Other[1] operator[SEP] { identifier[IVideoStreamCodec] operator[SEP] identifier[FrameData] identifier[fd] operator[=] identifier[videoCodec] operator[SEP] identifier[getInterframe] operator[SEP] identifier[bufferedInterframeIdx] operator[++] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[fd] operator[!=] Other[null] operator[SEP] { identifier[VideoData] identifier[interframe] operator[=] Keyword[new] identifier[VideoData] operator[SEP] identifier[fd] operator[SEP] identifier[getFrame] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[interframe] operator[SEP] identifier[setTimestamp] operator[SEP] identifier[body] operator[SEP] identifier[getTimestamp] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[rtmpMessage] operator[=] identifier[RTMPMessage] operator[SEP] identifier[build] operator[SEP] identifier[interframe] operator[SEP] operator[SEP] } Keyword[else] { identifier[bufferedInterframeIdx] operator[=] operator[-] Other[1] operator[SEP] } } } } } } Keyword[else] Keyword[if] operator[SEP] identifier[body] Keyword[instanceof] identifier[AudioData] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[receiveAudio] operator[&&] identifier[sendBlankAudio] operator[SEP] { identifier[sendBlankAudio] operator[=] literal[boolean] operator[SEP] identifier[body] operator[=] Keyword[new] identifier[AudioData] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[lastMessageTs] operator[>] Other[0] operator[SEP] { identifier[body] operator[SEP] identifier[setTimestamp] operator[SEP] identifier[lastMessageTs] operator[SEP] operator[SEP] } Keyword[else] { identifier[body] operator[SEP] identifier[setTimestamp] operator[SEP] Other[0] operator[SEP] operator[SEP] } identifier[rtmpMessage] operator[=] identifier[RTMPMessage] operator[SEP] identifier[build] operator[SEP] identifier[body] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] operator[!] identifier[receiveAudio] operator[SEP] { Keyword[return] operator[SEP] } } identifier[sendMessage] operator[SEP] identifier[rtmpMessage] operator[SEP] operator[SEP] } Keyword[else] { Keyword[throw] Keyword[new] identifier[RuntimeException] operator[SEP] identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[body] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] , identifier[body] operator[SEP] identifier[getDataType] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } Keyword[else] Keyword[if] operator[SEP] identifier[message] Keyword[instanceof] identifier[ResetMessage] operator[SEP] { identifier[sendReset] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[msgOutReference] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[pushMessage] operator[SEP] identifier[message] operator[SEP] operator[SEP] } }